commits@javamail.java.net

[mercurial:91] Add support for Message Delivery Notifications.

From: <shannon_at_kenai.com>
Date: Tue, 11 Nov 2008 01:05:09 +0000 (GMT)

Repository: mercurial
Revision: 91
Author: Bill Shannon <bill.shannon_at_sun.com>
Date: 2008-11-08 01:12:27 UTC

Log Message:
-----------
Add support for Message Delivery Notifications.

Modified Paths:
--------------
    doc/release/CHANGES.txt
    dsn/src/main/java/com/sun/mail/dsn/DeliveryStatus.java
    dsn/src/main/java/com/sun/mail/dsn/MessageHeaders.java
    dsn/src/main/java/com/sun/mail/dsn/MultipartReport.java
    dsn/src/main/java/com/sun/mail/dsn/message_deliverystatus.java
    dsn/src/main/java/com/sun/mail/dsn/multipart_report.java
    dsn/src/main/java/com/sun/mail/dsn/text_rfc822headers.java
    dsn/src/main/resources/META-INF/mailcap

Added Paths:
-----------
    dsn/src/main/java/com/sun/mail/dsn/DispositionNotification.java
    dsn/src/main/java/com/sun/mail/dsn/Report.java
   
dsn/src/main/java/com/sun/mail/dsn/message_dispositionnotification.java

Diffs:
-----
diff -r c9ce75557c9d -r 06393e58bf10 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Wed Nov 05 13:27:58 2008 -0800
+++ b/doc/release/CHANGES.txt Fri Nov 07 17:12:27 2008 -0800
@@ -50,6 +50,7 @@
 <no id> SMTP I/O failure incorrectly reports valid sent
addresses
 <no id> avoid creating IMAPMessage objects until they're
actually needed
 <no id> IMAPStore.isConnected might return true even though not
connected
+<no id> add support for Message Delivery Notifications (RFC
3798) to dsn.jar
 
 
                  CHANGES IN THE 1.4.1 RELEASE
diff -r c9ce75557c9d -r 06393e58bf10
dsn/src/main/java/com/sun/mail/dsn/DeliveryStatus.java
--- a/dsn/src/main/java/com/sun/mail/dsn/DeliveryStatus.java Wed Nov
05 13:27:58 2008 -0800
+++ b/dsn/src/main/java/com/sun/mail/dsn/DeliveryStatus.java Fri Nov
07 17:12:27 2008 -0800
@@ -49,8 +49,10 @@
 /**
  * A message/delivery-status message content, as defined in
  * <A HREF="http://www.ietf.org/rfc/rfc3464.txt">RFC 3464</A>.
+ *
+ * @since JavaMail 1.4
  */
