commits@javamail.java.net

[javamail~mercurial:820] add GmailMessage.clearCachedLabels() method - bug 7238

From: <shannon_at_java.net>
Date: Sat, 16 Apr 2016 00:22:25 +0000

Project: javamail
Repository: mercurial
Revision: 820
Author: shannon
Date: 2016-04-16 00:21:37 UTC
Link:

Log Message:
------------
Update version to 1.5.6-SNAPSHOT.
Add missing DurationFilter class.
Simplify javadoc configuration to make it less likely that classes are missed.
Get rid of javadoc timestamps to make diffing output possible.
Get rid of javadoc progress output.
fix NPE in APOP support when there's no greeting banner - bug 7140
InternetAddress.parse fails for valid domain literal address - bug 7151
MimeBodyPart.isMimeType returns false if type header can't be parsed - bug 7332
Make IMAPProtocol.handleLoginResult protected - bug 7150
Also, fix AUTHENTICATE commands to report OK responses when
setting the mail.imap.enableresponseevents property.
add GmailMessage.clearCachedLabels() method - bug 7238


Revisions:
----------
813
814
815
816
817
818
819
820


Modified Paths:
---------------
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
doc/release/CHANGES.txt
mail/src/main/java/com/sun/mail/pop3/Protocol.java
mail/src/test/java/com/sun/mail/pop3/POP3StoreTest.java
mail/src/main/java/javax/mail/internet/InternetAddress.java
mail/src/test/resources/javax/mail/internet/addrlist
mail/src/main/java/javax/mail/internet/MimeBodyPart.java
mail/src/test/java/javax/mail/internet/MimeBodyPartTest.java
mail/src/main/java/com/sun/mail/imap/protocol/IMAPProtocol.java
gimap/src/main/java/com/sun/mail/gimap/GmailMessage.java


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


Diffs:
------
diff -r 7bc4ddffce9c -r 15f276ddb21f android/activation/pom.xml
--- a/android/activation/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/android/activation/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>android</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f android/mail/pom.xml
--- a/android/mail/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/android/mail/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -52,7 +52,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>android</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f android/pom.xml
--- a/android/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/android/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f client/pom.xml
--- a/client/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/client/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f demo/pom.xml
--- a/demo/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/demo/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f dsn/pom.xml
--- a/dsn/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/dsn/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f gimap/pom.xml
--- a/gimap/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/gimap/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f imap/pom.xml
--- a/imap/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/imap/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 7bc4ddffce9c -r 15f276ddb21f javadoc/pom.xml
--- a/javadoc/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/javadoc/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,13 +48,13 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>
     <artifactId>javadoc</artifactId>
     <packaging>pom</packaging>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     <name>JavaMail API javadocs</name>
     <description>${project.name}</description>
 

diff -r 7bc4ddffce9c -r 15f276ddb21f logging/pom.xml
--- a/logging/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/logging/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f mail/pom.xml
--- a/mail/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/mail/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f mailapi/pom.xml
--- a/mailapi/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/mailapi/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -56,7 +56,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f mailapijar/pom.xml
--- a/mailapijar/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/mailapijar/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -55,7 +55,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>javax.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f mailhandler/pom.xml
--- a/mailhandler/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/mailhandler/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 7bc4ddffce9c -r 15f276ddb21f mbox/native/pom.xml
--- a/mbox/native/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/mbox/native/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 7bc4ddffce9c -r 15f276ddb21f mbox/pom.xml
--- a/mbox/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/mbox/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f oldmail/pom.xml
--- a/oldmail/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/oldmail/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -53,7 +53,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>javax.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f outlook/pom.xml
--- a/outlook/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/outlook/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f parent-distrib/pom.xml
--- a/parent-distrib/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/parent-distrib/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f pom.xml
--- a/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -54,7 +54,7 @@
     <groupId>com.sun.mail</groupId>
     <artifactId>all</artifactId>
     <packaging>pom</packaging>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</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.5.5</mail.version>
