commits@javamail.java.net

[javamail~mercurial:160] Missed a required change for previous fix.

From: <shannon_at_kenai.com>
Date: Mon, 31 Aug 2009 18:19:24 +0000

Project: javamail
Repository: mercurial
Revision: 160
Author: shannon
Date: 2009-08-25 04:27:24 UTC
Link:

Log Message:
------------
Fix javadocs.
Check for no recipient addresses.
Ensure that trailing spaces aren't lost at EOF - bug 6872072
Forgot to document previous fix.
better handle modifying messages created from input streams
Further clarify the limitations of search terms.
include server error message in exception when SMTP authentication fails
Verify domain name per RFC 1034 when in strict mode.
Forgot to document it.
Fixed SMTPTransport to use getCanonicalHostName() to make it more likely
that it will have a fully qualified domain name for HELO/EHLO - bug 6857090
Stop wrapping IOException in LineOutputStream - bug 6875367
Missed a required change for previous fix.


Revisions:
----------
149
150
151
152
153
154
155
156
157
158
159
160


Modified Paths:
---------------
mail/src/main/java/javax/mail/internet/package.html
mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java
mail/src/main/java/com/sun/mail/util/QPEncoderStream.java
doc/release/CHANGES.txt
mail/src/main/java/javax/mail/internet/MimeBodyPart.java
mail/src/main/java/javax/mail/internet/MimeMessage.java
mail/src/main/java/javax/mail/internet/MimeMultipart.java
mail/src/main/java/javax/mail/search/BodyTerm.java
mail/src/main/java/javax/mail/search/SubjectTerm.java
mail/src/main/java/javax/mail/search/package.html
mail/src/main/java/javax/mail/internet/InternetAddress.java
dsn/src/main/java/com/sun/mail/dsn/DeliveryStatus.java
dsn/src/main/java/com/sun/mail/dsn/DispositionNotification.java
dsn/src/main/java/com/sun/mail/dsn/message_deliverystatus.java
mail/src/main/java/com/sun/mail/util/LineOutputStream.java
dsn/src/main/java/com/sun/mail/dsn/message_dispositionnotification.java


Diffs:
------
diff -r 539ca970d47e -r 094d175a3708 mail/src/main/java/javax/mail/internet/package.html
--- a/mail/src/main/java/javax/mail/internet/package.html Fri Jul 10 15:19:57 2009 -0700
+++ b/mail/src/main/java/javax/mail/internet/package.html Fri Jul 31 10:07:06 2009 -0700
@@ -162,7 +162,7 @@
 <TD>
 If set to <code>"true"</code>, non-ASCII parameters in a
 <code>ParameterList</code>, e.g., in a Content-Type header,
-will be encoded as specified by
+will be decoded as specified by
 <A HREF="http://www.ietf.org/rfc/rfc2231.txt" TARGET="_top">RFC 2231</A>.
 The default is false.
 </TD>
@@ -174,7 +174,7 @@
 <TD>
 If set to <code>"true"</code>, non-ASCII parameters in a
 <code>ParameterList</code>, e.g., in a Content-Type header,
-will be decoded as specified by
+will be encoded as specified by
 <A HREF="http://www.ietf.org/rfc/rfc2231.txt" TARGET="_top">RFC 2231</A>.
 The default is false.
 </TD>


diff -r 094d175a3708 -r 05f5c3d36def mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java
--- a/mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java Fri Jul 31 10:07:06 2009 -0700
+++ b/mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java Tue Aug 18 15:03:56 2009 -0700
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2009 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
@@ -705,6 +705,8 @@
                                              " is not an InternetAddress");
             }
         }
+ if (addresses.length == 0)
+ throw new SendFailedException("No recipient addresses");
 
         this.message = (MimeMessage)message;
         this.addresses = addresses;


diff -r 05f5c3d36def -r e88b8d76ebda mail/src/main/java/com/sun/mail/util/QPEncoderStream.java
--- a/mail/src/main/java/com/sun/mail/util/QPEncoderStream.java Tue Aug 18 15:03:56 2009 -0700
+++ b/mail/src/main/java/com/sun/mail/util/QPEncoderStream.java Tue Aug 18 20:50:14 2009 -0700
@@ -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-2009 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
@@ -153,6 +153,10 @@
      * and closes this output stream
      */
     public void close() throws IOException {
+ if (gotSpace) {
+ output(' ', true);
+ gotSpace = false;
+ }
         out.close();
     }
 


