I´ve managed to get access to the user1 - mailbox:
Session session = Session.getInstance(properties, new ExchangeAuthenticator(username, password));
Store store = session.getStore("imaps");
store.connect(imapHost, username, password);
--> this works just fine! But now i want to access the additional mailbox by changing the login-String:
--> unfortunately I´m getting an "NO AUTHENTICATE" message:
DEBUG: setDebug: JavaMail version 1.4.5
DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
DEBUG: mail.imap.statuscachetimeout: 1000
DEBUG: mail.imap.appendbuffersize: -1
DEBUG: mail.imap.minidletime: 10
DEBUG: trying to connect to host "host.domain.com", port 993, isSSL true
* OK The Microsoft Exchange IMAP4 service is ready.
* CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
A0 OK CAPABILITY completed.
DEBUG IMAP: AUTH: NTLM
DEBUG IMAP: AUTH: GSSAPI
DEBUG IMAP: AUTH: PLAIN
DEBUG: protocolConnect login, host=host.domain.com, firstname.lastname@example.org/shared_MB, password=<non-null>
DEBUG IMAP: AUTHENTICATE PLAIN command trace suppressed
DEBUG IMAP: AUTHENTICATE PLAIN command result: A1 NO AUTHENTICATE failed.
javax.mail.AuthenticationFailedException: AUTHENTICATE failed.
I was able to get access with Thunderbird and also with the Exchange OWA-Client, so I think there is something missing in my code...
or is it just impossible to get access to a different mailbox using javamail and plain-auth?
Silly as I am, when I run into an error I can't explain I just copy/paste it into Google. Just like that, what a sneaky devil I am! Of course some careful examination of the logging is required before you know what part may be interesting. In this case "A1 NO AUTHENTICATE failed" tickles my fancy. Now normally I would put "java" in front of it, but in this case it seems like an error message that Exchange itself would return, so I just keep it general.
And what do you know, plenty of search results come up. This one in particular looks interesting:
Thanks for your response.
I´ve tried that before with the same result:
DEBUG IMAP: AUTHENTICATE NTLM command result: A1 NO AUTHENTICATE failed.
btw. Plain-Auth is working for usernames like: domain/user1 or user1@domain.
Unfortunatly a "fully qualified" string like user1@domain/mailbox isnt...
And what really "tickles me fancy" is that the guys from Thunderbird somehow managed to get access to those mailboxes.
It seems I only have three options to solve that problem:
1. using some .net - stuff
2. figuring out how to handle webservices implemented in Exchange-Server 2010
3. asking my Mailbox-Operator again and again to give me the password for a direct-access to the mailbox (he won´t)
Try turning on protocol logging for Thunderbird as described here:
If it shows you how Thunderbird is authenticating, you should be
able to replicate that with JavaMail.