+ <mail.version>1.5.6-SNAPSHOT</mail.version>
         <!-- like mail.version, but with underscores instead of dots -->
- <mail.zipversion>1_5_5</mail.zipversion>
+ <mail.zipversion>1_5_6-SNAPSHOT</mail.zipversion>
         <mail.spec.version>1.5</mail.spec.version>
         <!-- defaults that are overridden in mail module -->
         <mail.extensionName>

diff -r 7bc4ddffce9c -r 15f276ddb21f pop3/pom.xml
--- a/pop3/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/pop3/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 7bc4ddffce9c -r 15f276ddb21f publish/pom.xml
--- a/publish/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/publish/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,13 +48,13 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>
     <artifactId>publish</artifactId>
     <packaging>pom</packaging>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     <name>JavaMail API publish project</name>
 
     <build>
@@ -89,44 +89,44 @@
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>javax.mail</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         </dependency>
     <!--
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>demo</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>client</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>servlet</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>webapp</artifactId>
             <type>war</type>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>taglib</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>logging</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>outlook</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         </dependency>
     -->
     </dependencies>

diff -r 7bc4ddffce9c -r 15f276ddb21f servlet/pom.xml
--- a/servlet/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/servlet/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f smtp/pom.xml
--- a/smtp/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/smtp/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 7bc4ddffce9c -r 15f276ddb21f taglib/pom.xml
--- a/taglib/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/taglib/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 7bc4ddffce9c -r 15f276ddb21f webapp/pom.xml
--- a/webapp/pom.xml Tue Dec 15 14:22:26 2015 -0800
+++ b/webapp/pom.xml Thu Dec 17 13:48:44 2015 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.5</version>
+ <version>1.5.6-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>


diff -r 15f276ddb21f -r 5d8ed6f48dbd javadoc/pom.xml
--- a/javadoc/pom.xml Thu Dec 17 13:48:44 2015 -0800
+++ b/javadoc/pom.xml Thu Dec 17 13:51:49 2015 -0800
@@ -115,6 +115,7 @@
                         com/sun/mail/util/logging/MailHandler.java,
                         com/sun/mail/util/logging/CollectorFormatter.java,
                         com/sun/mail/util/logging/CompactFormatter.java,
+ com/sun/mail/util/logging/DurationFilter.java,
                         com/sun/mail/util/logging/SeverityComparator.java
                                         "/>
                                     <fileset dir="../dsn/src/main/java"


diff -r 5d8ed6f48dbd -r 1006d175d0f1 javadoc/pom.xml
--- a/javadoc/pom.xml Thu Dec 17 13:51:49 2015 -0800
+++ b/javadoc/pom.xml Fri Dec 18 16:21:07 2015 -0800
@@ -112,11 +112,7 @@
                         com/sun/mail/util/MailConnectException.java,
                         com/sun/mail/util/MailSSLSocketFactory.java,
                         com/sun/mail/util/ReadableMime.java,
