commits@javamail.java.net

[javamail~mercurial:915] Added tag JAVAMAIL-1_6_0-RC1 for changeset d90b0230ffde

From: <shannon_at_java.net>
Date: Wed, 22 Mar 2017 20:12:34 +0000

Project: javamail
Repository: mercurial
Revision: 915
Author: shannon
Date: 2017-03-21 00:05:14 UTC
Link:

Log Message:
------------
No Method.getParameterCount() method on JDK 1.7.
Support UTF-8 always with PLAIN authentication per RFC 4616 - bug 9169
Support connecting through a web proxy server - bug 9418
Sync with updates to comments for JDK 9.
Update copyright date.
Update spec license.
Update version to 1.6.0-rc1.
Added tag JAVAMAIL-1_6_0-RC1 for changeset d90b0230ffde


Revisions:
----------
908
909
910
911
912
913
914
915


Modified Paths:
---------------
mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java
doc/release/CHANGES.txt
mail/src/main/java/com/sun/mail/imap/protocol/IMAPProtocol.java
mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java
mail/src/main/java/com/sun/mail/smtp/package.html
mail/src/test/java/com/sun/mail/imap/IMAPHandler.java
mail/src/test/java/com/sun/mail/smtp/SMTPLoginHandler.java
mail/src/test/java/com/sun/mail/smtp/SMTPUtf8Test.java
mail/src/main/java/com/sun/mail/imap/package.html
mail/src/main/java/com/sun/mail/pop3/package.html
mail/src/main/java/com/sun/mail/util/SocketFetcher.java
android/activation/src/main/java/javax/activation/MailcapCommandMap.java
android/activation/src/main/java/javax/activation/MimetypesFileTypeMap.java
mail/src/main/java/doc-files/speclicense.html
android/activation/pom.xml
android/mail/pom.xml
android/pom.xml
client/pom.xml
demo/pom.xml
dsn/pom.xml
gimap/pom.xml
imap/pom.xml
javadoc/pom.xml
logging/pom.xml
mail/pom.xml
mailapi/pom.xml
mailapijar/pom.xml
mailhandler/pom.xml
mbox/native/pom.xml
mbox/pom.xml
oldmail/pom.xml
outlook/pom.xml
parent-distrib/pom.xml
pom.xml
pop3/pom.xml
publish/pom.xml
servlet/pom.xml
smtp/pom.xml
taglib/pom.xml
webapp/pom.xml
.hgtags


Added Paths:
------------
mail/src/test/java/com/sun/mail/imap/IMAPPlainHandler.java
mail/src/test/java/com/sun/mail/imap/IMAPStoreTest.java


Diffs:
------
diff -r ff7e0fbbe4e5 -r 464fdaabb73e mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java
--- a/mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java Fri Mar 03 15:52:59 2017 -0800
+++ b/mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java Fri Mar 03 16:33:41 2017 -0800
@@ -597,7 +597,7 @@
         assertTrue(s, Modifier.isPublic(m.getModifiers()));
         assertFalse(s, Modifier.isStatic(m.getModifiers()));
         assertTrue(s, Void.TYPE.equals(m.getReturnType()));
- assertTrue(s, m.getParameterCount() == 0);
+ assertTrue(s, m.getParameterTypes().length == 0);
         assertTrue(s, m.getExceptionTypes().length == 0);
     }
 


diff -r 464fdaabb73e -r 071a1ca0bf67 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Fri Mar 03 16:33:41 2017 -0800
+++ b/doc/release/CHANGES.txt Fri Mar 10 15:23:08 2017 -0800
@@ -50,6 +50,7 @@
 K 8822 Flags convenience methods
 K 8833 SMTP support for the CHUNKING extension of RFC 3030
 K 8846 MimeUtility.unfold squashes multiple spaces
+K 9169 JavaMail PLAIN authentication should implement RFC 4616
 
 
                   CHANGES IN THE 1.5.6 RELEASE

diff -r 464fdaabb73e -r 071a1ca0bf67 mail/src/main/java/com/sun/mail/imap/protocol/IMAPProtocol.java
--- a/mail/src/main/java/com/sun/mail/imap/protocol/IMAPProtocol.java Fri Mar 03 16:33:41 2017 -0800
+++ b/mail/src/main/java/com/sun/mail/imap/protocol/IMAPProtocol.java Fri Mar 10 15:23:08 2017 -0800
@@ -712,7 +712,7 @@
                                     nullByte + u + nullByte + p;
 
                     // obtain b64 encoded bytes
- b64os.write(toBytes(s));
+ b64os.write(s.getBytes(StandardCharsets.UTF_8));
                     b64os.flush(); // complete the encoding
 
                     bos.write(CRLF); // CRLF termination

diff -r 464fdaabb73e -r 071a1ca0bf67 mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java
--- a/mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java Fri Mar 03 16:33:41 2017 -0800
+++ b/mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java Fri Mar 10 15:23:08 2017 -0800
@@ -1004,11 +1004,11 @@
             OutputStream b64os =
                         new BASE64EncoderStream(bos, Integer.MAX_VALUE);
             if (authzid != null)
- b64os.write(toBytes(authzid));
+ b64os.write(authzid.getBytes(StandardCharsets.UTF_8));
             b64os.write(0);
