-2

I am using the below code to connect with office 365 mailboxes and this works 99% of the time but i am seeing a weird issue some time that the logger after this connect is not getting printed and also getting nothing in the exception block as well. Only after some time the thread is getting killed silently . I have looked into docs but not able to find any reason for this blocking behavior from this connect call

try {
Session session = Session.getInstance(props);
Store store = session.getStore("IMAP");
store.connect("outlook.office365.com", mailbox, accessToken);
logger.info("Connected Store Properties")
}catch (Exception e) {
                        logger.error("Exception in connecting To MailBox");
                    }

In the logs i can see below and nothing after that

DEBUG IMAP: AUTH: PLAIN
DEBUG IMAP: AUTH: XOAUTH2
DEBUG IMAP: protocolConnect login, host=outlook.office365.com, [email protected], password=<non-null>
DEBUG IMAP: mechanism PLAIN disabled by property: mail.imap.auth.plain.disable
DEBUG IMAP: mechanism LOGIN disabled by property: mail.imap.auth.login.disable
DEBUG IMAP: mechanism NTLM not supported by server
Q1 AUTHENTICATE XOAUTH2 authenticatestring 

We can rule out the network connectivity, credentials or set up issue The only thing is i am connecting to 10 office 365 mailboxes sequentially programmatically so would it be possible that some throttling at Microsoft end is stopping this.

it will be really helpful if some can provide some insights into this and how to debug this further and if there is some setting which should fail the connect api instead of being blocked.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.