A status update on this thread, since it’s still the place people land for Office 365 problems.
We reviewed every log posted here. Two distinct things happened over the years:
- The 2021–2022 problems (24-hour token expiry
AADSTS700084,AADSTS9002327, refresh tokens not being saved) were Mailspring bugs and were fixed by 1.10.4. - Everything since —
535 5.7.139 SmtpClientAuthentication is disabled,BAD User is authenticated but not connected,LOGIN failedright after a successful sign-in — is the tenant having IMAP and/or SMTP AUTH turned off. Microsoft now disables these by default for new tenants, and no IMAP client can work around it; the admin either enables them per mailbox (Set-CASMailbox, as in this thread) or the client has to use Microsoft’s Graph API instead.
We’re planning to add Microsoft Graph API support so Office 365 accounts no longer depend on IMAP/SMTP being enabled. I’ll post here when there’s something to test. Until then, if your organization has IMAP disabled, Mailspring unfortunately can’t connect to it.