- com/sun/mail/util/logging/MailHandler.java,
- com/sun/mail/util/logging/CollectorFormatter.java,
- com/sun/mail/util/logging/CompactFormatter.java,
- com/sun/mail/util/logging/DurationFilter.java,
- com/sun/mail/util/logging/SeverityComparator.java
+ com/sun/mail/util/logging/*.java
                                         "/>
                                     <fileset dir="../dsn/src/main/java"
                                         includes="
@@ -130,14 +126,7 @@
                                     <fileset dir="../gimap/src/main/java"
                                         includes="
                         com/sun/mail/gimap/package.html,
- com/sun/mail/gimap/GmailStore.java,
- com/sun/mail/gimap/GmailSSLStore.java,
- com/sun/mail/gimap/GmailFolder.java,
- com/sun/mail/gimap/GmailMessage.java,
- com/sun/mail/gimap/GmailMsgIdTerm.java,
- com/sun/mail/gimap/GmailThrIdTerm.java,
- com/sun/mail/gimap/GmailRawSearchTerm.java,
- com/sun/mail/gimap/LongTerm.java
+ com/sun/mail/gimap/*.java
                                         "/>
                                 </copy>
 
@@ -173,6 +162,9 @@
                             </windowtitle>
                             <splitindex>true</splitindex>
                             <use>true</use>
+ <notimestamp>true</notimestamp>
+ <serialwarn>true</serialwarn>
+ <quiet>true</quiet>
                             <overview>
                                 ${basedir}/target/javadoc/overview.html
                             </overview>


diff -r 1006d175d0f1 -r 2b0404e1ccb5 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Fri Dec 18 16:21:07 2015 -0800
+++ b/doc/release/CHANGES.txt Fri Jan 22 16:45:31 2016 -0800
@@ -15,6 +15,13 @@
 longer available.
 
 
+ CHANGES IN THE 1.5.6 RELEASE
+ ----------------------------
+The following bugs have been fixed in the 1.5.6 release.
+
+K 7140 NPE by APOP detection when no greeting banner
+
+
                   CHANGES IN THE 1.5.5 RELEASE
                   ----------------------------
 The following bugs have been fixed in the 1.5.5 release.

diff -r 1006d175d0f1 -r 2b0404e1ccb5 mail/src/main/java/com/sun/mail/pop3/Protocol.java
--- a/mail/src/main/java/com/sun/mail/pop3/Protocol.java Fri Dec 18 16:21:07 2015 -0800
+++ b/mail/src/main/java/com/sun/mail/pop3/Protocol.java Fri Jan 22 16:45:31 2016 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2016 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
@@ -127,7 +127,7 @@
                 throw new IOException("Connect failed");
             }
         }
- if (enableAPOP) {
+ if (enableAPOP && r.data != null) {
             int challStart = r.data.indexOf('<'); // start of challenge
             int challEnd = r.data.indexOf('>', challStart); // end of challenge
             if (challStart != -1 && challEnd != -1)

diff -r 1006d175d0f1 -r 2b0404e1ccb5 mail/src/test/java/com/sun/mail/pop3/POP3StoreTest.java
--- a/mail/src/test/java/com/sun/mail/pop3/POP3StoreTest.java Fri Dec 18 16:21:07 2015 -0800
+++ b/mail/src/test/java/com/sun/mail/pop3/POP3StoreTest.java Fri Jan 22 16:45:31 2016 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2009-2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009-2016 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
@@ -54,12 +54,13 @@
 import static org.junit.Assert.fail;
 
 /**
- * Test is connected.
- *
+ * Test POP3Store.
+ *
  * @author sbo
+ * @author Bill Shannon
  */
 public final class POP3StoreTest {
-
+
     /**
      * Check is connected.
      */
@@ -70,20 +71,19 @@
             final POP3Handler handler = new POP3HandlerNoopErr();
             server = new TestServer(handler);
             server.start();
- Thread.sleep(1000);
-
+
             final Properties properties = new Properties();
             properties.setProperty("mail.pop3.host", "localhost");
             properties.setProperty("mail.pop3.port", "" + server.getPort());
             final Session session = Session.getInstance(properties);
             //session.setDebug(true);
-
+
             final Store store = session.getStore("pop3");
             try {
                 store.connect("test", "test");
                 final Folder folder = store.getFolder("INBOX");
                 folder.open(Folder.READ_ONLY);
-
+
                 // Check
                 assertFalse(folder.isOpen());
             } finally {
@@ -98,14 +98,50 @@
             }
         }
     }
