commits@javamail.java.net

[javamail~mercurial:307] Oops, forgot bug id.

From: <shannon_at_kenai.com>
Date: Mon, 25 Oct 2010 21:46:43 +0000

Project: javamail
Repository: mercurial
Revision: 307
Author: shannon
Date: 2010-10-24 06:33:41 UTC
Link:

Log Message:
------------
Convert to new naming scheme for maven artifacts and OSGi modules.
Also create a mail.jar with the old name for compatibility.
Fix bug in POP3Message that prevented reading the same message content twice.
Add unit test for same.
Fix dependency on main mail.jar, to allow clean build to work.
Helps a lot if I add these files!
Make sure socket is closed if SMTP connect fails.
Oops, forgot bug id.


Revisions:
----------
302
303
304
305
306
307


Modified Paths:
---------------
dsn/src/main/resources/META-INF/MANIFEST.MF
imap/src/main/resources/META-INF/MANIFEST.MF
mail/pom.xml
mail/src/main/resources/META-INF/MANIFEST.MF
mailapi/pom.xml
mbox/src/main/resources/META-INF/MANIFEST.MF
pom.xml
pop3/src/main/resources/META-INF/MANIFEST.MF
smtp/src/main/resources/META-INF/MANIFEST.MF
mail/src/main/java/com/sun/mail/pop3/POP3Message.java
mail/src/test/java/com/sun/mail/pop3/POP3Handler.java
parent-distrib/pom.xml
doc/release/CHANGES.txt
mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java


Added Paths:
------------
mail/src/test/java/com/sun/mail/pop3/POP3MessageTest.java
mailapijar/pom.xml
oldmail/pom.xml
mail/src/test/java/com/sun/mail/smtp/NopServer.java
mail/src/test/java/com/sun/mail/smtp/SMTPCloseTest.java


Diffs:
------
diff -r ff83aab363d9 -r 94ae02a0149b dsn/src/main/resources/META-INF/MANIFEST.MF
--- a/dsn/src/main/resources/META-INF/MANIFEST.MF Tue Oct 05 13:49:06 2010 -0700
+++ b/dsn/src/main/resources/META-INF/MANIFEST.MF Thu Oct 21 13:59:47 2010 -0700
@@ -2,8 +2,8 @@
 Extension-Name: com.sun.mail.dsn
 Specification-Title: com.sun.mail.dsn
 Specification-Version: ${mail.spec.version}
-Specification-Vendor: Sun Microsystems, Inc.
+Specification-Vendor: ${project.organization.name}
 Implementation-Title: com.sun.mail.dsn
 Implementation-Version: ${mail.version}
-Implementation-Vendor: Sun Microsystems, Inc.
+Implementation-Vendor: ${project.organization.name}
 Implementation-Vendor-Id: com.sun

diff -r ff83aab363d9 -r 94ae02a0149b imap/src/main/resources/META-INF/MANIFEST.MF
--- a/imap/src/main/resources/META-INF/MANIFEST.MF Tue Oct 05 13:49:06 2010 -0700
+++ b/imap/src/main/resources/META-INF/MANIFEST.MF Thu Oct 21 13:59:47 2010 -0700
@@ -2,8 +2,8 @@
 Extension-Name: com.sun.mail.imap
 Specification-Title: com.sun.mail.imap
 Specification-Version: ${mail.spec.version}
-Specification-Vendor: Sun Microsystems, Inc.
+Specification-Vendor: ${project.organization.name}
 Implementation-Title: com.sun.mail.imap
 Implementation-Version: ${mail.version}
-Implementation-Vendor: Sun Microsystems, Inc.
+Implementation-Vendor: ${project.organization.name}
 Implementation-Vendor-Id: com.sun

diff -r ff83aab363d9 -r 94ae02a0149b mail/pom.xml
--- a/mail/pom.xml Tue Oct 05 13:49:06 2010 -0700
+++ b/mail/pom.xml Thu Oct 21 13:59:47 2010 -0700
@@ -51,8 +51,8 @@
         <version>1.4.4-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
+ <groupId>com.sun.mail</groupId>
+ <artifactId>javax.mail</artifactId>
     <packaging>jar</packaging>
     <name>JavaMail API</name>
 

diff -r ff83aab363d9 -r 94ae02a0149b mail/src/main/resources/META-INF/MANIFEST.MF
--- a/mail/src/main/resources/META-INF/MANIFEST.MF Tue Oct 05 13:49:06 2010 -0700
+++ b/mail/src/main/resources/META-INF/MANIFEST.MF Thu Oct 21 13:59:47 2010 -0700
@@ -2,8 +2,8 @@
 Extension-Name: javax.mail
 Specification-Title: JavaMail(TM) API Design Specification
 Specification-Version: ${mail.spec.version}