-public class DeliveryStatus {
+public class DeliveryStatus extends Report {
 
     private static boolean debug =
        PropUtil.getBooleanSystemProperty("mail.dsn.debug", false);
@@ -69,6 +71,7 @@
      * Construct a delivery status notification with no content.
      */
     public DeliveryStatus() throws MessagingException {
+ super("delivery-status");
        messageDSN = new InternetHeaders();
        recipientDSN = new InternetHeaders[0];
     }
@@ -79,6 +82,7 @@
      */
     public DeliveryStatus(InputStream is)
                                throws MessagingException, IOException
{
+ super("delivery-status");
        messageDSN = new InternetHeaders(is);
        if (debug)
            System.out.println("DSN: got messageDSN");
diff -r c9ce75557c9d -r 06393e58bf10
dsn/src/main/java/com/sun/mail/dsn/DispositionNotification.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dsn/src/main/java/com/sun/mail/dsn/DispositionNotification.java
Fri Nov 07 17:12:27 2008 -0800
@@ -0,0 +1,149 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the
GNU
+ * General Public License Version 2 only ("GPL") or the Common
Development
+ * and Distribution License("CDDL") (collectively, the "License").
You
+ * may not use this file except in compliance with the License. You
can obtain
+ * a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the
specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice
in each
+ * file and include the License file at
glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath"
exception
+ * as provided by Sun in the GPL Version 2 section of the License file
that
+ * accompanied this code. If applicable, add the following below the
License
+ * Header, with the fields enclosed by brackets [] replaced by your
own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the
CDDL or
+ * only the GPL Version 2, indicate your decision by adding
"[Contributor]
+ * elects to include this software in this distribution under the
[CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of
license, a
+ * recipient has the option to distribute your version of this file
under
+ * either the CDDL, the GPL Version 2 or to extend the choice of
license to
+ * its licensees as provided above. However, if you add GPL Version 2
code
+ * and therefore, elected the GPL Version 2 license, then the option
applies
+ * only if the new code is made subject to such option by the
copyright
+ * holder.
+ */
+
+package com.sun.mail.dsn;
+
+import java.io.*;
+import java.util.*;
+
+import javax.mail.*;
+import javax.mail.internet.*;
+
+import com.sun.mail.util.LineOutputStream; // XXX
+import com.sun.mail.util.PropUtil;
+
+/**
+ * A message/disposition-notification message content, as defined in
+ * <A HREF="http://www.ietf.org/rfc/rfc3798.txt">RFC 3798</A>.
+ *
+ * @since JavaMail 1.4.2
+ */
+public class DispositionNotification extends Report {
+
+ private static boolean debug =
+ PropUtil.getBooleanSystemProperty("mail.dsn.debug", false);
+
+ /**
+ * The disposition notification content fields.
+ */
+ protected InternetHeaders notifications;
+
+ /**
+ * Construct a disposition notification with no content.
+ */
+ public DispositionNotification() throws MessagingException {
+ super("disposition-notification");
+ notifications = new InternetHeaders();
+ }
+
+ /**
+ * Construct a disposition notification by parsing the
+ * supplied input stream.
+ */
+ public DispositionNotification(InputStream is)
+ throws MessagingException, IOException
{
+ super("disposition-notification");
+ notifications = new InternetHeaders(is);
+ if (debug)
+ System.out.println("MDN: got notification content");
+ }
+
+ /**
+ * Return all the disposition notification fields in the
+ * disposition notification.
+ * The fields are defined as:
+ *
+ * <pre>
+ * disposition-notification-content =
+ * [ reporting-ua-field CRLF ]
+ * [ mdn-gateway-field CRLF ]
+ * [ original-recipient-field CRLF ]
+ * final-recipient-field CRLF
+ * [ original-message-id-field CRLF ]
+ * disposition-field CRLF
+ * *( failure-field CRLF )
+ * *( error-field CRLF )
+ * *( warning-field CRLF )
+ * *( extension-field CRLF )
+ * </pre>
+ */
+ // XXX - could parse each of these fields
+ public InternetHeaders getNotifications() {
+ return notifications;
+ }
+
+ /**
+ * Set the disposition notification fields in the
+ * disposition notification.
+ */
+ public void setNotifications(InternetHeaders notifications) {
+ this.notifications = notifications;
+ }
+
+ public void writeTo(OutputStream os)
+ throws IOException, MessagingException
{
+ // see if we already have a LOS
+ LineOutputStream los = null;
+ if (os instanceof LineOutputStream) {
+ los = (LineOutputStream) os;
+ } else {
+ los = new LineOutputStream(os);
+ }
+
+ writeInternetHeaders(notifications, los);
+ los.writeln();
+ }
+
+ private static void writeInternetHeaders(InternetHeaders h,
+ LineOutputStream los) throws
IOException {
+ Enumeration e = h.getAllHeaderLines();
+ try {
+ while (e.hasMoreElements())
+ los.writeln((String)e.nextElement());
+ } catch (MessagingException mex) {
+ Exception ex = mex.getNextException();
+ if (ex instanceof IOException)
+ throw (IOException)ex;
+ else
+ throw new IOException("Exception writing headers: " +
mex);
+ }
+ }
+
+ public String toString() {
+ return "DispositionNotification: Reporting-UA=" +
+ notifications.getHeader("Reporting-UA", null);
+ }
+}
diff -r c9ce75557c9d -r 06393e58bf10
dsn/src/main/java/com/sun/mail/dsn/MessageHeaders.java
--- a/dsn/src/main/java/com/sun/mail/dsn/MessageHeaders.java Wed Nov
05 13:27:58 2008 -0800
+++ b/dsn/src/main/java/com/sun/mail/dsn/MessageHeaders.java Fri Nov
07 17:12:27 2008 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the
GNU
  * General Public License Version 2 only ("GPL") or the Common
Development
@@ -45,6 +45,8 @@
 /**
  * A special MimeMessage object that contains only message headers,
  * no content. Used to represent the MIME type text/rfc822-headers.
+ *
+ * @since JavaMail 1.4
  */
 public class MessageHeaders extends MimeMessage {
 
diff -r c9ce75557c9d -r 06393e58bf10
dsn/src/main/java/com/sun/mail/dsn/MultipartReport.java
--- a/dsn/src/main/java/com/sun/mail/dsn/MultipartReport.java Wed Nov
05 13:27:58 2008 -0800
+++ b/dsn/src/main/java/com/sun/mail/dsn/MultipartReport.java Fri Nov
07 17:12:27 2008 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the
GNU
  * General Public License Version 2 only ("GPL") or the Common
Development
@@ -48,8 +48,7 @@
  * <A HREF="http://www.ietf.org/rfc/rfc3462.txt">RFC 3462</A>.
  * A multipart/report content is a container for mail reports
  * of any kind, and is most often used to return a delivery
- * status report. This class only supports that most common
- * usage. <p>
+ * status report or a disposition notification report. <p>
  *
  * A MultipartReport object is a special type of MimeMultipart
  * object with a restricted set of body parts. A MultipartReport
@@ -57,7 +56,7 @@
  * <ul>
  * <li>[Required] A human readable text message describing the
  * reason the report was generated.</li>
- * <li>[Required] A {_at_link DeliveryStatus} object containing the
+ * <li>[Required] A {_at_link Report} object containing the
  * details for why the report was generated.</li>
  * <li>[Optional] A returned copy of the entire message, or just
  * its headers, which caused the generation of this report.
@@ -65,6 +64,8 @@
  * Many of the normal MimeMultipart operations are restricted to
  * ensure that the MultipartReport object always follows this
  * structure.
+ *
+ * @since JavaMail 1.4
  */
 public class MultipartReport extends MimeMultipart {
     protected boolean constructed; // true when done with constructor
@@ -84,30 +85,33 @@
 
     /**
      * Construct a multipart/report object with the specified plain
- * text and delivery status to be returned to the user.
+ * text and report type (DeliveryStatus or
DispositionNotification)
+ * to be returned to the user.
      */
- public MultipartReport(String text, DeliveryStatus status)
+ public MultipartReport(String text, Report report)
                                throws MessagingException {
        super("report");
        ContentType ct = new ContentType(contentType);
- ct.setParameter("report-type", "delivery-status");
+ String reportType = report.getType();
+ ct.setParameter("report-type", reportType);
        contentType = ct.toString();
        MimeBodyPart mbp = new MimeBodyPart();
        mbp.setText(text);
        setBodyPart(mbp, 0);
        mbp = new MimeBodyPart();
- mbp.setContent(status, "message/delivery-status");
+ ct = new ContentType("message", reportType, null);
+ mbp.setContent(report, ct.toString());
        setBodyPart(mbp, 1);
        constructed = true;
     }
 
     /**
      * Construct a multipart/report object with the specified plain
- * text, delivery status, and original message to be returned to
the user.
+ * text, report, and original message to be returned to the user.
      */
- public MultipartReport(String text, DeliveryStatus status,
- MimeMessage msg) throws
MessagingException {
- this(text, status);
+ public MultipartReport(String text, Report report, MimeMessage
msg)
+ throws MessagingException {
+ this(text, report);
        if (msg != null) {
            MimeBodyPart mbp = new MimeBodyPart();
            mbp.setContent(msg, "message/rfc822");
@@ -117,12 +121,12 @@
 
     /**
      * Construct a multipart/report object with the specified plain
- * text, delivery status, and headers from the original message
+ * text, report, and headers from the original message
      * to be returned to the user.
      */
- public MultipartReport(String text, DeliveryStatus status,
- InternetHeaders hdr) throws
MessagingException {
- this(text, status);
+ public MultipartReport(String text, Report report, InternetHeaders
hdr)
+ throws MessagingException {
+ this(text, report);
        if (hdr != null) {
            MimeBodyPart mbp = new MimeBodyPart();
            mbp.setContent(new MessageHeaders(hdr),
"text/rfc822-headers");
@@ -210,7 +214,45 @@
     }
 
     /**
+ * Get the report associated with this multipart/report.
+ *
+ * @since JavaMail 1.4.2
+ */
+ public synchronized Report getReport() throws MessagingException {
+ if (getCount() < 2)
+ return null;
+ BodyPart bp = getBodyPart(1);
+ try {
+ Object content = bp.getContent();
+ if (!(content instanceof Report))
+ return null;
+ return (Report)content;
+ } catch (IOException ex) {
+ throw new MessagingException("IOException getting Report",
ex);
+ }
+ }
+
+ /**
+ * Set the report associated with this multipart/report.
+ *
+ * @since JavaMail 1.4.2
+ */
+ public synchronized void setReport(Report report)
+ throws MessagingException {
+ MimeBodyPart mbp = new MimeBodyPart();
+ ContentType ct = new ContentType(contentType);
+ String reportType = report.getType();
+ ct.setParameter("report-type", reportType);
+ contentType = ct.toString();
+ ct = new ContentType("message", reportType, null);
+ mbp.setContent(report, ct.toString());
+ setBodyPart(mbp, 2);
+ }
+
+ /**
      * Get the delivery status associated with this multipart/report.
+ *
+ * @deprecated use getReport instead
      */
     public synchronized DeliveryStatus getDeliveryStatus()
                                throws MessagingException {
@@ -229,6 +271,8 @@
 
     /**
      * Set the delivery status associated with this multipart/report.
+ *
+ * @deprecated use setReport instead
      */
     public synchronized void setDeliveryStatus(DeliveryStatus status)
                                throws MessagingException {
diff -r c9ce75557c9d -r 06393e58bf10
dsn/src/main/java/com/sun/mail/dsn/Report.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dsn/src/main/java/com/sun/mail/dsn/Report.java Fri Nov 07
17:12:27 2008 -0800
@@ -0,0 +1,64 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the
GNU
+ * General Public License Version 2 only ("GPL") or the Common
Development
+ * and Distribution License("CDDL") (collectively, the "License").
You
+ * may not use this file except in compliance with the License. You
can obtain
+ * a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the
specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice
in each
+ * file and include the License file at
glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath"
exception
+ * as provided by Sun in the GPL Version 2 section of the License file
that
+ * accompanied this code. If applicable, add the following below the
License
+ * Header, with the fields enclosed by brackets [] replaced by your
own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the
CDDL or
+ * only the GPL Version 2, indicate your decision by adding
"[Contributor]
+ * elects to include this software in this distribution under the
[CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of
license, a
+ * recipient has the option to distribute your version of this file
under
+ * either the CDDL, the GPL Version 2 or to extend the choice of
license to
+ * its licensees as provided above. However, if you add GPL Version 2
code
+ * and therefore, elected the GPL Version 2 license, then the option
applies
+ * only if the new code is made subject to such option by the
copyright
+ * holder.
+ */
+
+package com.sun.mail.dsn;
+
+/**
+ * An abstract report type, to be included in a MultipartReport.
+ * Subclasses define specific report types, such as DeliverStatus
+ * and DispositionNotification.
+ *
+ * @since JavaMail 1.4.2
+ */
+public abstract class Report {
+ protected String type; // the MIME subtype of the report
+
+ /**
+ * Construct a report of the indicated MIME subtype.
+ * The primary MIME type is always "message".
+ */
+ protected Report(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Get the MIME subtype of the report.
+ * The primary MIME type is always "message".
+ */
+ public String getType() {
+ return type;
+ }
+}
diff -r c9ce75557c9d -r 06393e58bf10
dsn/src/main/java/com/sun/mail/dsn/message_deliverystatus.java
--- a/dsn/src/main/java/com/sun/mail/dsn/message_deliverystatus.java
Wed Nov 05 13:27:58 2008 -0800
+++ b/dsn/src/main/java/com/sun/mail/dsn/message_deliverystatus.java
Fri Nov 07 17:12:27 2008 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the
GNU
  * General Public License Version 2 only ("GPL") or the Common
Development
@@ -45,6 +45,11 @@
 
 
 /**
+ * DataContentHandler for message/delivery-status MIME type.
+ * Applications should not use this class directly, it's used
indirectly
+ * through the JavaBeans Activation Framework.
+ *
+ * @since JavaMail 1.4
  */
 public class message_deliverystatus implements DataContentHandler {
 
@@ -100,7 +105,7 @@
            return new DeliveryStatus(ds.getInputStream());
        } catch (MessagingException me) {
            throw new IOException("Exception creating DeliveryStatus in
" +
- "message/devliery-status DataContentHandler: " +
+ "message/delivery-status DataContentHandler: " +
                    me.toString());
        }
     }
diff -r c9ce75557c9d -r 06393e58bf10
dsn/src/main/java/com/sun/mail/dsn/message_dispositionnotification.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++
b/dsn/src/main/java/com/sun/mail/dsn/message_dispositionnotification.ja
va Fri Nov 07 17:12:27 2008 -0800
@@ -0,0 +1,131 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the
GNU
+ * General Public License Version 2 only ("GPL") or the Common
Development
+ * and Distribution License("CDDL") (collectively, the "License").
You
+ * may not use this file except in compliance with the License. You
can obtain
+ * a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the
specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice
in each
+ * file and include the License file at
glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath"
exception
+ * as provided by Sun in the GPL Version 2 section of the License file
that
+ * accompanied this code. If applicable, add the following below the
License
+ * Header, with the fields enclosed by brackets [] replaced by your
own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the
CDDL or
+ * only the GPL Version 2, indicate your decision by adding
"[Contributor]
+ * elects to include this software in this distribution under the
[CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of
license, a
+ * recipient has the option to distribute your version of this file
under
+ * either the CDDL, the GPL Version 2 or to extend the choice of
license to
+ * its licensees as provided above. However, if you add GPL Version 2
code
+ * and therefore, elected the GPL Version 2 license, then the option
applies
+ * only if the new code is made subject to such option by the
copyright
+ * holder.
+ */
+
+package com.sun.mail.dsn;
+
+import java.io.*;
+import java.util.Properties;
+import java.awt.datatransfer.DataFlavor;
+import javax.activation.*;
+import javax.mail.*;
+import javax.mail.internet.*;
+
+
+/**
+ * DataContentHandler for message/disposition-notification MIME type.
+ * Applications should not use this class directly, it's used
indirectly
+ * through the JavaBeans Activation Framework.
+ *
+ * @since JavaMail 1.4.2
+ */
+public class message_dispositionnotification implements
DataContentHandler {
+
+ ActivationDataFlavor ourDataFlavor = new ActivationDataFlavor(
+ DispositionNotification.class,
+ "message/disposition-notification",
+ "Disposition Notification");
+
+ /**
+ * return the DataFlavors for this <code>DataContentHandler</code>
+ * @return The DataFlavors.
+ */
+ public DataFlavor[] getTransferDataFlavors() {
+ return new DataFlavor[] { ourDataFlavor };
+ }
+
+ /**
+ * return the Transfer Data of type DataFlavor from InputStream
+ * @param df The DataFlavor.
+ * @param ins The InputStream corresponding to the data.
+ * @return a Message object
+ */
+ public Object getTransferData(DataFlavor df, DataSource ds)
+ throws IOException {
+ // make sure we can handle this DataFlavor
+ if (ourDataFlavor.equals(df))
+ return getContent(ds);
+ else
+ return null;
+ }
+
+ /**
+ * Return the content.
+ */
+ public Object getContent(DataSource ds) throws IOException {
+ // create a new DispositionNotification
+ try {
+ /*
+ Session session;
+ if (ds instanceof MessageAware) {
+ javax.mail.MessageContext mc =
+ ((MessageAware)ds).getMessageContext();
+ session = mc.getSession();
+ } else {
+ // Hopefully a rare case. Also hopefully the
application
+ // has created a default Session that can just be
returned
+ // here. If not, the one we create here is better than
+ // nothing, but overall not a really good answer.
+ session = Session.getDefaultInstance(new Properties(),
null);
+ }
+ return new DispositionNotification(session,
ds.getInputStream());
+ */
+ return new DispositionNotification(ds.getInputStream());
+ } catch (MessagingException me) {
+ throw new IOException(
+ "Exception creating DispositionNotification in " +
+ "message/disposition-notification
DataContentHandler: " +
+ me.toString());
+ }
+ }
+
+ /**
+ */
+ public void writeTo(Object obj, String mimeType, OutputStream os)
+ throws IOException {
+ // if it's a DispositionNotification, we know how to write that
out
+ if (obj instanceof DispositionNotification) {
+ DispositionNotification dn = (DispositionNotification)obj;
+ try {
+ dn.writeTo(os);
+ } catch (MessagingException me) {
+ throw new IOException(me.toString());
+ }
+
+ } else {
+ throw new IOException("unsupported object");
+ }
+ }
+}
diff -r c9ce75557c9d -r 06393e58bf10
dsn/src/main/java/com/sun/mail/dsn/multipart_report.java
--- a/dsn/src/main/java/com/sun/mail/dsn/multipart_report.java Wed Nov
05 13:27:58 2008 -0800
+++ b/dsn/src/main/java/com/sun/mail/dsn/multipart_report.java Fri Nov
07 17:12:27 2008 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the
GNU
  * General Public License Version 2 only ("GPL") or the Common
Development
@@ -43,6 +43,13 @@
 import javax.mail.internet.*;
 
 
+/**
+ * DataContentHandler for multipart/report MIME type.
+ * Applications should not use this class directly, it's used
indirectly
+ * through the JavaBeans Activation Framework.
+ *
+ * @since JavaMail 1.4
+ */
 public class multipart_report implements DataContentHandler {
     private ActivationDataFlavor myDF = new ActivationDataFlavor(
            MultipartReport.class,
diff -r c9ce75557c9d -r 06393e58bf10
dsn/src/main/java/com/sun/mail/dsn/text_rfc822headers.java
--- a/dsn/src/main/java/com/sun/mail/dsn/text_rfc822headers.java
Wed Nov 05 13:27:58 2008 -0800
+++ b/dsn/src/main/java/com/sun/mail/dsn/text_rfc822headers.java
Fri Nov 07 17:12:27 2008 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the
GNU
  * General Public License Version 2 only ("GPL") or the Common
Development
@@ -43,7 +43,11 @@
 import javax.mail.internet.*;
 
 /**
- * DataContentHandler for text/rfc822-headers.
+ * DataContentHandler for text/rfc822-headers MIME type.
+ * Applications should not use this class directly, it's used
indirectly
+ * through the JavaBeans Activation Framework.
+ *
+ * @since JavaMail 1.4
  *
  */
 public class text_rfc822headers implements DataContentHandler {
diff -r c9ce75557c9d -r 06393e58bf10
dsn/src/main/resources/META-INF/mailcap
--- a/dsn/src/main/resources/META-INF/mailcap Wed Nov 05 13:27:58
2008 -0800
+++ b/dsn/src/main/resources/META-INF/mailcap Fri Nov 07 17:12:27
2008 -0800
@@ -4,4 +4,5 @@
 #
 multipart/report;;
x-java-content-handler=com.sun.mail.dsn.multipart_report
 message/delivery-status;;
x-java-content-handler=com.sun.mail.dsn.message_deliverystatus
+message/disposition-notification;;
x-java-content-handler=com.sun.mail.dsn.message_dispositionnotification
 text/rfc822-headers;;
x-java-content-handler=com.sun.mail.dsn.text_rfc822headers