-
+
+ /**
+ * Check that enabling APOP with a server that doesn't support APOP
+ * (and doesn't return any information in the greeting) doesn't fail.
+ */
+ @Test
+ public void testApopNotSupported() {
+ TestServer server = null;
+ try {
+ final POP3Handler handler = new POP3HandlerNoGreeting();
+ server = new TestServer(handler);
+ server.start();
+
+ final Properties properties = new Properties();
+ properties.setProperty("mail.pop3.host", "localhost");
+ properties.setProperty("mail.pop3.port", "" + server.getPort());
+ properties.setProperty("mail.pop3.apop.enable", "true");
+ final Session session = Session.getInstance(properties);
+ //session.setDebug(true);
+
+ final Store store = session.getStore("pop3");
+ try {
+ store.connect("test", "test");
+ // success!
+ } finally {
+ store.close();
+ }
+ } catch (final Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ } finally {
+ if (server != null) {
+ server.quit();
+ }
+ }
+ }
+
     /**
      * Custom handler. Returns ERR for NOOP.
- *
+ *
      * @author sbo
      */
     private static final class POP3HandlerNoopErr extends POP3Handler {
-
+
         /**
          * {_at_inheritDoc}
          */
@@ -114,4 +150,20 @@
             this.println("-ERR");
         }
     }
+
+ /**
+ * Custom handler. Don't include any extra information in the greeting.
+ *
+ * @author Bill Shannon
+ */
+ private static final class POP3HandlerNoGreeting extends POP3Handler {
+
+ /**
+ * {_at_inheritDoc}
+ */
+ @Override
+ public void sendGreetings() throws IOException {
+ this.println("+OK");
+ }
+ }
 }


diff -r 2b0404e1ccb5 -r 381478f33ec5 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Fri Jan 22 16:45:31 2016 -0800
+++ b/doc/release/CHANGES.txt Wed Jan 27 17:03:33 2016 -0800
@@ -20,6 +20,7 @@
 The following bugs have been fixed in the 1.5.6 release.
 
 K 7140 NPE by APOP detection when no greeting banner
+K 7151 InternetAddress.parse fails for valid domain literal address
 
 
                   CHANGES IN THE 1.5.5 RELEASE

diff -r 2b0404e1ccb5 -r 381478f33ec5 mail/src/main/java/javax/mail/internet/InternetAddress.java
--- a/mail/src/main/java/javax/mail/internet/InternetAddress.java Fri Jan 22 16:45:31 2016 -0800
+++ b/mail/src/main/java/javax/mail/internet/InternetAddress.java Wed Jan 27 17:03:33 2016 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2016 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
@@ -1284,29 +1284,31 @@
                     throw new AddressException(
                             "Domain literal end not at end of domain", addr);
                 inliteral = false;