-Specification-Vendor: Sun Microsystems, Inc.
+Specification-Vendor: ${project.organization.name}
 Implementation-Title: javax.mail
 Implementation-Version: ${mail.version}
-Implementation-Vendor: Sun Microsystems, Inc.
+Implementation-Vendor: ${project.organization.name}
 Implementation-Vendor-Id: com.sun

diff -r ff83aab363d9 -r 94ae02a0149b mailapi/pom.xml
--- a/mailapi/pom.xml Tue Oct 05 13:49:06 2010 -0700
+++ b/mailapi/pom.xml Thu Oct 21 13:59:47 2010 -0700
@@ -41,6 +41,14 @@
 
 -->
 
+<!--
+ This project builds the JavaMail "mailapi.jar" file. This jar file
+ contains a fully operational JavaMail implementation but without any
+ protocol providers. It can be used with the separate protocol provider
+ jar files (e.g., smtp.jar, imap.jar) to provide a full JavaMail runtime
+ implementation.
+-->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
@@ -51,10 +59,10 @@
         <version>1.4.4-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
- <groupId>javax.mail</groupId>
+ <groupId>com.sun.mail</groupId>
     <artifactId>mailapi</artifactId>
     <packaging>jar</packaging>
- <name>JavaMail API jar</name>
+ <name>JavaMail API (no providers)</name>
 
     <properties>
         <mail.packages.export>
@@ -63,6 +71,9 @@
             com.sun.mail.util.logging; version=${mail.version},
             com.sun.mail.handlers; version=${mail.version}
         </mail.packages.export>
+ <mail.bundle.symbolicName>
+ javax.mail.api
+ </mail.bundle.symbolicName>
     </properties>
 
     <build>
@@ -81,8 +92,8 @@
                 <configuration>
                     <artifactItems>
                         <artifactItem>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
+ <groupId>com.sun.mail</groupId>
+ <artifactId>javax.mail</artifactId>
                             <version>${mail.version}</version>
                         </artifactItem>
                     </artifactItems>

diff -r ff83aab363d9 -r 94ae02a0149b mbox/src/main/resources/META-INF/MANIFEST.MF
--- a/mbox/src/main/resources/META-INF/MANIFEST.MF Tue Oct 05 13:49:06 2010 -0700
+++ b/mbox/src/main/resources/META-INF/MANIFEST.MF Thu Oct 21 13:59:47 2010 -0700
@@ -2,8 +2,8 @@
 Extension-Name: com.sun.mail.mbox
 Specification-Title: com.sun.mail.mbox
 Specification-Version: ${mail.spec.version}
-Specification-Vendor: Sun Microsystems, Inc.
+Specification-Vendor: ${project.organization.name}
 Implementation-Title: com.sun.mail.mbox
 Implementation-Version: ${mail.version}
-Implementation-Vendor: Sun Microsystems, Inc.
+Implementation-Vendor: ${project.organization.name}
 Implementation-Vendor-Id: com.sun

diff -r ff83aab363d9 -r 94ae02a0149b pom.xml
--- a/pom.xml Tue Oct 05 13:49:06 2010 -0700
+++ b/pom.xml Thu Oct 21 13:59:47 2010 -0700
@@ -52,7 +52,7 @@
     <version>1.4.4-SNAPSHOT</version>
     <name>JavaMail API distribution</name>
     <description>${project.name}</description>
- <url>http://java.sun.com/projects/javamail</url>
+ <url>http://kenai.com/projects/javamail</url>
 
     <licenses>
       <license>
@@ -70,8 +70,8 @@
     </licenses>
 
     <organization>
- <name>Sun Microsystems, Inc.</name>
- <url>http://www.sun.com</url>
+ <name>Oracle</name>
+ <url>http://www.oracle.com</url>
     </organization>
 
     <properties>
@@ -90,6 +90,9 @@
         <mail.implementationTitle>
             ${project.groupId}.${project.artifactId}
         </mail.implementationTitle>
+ <mail.bundle.symbolicName>
+ ${project.groupId}.${project.artifactId}
+ </mail.bundle.symbolicName>
         <mail.packages.export>
             javax.mail.*; version=${mail.spec.version}
         </mail.packages.export>
@@ -113,7 +116,7 @@
         <developer>
             <id>shannon</id>
             <name>Bill Shannon</name>
- <organization>Sun Microsystems, Inc.</organization>
+ <organization>Oracle</organization>
             <roles>
                 <role>lead</role>
             </roles>
@@ -123,10 +126,12 @@
     <modules>
         <module>mail</module>
         <module>mailapi</module>
+ <module>mailapijar</module>
         <module>smtp</module>
         <module>imap</module>
         <module>pop3</module>
         <module>dsn</module>
+ <module>oldmail</module>
     </modules>
 
     <profiles>
@@ -246,7 +251,7 @@
             <!--
                 This plugin is reponsible for packaging artifacts
                 as OSGi bundles. Please refer to
