This issue occurs in environments where Office365 is used.
Error trace in logs:
12:13:19:086]|[08-05-2019]|[SYSERR]|[INFO]|[71]: 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.|
[12:13:19:086]|[08-05-2019]|[SYSERR]|[INFO]|[71]: at com.sun.mail.imap.IMAPFolder.open(IMAPFolder.java:1064)|
This issue can occur under the following circumstances.
1.
It is due to a bug in the Office365 IMAP implementation. If the client
presents a valid user name but an invalid password, the server accepts
the login, but subsequent commands fail with the aforementioned error
message. But in your case, mails are fetching intermittently. So, we can
rule this case out.
2. Try authenticating using account username as Username@DomainName\SharedMailboxAlias and Correct password.
3.
If the above step is not working, please try connecting using POPS
protocol and monitor the application. This has worked for few other
customers who has changed this.
Even if that doesn't help, please contact Office365 support regarding this connectivity issue.