- } else if (c <= 040 || c >= 0177)
+ } else if (c <= 040 || c >= 0177) {
                 throw new AddressException(
                                 "Domain contains control or whitespace", addr);
- // RFC 2822 rule
- //if (specialsNoDot.indexOf(c) >= 0)
- /*
- * RFC 1034 rule is more strict
- * the full rule is:
- *
- * <domain> ::= <subdomain> | " "
- * <subdomain> ::= <label> | <subdomain> "." <label>
- * <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
- * <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
- * <let-dig-hyp> ::= <let-dig> | "-"
- * <let-dig> ::= <letter> | <digit>
- */
- if (!inliteral) {
- if (!(Character.isLetterOrDigit(c) || c == '-' || c == '.'))
- throw new AddressException(
+ } else {
+ // RFC 2822 rule
+ //if (specialsNoDot.indexOf(c) >= 0)
+ /*
+ * RFC 1034 rule is more strict
+ * the full rule is:
+ *
+ * <domain> ::= <subdomain> | " "
+ * <subdomain> ::= <label> | <subdomain> "." <label>
+ * <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
+ * <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
+ * <let-dig-hyp> ::= <let-dig> | "-"
+ * <let-dig> ::= <letter> | <digit>
+ */
+ if (!inliteral) {
+ if (!(Character.isLetterOrDigit(c) || c == '-' || c == '.'))
+ throw new AddressException(
                                     "Domain contains illegal character", addr);
- if (c == '.' && lastc == '.')
- throw new AddressException(
- "Domain contains dot-dot", addr);
+ if (c == '.' && lastc == '.')
+ throw new AddressException(
+ "Domain contains dot-dot", addr);
+ }
             }
             lastc = c;
         }

diff -r 2b0404e1ccb5 -r 381478f33ec5 mail/src/test/resources/javax/mail/internet/addrlist
--- a/mail/src/test/resources/javax/mail/internet/addrlist Fri Jan 22 16:45:31 2016 -0800
+++ b/mail/src/test/resources/javax/mail/internet/addrlist Wed Jan 27 17:03:33 2016 -0800
@@ -2,7 +2,7 @@
 
     DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
- Copyright (c) 1997-2014 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1997-2016 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
@@ -308,6 +308,9 @@
 To: "john doe" (john.doe_at_a.com)
 Expect: 1
         "john doe"
+To: (test domain literal verification) b@[1.2.3.4]
+Expect: 1
+ b@[1.2.3.4]
 Comment: parsed as a header, we pick out the address from the "comment"
 Header: true
 To: "john doe" (john.doe_at_a.com)


diff -r 381478f33ec5 -r bed896911492 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Wed Jan 27 17:03:33 2016 -0800
+++ b/doc/release/CHANGES.txt Mon Apr 11 14:53:43 2016 -0700
@@ -21,6 +21,7 @@
 
 K 7140 NPE by APOP detection when no greeting banner
 K 7151 InternetAddress.parse fails for valid domain literal address
+K 7332 MimeBodyPart.isMimeType returns false if type header can't be parsed
 
 
                   CHANGES IN THE 1.5.5 RELEASE

diff -r 381478f33ec5 -r bed896911492 mail/src/main/java/javax/mail/internet/MimeBodyPart.java
--- a/mail/src/main/java/javax/mail/internet/MimeBodyPart.java Wed Jan 27 17:03:33 2016 -0800
+++ b/mail/src/main/java/javax/mail/internet/MimeBodyPart.java Mon Apr 11 14:53:43 2016 -0700
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2016 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
@@ -1156,11 +1156,18 @@
     static boolean isMimeType(MimePart part, String mimeType)
                                 throws MessagingException {
         // XXX - lots of room for optimization here!
+ String type = part.getContentType();
         try {
- ContentType ct = new ContentType(part.getContentType());
- return ct.match(mimeType);
+ return new ContentType(type).match(mimeType);
         } catch (ParseException ex) {
- return part.getContentType().equalsIgnoreCase(mimeType);
+ // we only need the type and subtype so throw away the rest
+ try {
+ int i = type.indexOf(';');
+ if (i > 0)
+ return new ContentType(type.substring(0, i)).match(mimeType);
+ } catch (ParseException pex2) {
+ }
+ return type.equalsIgnoreCase(mimeType);
         }
     }
 

diff -r 381478f33ec5 -r bed896911492 mail/src/test/java/javax/mail/internet/MimeBodyPartTest.java
--- a/mail/src/test/java/javax/mail/internet/MimeBodyPartTest.java Wed Jan 27 17:03:33 2016 -0800
+++ b/mail/src/test/java/javax/mail/internet/MimeBodyPartTest.java Mon Apr 11 14:53:43 2016 -0700
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2011-2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011-2016 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,6 +51,7 @@
 
 import org.junit.*;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertArrayEquals;
 
@@ -167,6 +168,24 @@
         in.close();
     }
 