diff -r e88b8d76ebda -r b3690d68d64d doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Tue Aug 18 20:50:14 2009 -0700
+++ b/doc/release/CHANGES.txt Wed Aug 19 13:27:16 2009 -0700
@@ -14,6 +14,7 @@
 The following bugs have been fixed in the 1.4.3 release.
 
 6850882 IMAPMessage returns wrong getMessageNumber() from messageRemovedEvent
+6872072 QPEncoderStream write method eats up trailing white space of a string
 <no id> add starttls support to POP3
 <no id> fix deadlock in IMAP IDLE support
 <no id> add mail.transport.protocol.<address-type> property


diff -r b3690d68d64d -r a02afed21341 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Wed Aug 19 13:27:16 2009 -0700
+++ b/doc/release/CHANGES.txt Thu Aug 20 15:09:31 2009 -0700
@@ -20,6 +20,7 @@
 <no id> add mail.transport.protocol.<address-type> property
 <no id> fail POP3Folder.open if STAT command fails
 <no id> fix POP3Folder.isOpen if POP3 server fails and is then reconnected
+<no id> better handle modifying messages created from input streams
 
 
                   CHANGES IN THE 1.4.2 RELEASE

diff -r b3690d68d64d -r a02afed21341 mail/src/main/java/javax/mail/internet/MimeBodyPart.java
--- a/mail/src/main/java/javax/mail/internet/MimeBodyPart.java Wed Aug 19 13:27:16 2009 -0700
+++ b/mail/src/main/java/javax/mail/internet/MimeBodyPart.java Thu Aug 20 15:09:31 2009 -0700
@@ -597,7 +597,7 @@
      */
     public DataHandler getDataHandler() throws MessagingException {
         if (dh == null)
- dh = new DataHandler(new MimePartDataSource(this));
+ dh = new MimePartDataHandler(new MimePartDataSource(this));
         return dh;
     }
 
@@ -1260,6 +1260,8 @@
         DataHandler dh = part.getDataHandler();
         if (dh == null) // Huh ?
             return;
+ if (dh instanceof MimePartDataHandler)
+ return; // can't update it
 
         try {
             String type = dh.getContentType();
@@ -1381,4 +1383,17 @@
         part.getDataHandler().writeTo(os);
         os.flush(); // Needed to complete encoding
     }
+
+ /**
+ * A special DataHandler used only as a marker to indicate that
+ * the source of the data is a MimePart. This prevents updateHeaders
+ * from trying to change the headers for such data. In particular,
+ * the original Content-Transfer-Encoding for the data must be preserved.
+ * Otherwise the data would need to be decoded and reencoded.
+ */
+ static class MimePartDataHandler extends DataHandler {
+ public MimePartDataHandler(DataSource ds) {
+ super(ds);
+ }
+ }
 }

diff -r b3690d68d64d -r a02afed21341 mail/src/main/java/javax/mail/internet/MimeMessage.java
--- a/mail/src/main/java/javax/mail/internet/MimeMessage.java Wed Aug 19 13:27:16 2009 -0700
+++ b/mail/src/main/java/javax/mail/internet/MimeMessage.java Thu Aug 20 15:09:31 2009 -0700
@@ -1360,7 +1360,8 @@
     public synchronized DataHandler getDataHandler()
                 throws MessagingException {
         if (dh == null)
- dh = new DataHandler(new MimePartDataSource(this));
+ dh = new MimeBodyPart.MimePartDataHandler(
+ new MimePartDataSource(this));
         return dh;
     }
 

diff -r b3690d68d64d -r a02afed21341 mail/src/main/java/javax/mail/internet/MimeMultipart.java
--- a/mail/src/main/java/javax/mail/internet/MimeMultipart.java Wed Aug 19 13:27:16 2009 -0700
+++ b/mail/src/main/java/javax/mail/internet/MimeMultipart.java Thu Aug 20 15:09:31 2009 -0700
@@ -410,6 +410,7 @@
      * did change, and do the header updating only if necessary.
      */
     protected synchronized void updateHeaders() throws MessagingException {
+ parse();
         for (int i = 0; i < parts.size(); i++)
             ((MimeBodyPart)parts.elementAt(i)).updateHeaders();
     }


