Whenever trying to connect using Mailspring, an institutional office365 account doesn’t authenticate. So far I’ve tried as many options as there are online (including multiple different DavMail configs).
The same problem occurs for accounts with two-factor authentication enabled and an app password is generated for authentication.
To Reproduce…
Steps to reproduce the behavior:
Add account → Office 365
Add name, mail and password
Login not succeded
Expected Behavior
Account to be authenticated
Log
----------IMAP----------
connect mailcore::IMAPSession:0x7fffc7838df0
OK The Microsoft Exchange IMAP4 service is ready. [QwBIADIAUABSADEANABDAEEAMAAwADAANwAuAG4AYQBtAHAAcgBkADEANAAuAHAAcgBvAGQALgBvAHUAdABsAG8AbwBrAC4AYwBvAG0A]
ssl connect outlook.office365.com 993 2
OpenSSL version: OpenSSL 1.1.0f 25 May 2017
1 CAPABILITY
CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
1 OK CAPABILITY completed.
connect ok
login
2 LOGIN "username@domain.edu" "####"
2 NO LOGIN failed.
Setup
OS and Version: Ubuntu Linux 20.04
Mailspring Version: 1.7.8
Additional Context
The behavior is the same wether there is normal password authentication (no two-factor) and when using app-password (account has two-factor).
@CodeMouse92, could you point me to the roadmap for Mailspring? I am having similar issues: my organization requires OAuth and I am therefore unable to use Mailspring currently. I would like to follow the development on this but am unsure of where I can find it…
I just upgraded to the 1.8.0 version. Now it seems like there is some support for OAuth. At least I got directed to the login page for my office365 account. But still no luck in getting authenticated.
Since last update I have to reconnect everyday, because office365 is giving short lifetime tokens?
29612 [2021-02-04 15:11:13.495] [background] [info] Fetching XOAuth2 access token (office365) for d4f3745c
29612 [2021-02-04 15:11:13.495] [metadata] [info] Metadata delta stream starting...
29612 [2021-02-04 15:11:14.112] [background] [critical]
***
*** Mailspring Sync
*** An exception occurred during program execution:
*** {"debuginfo":"https://login.microsoftonline.com/common/oauth2/v2.0/token RETURNED {\"error\":\"invalid_grant\",\"error_description\":\"AADSTS700081: The refresh token has expired due to maximum lifetime. The token was issued on 2021-02-03T13:56:36.8761451Z and the maximum allowed lifetime for this application is 1.00:00:00.\\r\\nTrace ID: c3669801-93e3-4b7b-9d76-c92b58b86900\\r\\nCorrelation ID: db8faa5a-70e6-4dac-b839-4e7a70dcaa54\\r\\nTimestamp: 2021-02-04 14:11:14Z\",\"error_codes\":[700081],\"timestamp\":\"2021-02-04 14:11:14Z\",\"trace_id\":\"c3669801-93e3-4b7b-9d76-c92b58b86900\",\"correlation_id\":\"db8faa5a-70e6-4dac-b839-4e7a70dcaa54\",\"error_uri\":\"https://login.microsoftonline.com/error?code=700081\"}","key":"Invalid Response Code: 400","retryable":false,"what":"std::exception"}
I am new to Mailspring as of this morning. I’ve set up my accounts, one of which is Office 365. I have successfully sent and received email with both accounts.
However, with my o365 account, it continually encounters a “connection issue” with that account. When I click “Try now,” it tries to sync again and then fails, says it encountered an error while syncing, and finally forces me to re-authenticate with o365. I’ve had to do this multiple times. After I re-auth, it works for a bit until it encounters the errors again.
I have a basic account as I am just getting familiar with the program.
I will include screenshots below. Please note: I am a mere mortal and not a developer. I appreciate any help!
Hi @erinanacker, I’ve migrated your post to the open issue about this. We’re hoping to fix this soon! Please vote for this issue — select Vote at the top — to help raise its priority.
Hey @CodeMouse92 — Just a quick update. The problem seems to either have gone away or reduced significantly after Mailspring completed it’s initial scan of my email and folders for o365. Thank you for your help and continued efforts on this.
Hello, I was wondering if there is any intention to integrate with Duo 2FA? My college account uses it and it gives me error as of now to log in.
{"error":null}
Manual update check (updates.getmailspring.com/check/linux/x64/1.8.0-8983dca2/545e9ea3
{ Error: Authentication Error - Check your username and password. (IMAP)
at ChildProcess._proc.on.code (file:///tmp/nylas-build/electron-packager/linux-x64
at ChildProcess.emit (events.js:182:13)
at ChildProcess.EventEmitter.emit (domain.js:442:20)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Socket.EventEmitter.emit (domain.js:442:20)
at Pipe._handle.close (net.js:606:12)
message:
'Authentication Error - Check your username and password. (IMAP)',
rawLog:
'----------IMAP----------\nconnect <mailcore::IMAPSession:0x7ffdebf367f0>\r\n* OK TBvAHUAdABsAG8AbwBrAC4AYwBvAG0A]\r\nssl connect outlook.office365.com 993 2\r\nOpenSSL LUS MOVE ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+\r\n1 OK CAPABILITY completed.\r\...\r\n2 NO AUTHENTICATE failed.\r\n' } {
Raven: 429 - undefined
Is there an update on this, I am currently trying to connect my school office 365 account and it takes me to the page to verify and then shows this message. There is no 2FA setup.
I did look for logs but couldn’t find where they were.
If there was an update on this, it would have been posted here already.
Mailspring is developed entirely in free time, and there’s a lot to do in that extremely limited time. As a result, it’s not possible to provide timelines. Any development help fixing this would be appreciated.