+ /**
+ * Test that isMimeType does something reasonable even if the
+ * Content-Type header can't be parsed because of a bad parameter.
+ */
+ @Test
+ public void testIsMimeTypeBadParameter() throws Exception {
+ String part =
+ "Content-Type: application/x-test; type=a/b\n" +
+ "\n" +
+ "\n";
+ InputStream in = new ByteArrayInputStream(part.getBytes("iso-8859-1"));
+ MimeBodyPart mbp = new MimeBodyPart(in);
+ in.close();
+ assertTrue("complete MIME type", mbp.isMimeType("application/x-test"));
+ assertTrue("pattern MIME type", mbp.isMimeType("application/*"));
+ assertFalse("wrong MIME type", mbp.isMimeType("application/test"));
+ }
+
 
     private static MimeMessage createMessage(Session s)
                                 throws MessagingException {


diff -r bed896911492 -r 4cc3ffe21583 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Mon Apr 11 14:53:43 2016 -0700
+++ b/doc/release/CHANGES.txt Fri Apr 15 14:35:02 2016 -0700
@@ -20,6 +20,7 @@
 The following bugs have been fixed in the 1.5.6 release.
 
 K 7140 NPE by APOP detection when no greeting banner
+K 7150 Make IMAPProtocol.handleLoginResult protected
 K 7151 InternetAddress.parse fails for valid domain literal address
 K 7332 MimeBodyPart.isMimeType returns false if type header can't be parsed
 

diff -r bed896911492 -r 4cc3ffe21583 mail/src/main/java/com/sun/mail/imap/protocol/IMAPProtocol.java
--- a/mail/src/main/java/com/sun/mail/imap/protocol/IMAPProtocol.java Mon Apr 11 14:53:43 2016 -0700
+++ b/mail/src/main/java/com/sun/mail/imap/protocol/IMAPProtocol.java Fri Apr 15 14:35:02 2016 -0700
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2016 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
@@ -579,13 +579,13 @@
                     done = true;
                 else if (r.isBYE()) // outta here
                     done = true;
- else // hmm .. unsolicited response here ?!
- v.add(r);
+ // hmm .. unsolicited response here ?!
             } catch (Exception ioex) {
                 // convert this into a BYE response
                 r = Response.byeResponse(ioex);
                 done = true;
             }
+ v.add(r);
         }
 
         } finally {
@@ -689,13 +689,13 @@
                     done = true;
                 else if (r.isBYE()) // outta here
                     done = true;
- else // hmm .. unsolicited response here ?!
- v.add(r);
+ // hmm .. unsolicited response here ?!
             } catch (Exception ioex) {
                 // convert this into a BYE response
                 r = Response.byeResponse(ioex);
                 done = true;
             }
+ v.add(r);
         }
 
         } finally {
@@ -786,13 +786,13 @@
                     done = true;
                 else if (r.isBYE()) // outta here
                     done = true;
- else // hmm .. unsolicited response here ?!
- v.add(r);
+ // hmm .. unsolicited response here ?!
             } catch (Exception ioex) {
                 // convert this into a BYE response
                 r = Response.byeResponse(ioex);
                 done = true;
             }
+ v.add(r);
         }
 
         } finally {
@@ -880,13 +880,13 @@
                     done = true;
                 else if (r.isBYE()) // outta here
                     done = true;
- else // hmm .. unsolicited response here ?!
- v.add(r);
+ // hmm .. unsolicited response here ?!
             } catch (Exception ioex) {
                 // convert this into a BYE response
                 r = Response.byeResponse(ioex);
                 done = true;
             }
