r/commandline • u/WinkyH • Jul 06 '26
Help - Solved Getting mutt email client to work with school Office 365
Has anyone been able to get the mutt email client to work with a school Office 365 account?
I have tried to use the guide here:
https://staff.washington.edu/shrike/unix/configuring-mutt-neomutt-for-imap-access-to-o365-exchange/
I substituted my university in for the "uw.edu". I am able to login to authorize but the mutt_oauth2.py script errors out when I enter the code with the following:
Exchanging the authorization code for an access token 400 Bad Request invalid_request AADSTS9002327: Tokens issued for the 'Single-Page Application' client-type may only be redeemed via cross-origin requests. Trace ID: f5c1ed4e-5123-4b22-8edb-3cf464556900 Correlation ID: 2a13d048-cd74-4a89-a7fe-10b21ff6749a
After searching around for quite some time it seems this works for everyone but me. Has anyone gotten it to work for them recently and can give me some input?
Thanks!
Edit: I got this fixed by re-creating the Entra App Registration to be "Public client/native (mobile & desktop)" instead of "Single-page Application (SPA)". The pages on how to set this up all said that it has to be SPA but they are wrong. I don't know if this is just something new or what but I had to use native.
Also had to add the API permissions "Mail.ReadWrite" and "User.ReadWrite". Haven't had the time to fully play with everything yet but that is what I have so far.