- b64os.write(toBytes(user));
+ b64os.write(user.getBytes(StandardCharsets.UTF_8));
             b64os.write(0);
- b64os.write(toBytes(passwd));
+ b64os.write(passwd.getBytes(StandardCharsets.UTF_8));
             b64os.flush(); // complete the encoding
 
             return ASCIIUtility.toString(bos.toByteArray());

diff -r 464fdaabb73e -r 071a1ca0bf67 mail/src/main/java/com/sun/mail/smtp/package.html
--- a/mail/src/main/java/com/sun/mail/smtp/package.html Fri Mar 03 16:33:41 2017 -0800
+++ b/mail/src/main/java/com/sun/mail/smtp/package.html Fri Mar 10 15:23:08 2017 -0800
@@ -71,7 +71,7 @@
 It can optionally use SMTP Authentication
 (<A HREF="http://www.ietf.org/rfc/rfc2554.txt" TARGET="_top">RFC 2554</A>)
 using the LOGIN, PLAIN, DIGEST-MD5, and NTLM mechanisms
-(<A HREF="http://www.ietf.org/rfc/rfc2595.txt" TARGET="_top">RFC 2595</A>
+(<A HREF="http://www.ietf.org/rfc/rfc4616.txt" TARGET="_top">RFC 4616</A>
 and <A HREF="http://www.ietf.org/rfc/rfc2831.txt" TARGET="_top">RFC 2831</A>).
 <P>
 To use SMTP authentication you'll need to set the <code>mail.smtp.auth</code>

diff -r 464fdaabb73e -r 071a1ca0bf67 mail/src/test/java/com/sun/mail/imap/IMAPHandler.java
--- a/mail/src/test/java/com/sun/mail/imap/IMAPHandler.java Fri Mar 03 16:33:41 2017 -0800
+++ b/mail/src/test/java/com/sun/mail/imap/IMAPHandler.java Fri Mar 10 15:23:08 2017 -0800
@@ -272,6 +272,8 @@
             delete(currentLine);
         } else if (commandName.equals("STATUS")) {
             status(currentLine);
+ } else if (commandName.equals("NAMESPACE")) {
+ namespace();
         } else {
             LOGGER.log(Level.SEVERE, "ERROR command unknown: {0}",
                                                         escape(currentLine));
@@ -509,6 +511,15 @@
     }
 
     /**
+ * NAMESPACE command.
+ *
+ * @throws IOException unable to read/write to socket
+ */
+ public void namespace() throws IOException {
+ no("no namespaces");
+ }
+
+ /**
      * Collect "bytes" worth of data for the message being appended.
      */
     protected void collectMessage(int bytes) throws IOException {

diff -r 464fdaabb73e -r 071a1ca0bf67 mail/src/test/java/com/sun/mail/imap/IMAPPlainHandler.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/src/test/java/com/sun/mail/imap/IMAPPlainHandler.java Fri Mar 10 15:23:08 2017 -0800
@@ -0,0 +1,86 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2009-2017 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.imap;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+import com.sun.mail.util.BASE64DecoderStream;
+
+/**
+ * Handle IMAP connection with PLAIN authentication.
+ *
+ * @author Bill Shannon
+ */
+public class IMAPPlainHandler extends IMAPHandler {
+
+ protected String username = "test";
+ protected String password = "test";
+
+ public IMAPPlainHandler() {
+ capabilities += " LOGINDISABLED AUTH=PLAIN";
+ }
+
+ /**
+ * AUTHENTICATE PLAIN command.
+ *
+ * @throws IOException unable to read/write to socket
+ */
+ @Override
+ public void authplain(String ir) throws IOException {
+ if (ir == null) {
+ cont("");
+ ir = readLine();
+ }
+ String auth = new String(BASE64DecoderStream.decode(
+ ir.getBytes(StandardCharsets.US_ASCII)),
+ StandardCharsets.UTF_8);
+ String[] ap = auth.split("\000");
+ String u = ap[1];
+ String p = ap[2];
+ //System.out.printf("USER: %s, PASSWORD: %s%n", u, p);
+ if (!u.equals(username) || !p.equals(password)) {
+ no("authentication failed");
+ return;
+ }
+ ok("[CAPABILITY " + capabilities + "]");
+ }
+}

diff -r 464fdaabb73e -r 071a1ca0bf67 mail/src/test/java/com/sun/mail/imap/IMAPStoreTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/src/test/java/com/sun/mail/imap/IMAPStoreTest.java Fri Mar 10 15:23:08 2017 -0800
@@ -0,0 +1,230 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2009-2017 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.imap;
+
+import java.io.IOException;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import javax.mail.Folder;
+import javax.mail.Session;
+import javax.mail.Store;
+import javax.mail.MessagingException;
+
+import com.sun.mail.test.TestServer;
+
+import org.junit.Test;
+import org.junit.Rule;
+import org.junit.rules.Timeout;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
+
+/**
+ * Test IMAPStore methods.
+ */
+public final class IMAPStoreTest {
+
+ // timeout the test in case of deadlock
+ @Rule
+ public Timeout deadlockTimeout = Timeout.seconds(20);
+
+ private static final String utf8Folder = "test\u03b1";
+ private static final String utf7Folder = "test&A7E-";
+
+ public static abstract class IMAPTest {
+ public void init(Properties props) { };
+ public void test(Store store, IMAPHandler handler) throws Exception { };
+ }
+
+ /**
+ * Test that UTF-8 user name works with PLAIN authentication.
+ */
+ @Test
+ public void testUtf8Username() {
+ testWithHandler(
+ new IMAPTest() {
+ @Override
+ public void test(Store store, IMAPHandler handler)
+ throws MessagingException, IOException {
+ store.connect(utf8Folder, utf8Folder);
+ }
+ },
+ new IMAPPlainHandler() {
+ @Override
+ public void authplain(String ir)
+ throws IOException {
+ username = utf8Folder;
+ password = utf8Folder;
+ super.authplain(ir);
+ }
+ });
+ }
+
+ /**
+ * Test that UTF-7 folder names in the NAMESPACE command are
+ * decoded properly.
+ */
+ @Test
+ public void testUtf7Namespaces() {
+ testWithHandler(
+ new IMAPTest() {
+ @Override
+ public void test(Store store, IMAPHandler handler)
+ throws MessagingException, IOException {
+ store.connect("test", "test");
+ Folder[] pub = ((IMAPStore)store).getSharedNamespaces();
+ assertEquals(utf8Folder, pub[0].getName());
+ }
+ },
+ new IMAPHandler() {
+ {{ capabilities += " NAMESPACE"; }}
+ @Override
+ public void namespace() throws IOException {
+ untagged("NAMESPACE ((\"\" \"/\")) ((\"~\" \"/\")) " +
+ "((\"" + utf7Folder + "/\" \"/\"))");
+ ok();
+ }
+ });
+ }
+
+ /**
+ * Test that using a UTF-8 folder name results in the proper UTF-8
+ * unencoded name for the CREATE command.
+ */
+ @Test
+ public void testUtf8FolderNameCreate() {
+ testWithHandler(
+ new IMAPTest() {
+ @Override
+ public void test(Store store, IMAPHandler handler)
+ throws MessagingException, IOException {
+ store.connect("test", "test");
+ Folder test = store.getFolder(utf8Folder);
+ assertTrue(test.create(Folder.HOLDS_MESSAGES));
+ }
+ },
+ new IMAPUtf8Handler() {
+ @Override
+ public void create(String line) throws IOException {
+ StringTokenizer st = new StringTokenizer(line);
+ st.nextToken(); // skip tag
+ st.nextToken(); // skip "CREATE"
+ String name = unquote(st.nextToken());
+ if (name.equals(utf8Folder))
+ ok();
+ else
+ no("wrong name");
+ }
+
+ @Override
+ public void list(String line) throws IOException {
+ untagged("LIST (\\HasNoChildren) \"/\" \"" +
+ utf8Folder + "\"");
+ ok();
+ }
+ });
+ }
+
+ private void testWithHandler(IMAPTest test, IMAPHandler handler) {
+ TestServer server = null;
+ try {
+ server = new TestServer(handler);
+ server.start();
+
+ final Properties properties = new Properties();
+ properties.setProperty("mail.imap.host", "localhost");
+ properties.setProperty("mail.imap.port", "" + server.getPort());
+ test.init(properties);
+ final Session session = Session.getInstance(properties);
+ //session.setDebug(true);
+
+ final Store store = session.getStore("imap");
+ try {
+ test.test(store, handler);
+ } catch (Exception ex) {
+ System.out.println(ex);
+ //ex.printStackTrace();
+ fail(ex.toString());
+ } finally {
+ store.close();
+ }
+ } catch (final Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ } finally {
+ if (server != null) {
+ server.quit();
+ }
+ }
+ }
+
+ private static String unquote(String s) {
+ if (s.startsWith("\"") && s.endsWith("\"") && s.length() > 1) {
+ s = s.substring(1, s.length() - 1);
+ // check for any escaped characters
+ if (s.indexOf('\\') >= 0) {
+ StringBuffer sb = new StringBuffer(s.length()); // approx
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
+ if (c == '\\' && i < s.length() - 1)
+ c = s.charAt(++i);
+ sb.append(c);
+ }
+ s = sb.toString();
+ }
+ }
+ return s;
+ }
+
+ /**
+ * An IMAPHandler that enables UTF-8 support.
+ */
+ private static class IMAPUtf8Handler extends IMAPHandler {
+ {{ capabilities += " ENABLE UTF8=ACCEPT"; }}
+
+ @Override
+ public void enable(String line) throws IOException {
+ ok();
+ }
+ }
+}