- http://felix.apache.org/site/maven-bundle-plugin-bnd.html
+ http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
                 for more information about how to use this plugin.
             -->
             <plugin>
@@ -254,6 +259,9 @@
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
+ <Bundle-SymbolicName>
+ ${mail.bundle.symbolicName}
+ </Bundle-SymbolicName>
                         <Export-Package>
                             ${mail.packages.export}
                         </Export-Package>
@@ -355,7 +363,8 @@
                                 ${mail.specificationTitle}
                             </Specification-Title>
                             <Specification-Version>
- ${mail.spec.version}</Specification-Version>
+ ${mail.spec.version}
+ </Specification-Version>
                             <Specification-Vendor>
                                 ${project.organization.name}
                             </Specification-Vendor>

diff -r ff83aab363d9 -r 94ae02a0149b pop3/src/main/resources/META-INF/MANIFEST.MF
--- a/pop3/src/main/resources/META-INF/MANIFEST.MF Tue Oct 05 13:49:06 2010 -0700
+++ b/pop3/src/main/resources/META-INF/MANIFEST.MF Thu Oct 21 13:59:47 2010 -0700
@@ -2,8 +2,8 @@
 Extension-Name: com.sun.mail.pop3
 Specification-Title: com.sun.mail.pop3
 Specification-Version: ${mail.spec.version}
-Specification-Vendor: Sun Microsystems, Inc.
+Specification-Vendor: ${project.organization.name}
 Implementation-Title: com.sun.mail.pop3
 Implementation-Version: ${mail.version}
-Implementation-Vendor: Sun Microsystems, Inc.
+Implementation-Vendor: ${project.organization.name}
 Implementation-Vendor-Id: com.sun

diff -r ff83aab363d9 -r 94ae02a0149b smtp/src/main/resources/META-INF/MANIFEST.MF
--- a/smtp/src/main/resources/META-INF/MANIFEST.MF Tue Oct 05 13:49:06 2010 -0700
+++ b/smtp/src/main/resources/META-INF/MANIFEST.MF Thu Oct 21 13:59:47 2010 -0700
@@ -2,8 +2,8 @@
 Extension-Name: com.sun.mail.smtp
 Specification-Title: com.sun.mail.smtp
 Specification-Version: ${mail.spec.version}
-Specification-Vendor: Sun Microsystems, Inc.
+Specification-Vendor: ${project.organization.name}
 Implementation-Title: com.sun.mail.smtp
 Implementation-Version: ${mail.version}
-Implementation-Vendor: Sun Microsystems, Inc.
+Implementation-Vendor: ${project.organization.name}
 Implementation-Vendor-Id: com.sun


diff -r 94ae02a0149b -r 0b1d6fc83357 mail/src/main/java/com/sun/mail/pop3/POP3Message.java
--- a/mail/src/main/java/com/sun/mail/pop3/POP3Message.java Thu Oct 21 13:59:47 2010 -0700
+++ b/mail/src/main/java/com/sun/mail/pop3/POP3Message.java Thu Oct 21 16:19:28 2010 -0700
@@ -234,6 +234,12 @@
                         ((POP3Store)(folder.getStore())).keepMessageContent)
                     contentStream = cstream;
                 contentData = new SoftReference(cstream);
+ } else {
+ /*
+ * We have a cached stream, but we need to return
+ * a fresh stream to read from the beginning.
+ */
+ cstream = ((SharedInputStream)cstream).newStream(0, -1);
             }
         }
         } catch (EOFException eex) {

diff -r 94ae02a0149b -r 0b1d6fc83357 mail/src/test/java/com/sun/mail/pop3/POP3Handler.java
--- a/mail/src/test/java/com/sun/mail/pop3/POP3Handler.java Thu Oct 21 13:59:47 2010 -0700
+++ b/mail/src/test/java/com/sun/mail/pop3/POP3Handler.java Thu Oct 21 16:19:28 2010 -0700
@@ -74,7 +74,36 @@
     
     /** Current line. */
     private String currentLine;
-
+
+ /** First test message. */
+ private String msg1 =
+ "Mime-Version: 1.0\r\n" +
+ "From: joe_at_example.com\r\n" +
+ "To: bob_at_example.com\r\n" +
+ "Subject: Example\r\n" +
+ "Content-Type: text/plain\r\n" +
+ "\r\n" +
+ "plain text\r\n";
+
+ /** Second test message. */
+ private String msg2 =
+ "Mime-Version: 1.0\r\n" +
+ "From: joe_at_example.com\r\n" +
+ "To: bob_at_example.com\r\n" +
+ "Subject: Multipart Example\r\n" +
+ "Content-Type: multipart/mixed; boundary=\"xxx\"\r\n" +
+ "\r\n" +
+ "preamble\r\n" +
+ "--xxx\r\n" +
+ "\r\n" +
+ "first part\r\n" +
+ "\r\n" +
+ "--xxx\r\n" +
+ "\r\n" +
+ "second part\r\n" +
+ "\r\n" +
+ "--xxx--\r\n";
+
     /**
      * Sets the client socket.
      *
@@ -112,7 +141,7 @@
             }
         }
     }
-
+
     /**
      * Send greetings.
      *
@@ -132,7 +161,8 @@
      * unable to write to socket
      */
     public void println(final String str) throws IOException {
- this.writer.println(str);
+ this.writer.print(str);
+ this.writer.print("\r\n");
         this.writer.flush();
     }
     
@@ -151,8 +181,9 @@
             return;
         }
         
