Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IMAP java mail -- Can't disable plain login

843834Sep 12 2008 — edited Jul 9 2009
Hi,
I am trying to solve Authentication issue with IMAP and java mail1.4.1 connecting to Microsoft Exchange Server 2007 and couldn't disable AUTH: PLAIN.Also need to know how to enable NTLM.

I set the property as follows with "xxxxxxxx...." shown below with right values:
//////////////

props.setProperty("mail.store.protocol","imaps");
props.setProperty("mail.imap.auth.plain.disable","true"); -- "true" within quotes
props.setProperty("mail.imap.host","xxxxxxxxxxx");
props.setProperty("mail.imap.port","993");
props.setProperty("mail.imap.user","xxxxxxx");
props.setProperty("mail.imap.pwd","xxxxxx");
props.setProperty("mail.imap.debug","true");
props.setProperty("mail.imap.ssl.protocols","SSL");
props.setProperty("mail.imap.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.setProperty("mail.imap.socketFactory.fallback", "false");
props.setProperty("mail.imap.socketFactory.port", "993");

/////////////////////

Still i couldn't get AUTH:PLAIN disabled and trying to get AUTH:NTLM enabled.
////////////////////////////////////////////////////////////////////////////

DEBUG: setDebug: JavaMail version 1.4.1
DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
* OK Microsoft Exchange Server 2007 IMAP4 service ready
A0 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN IDLE NAMESPACE LITERAL+
A0 OK CAPABILITY completed.
IMAP DEBUG: AUTH: NTLM
IMAP DEBUG: AUTH: GSSAPI
IMAP DEBUG: AUTH: PLAIN
DEBUG: protocolConnect login, host=xxxxxxxxxxx, user=xxxxxxx, password=<non-null>
A1 AUTHENTICATE PLAIN
+
NzM0NjE1NTk5NAA3MzQ2MTU1OTk0AE5ld3Bhc3N3MHJk
A1 NO AUTHENTICATE failed.
caught exception: javax.mail.AuthenticationFailedException: AUTHENTICATE failed.
javax.mail.AuthenticationFailedException: AUTHENTICATE failed.
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:566)
at javax.mail.Service.connect(Service.java:288)
at javax.mail.Service.connect(Service.java:169)
at edu.umich.mais.mail.testssl.main(testssl.java:59)

/////////////////////////////////////////////////////////////

Please help!!! thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 6 2009
Added on Sep 12 2008
6 comments
3,682 views