diff -r 464fdaabb73e -r 071a1ca0bf67 mail/src/test/java/com/sun/mail/smtp/SMTPLoginHandler.java
--- a/mail/src/test/java/com/sun/mail/smtp/SMTPLoginHandler.java Fri Mar 03 16:33:41 2017 -0800
+++ b/mail/src/test/java/com/sun/mail/smtp/SMTPLoginHandler.java Fri Mar 10 15:23:08 2017 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2009-2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009-2017 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
@@ -51,7 +51,7 @@
 import com.sun.mail.util.ASCIIUtility;
 
 /**
- * Handle connection with LOGIN authentication.
+ * Handle connection with LOGIN or PLAIN authentication.
  *
  * @author Bill Shannon
  */
@@ -70,7 +70,7 @@
         println("250-hello");
         println("250-SMTPUTF8");
         println("250-8BITMIME");
- println("250 AUTH LOGIN");
+ println("250 AUTH PLAIN LOGIN");
     }
 
     /**
@@ -90,7 +90,18 @@
 
         if (LOGGER.isLoggable(Level.FINE))
             LOGGER.fine(line);
+ if (mech.equalsIgnoreCase("PLAIN"))
+ plain(ir);
+ else if (mech.equalsIgnoreCase("LOGIN"))
+ login(ir);
+ else
+ println("501 bad AUTH mechanism");
+ }
 
+ /**
+ * AUTH LOGIN
+ */
+ private void login(String ir) throws IOException {
         println("334");
         // read user name
         String resp = readLine();
@@ -127,6 +138,24 @@
     }
 
     /**
+ * AUTH PLAIN
+ */
+ private void plain(String ir) throws IOException {
+ String auth = new String(BASE64DecoderStream.decode(
+ ir.getBytes(StandardCharsets.US_ASCII)),
+ StandardCharsets.UTF_8);
+ String[] ap = auth.split("\000");
+ String u = ap[1];
+ String p = ap[2];
+ //System.out.printf("USER: %s, PASSWORD: %s%n", u, p);
+ if (!u.equals(username) || !p.equals(password)) {
+ println("535 authentication failed");
+ return;
+ }
+ println("235 Authenticated");
+ }
+
+ /**
      * Is every character in the string a base64 character?
      */
     private boolean isBase64(String s) {

diff -r 464fdaabb73e -r 071a1ca0bf67 mail/src/test/java/com/sun/mail/smtp/SMTPUtf8Test.java
--- a/mail/src/test/java/com/sun/mail/smtp/SMTPUtf8Test.java Fri Mar 03 16:33:41 2017 -0800
+++ b/mail/src/test/java/com/sun/mail/smtp/SMTPUtf8Test.java Fri Mar 10 15:23:08 2017 -0800
@@ -84,6 +84,7 @@
             Properties properties = new Properties();
             properties.setProperty("mail.smtp.host", "localhost");
             properties.setProperty("mail.smtp.port", "" + server.getPort());
+ properties.setProperty("mail.smtp.auth.mechanisms", "LOGIN");
             properties.setProperty("mail.mime.allowutf8", "true");
             //properties.setProperty("mail.debug.auth", "true");
             Session session = Session.getInstance(properties);
@@ -130,6 +131,7 @@
             Properties properties = new Properties();
             properties.setProperty("mail.smtp.host", "localhost");
             properties.setProperty("mail.smtp.port", "" + server.getPort());
+ properties.setProperty("mail.smtp.auth.mechanisms", "LOGIN");
             //properties.setProperty("mail.debug.auth", "true");
             Session session = Session.getInstance(properties);
             //session.setDebug(true);
@@ -156,6 +158,52 @@
         }
     }
 
