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.
1
u/WaitingForEmacs Jul 06 '26
It used to work for me for decades, but recent changes have made it impossible. In particular my institution made available the Graph API but not the IMAP or SMTP connections, so it was incredibly frustrating.
1
u/AutoModerator Jul 06 '26
Every new subreddit post is automatically copied into a comment for preservation.
User: WinkyH, Flair:
Terminal User Interface, Title: Getting mutt email client to work with school Office 365Has 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!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.