+1 vote

Getting the 'User is authenticated but not connected.' exception on executing the search for the unseen mails in the mail.

I'm using IMAP protocol to search the mails that are unseen, of the office365 outlook mail

the mail is not frequently used mail
verified password once again and the credentials are correct
it's not a shared mailbox

by
edited

1 Answer

0 votes
 
Best answer

This error comes from Office365 server, not Mail.dll itself.

Log-in via the web UI - there might be a some policy update information dialog on your account, that you need to confirm.

Other most likely causes are:

  1. It is a Microsoft's mechanism to shut down chatty clients. The solution would be to login to this account less frequently. (Remember to close the connection properly use Close method and using clause around Imap instance).

  2. It is due to a bug in MS 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.

  3. It is a shared mailbox and you are using incorrect login scheme. Use Login method and Username@DomainName\SharedMailbox@DomainName for Office365 per: https://www.limilabs.com/blog/shared-mailbox-office365

by (301k points)
selected by

EDIT: I spend a support case on it, since there is too much fuzzyness around this and no-one seemed to know for sure around the web.

The message means that:
a) you have setup your app and token fine, no problems there
b) you also did a great job with the imap protocol
c) HOWEVER, even tho your application is and does connect fine, you lack rights on this specific mailbox.

Hence the authenticated (application) and not connected (mailbox)

In other words: you most likely messed up or skipped the step "Add permissions to a specific mailbox" (which can take up to half an hour to take effect)

  • Popz.
...