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!

Cannot read mail from Win 2003 POP3 Service using SPA

829187Jan 6 2011 — edited Jan 10 2011
Hello Friends,

I created a simple test application to connect to and read mail from Win 2003 POP3 Service (No Exchange Server). Without using SPA (Secure Password Authentication), the code runs fine.

But if I turn on SPA, following error is encountered

-----
DEBUG: setDebug: JavaMail version 1.4.1
DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.
POP3Store,Sun Microsystems, Inc]
DEBUG POP3: connecting to host "mayur.net", port 110, isSSL false
S: +OK Microsoft Windows POP3 Service Version 1.0 <108921981@trinetradome> ready
.
C: USER mayur@mayur.net
S: -ERR SPA Required, use AUTH or APOP
C: QUIT
S: +OK Microsoft Windows POP3 Service Version 1.0 <108921981@trinetradome> signi
ng off.
Error while receiving message: javax.mail.AuthenticationFailedException: SPA Req
uired, use AUTH or APOP

javax.mail.AuthenticationFailedException: SPA Required, use AUTH or APOP
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:159)
at javax.mail.Service.connect(Service.java:288)
at javax.mail.Service.connect(Service.java:169)
at FirstReceiveMailExample2.main(FirstReceiveMailExample2.java:18)
-----

Now if I enable apop for POP3 by adding a line
props.put("mail.pop3.apop.enable","true");
I still get Authentication Failure as shown below

-----
DEBUG: setDebug: JavaMail version 1.4.1
DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.
POP3Store,Sun Microsystems, Inc]
DEBUG POP3: connecting to host "mayur.net", port 110, isSSL false
S: +OK Microsoft Windows POP3 Service Version 1.0 <109258064@trinetradome> ready
.
DEBUG POP3: APOP challenge: <109258064@trinetradome>
C: APOP mayur@mayur.net bbebbda25a3abca24e6d66a07ad6c92e
S: -ERR Logon Failure
C: QUIT
S: +OK Microsoft Windows POP3 Service Version 1.0 <109258064@trinetradome> signi
ng off.
Error while receiving message: javax.mail.AuthenticationFailedException: Logon F
ailure

javax.mail.AuthenticationFailedException: Logon Failure
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:159)
at javax.mail.Service.connect(Service.java:288)
at javax.mail.Service.connect(Service.java:169)
at FirstReceiveMailExample2.main(FirstReceiveMailExample2.java:19)
-----

I even tried to connect to POP3 (with SPA enabled) using telnet, there it shows AUTH as NTLM. Does this mean I have to use NTLM for POP3 to connect to Win 2003 POP3 (SPA enabled)? If I have to do so, which libraries to use?

Can anyone please provide any help in this regard?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2011
Added on Jan 6 2011
8 comments
763 views