Can't add Office365 account (Authentication Error - Check your username and password. (SMTP))


To Reproduce…

Steps to reproduce the behavior:

  1. Got to add an account
  2. Select Office365
  3. Insert credentials in browser
  4. image

Expected Behavior

OAuth setup successfully


  • OS and Version: Windows 11 Pro 10.0.22000 Build 22000
    • Installation Method: installer
  • Mailspring Version: 1.9.2-6e14dad1.

I’m seeing similar behaviour in V1.10.0 when trying to reconnect/reauthenticate my Office 365 account:

Sorry we had trouble logging you in.

OAuth Code exchange returned 400 Bad Request: {“error”:“invalid_request”,“error_description”:“AADSTS9002327: Tokens issued for the ‘Single-Page Application’ client-type may only be redeemed via cross-origin requests.\r\nTrace ID: 07387f22-5043-4264-a6b7-275ccdf66200\r\nCorrelation ID: 6abfd984-2b66-46b1-a228-1dac6f1d133b\r\nTimestamp: 2022-03-01 13:35:45Z”,“error_codes”:[9002327],“timestamp”:“2022-03-01 13:35:45Z”,“trace_id”:“07387f22-5043-4264-a6b7-275ccdf66200”,“correlation_id”:“6abfd984-2b66-46b1-a228-1dac6f1d133b”}

Many of us will have limited control over our Office365 account settings as they’re tied to institutions/businesses.

I am getting the same error as TJC today.

We were able to fix this via messing around with office365 settings, I don’t know which setting fixed it since after messing around with quite a few of them it started working later.

I’m having this same exact issue.

Arimil, were you adjusting settings on the management side or as a 365 user?

For what it’s worth: I’ve been trying out a few different email clients and one thing I noticed is when the other clients used OAuth for the first time, Microsoft would as me if I wanted to allow certain permissions, and I had to hit “yes”.

I never received such a request for mailspring. It just jumped to “You’re all set!” and then failed.

Changes were made on the management side, Mailspring appears to still be using SMTP to send mail. I’ve seen other solutions not need this, I assume they’re using OAuth and the Office365 API instead.


Just installed Mailspring 1.10.3 as a snap under Ubuntu 22.04 Desktop. Having exaclty the same issue.

I can see that “Fix login to Office 365 Accounts” should be fixed in this release, but still not working for me at least.

Is this a know issue being worked on or not?

OK, so this solved it for me: Enable or disable SMTP AUTH in Exchange Online | Microsoft Docs


Fantastic!!! Thanks very much - this worked for me too!

Enabling SMTP auth is a really bad practice and not a solution to the problem:


I thought they added OAUTH authentication to Mailspring? I guess they forgot to add it for SMTP then?

Facing the same issue. Mailspring was Installed today (Dec-01-2022)
Ubuntu - 22.04
Mailspring - 1.10.7-5008ecc3

You have to enable SMTP authentication to sign in. In your O365 account go to active users> select user> click mail tab> manage email apps> Tick SMTP authentication
and you are all set to go

I am getting the same error, and the above solutions didn’t work for me.

Same error. Still not resolved.

Also occurred to me. Allowing SMTP auth is not acceptable

Looks like this has been an issue for a while. Using a MacBook Pro M2 Max, installed today and got my Gmail accounts set up and working. I cannot get either one of my Office 365 accounts working. Both give the same error “Authentication Error - Check your username and password. (SMTP)”.

I made sure IMAP was enabled for my user account. Also tried enabling the Authenticated SMTP. Nottaa

is there any plan at this time to add oauth support without the need of disabling smtp auth?

Sad that Mailspring is not looking at this. I am not sure why they are stated as one of the best email clients. I was planning to get a subscription for our org replacing Hiri and this looks worse.

The error is still not resolved.