1
votes

We are using spring integration to poll the emails from outlook box.

Intermittently, we are seeing these exceptions.

Javax.mail.MessagingException: A4400 NO Server Unavailable javax.mail.MessagingException: A3 BAD User is authenticated but not connected.;

02:20:03.858 [task-scheduler-2] ERROR o.s.i.handler.LoggingHandler - org.springframework.messaging.MessagingException: failure occurred while polling for mail; nested exception is javax.mail.MessagingException: A4400 NO Server Unavailabl e. 15; nested exception is: com.sun.mail.iap.CommandFailedException: A4400 NO Server Unavailable. 15 at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:131) at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:224) at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:245) at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:58)

02:20:05.321 [task-scheduler-2] ERROR o.s.i.handler.LoggingHandler - org.springframework.messaging.MessagingException: failure occurred while polling for mail; nested exception is javax.mail.MessagingException: A3 BAD User is authenticated but not connected.; nested exception is: com.sun.mail.iap.BadCommandException: A3 BAD User is authenticated but not connected. : at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:131)

Code snippet:

@Bean public IntegrationFlow imapIdleFlow() { return IntegrationFlows .from( Mail.imapInboundAdapter() .searchTermStrategy((f, l) ->) .javaMailProperties(p -> p .put("mail.debug", ) .put("mail.imap.connectionpoolsize", ))

I don't get the solution When I surfed the solution for this.

1

1 Answers

0
votes

You don't mention what server you're trying to connect to, but I ran into the "A3 BAD User is authenticated but not connected" error with imap and outlook.office365.com. I tried to set up the same account in Outlook to make sure it was working in general. Although I was able to add the account, when I actually tried to look at the inbox Outlook became unresponsive. So in my case, it was a problem with the account in general, not with how I was trying to connect. I was able to connect successfully with pop3 in case that's an option for you.