diff -r a02afed21341 -r e236e7b66fe9 mail/src/main/java/javax/mail/search/BodyTerm.java
--- a/mail/src/main/java/javax/mail/search/BodyTerm.java Thu Aug 20 15:09:31 2009 -0700
+++ b/mail/src/main/java/javax/mail/search/BodyTerm.java Thu Aug 20 15:23:03 2009 -0700
@@ -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-2009 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
@@ -39,8 +39,10 @@
 import javax.mail.*;
 
 /**
- * This class implements searches on a Message Body.
+ * This class implements searches on a message body.
  * All parts of the message that are of MIME type "text/*" are searched.
+ * The pattern is a simple string that must appear as a substring in
+ * the message body.
  *
  * @author Bill Shannon
  * @author John Mani

diff -r a02afed21341 -r e236e7b66fe9 mail/src/main/java/javax/mail/search/SubjectTerm.java
--- a/mail/src/main/java/javax/mail/search/SubjectTerm.java Thu Aug 20 15:09:31 2009 -0700
+++ b/mail/src/main/java/javax/mail/search/SubjectTerm.java Thu Aug 20 15:23:03 2009 -0700
@@ -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-2009 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
@@ -39,8 +39,9 @@
 import javax.mail.Message;
 
 /**
- * This class implements comparisons for the Message Subject header.
- * The comparison is case-insensitive.
+ * This class implements comparisons for the message Subject header.
+ * The comparison is case-insensitive. The pattern is a simple string
+ * that must appear as a substring in the Subject.
  *
  * @author Bill Shannon
  * @author John Mani

diff -r a02afed21341 -r e236e7b66fe9 mail/src/main/java/javax/mail/search/package.html
--- a/mail/src/main/java/javax/mail/search/package.html Thu Aug 20 15:09:31 2009 -0700
+++ b/mail/src/main/java/javax/mail/search/package.html Thu Aug 20 15:23:03 2009 -0700
@@ -5,7 +5,7 @@
 
   DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  
- Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ Copyright 1997-2009 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
@@ -49,6 +49,16 @@
 see the {_at_link javax.mail.Folder#search search} method on
 {_at_link javax.mail.Folder javax.mail.Folder}.
 See {_at_link javax.mail.search.SearchTerm SearchTerm}.
+<P>
+Note that the exact search capabilities depend on the protocol,
+provider, and server in use. For the POP3 protocol, all searching is
+done on the client side using the JavaMail classes. For IMAP, all
+searching is done on the server side and is limited by the search
+capabilities of the IMAP protocol and the IMAP server being used.
+For example, IMAP date based searches have only day granularity.
+<P>
+In general, all of the string patterns supported by search terms are
+just simple strings; no regular expressions are supported.
 
 </BODY>
 </HTML>


diff -r e236e7b66fe9 -r 7ac03efc24cd doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Aug 20 15:23:03 2009 -0700
+++ b/doc/release/CHANGES.txt Thu Aug 20 15:28:10 2009 -0700
@@ -21,6 +21,7 @@
 <no id> fail POP3Folder.open if STAT command fails
 <no id> fix POP3Folder.isOpen if POP3 server fails and is then reconnected
 <no id> better handle modifying messages created from input streams
+<no id> include server error message in exception when SMTP authentication fails
 
 
                   CHANGES IN THE 1.4.2 RELEASE

diff -r e236e7b66fe9 -r 7ac03efc24cd mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java
--- a/mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java Thu Aug 20 15:23:03 2009 -0700
+++ b/mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java Thu Aug 20 15:28:10 2009 -0700
@@ -555,7 +555,8 @@
             } finally {
                 if (resp != 235) {
                     closeConnection();
- return false;
+ throw new AuthenticationFailedException(
+ getLastServerResponse());
                 }
             }
             return true;


diff -r 7ac03efc24cd -r ce5f26f95abe mail/src/main/java/javax/mail/internet/InternetAddress.java
--- a/mail/src/main/java/javax/mail/internet/InternetAddress.java Thu Aug 20 15:28:10 2009 -0700
+++ b/mail/src/main/java/javax/mail/internet/InternetAddress.java Fri Aug 21 23:31:25 2009 -0700
@@ -1194,7 +1194,20 @@
             if (c <= 040 || c >= 0177)
                 throw new AddressException(
                                 "Domain contains control or whitespace", addr);
- if (specialsNoDot.indexOf(c) >= 0)
+ // RFC 2822 rule
+ //if (specialsNoDot.indexOf(c) >= 0)
+ /*
+ * RFC 1034 rule is more strict
+ * the full rule is:
+ *
+ * <domain> ::= <subdomain> | " "
+ * <subdomain> ::= <label> | <subdomain> "." <label>
+ * <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
+ * <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
+ * <let-dig-hyp> ::= <let-dig> | "-"
+ * <let-dig> ::= <letter> | <digit>
+ */
+ if (!(Character.isLetterOrDigit(c) || c == '-' || c == '.'))
                 throw new AddressException(
                                 "Domain contains illegal character", addr);
             if (c == '.' && lastc == '.')


