commits@javamail.java.net

[mercurial:99] Add mail.imap.sasl.xgwtrustedapphack.enable property to allow disabling

From: <shannon_at_kenai.com>
Date: Mon, 9 Feb 2009 19:40:56 +0000 (GMT)

Repository: mercurial
Revision: 99
Author: Bill Shannon <bill.shannon_at_sun.com>
Date: 2008-12-15 20:58:27 UTC

Log Message:
-----------
Add mail.imap.sasl.xgwtrustedapphack.enable property to allow disabling
hack,
just in case.

Modified Paths:
--------------
    mail/src/main/java/com/sun/mail/imap/package.html
   
mail/src/main/java/com/sun/mail/imap/protocol/IMAPSaslAuthenticator.jav
a

Diffs:
-----
diff -r 2481c0a3e3ae -r 3d41b11075f7
mail/src/main/java/com/sun/mail/imap/package.html
--- a/mail/src/main/java/com/sun/mail/imap/package.html Thu Dec 11
10:07:58 2008 -0800
+++ b/mail/src/main/java/com/sun/mail/imap/package.html Mon Dec 15
12:58:27 2008 -0800
@@ -305,6 +305,16 @@
 </TR>
 
 <TR>
+<TD>mail.imap.sasl.xgwtrustedapphack.enable</TD>
+<TD>boolean</TD>
+<TD>
+If set to true, enables a workaround for a bug in the Novell Groupwise
+XGWTRUSTEDAPP SASL mechanism, when that mechanism is being used.
+Defaults to true.
+</TD>
+</TR>
+
+<TR>
 <TD>mail.imap.socketFactory</TD>
 <TD>SocketFactory</TD>
 <TD>
diff -r 2481c0a3e3ae -r 3d41b11075f7
mail/src/main/java/com/sun/mail/imap/protocol/IMAPSaslAuthenticator.jav
a
---
a/mail/src/main/java/com/sun/mail/imap/protocol/IMAPSaslAuthenticator.j
ava  Thu Dec 11 10:07:58 2008 -0800
+++
b/mail/src/main/java/com/sun/mail/imap/protocol/IMAPSaslAuthenticator.j
ava  Mon Dec 15 12:58:27 2008 -0800
@@ -174,7 +174,10 @@
	byte[] CRLF = { (byte)'\r', (byte)'\n'};
 
	// Hack for Novell GroupWise XGWTRUSTEDAPP authentication
mechanism
-	boolean isXGWTRUSTEDAPP =
sc.getMechanismName().equals("XGWTRUSTEDAPP");
+	boolean isXGWTRUSTEDAPP =
+	    sc.getMechanismName().equals("XGWTRUSTEDAPP") &&
+	    PropUtil.getBooleanProperty(props,
+		"mail." + name + ".sasl.xgwtrustedapphack.enable",
true);
	while (!done) { // loop till we are done
	    try {
		r = pr.readResponse();