Office365 IMAP Access: User is Authenticated but not Connected
<p>I'm building my own IMAP client using node-imap, and I'm testing it against accounts on office365.</p>

<p>Since it's under development, I tend to hammer on the IMAP server more that I would in production, but not necessarily what I would consider to be too much.</p>

<p>Occasionally, I start getting the IMAP response "BAD User is authenticated but not connected".  This comes after the first command after a successful login.</p>

<p>This is not related to password changes as other similar articles indicate, as my passwords are not changing during this time.</p>

<p>When this happens, the account seems to get locked up for a period of time.  I seem to be able to jiggle it free by disabling then re-enabling IMAP on the account via the office365 admin panel.</p>

<p>So it looks like there's a circuit breaker of some sort in the IMAP interface on office365.  Microsoft documents a limit of 20 concurrent sessions.  In my case I am only opening one session at a time, but I am then closing it and re-opening it again soon after (debugging), so if I am running afoul of a limitation, it's not documented anywhere i have read.</p>

<p>Microsoft support has been helpful but unable to help me root cause this.</p>

<p>In order to take this app to production, I need to know what causes this to happen.</p>

<p>Has anyone else had a similar experience with office365?</p>