+ /**
+ * Test using UTF-8 user name and PLAIN but without mail.mime.allowutf8.
+ */
+ @Test
+ public void testUtf8UserNamePlain() {
+ TestServer server = null;
+ final String user = "test\u03b1";
+ try {
+ server = new TestServer(new SMTPLoginHandler() {
+ @Override
+ public void auth(String line) throws IOException {
+ username = user;
+ password = user;
+ super.auth(line);
+ }
+ });
+ server.start();
+
+ Properties properties = new Properties();
+ properties.setProperty("mail.smtp.host", "localhost");
+ properties.setProperty("mail.smtp.port", "" + server.getPort());
+ properties.setProperty("mail.smtp.auth.mechanisms", "PLAIN");
+ //properties.setProperty("mail.debug.auth", "true");
+ Session session = Session.getInstance(properties);
+ //session.setDebug(true);
+
+ Transport t = session.getTransport("smtp");
+ try {
+ t.connect(user, user);
+ // success!
+ } catch (Exception ex) {
+ fail(ex.toString());
+ } finally {
+ t.close();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ } finally {
+ if (server != null) {
+ server.quit();
+ server.interrupt();
+ }
+ }
+ }
+
     private static class Envelope {
         public String from;
         public String to;


diff -r 071a1ca0bf67 -r 1d7e18fe5aa6 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Fri Mar 10 15:23:08 2017 -0800
+++ b/doc/release/CHANGES.txt Thu Mar 16 16:42:04 2017 -0700
@@ -51,6 +51,7 @@
 K 8833 SMTP support for the CHUNKING extension of RFC 3030
 K 8846 MimeUtility.unfold squashes multiple spaces
 K 9169 JavaMail PLAIN authentication should implement RFC 4616
+K 9418 Support connecting through web proxy servers
 
 
                   CHANGES IN THE 1.5.6 RELEASE

diff -r 071a1ca0bf67 -r 1d7e18fe5aa6 mail/src/main/java/com/sun/mail/imap/package.html
--- a/mail/src/main/java/com/sun/mail/imap/package.html Fri Mar 10 15:23:08 2017 -0800
+++ b/mail/src/main/java/com/sun/mail/imap/package.html Thu Mar 16 16:42:04 2017 -0700
@@ -5,7 +5,7 @@
 
     DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
- Copyright (c) 1997-2016 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1997-2017 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
@@ -757,6 +757,26 @@
 </TD>
 </TR>
 
+<A NAME="mail.imap.proxy.host"></A>
+<TR id="mail.imap.proxy.host">
+<TD>mail.imap.proxy.host</TD>
+<TD>string</TD>
+<TD>
+Specifies the host name of an HTTP web proxy server that will be used for
+connections to the mail server.
+</TD>
+</TR>
+
+<A NAME="mail.imap.proxy.port"></A>
+<TR id="mail.imap.proxy.port">
+<TD>mail.imap.proxy.port</TD>
+<TD>string</TD>
+<TD>
+Specifies the port number for the HTTP web proxy server.
+Defaults to port 80.
+</TD>
+</TR>
+
 <A NAME="mail.imap.socks.host"></A>
 <TR id="mail.imap.socks.host">
 <TD>mail.imap.socks.host</TD>
@@ -764,7 +784,6 @@
 <TD>
 Specifies the host name of a SOCKS5 proxy server that will be used for
 connections to the mail server.
-(Note that this only works on JDK 1.5 or newer.)
 </TD>
 </TR>
 

diff -r 071a1ca0bf67 -r 1d7e18fe5aa6 mail/src/main/java/com/sun/mail/pop3/package.html
--- a/mail/src/main/java/com/sun/mail/pop3/package.html Fri Mar 10 15:23:08 2017 -0800
+++ b/mail/src/main/java/com/sun/mail/pop3/package.html Thu Mar 16 16:42:04 2017 -0700
@@ -5,7 +5,7 @@
 
     DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
- Copyright (c) 1997-2016 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1997-2017 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
@@ -479,6 +479,26 @@
 </TD>
 </TR>
 
+<A NAME="mail.pop3.proxy.host"></A>
+<TR id="mail.pop3.proxy.host">
+<TD>mail.pop3.proxy.host</TD>
+<TD>string</TD>
+<TD>
+Specifies the host name of an HTTP web proxy server that will be used for
+connections to the mail server.
+</TD>
+</TR>
+
+<A NAME="mail.pop3.proxy.port"></A>
+<TR id="mail.pop3.proxy.port">
+<TD>mail.pop3.proxy.port</TD>
+<TD>string</TD>
+<TD>
+Specifies the port number for the HTTP web proxy server.
+Defaults to port 80.
+</TD>
+</TR>
+
 <A NAME="mail.pop3.socks.host"></A>
 <TR id="mail.pop3.socks.host">
 <TD>mail.pop3.socks.host</TD>
@@ -486,7 +506,6 @@
 <TD>
 Specifies the host name of a SOCKS5 proxy server that will be used for
 connections to the mail server.
-(Note that this only works on JDK 1.5 or newer.)
 </TD>
 </TR>
 

diff -r 071a1ca0bf67 -r 1d7e18fe5aa6 mail/src/main/java/com/sun/mail/smtp/package.html
--- a/mail/src/main/java/com/sun/mail/smtp/package.html Fri Mar 10 15:23:08 2017 -0800
+++ b/mail/src/main/java/com/sun/mail/smtp/package.html Thu Mar 16 16:42:04 2017 -0700
@@ -715,6 +715,26 @@
 </TD>
 </TR>
 
+<A NAME="mail.smtp.proxy.host"></A>
+<TR id="mail.smtp.proxy.host">
+<TD>mail.smtp.proxy.host</TD>
+<TD>string</TD>
+<TD>
+Specifies the host name of an HTTP web proxy server that will be used for
+connections to the mail server.
+</TD>
+</TR>
+
+<A NAME="mail.smtp.proxy.port"></A>
+<TR id="mail.smtp.proxy.port">
+<TD>mail.smtp.proxy.port</TD>
+<TD>string</TD>
+<TD>
+Specifies the port number for the HTTP web proxy server.
+Defaults to port 80.
+</TD>
+</TR>
+
 <A NAME="mail.smtp.socks.host"></A>
 <TR id="mail.smtp.socks.host">
 <TD>mail.smtp.socks.host</TD>
@@ -722,7 +742,6 @@
 <TD>
 Specifies the host name of a SOCKS5 proxy server that will be used for
 connections to the mail server.
-(Note that this only works on JDK 1.5 or newer.)
 </TD>
 </TR>
 

diff -r 071a1ca0bf67 -r 1d7e18fe5aa6 mail/src/main/java/com/sun/mail/util/SocketFetcher.java
--- a/mail/src/main/java/com/sun/mail/util/SocketFetcher.java Fri Mar 10 15:23:08 2017 -0800
+++ b/mail/src/main/java/com/sun/mail/util/SocketFetcher.java Thu Mar 16 16:42:04 2017 -0700
@@ -275,10 +275,29 @@
                 ", connection timeout " + cto + ", timeout " + to +
                 ", socket factory " + sf + ", useSSL " + useSSL);
                 
- String socksHost = props.getProperty(prefix + ".socks.host", null);
+ String proxyHost = props.getProperty(prefix + ".proxy.host", null);
+ int proxyPort = 80;
+ String socksHost = null;
         int socksPort = 1080;
         String err = null;
- if (socksHost != null) {
+
+ if (proxyHost != null) {
+ int i = proxyHost.indexOf(':');
+ if (i >= 0) {
+ proxyHost = proxyHost.substring(0, i);
+ try {
+ proxyPort = Integer.parseInt(proxyHost.substring(i + 1));
+ } catch (NumberFormatException ex) {
+ // ignore it
+ }
+ }
+ proxyPort = PropUtil.getIntProperty(props,
+ prefix + ".proxy.port", proxyPort);
+ err = "Using web proxy host, port: " + proxyHost + ", " + proxyPort;
+ if (logger.isLoggable(Level.FINER))
+ logger.finer("web proxy host " + proxyHost + ", port " + proxyPort);
+ } else if ((socksHost =
+ props.getProperty(prefix + ".socks.host", null)) != null) {
             int i = socksHost.indexOf(':');
             if (i >= 0) {
                 socksHost = socksHost.substring(0, i);
@@ -325,7 +344,9 @@
             socket.bind(new InetSocketAddress(localaddr, localport));
         try {
             logger.finest("connecting...");
- if (cto >= 0)
+ if (proxyHost != null)
+ proxyConnect(socket, proxyHost, proxyPort, host, port, cto);
+ else if (cto >= 0)
                 socket.connect(new InetSocketAddress(host, port), cto);
             else
                 socket.connect(new InetSocketAddress(host, port));
@@ -782,6 +803,65 @@
     }
 
     /**
+ * Use the HTTP CONNECT protocol to connect to a
+ * site through an HTTP proxy server. <p>
+ *
+ * Protocol is roughly:
+ * <pre>
+ * CONNECT <host>:<port> HTTP/1.0
+ * <blank line>
+ *
+ * HTTP/1.0 200 Connect established
+ * <headers>
+ * <blank line>
+ * </pre>
+ */
+ private static void proxyConnect(Socket socket,
+ String proxyHost, int proxyPort,
+ String host, int port, int cto)
+ throws IOException {
+ if (logger.isLoggable(Level.FINE))
+ logger.fine("connecting through proxy " +
+ proxyHost + ":" + proxyPort + " to " +
+ host + ":" + port);
+ if (cto >= 0)
+ socket.connect(new InetSocketAddress(proxyHost, proxyPort), cto);
+ else
+ socket.connect(new InetSocketAddress(proxyHost, proxyPort));
+ PrintStream os = new PrintStream(socket.getOutputStream());
+ os.print("CONNECT " + host + ":" + port + " HTTP/1.0\r\n\r\n");
+ os.flush();
+ BufferedReader r = new BufferedReader(new InputStreamReader(
+ socket.getInputStream()));
+ String line;
+ boolean first = true;
+ while ((line = r.readLine()) != null) {
+ logger.finest(line);
+ if (line.length() == 0)
+ break;
+ if (first) {
+ StringTokenizer st = new StringTokenizer(line);
+ String http = st.nextToken();
+ String code = st.nextToken();
+ if (!code.equals("200")) {
+ try {
+ socket.close();
+ } catch (IOException ioex) {
+ // ignored
+ }
+ ConnectException ex = new ConnectException(
+ "connection through proxy " +
+ proxyHost + ":" + proxyPort + " to " +
+ host + ":" + port + " failed: " + line);
+ logger.log(Level.FINE, "connect failed", ex);
+ throw ex;
+ }
+ first = false;
+ }
+ }
+ }
+
+ /**
      * Parse a string into whitespace separated tokens
      * and return the tokens in an array.
      */


diff -r 1d7e18fe5aa6 -r 6bf732d15821 android/activation/src/main/java/javax/activation/MailcapCommandMap.java
--- a/android/activation/src/main/java/javax/activation/MailcapCommandMap.java Thu Mar 16 16:42:04 2017 -0700
+++ b/android/activation/src/main/java/javax/activation/MailcapCommandMap.java Thu Mar 16 23:07:04 2017 -0700
@@ -64,16 +64,18 @@
  * <ol>
  * <li> Programatically added entries to the MailcapCommandMap instance.
  * <li> The file <code>.mailcap</code> in the user's home directory.
- * <li> The file <code><i>java.home</i>/<i>conf</i>/mailcap</code>.
+ * <li> The file <code>mailcap</code> in the Java runtime.
  * <li> The file or resources named <code>META-INF/mailcap</code>.
  * <li> The file or resource named <code>META-INF/mailcap.default</code>
  * (usually found only in the <code>activation.jar</code> file).
  * </ol>
  * <p>
- * (Where <i>java.home</i> is the value of the "java.home" System property
- * and <i>conf</i> is the directory named "conf" if it exists,
- * otherwise the directory named "lib"; the "conf" directory was
- * introduced in JDK 1.9.)
+ * (The current implementation looks for the <code>mailcap</code> file
+ * in the Java runtime in the directory <code><i>java.home</i>/conf</code>
+ * if it exists, and otherwise in the directory
+ * <code><i>java.home</i>/lib</code>, where <i>java.home</i> is the value
+ * of the "java.home" System property. Note that the "conf" directory was
+ * introduced in JDK 9.)
  * <p>
  * <b>Mailcap file format:</b><p>
  *

diff -r 1d7e18fe5aa6 -r 6bf732d15821 android/activation/src/main/java/javax/activation/MimetypesFileTypeMap.java
--- a/android/activation/src/main/java/javax/activation/MimetypesFileTypeMap.java Thu Mar 16 16:42:04 2017 -0700
+++ b/android/activation/src/main/java/javax/activation/MimetypesFileTypeMap.java Thu Mar 16 23:07:04 2017 -0700
@@ -60,16 +60,18 @@
  * <ol>
  * <li> Programmatically added entries to the MimetypesFileTypeMap instance.
  * <li> The file <code>.mime.types</code> in the user's home directory.
- * <li> The file <code><i>java.home</i>/<i>conf</i>/mime.types</code>.
+ * <li> The file <code>mime.types</code> in the Java runtime.
  * <li> The file or resources named <code>META-INF/mime.types</code>.
  * <li> The file or resource named <code>META-INF/mimetypes.default</code>
  * (usually found only in the <code>activation.jar</code> file).
  * </ol>
  * <p>
- * (Where <i>java.home</i> is the value of the "java.home" System property
- * and <i>conf</i> is the directory named "conf" if it exists,
- * otherwise the directory named "lib"; the "conf" directory was
- * introduced in JDK 1.9.)
+ * (The current implementation looks for the <code>mime.types</code> file
+ * in the Java runtime in the directory <code><i>java.home</i>/conf</code>
+ * if it exists, and otherwise in the directory
+ * <code><i>java.home</i>/lib</code>, where <i>java.home</i> is the value
+ * of the "java.home" System property. Note that the "conf" directory was
+ * introduced in JDK 9.)
  * <p>
  * <b>MIME types file format:</b><p>
  *


diff -r 6bf732d15821 -r fdb91b2b2220 mail/src/main/java/com/sun/mail/util/SocketFetcher.java
--- a/mail/src/main/java/com/sun/mail/util/SocketFetcher.java Thu Mar 16 23:07:04 2017 -0700
+++ b/mail/src/main/java/com/sun/mail/util/SocketFetcher.java Fri Mar 17 14:18:51 2017 -0700
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2017 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


diff -r fdb91b2b2220 -r 75066dcecf9b mail/src/main/java/doc-files/speclicense.html
--- a/mail/src/main/java/doc-files/speclicense.html Fri Mar 17 14:18:51 2017 -0700
+++ b/mail/src/main/java/doc-files/speclicense.html Mon Mar 20 16:26:27 2017 -0700
@@ -5,19 +5,17 @@
 <body>
 Specification: JSR-919 JavaMail API Specification ("Specification")
 <br/>
-Version: 1.5
+Version: 1.6
 <br/>
-Status: Final Release
+Status: Maintenance Release
 <br/>
 Specification Lead: Oracle America, Inc. ("Specification Lead")
 <br/>
-Release: March 18, 2013
+Release: August 2017
 <br/>
 
 <br/>
-Copyright &#169; 2013 Oracle America, Inc.
-<br/>
-All rights reserved.
+Copyright &#169; 2017 Oracle America, Inc. All rights reserved.
 <br/>
 <p>
 LIMITED LICENSE GRANTS
@@ -115,16 +113,16 @@
 from Specification Lead, includes any of Specification Lead's source
 code or binary code materials; "Licensor Name Space" shall mean the
 public class or interface declarations whose names begin with "java",
-"javax", "com.sun" and "com.oracle" or their equivalents in any
-subsequent naming convention adopted by Oracle America, Inc. through
-the Java Community Process, or any recognized successors or
-replacements thereof; and "Technology Compatibility Kit" or "TCK" shall
-mean the test suite and accompanying TCK User's Guide provided by
-Specification Lead which corresponds to the Specification and that was
-available either (i) from Specification Lead's 120 days before the
-first release of Your Independent Implementation that allows its use
-for commercial purposes, or (ii) more recently than 120 days from such
-release but against which You elect to test Your implementation of the
+"javax", "com.oracle", "com.sun" or their equivalents in any subsequent
+naming convention adopted by Oracle America, Inc. through the Java
+Community Process, or any recognized successors or replacements
+thereof; and "Technology Compatibility Kit" or "TCK" shall mean the
+test suite and accompanying TCK User's Guide provided by Specification
+Lead which corresponds to the Specification and that was available
+either (i) from Specification Lead 120 days before the first release of
+Your Independent Implementation that allows its use for commercial
+purposes, or (ii) more recently than 120 days from such release but
+against which You elect to test Your implementation of the
 Specification.
 </p>
 <p>
@@ -153,15 +151,15 @@
 LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT,
 CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
 REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED IN ANY
-WAY TO YOUR HAVING, IMPELEMENTING OR OTHERWISE USING USING THE
-SPECIFICATION, EVEN IF SPECIFICATION LEAD AND/OR ITS LICENSORS HAVE
-BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You will indemnify,
-hold harmless, and defend Specification Lead and its licensors from any
-claims arising or resulting from: (i) your use of the Specification;
-(ii) the use or distribution of your Java application, applet and/or
-implementation; and/or (iii) any claims that later versions or releases
-of any Specification furnished to you are incompatible with the
-Specification provided to you under this license.
+WAY TO YOUR HAVING, IMPLEMENTING OR OTHERWISE USING THE SPECIFICATION,
+EVEN IF SPECIFICATION LEAD AND/OR ITS LICENSORS HAVE BEEN ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES. You will indemnify, hold harmless,
+and defend Specification Lead and its licensors from any claims arising
+or resulting from: (i) your use of the Specification; (ii) the use or
+distribution of your Java application, applet and/or implementation;
+and/or (iii) any claims that later versions or releases of any
+Specification furnished to you are incompatible with the Specification
+provided to you under this license.
 </p>
 <p>
 RESTRICTED RIGHTS LEGEND


diff -r 75066dcecf9b -r d90b0230ffde android/activation/pom.xml
--- a/android/activation/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/android/activation/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>android</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde android/mail/pom.xml
--- a/android/mail/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/android/mail/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -52,7 +52,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>android</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde android/pom.xml
--- a/android/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/android/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde client/pom.xml
--- a/client/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/client/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde demo/pom.xml
--- a/demo/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/demo/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde dsn/pom.xml
--- a/dsn/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/dsn/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde gimap/pom.xml
--- a/gimap/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/gimap/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde imap/pom.xml
--- a/imap/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/imap/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 75066dcecf9b -r d90b0230ffde javadoc/pom.xml
--- a/javadoc/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/javadoc/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,13 +48,13 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>
     <artifactId>javadoc</artifactId>
     <packaging>pom</packaging>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     <name>JavaMail API javadocs</name>
     <description>${project.name}</description>
 

diff -r 75066dcecf9b -r d90b0230ffde logging/pom.xml
--- a/logging/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/logging/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde mail/pom.xml
--- a/mail/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/mail/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde mailapi/pom.xml
--- a/mailapi/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/mailapi/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -56,7 +56,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde mailapijar/pom.xml
--- a/mailapijar/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/mailapijar/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -55,7 +55,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>javax.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde mailhandler/pom.xml
--- a/mailhandler/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/mailhandler/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 75066dcecf9b -r d90b0230ffde mbox/native/pom.xml
--- a/mbox/native/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/mbox/native/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 75066dcecf9b -r d90b0230ffde mbox/pom.xml
--- a/mbox/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/mbox/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde oldmail/pom.xml
--- a/oldmail/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/oldmail/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -53,7 +53,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>javax.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde outlook/pom.xml
--- a/outlook/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/outlook/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde parent-distrib/pom.xml
--- a/parent-distrib/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/parent-distrib/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde pom.xml
--- a/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -54,7 +54,7 @@
     <groupId>com.sun.mail</groupId>
     <artifactId>all</artifactId>
     <packaging>pom</packaging>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     <name>JavaMail API distribution</name>
     <description>${project.name}</description>
     <url>http://javamail.java.net</url>
@@ -85,9 +85,9 @@
     </organization>
 
     <properties>
- <mail.version>1.6.0-SNAPSHOT</mail.version>
+ <mail.version>1.6.0-rc1</mail.version>
         <!-- like mail.version, but with underscores instead of dots -->
- <mail.zipversion>1_6_0-SNAPSHOT</mail.zipversion>
+ <mail.zipversion>1_6_0-rc1</mail.zipversion>
         <mail.spec.version>1.5</mail.spec.version>
         <!-- defaults that are overridden in mail module -->
         <mail.extensionName>

diff -r 75066dcecf9b -r d90b0230ffde pop3/pom.xml
--- a/pop3/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/pop3/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 75066dcecf9b -r d90b0230ffde publish/pom.xml
--- a/publish/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/publish/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,13 +48,13 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>
     <artifactId>publish</artifactId>
     <packaging>pom</packaging>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     <name>JavaMail API publish project</name>
 
     <build>
@@ -89,44 +89,44 @@
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>javax.mail</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         </dependency>
     <!--
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>demo</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>client</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>servlet</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>webapp</artifactId>
             <type>war</type>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>taglib</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>logging</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>outlook</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         </dependency>
     -->
     </dependencies>

diff -r 75066dcecf9b -r d90b0230ffde servlet/pom.xml
--- a/servlet/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/servlet/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde smtp/pom.xml
--- a/smtp/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/smtp/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 75066dcecf9b -r d90b0230ffde taglib/pom.xml
--- a/taglib/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/taglib/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 75066dcecf9b -r d90b0230ffde webapp/pom.xml
--- a/webapp/pom.xml Mon Mar 20 16:26:27 2017 -0700
+++ b/webapp/pom.xml Mon Mar 20 17:04:40 2017 -0700
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0-rc1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>


diff -r d90b0230ffde -r 990d55e90e6c .hgtags
--- a/.hgtags Mon Mar 20 17:04:40 2017 -0700
+++ b/.hgtags Mon Mar 20 17:05:14 2017 -0700
@@ -21,3 +21,4 @@
 15b5ba9b58712d064178b2530a2b7f89e1d2ebc1 JAVAMAIL-1_5_4
 6f854b7031906581f1c91bf70a13734cbec18e0a JAVAMAIL-1_5_5
 ddcb8608cc654e273da1cd11969a41d60c7c07db JAVAMAIL-1_5_6
+d90b0230ffde36e71d06cc8efc35c1bc662d3731 JAVAMAIL-1_6_0-RC1