+ v.add(r);
         }
 
         } finally {
@@ -1004,11 +1004,11 @@
      * @exception ProtocolException for protocol failures
      * @since JavaMail 1.5.5
      */
- void handleLoginResult(Response r) throws ProtocolException {
+ protected void handleLoginResult(Response r) throws ProtocolException {
         if (hasCapability("LOGIN-REFERRALS") &&
                 (!r.isOK() || referralException))
             checkReferral(r);
- super.handleResult(r);
+ handleResult(r);
     }
 
     /**

diff -r bed896911492 -r 4cc3ffe21583 mail/src/test/java/com/sun/mail/imap/IMAPResponseEventTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/src/test/java/com/sun/mail/imap/IMAPResponseEventTest.java Fri Apr 15 14:35:02 2016 -0700
@@ -0,0 +1,154 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2009-2016 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.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import javax.mail.Session;
+import javax.mail.Store;
+import javax.mail.event.StoreListener;
+import javax.mail.event.StoreEvent;
+
+import com.sun.mail.test.TestServer;
+
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+/**
+ * Test IMAP response events.
+ */
+public final class IMAPResponseEventTest {
+
+ private volatile boolean gotResponse;
+
+ /**
+ * Test that response events are sent for the LOGIN command.
+ */
+ @Test
+ public void testLoginResponseEvent() {
+ testLogin("");
+ }
+
+ /**
+ * Test that response events are sent for the AUTHENTICATE LOGIN command.
+ */
+ @Test
+ public void testAuthLoginResponseEvent() {
+ testLogin("LOGINDISABLED AUTH=LOGIN");
+ }
+
+ /**
+ * Test that response events are sent for the AUTHENTICATE PLAIN command.
+ */
+ @Test
+ public void testAuthPlainResponseEvent() {
+ testLogin("LOGINDISABLED AUTH=PLAIN");
+ }
+
+ private void testLogin(String type) {
+ TestServer server = null;
+ try {
+ final IMAPHandler handler = new IMAPHandlerLogin(type);
+ server = new TestServer(handler);
+ server.start();
+
+ final Properties properties = new Properties();
+ properties.setProperty("mail.imap.host", "localhost");
+ properties.setProperty("mail.imap.port", "" + server.getPort());
+ properties.setProperty("mail.imap.enableresponseevents", "true");
+ final Session session = Session.getInstance(properties);
+ //session.setDebug(true);
+ final CountDownLatch latch = new CountDownLatch(1);
+
+ final Store store = session.getStore("imap");
+ store.addStoreListener(new StoreListener() {
+ public void notification(StoreEvent e) {
+ String s;
+ if (e.getMessageType() == IMAPStore.RESPONSE) {
+ s = "RESPONSE: ";
+ // is this the expected AUTHENTICATE response?
+ if (e.getMessage().indexOf("X-LOGIN-SUCCESS") >= 0)
+ gotResponse = true;
+ latch.countDown();
+ } else
+ s = "OTHER: ";
+ //System.out.println(s + e.getMessage());
+ }
+ });
+ gotResponse = false;
+ try {
+ store.connect("test", "test");
+ // time for event to be delivered
+ latch.await(5, TimeUnit.SECONDS);
+ assertTrue(gotResponse);
+
+ } 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();
+ }
+ }
+ }
+
+ /**
+ * Custom handler. Forces use of specific login type and includes
+ * a fake capability to be included in the OK response that we
+ * will check for success.
+ */
+ private static final class IMAPHandlerLogin extends IMAPHandler {
+ public IMAPHandlerLogin(String type) {
+ capabilities += " " + type + " X-LOGIN-SUCCESS";
+ }
+ }
+}


diff -r 4cc3ffe21583 -r f34dc211d0fc doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Fri Apr 15 14:35:02 2016 -0700
+++ b/doc/release/CHANGES.txt Fri Apr 15 17:21:37 2016 -0700
@@ -22,6 +22,7 @@
 K 7140 NPE by APOP detection when no greeting banner
 K 7150 Make IMAPProtocol.handleLoginResult protected
 K 7151 InternetAddress.parse fails for valid domain literal address
+K 7238 unsolicited FETCH response *must* invalidate X-GM-LABELS in cache
 K 7332 MimeBodyPart.isMimeType returns false if type header can't be parsed
 
 

diff -r 4cc3ffe21583 -r f34dc211d0fc gimap/src/main/java/com/sun/mail/gimap/GmailMessage.java
--- a/gimap/src/main/java/com/sun/mail/gimap/GmailMessage.java Fri Apr 15 14:35:02 2016 -0700
+++ b/gimap/src/main/java/com/sun/mail/gimap/GmailMessage.java Fri Apr 15 17:21:37 2016 -0700
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2016 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
@@ -145,4 +145,19 @@
             }
         }
     }
+
+ /**
+ * Clear any cached labels for this message.
+ * The Gmail labels for a messge will be cached when first accessed
+ * using either the fetch method or the getLabels method. Gmail provides
+ * no notification when the labels have been changed by another application
+ * so applications may need to clear the cache if accessing the labels for
+ * a message more than once while the Folder is open.
+ *
+ * @since JavaMail 1.5.6
+ */
+ public synchronized void clearCachedLabels() {
+ if (items != null)
+ items.remove(GmailProtocol.LABELS_ITEM.getName());
+ }
 }