- final String commandName = new StringTokenizer(
- this.currentLine, " ").nextToken().toUpperCase();
+ final StringTokenizer st = new StringTokenizer(this.currentLine, " ");
+ final String commandName = st.nextToken().toUpperCase();
+ final String arg = st.hasMoreTokens() ? st.nextToken() : null;
         if (commandName == null) {
             LOGGER.severe("Command name is empty!");
             this.exit();
@@ -164,7 +195,7 @@
         } else if (commandName.equals("LIST")) {
             this.list();
         } else if (commandName.equals("RETR")) {
- this.retr();
+ this.retr(arg);
         } else if (commandName.equals("DELE")) {
             this.dele();
         } else if (commandName.equals("NOOP")) {
@@ -196,7 +227,7 @@
      * unable to read/write to socket
      */
     public void stat() throws IOException {
- this.println("+OK 2 18");
+ this.println("+OK 2 " + (msg1.length() + msg2.length()));
     }
     
     /**
@@ -207,8 +238,8 @@
      */
     public void list() throws IOException {
         this.writer.println("+OK");
- this.writer.println("1 7");
- this.writer.println("2 7");
+ this.writer.println("1 " + msg1.length());
+ this.writer.println("2 " + msg2.length());
         this.println(".");
     }
     
@@ -218,8 +249,15 @@
      * @throws IOException
      * unable to read/write to socket
      */
- public void retr() throws IOException {
- // Nothing
+ public void retr(String arg) throws IOException {
+ String msg;
+ if (arg.equals("1"))
+ msg = msg1;
+ else
+ msg = msg2;
+ this.println("+OK " + msg.length() + " octets");
+ this.writer.write(msg);
+ this.println(".");
     }
     
     /**
@@ -229,7 +267,7 @@
      * unable to read/write to socket
      */
     public void dele() throws IOException {
- // Nothing
+ this.println("-ERR DELE not supported");
     }
     
     /**
@@ -270,7 +308,7 @@
      * unable to read/write to socket
      */
     public void top() throws IOException {
- // Nothing
+ this.println("-ERR TOP not supported");
     }
     
     /**

diff -r 94ae02a0149b -r 0b1d6fc83357 mail/src/test/java/com/sun/mail/pop3/POP3MessageTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/src/test/java/com/sun/mail/pop3/POP3MessageTest.java Thu Oct 21 16:19:28 2010 -0700
@@ -0,0 +1,138 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2009-2010 Oracle and/or its affiliates. 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_1_1.html
+ * or packager/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 packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [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.pop3;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import javax.mail.Folder;
+import javax.mail.Session;
+import javax.mail.Store;
+import javax.mail.Message;
+import javax.mail.Multipart;
+import javax.mail.Part;
+import javax.mail.MessagingException;
+
+import org.junit.Test;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
+
+/**
+ * Test that we can read POP3 messages.
+ *
+ * @author Bill Shannon
+ */
+public final class POP3MessageTest {
+
+ private static POP3Server server = null;
+ private static Store store;
+ private static Folder folder;
+
+ @BeforeClass
+ public static void startServer() {
+ try {
+ final POP3Handler handler = new POP3Handler();
+ server = new POP3Server(handler, 26421);
+ server.start();
+ Thread.sleep(1000);
+
+ final Properties properties = new Properties();
+ properties.setProperty("mail.pop3.host", "localhost");
+ properties.setProperty("mail.pop3.port", "26421");
+ final Session session = Session.getInstance(properties);
+ //session.setDebug(true);
+
+ store = session.getStore("pop3");
+ store.connect("test", "test");
+ folder = store.getFolder("INBOX");
+ folder.open(Folder.READ_ONLY);
+ } catch (final Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+
+ @AfterClass
+ public static void stopServer() {
+ try {
+ if (folder != null)
+ folder.close(false);
+ if (store != null)
+ store.close();
+ } catch (MessagingException ex) {
+ // ignore it
+ } finally {
+ if (server != null)
+ server.quit();
+ }
+ }
+
+ /**
+ * Test that we can read the content of a message twice.
+ * A bug caused POP3Message to return the same stream the
+ * second time, instead of a new stream positioned at the
+ * beginning of the data. This caused multipart parsing
+ * to fail.
+ *
+ * XXX - really should test this with all the various caching options
+ */
+ @Test
+ public void testReadTwice() throws Exception {
+ Message[] msgs = folder.getMessages();
+ for (int i = 0; i < msgs.length; i++) {
+ loadMail(msgs[i]);
+ loadMail(msgs[i]);
+ }
+ // no exception is success!
+ }
+
+ private void loadMail(Part p) throws Exception {
+ Object content = p.getContent();
+ if (content instanceof Multipart) {
+ Multipart mp = (Multipart)content;
+ int cnt = mp.getCount();
+ for (int i = 0; i < cnt; i++)
+ loadMail(mp.getBodyPart(i));
+ }
+ }
+}


diff -r 0b1d6fc83357 -r 1205b31c543d parent-distrib/pom.xml
--- a/parent-distrib/pom.xml Thu Oct 21 16:19:28 2010 -0700
+++ b/parent-distrib/pom.xml Fri Oct 22 11:38:15 2010 -0700
@@ -72,8 +72,8 @@
                 <configuration>
                     <artifactItems>
                         <artifactItem>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
+ <groupId>com.sun..mail</groupId>
+ <artifactId>javax.mail</artifactId>
                             <version>${mail.version}</version>
                         </artifactItem>
                     </artifactItems>


diff -r 1205b31c543d -r b409f03b68a7 mailapijar/pom.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mailapijar/pom.xml Sat Oct 23 12:02:24 2010 -0700
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 1997-2010 Oracle and/or its affiliates. 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_1_1.html
+ or packager/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 packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [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.
+
+-->
+
+<!--
+ This project builds the JavaMail API jar file, which contains only
+ the javax.mail.* API definitions and is *only* intended to be used
+ for programs to compile against. Note that it includes none of the
+ implementation-specific classes that the javax.mail.* classes rely on.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>com.sun.mail</groupId>
+ <artifactId>all</artifactId>
+ <version>1.4.4-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>javax.mail</groupId>
+ <artifactId>javax.mail-api</artifactId>
+ <packaging>jar</packaging>
+ <name>JavaMail API jar</name>
+
+ <properties>
+ <mail.packages.export>
+ javax.mail.*; version=${mail.spec.version}
+ </mail.packages.export>
+ <mail.bundle.symbolicName>
+ javax.mail-api
+ </mail.bundle.symbolicName>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.sun.mail</groupId>
+ <artifactId>javax.mail</artifactId>
+ <version>${mail.version}</version>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>
+ ${project.build.outputDirectory}
+ </outputDirectory>
+ <includes>
+ javax/**,
+ META-INF/*
+ </includes>
+ <excludes>
+ META-INF/javamail.default.*
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <finalName>${project.artifactId}</finalName>
+ <archive>
+ <manifestFile>
+ ${project.build.outputDirectory}/META-INF/MANIFEST.MF
+ </manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>

diff -r 1205b31c543d -r b409f03b68a7 oldmail/pom.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/oldmail/pom.xml Sat Oct 23 12:02:24 2010 -0700
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 1997-2010 Oracle and/or its affiliates. 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_1_1.html
+ or packager/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 packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [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.
+
+-->
+
+<!--
+ This project creates a jar file using the old name (mail.jar),
+ the old groupId:artifactId, etc.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>com.sun.mail</groupId>
+ <artifactId>all</artifactId>
+ <version>1.4.4-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <packaging>jar</packaging>
+ <name>JavaMail API (compat)</name>
+
+ <properties>
+ <!-- override the OSGi Bundle-SymbolicName -->
+ <mail.bundle.symbolicName>
+ javax.mail
+ </mail.bundle.symbolicName>
+ <!-- rest copied from mail/pom.xml -->
+ <mail.extensionName>
+ javax.mail
+ </mail.extensionName>
+ <mail.specificationTitle>
+ JavaMail(TM) API Design Specification
+ </mail.specificationTitle>
+ <mail.implementationTitle>
+ javax.mail
+ </mail.implementationTitle>
+ <mail.packages.export>
+ javax.mail.*; version=${mail.spec.version},
+ com.sun.mail.imap; version=${mail.osgiversion},
+ com.sun.mail.imap.protocol; version=${mail.osgiversion},
+ com.sun.mail.iap; version=${mail.osgiversion},
+ com.sun.mail.pop3; version=${mail.osgiversion},
+ com.sun.mail.smtp; version=${mail.osgiversion},
+ com.sun.mail.util; version=${mail.osgiversion},
+ com.sun.mail.util.logging; version=${mail.osgiversion},
+ com.sun.mail.handlers; version=${mail.osgiversion}
+ </mail.packages.export>
+ <mail.probeFile>
+ META-INF/gfprobe-provider.xml
+ </mail.probeFile>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.sun.mail</groupId>
+ <artifactId>javax.mail</artifactId>
+ <version>${mail.version}</version>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>
+ ${project.build.outputDirectory}
+ </outputDirectory>
+ <excludes>
+ META-INF/maven/**
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <finalName>${project.artifactId}</finalName>
+ <archive>
+ <manifestFile>
+ ${project.build.outputDirectory}/META-INF/MANIFEST.MF
+ </manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>


diff -r b409f03b68a7 -r f02702fa74d9 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Sat Oct 23 12:02:24 2010 -0700
+++ b/doc/release/CHANGES.txt Sat Oct 23 23:31:41 2010 -0700
@@ -46,6 +46,7 @@
 <no id> add demo classes to support non-MIME messages from Outlook
 <no id> fix deadlock when using IMAP fetch and IDLE
 <no id> add support for mail.smtp.auth.<mechanism>.disable properties
+<no id> make sure socket is closed if SMTP connect fails
 
 
                   CHANGES IN THE 1.4.3 RELEASE

diff -r b409f03b68a7 -r f02702fa74d9 mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java
--- a/mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java Sat Oct 23 12:02:24 2010 -0700
+++ b/mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java Sat Oct 23 23:31:41 2010 -0700
@@ -598,12 +598,6 @@
         // setting mail.smtp.auth to true enables attempts to use AUTH
         boolean useAuth = PropUtil.getBooleanSessionProperty(session,
                                         "mail." + name + ".auth", false);
- // setting mail.smtp.auth.mechanisms controls which mechanisms will
- // be used, and in what order they'll be considered. only the first
- // match is used.
- String mechs = session.getProperty("mail." + name + ".auth.mechanisms");
- if (mechs == null)
- mechs = defaultAuthenticationMechanisms;
 
         if (debug)
             out.println("DEBUG SMTP: useEhlo " + useEhlo +
@@ -631,107 +625,135 @@
         if (host == null || host.length() == 0)
             host = "localhost";
 
- boolean succeed = false;
+ /*
+ * If anything goes wrong, we need to be sure
+ * to close the connection.
+ */
+ boolean connected = false;
+ try {
 
- if (serverSocket != null)
- openServer(); // only happens from connect(socket)
- else
- openServer(host, port);
+ if (serverSocket != null)
+ openServer(); // only happens from connect(socket)
+ else
+ openServer(host, port);
 
- if (useEhlo)
- succeed = ehlo(getLocalHost());
- if (!succeed)
- helo(getLocalHost());
+ boolean succeed = false;
+ if (useEhlo)
+ succeed = ehlo(getLocalHost());
+ if (!succeed)
+ helo(getLocalHost());
 
- if (useStartTLS || requireStartTLS) {
- if (supportsExtension("STARTTLS")) {
- startTLS();
- /*
- * Have to issue another EHLO to update list of extensions
- * supported, especially authentication mechanisms.
- * Don't know if this could ever fail, but we ignore failure.
- */
- ehlo(getLocalHost());
- } else if (requireStartTLS) {
- if (debug)
- out.println(
- "DEBUG SMTP: STARTTLS required but not supported");
+ if (useStartTLS || requireStartTLS) {
+ if (supportsExtension("STARTTLS")) {
+ startTLS();
+ /*
+ * Have to issue another EHLO to update list of extensions
+ * supported, especially authentication mechanisms.
+ * Don't know if this could ever fail, but we ignore
+ * failure.
+ */
+ ehlo(getLocalHost());
+ } else if (requireStartTLS) {
+ if (debug)
+ out.println(
+ "DEBUG SMTP: STARTTLS required but not supported");
+ throw new MessagingException(
+ "STARTTLS is required but " +
+ "host does not support STARTTLS");
+ }
+ }
+
+ if ((useAuth || (user != null && passwd != null)) &&
+ (supportsExtension("AUTH") ||
+ supportsExtension("AUTH=LOGIN"))) {
+ return authenticate(user, passwd);
+ }
+
+ // we connected correctly
+ connected = true;
+ return true;
+
+ } finally {
+ // if we didn't connect successfully,
+ // make sure the connection is closed
+ if (!connected) {
                 try {
                     closeConnection();
- } catch (MessagingException mex) { /* ignore it */ }
- throw new MessagingException(
- "STARTTLS is required but host does not support STARTTLS");
+ } catch (MessagingException mex) { } // ignore it
             }
         }
+ }
 
- if ((useAuth || (user != null && passwd != null)) &&
- (supportsExtension("AUTH") || supportsExtension("AUTH=LOGIN"))) {
- String authzid = getAuthorizationId();
- if (authzid == null)
- authzid = user;
- if (enableSASL) {
- if (debug)
- out.println("DEBUG SMTP: Authenticate with SASL");
- if (sasllogin(getSASLMechanisms(), getSASLRealm(), authzid,
- user, passwd))
- return true; // success
- if (debug)
- out.println("DEBUG SMTP: SASL authentication failed");
- }
+ /**
+ * Authenticate to the server.
+ */
+ private boolean authenticate(String user, String passwd)
+ throws MessagingException {
+ // setting mail.smtp.auth.mechanisms controls which mechanisms will
+ // be used, and in what order they'll be considered. only the first
+ // match is used.
+ String mechs = session.getProperty("mail." + name + ".auth.mechanisms");
+ if (mechs == null)
+ mechs = defaultAuthenticationMechanisms;
 
- if (debug) {
- out.println("DEBUG SMTP: Attempt to authenticate");
- out.println("DEBUG SMTP: check mechanisms: " + mechs);
- }
-
- /*
- * Loop through the list of mechanisms supplied by the user
- * (or defaulted) and try each in turn. If the server supports
- * the mechanism and we have an authenticator for the mechanism,
- * and it hasn't been disabled, use it.
- */
- StringTokenizer st = new StringTokenizer(mechs);
- while (st.hasMoreTokens()) {
- String m = st.nextToken();
- String dprop = "mail." + name + ".auth." +
- m.toLowerCase(Locale.ENGLISH) + ".disable";
- boolean disabled =
- PropUtil.getBooleanSessionProperty(session, dprop, false);
- if (disabled) {
- if (debug)
- out.println("DEBUG SMTP: mechanism " + m +
- " disabled by property: " + dprop);
- continue;
- }
- m = m.toUpperCase(Locale.ENGLISH);
- if (!supportsAuthentication(m)) {
- if (debug)
- out.println("DEBUG SMTP: mechanism " + m +
- " not supported by server");
- continue;
- }
- Authenticator a = (Authenticator)authenticators.get(m);
- if (a == null) {
- if (debug)
- out.println("DEBUG SMTP: " +
- "no authenticator for mechanism " + m);
- continue;
- }
- // only first supported mechanism is used
- return a.authenticate(host, authzid, user, passwd);
- }
-
- // if no authentication mechanism found, close connection and fail
- try {
- closeConnection();
- } catch (MessagingException mex) { /* ignore it */ }
- throw new AuthenticationFailedException(
- "No authentication mechansims supported by both " +
- "server and client");
+ String authzid = getAuthorizationId();
+ if (authzid == null)
+ authzid = user;
+ if (enableSASL) {
+ if (debug)
+ out.println("DEBUG SMTP: Authenticate with SASL");
+ if (sasllogin(getSASLMechanisms(), getSASLRealm(), authzid,
+ user, passwd))
+ return true; // success
+ if (debug)
+ out.println("DEBUG SMTP: SASL authentication failed");
         }
 
- // we connected correctly
- return true;
+ if (debug) {
+ out.println("DEBUG SMTP: Attempt to authenticate");
+ out.println("DEBUG SMTP: check mechanisms: " + mechs);
+ }
+
+ /*
+ * Loop through the list of mechanisms supplied by the user
+ * (or defaulted) and try each in turn. If the server supports
+ * the mechanism and we have an authenticator for the mechanism,
+ * and it hasn't been disabled, use it.
+ */
+ StringTokenizer st = new StringTokenizer(mechs);
+ while (st.hasMoreTokens()) {
+ String m = st.nextToken();
+ String dprop = "mail." + name + ".auth." +
+ m.toLowerCase(Locale.ENGLISH) + ".disable";
+ boolean disabled =
+ PropUtil.getBooleanSessionProperty(session, dprop, false);
+ if (disabled) {
+ if (debug)
+ out.println("DEBUG SMTP: mechanism " + m +
+ " disabled by property: " + dprop);
+ continue;
+ }
+ m = m.toUpperCase(Locale.ENGLISH);
+ if (!supportsAuthentication(m)) {
+ if (debug)
+ out.println("DEBUG SMTP: mechanism " + m +
+ " not supported by server");
+ continue;
+ }
+ Authenticator a = (Authenticator)authenticators.get(m);
+ if (a == null) {
+ if (debug)
+ out.println("DEBUG SMTP: " +
+ "no authenticator for mechanism " + m);
+ continue;
+ }
+ // only first supported mechanism is used
+ return a.authenticate(host, authzid, user, passwd);
+ }
+
+ // if no authentication mechanism found, fail
+ throw new AuthenticationFailedException(
+ "No authentication mechansims supported by both server and client");
     }
 
     /**

diff -r b409f03b68a7 -r f02702fa74d9 mail/src/test/java/com/sun/mail/smtp/NopServer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/src/test/java/com/sun/mail/smtp/NopServer.java Sat Oct 23 23:31:41 2010 -0700
@@ -0,0 +1,127 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2009-2010 Oracle and/or its affiliates. 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_1_1.html
+ * or packager/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 packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [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.smtp;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+/**
+ * A server that does nothing, but keeps track of
+ * whether the client socket was closed.
+ *
+ * Inspired by, and derived from, POP3Server by sbo.
+ *
+ * @author Bill Shannon
+ */
+public final class NopServer extends Thread {
+
+ /** Server socket. */
+ private ServerSocket serverSocket;
+
+ /** Keep on? */
+ private volatile boolean keepOn;
+
+ /** Port to listen. */
+ private final int port;
+
+ /** DId we get EOF on the client socket? */
+ private volatile boolean gotEOF = false;
+
+ /**
+ * Nop server.
+ *
+ * @param port port to listen on
+ */
+ public NopServer(final int port) {
+ this.port = port;
+ }
+
+ /**
+ * Exit Nop server.
+ */
+ public void quit() {
+ try {
+ keepOn = false;
+ if (serverSocket != null && !serverSocket.isClosed()) {
+ serverSocket.close();
+ serverSocket = null;
+ }
+ } catch (final IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public boolean eof() {
+ return gotEOF;
+ }
+
+ public void run() {
+ try {
+ keepOn = true;
+
+ try {
+ serverSocket = new ServerSocket(port, 0, null);
+ } catch (final IOException e) {
+ throw new RuntimeException(e);
+ }
+
+ while (keepOn) {
+ try {
+ final Socket clientSocket = serverSocket.accept();
+ /*
+ * Do nothing but consume any input and throw it away.
+ * When we see EOF, remember it.
+ */
+ InputStream is = clientSocket.getInputStream();
+ while (is.read() >= 0)
+ ;
+ gotEOF = true;
+ } catch (final IOException e) {
+ //e.printStackTrace();
+ }
+ }
+ } finally {
+ quit();
+ }
+ }
+}

diff -r b409f03b68a7 -r f02702fa74d9 mail/src/test/java/com/sun/mail/smtp/SMTPCloseTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/src/test/java/com/sun/mail/smtp/SMTPCloseTest.java Sat Oct 23 23:31:41 2010 -0700
@@ -0,0 +1,100 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2009-2010 Oracle and/or its affiliates. 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_1_1.html
+ * or packager/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 packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [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.smtp;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import javax.mail.Session;
+import javax.mail.Transport;
+
+import org.junit.Test;
+import org.junit.Rule;
+import org.junit.rules.Timeout;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+/**
+ * Test that the socket is closed when connect times out.
+ */
+public final class SMTPCloseTest {
+
+ // timeout the test in case of failure
+ @Rule
+ public Timeout deadlockTimeout = new Timeout(5000);
+
+ @Test
+ public void test() {
+ NopServer server = null;
+ try {
+ server = new NopServer(26423);
+ server.start();
+ Thread.sleep(1000);
+
+ final Properties properties = new Properties();
+ properties.setProperty("mail.smtp.host", "localhost");
+ properties.setProperty("mail.smtp.port", "26423");
+ properties.setProperty("mail.smtp.timeout", "100");
+ final Session session = Session.getInstance(properties);
+ //session.setDebug(true);
+
+ final Transport t = session.getTransport("smtp");
+ try {
+ t.connect();
+ } catch (Exception ex) {
+ // expect an exception when connect times out
+ } finally {
+ t.close();
+ }
+ // give the server thread a chance to detect the close
+ Thread.sleep(100);
+ assertTrue("socket closed", server.eof());
+ } catch (final Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ } finally {
+ if (server != null) {
+ server.quit();
+ server.interrupt();
+ }
+ }
+ }
+}


diff -r f02702fa74d9 -r e1f64886091f doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Sat Oct 23 23:31:41 2010 -0700
+++ b/doc/release/CHANGES.txt Sat Oct 23 23:33:41 2010 -0700
@@ -24,6 +24,7 @@
 6910675 IMAP provider can lose track of message sequence numbers
 6928566 Header violates RFC 2822 for multiple calls of addRecipient(s)
 G 11069 update the mail.jar manifest to include DynamicImport-Package
+K 3442 make sure socket is closed if SMTP connect fails
 <no id> add mail.mime.windowsfilenames System property to handle IE6 breakage
 <no id> properly disable TOP if POP3 CAPA response doesn't include it
 <no id> add mail.pop3.disablecapa property to disable use of the CAPA command
@@ -46,7 +47,6 @@
 <no id> add demo classes to support non-MIME messages from Outlook
 <no id> fix deadlock when using IMAP fetch and IDLE
 <no id> add support for mail.smtp.auth.<mechanism>.disable properties
-<no id> make sure socket is closed if SMTP connect fails
 
 
                   CHANGES IN THE 1.4.3 RELEASE