diff -r ce5f26f95abe -r c7aa907f0250 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Fri Aug 21 23:31:25 2009 -0700
+++ b/doc/release/CHANGES.txt Fri Aug 21 23:33:10 2009 -0700
@@ -22,6 +22,7 @@
 <no id> fix POP3Folder.isOpen if POP3 server fails and is then reconnected
 <no id> better handle modifying messages created from input streams
 <no id> include server error message in exception when SMTP authentication fails
+<no id> InternetAddress verifies domain per RFC1034 instead of RFC822 in strict
 
 
                   CHANGES IN THE 1.4.2 RELEASE


diff -r c7aa907f0250 -r aae40821bbf0 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Fri Aug 21 23:33:10 2009 -0700
+++ b/doc/release/CHANGES.txt Mon Aug 24 17:34:51 2009 -0700
@@ -14,6 +14,7 @@
 The following bugs have been fixed in the 1.4.3 release.
 
 6850882 IMAPMessage returns wrong getMessageNumber() from messageRemovedEvent
+6857090 JavaMail is not sending HELO / EHLO according to specs
 6872072 QPEncoderStream write method eats up trailing white space of a string
 <no id> add starttls support to POP3
 <no id> fix deadlock in IMAP IDLE support

diff -r c7aa907f0250 -r aae40821bbf0 mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java
--- a/mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java Fri Aug 21 23:33:10 2009 -0700
+++ b/mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java Mon Aug 24 17:34:51 2009 -0700
@@ -201,7 +201,7 @@
                         session.getProperty("mail." + name + ".localaddress");
             if (localHostName == null || localHostName.length() <= 0) {
                 InetAddress localHost = InetAddress.getLocalHost();
- localHostName = localHost.getHostName();
+ localHostName = localHost.getCanonicalHostName();
                 // if we can't get our name, use local address literal
                 if (localHostName == null)
                     // XXX - not correct for IPv6


diff -r aae40821bbf0 -r 282fb74fd9dc doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Mon Aug 24 17:34:51 2009 -0700
+++ b/doc/release/CHANGES.txt Mon Aug 24 17:58:19 2009 -0700
@@ -16,6 +16,7 @@
 6850882 IMAPMessage returns wrong getMessageNumber() from messageRemovedEvent
 6857090 JavaMail is not sending HELO / EHLO according to specs
 6872072 QPEncoderStream write method eats up trailing white space of a string
+6875367 LineOutputStream wraps IOException instead of throwing it directly
 <no id> add starttls support to POP3
 <no id> fix deadlock in IMAP IDLE support
 <no id> add mail.transport.protocol.<address-type> property

diff -r aae40821bbf0 -r 282fb74fd9dc dsn/src/main/java/com/sun/mail/dsn/DeliveryStatus.java
--- a/dsn/src/main/java/com/sun/mail/dsn/DeliveryStatus.java Mon Aug 24 17:34:51 2009 -0700
+++ b/dsn/src/main/java/com/sun/mail/dsn/DeliveryStatus.java Mon Aug 24 17:58:19 2009 -0700
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2009 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
@@ -157,8 +157,7 @@
         recipientDSN[recipientDSN.length - 1] = h;
     }
 
