Unable to Authenticate using javamail

Hi,

I am unable to login to the sun messaging server using imaps. I am getting the following exception:

DEBUG: setDebug: JavaMail version 1.4.1ea-SNAPSHOT

* OK [CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS CHILDREN BINARY LANGUAGE XSENDER X-NETSCAPE XSERVERINFO AUTH=PLAIN] Messaging Multiplexor (Sun Java(tm) System Messaging Server 6.2-3.05 (built Nov 23 2005))

IMAP DEBUG: AUTH: PLAIN

A0 CAPABILITY

* CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS CHILDREN BINARY LANGUAGE XSENDER X-NETSCAPE XSERVERINFO AUTH=PLAIN

A0 OK CAPABILITY completed

IMAP DEBUG: AUTH: PLAIN

A1 LOGIN KBahadur mypassword

javax.mail.MessagingException: * BYE JavaMail Exception: java.net.SocketException: Connection reset;

nested exception is:

com.sun.mail.iap.ConnectionException: * BYE JavaMail Exception: java.net.SocketException: Connection reset

at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:476)

at javax.mail.Service.connect(Service.java:275)

at javax.mail.Service.connect(Service.java:156)

How do i change from auth=plain to auth=login in messaging server?

Thanks,

-

Kamal

[1230 byte] By [kamal_bahadur] at [2007-11-26 11:57:38]
# 1

Hi,

This isn't the best forum to ask javamail questions. Java mail (api) and messaging server aren't related products. You may want to ask this question on a java coding forum.

Also why would you want to change auth=plain to auth=login. Looking at the javamail api it should be able to handle auth=plain:

http://java.sun.com/products/javamail/javadocs/com/sun/mail/imap/package-summar y.html

mail.imap.auth.login.disable boolean If true, prevents use of the non-standard AUTHENTICATE LOGIN command, instead using the plain LOGIN command. Default is false.

mail.imap.auth.plain.disable boolean If true, prevents use of the AUTHENTICATE PLAIN command. Default is false.

Make sure those values are set as appropriate. Also your debug output doesn't really show that the auth=plain is the problem, just that this was the last operation performed before it failed.

Regards,

Shane.

shane_hjorth at 2007-7-7 12:18:00 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...