- public void writeTo(OutputStream os)
- throws IOException, MessagingException {
+ public void writeTo(OutputStream os) throws IOException {
         // see if we already have a LOS
         LineOutputStream los = null;
         if (os instanceof LineOutputStream) {
@@ -178,16 +177,8 @@
     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);
- }
+ while (e.hasMoreElements())
+ los.writeln((String)e.nextElement());
     }
 
     public String toString() {

diff -r aae40821bbf0 -r 282fb74fd9dc dsn/src/main/java/com/sun/mail/dsn/DispositionNotification.java
--- a/dsn/src/main/java/com/sun/mail/dsn/DispositionNotification.java Mon Aug 24 17:34:51 2009 -0700
+++ b/dsn/src/main/java/com/sun/mail/dsn/DispositionNotification.java Mon Aug 24 17:58:19 2009 -0700
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2009 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
@@ -113,8 +113,7 @@
         this.notifications = notifications;
     }
 
- public void writeTo(OutputStream os)
- throws IOException, MessagingException {
+ public void writeTo(OutputStream os) throws IOException {
         // see if we already have a LOS
         LineOutputStream los = null;
         if (os instanceof LineOutputStream) {
@@ -130,16 +129,8 @@
     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);
- }
+ while (e.hasMoreElements())
+ los.writeln((String)e.nextElement());
     }
 
     public String toString() {

diff -r aae40821bbf0 -r 282fb74fd9dc dsn/src/main/java/com/sun/mail/dsn/message_deliverystatus.java
--- a/dsn/src/main/java/com/sun/mail/dsn/message_deliverystatus.java Mon Aug 24 17:34:51 2009 -0700
+++ b/dsn/src/main/java/com/sun/mail/dsn/message_deliverystatus.java Mon Aug 24 17:58:19 2009 -0700
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2009 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
@@ -117,11 +117,7 @@
         // if the object is a DeliveryStatus, we know how to write that out
         if (obj instanceof DeliveryStatus) {
             DeliveryStatus ds = (DeliveryStatus)obj;
- try {
- ds.writeTo(os);
- } catch (MessagingException me) {
- throw new IOException(me.toString());
- }
+ ds.writeTo(os);
             
         } else {
             throw new IOException("unsupported object");

diff -r aae40821bbf0 -r 282fb74fd9dc mail/src/main/java/com/sun/mail/util/LineOutputStream.java
--- a/mail/src/main/java/com/sun/mail/util/LineOutputStream.java Mon Aug 24 17:34:51 2009 -0700
+++ b/mail/src/main/java/com/sun/mail/util/LineOutputStream.java Mon Aug 24 17:58:19 2009 -0700
@@ -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-2009 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
@@ -37,7 +37,6 @@
 package com.sun.mail.util;
 
 import java.io.*;
-import javax.mail.MessagingException;
 
 /**
  * This class is to support writing out Strings as a sequence of bytes
@@ -63,21 +62,13 @@
         super(out);
     }
 
- public void writeln(String s) throws MessagingException {
- try {
- byte[] bytes = ASCIIUtility.getBytes(s);
- out.write(bytes);
- out.write(newline);
- } catch (Exception ex) {
- throw new MessagingException("IOException", ex);
- }
+ public void writeln(String s) throws IOException {
+ byte[] bytes = ASCIIUtility.getBytes(s);
+ out.write(bytes);
+ out.write(newline);
     }
 
- public void writeln() throws MessagingException {
- try {
- out.write(newline);
- } catch (Exception ex) {
- throw new MessagingException("IOException", ex);
- }
+ public void writeln() throws IOException {
+ out.write(newline);
     }
 }


diff -r 282fb74fd9dc -r fb5e9b99db4e dsn/src/main/java/com/sun/mail/dsn/message_dispositionnotification.java
--- a/dsn/src/main/java/com/sun/mail/dsn/message_dispositionnotification.java Mon Aug 24 17:58:19 2009 -0700
+++ b/dsn/src/main/java/com/sun/mail/dsn/message_dispositionnotification.java Mon Aug 24 21:27:24 2009 -0700
@@ -118,12 +118,7 @@
         // 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());
- }
-
+ dn.writeTo(os);
         } else {
             throw new IOException("unsupported object");
         }