d99kris / nmail

Terminal-based email client for Linux and macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for Microsoft Outlook OAuth2.0 authentication

d99kris opened this issue · comments

Discussed in #132

Originally posted by krackout January 5, 2023
On occasion of my business e-mail (office365) going OAuth 2.0 only, I'm concerned on how it'll be possible to continue using nmail with office365-OAuth.

Since application approval for OAuth on office365 is out of the question I suppose, what alternatives can be used?
One thought, making an oauth account on Thunderbird and using settings from there, (somehow) make nmail to pretend to be Thunderbird and trick office365 to allow nmail to connect.
Another thought is (email-oauth2-proxy)[https://github.com/simonrob/email-oauth2-proxy]. I haven't tried it yet.

Any guidance on these two thoughts or other proposals welcomed. I really like nmail and the workflow I got accustomed using it. Thank you once more @d99kris for a great product.

Dev notes: This would be possible to support internally in nmail without too major changes - mainly extending src/oauth2nmail as needed. Will prepare the changes.

Support for Microsoft Outlook OAuth2.0 authentication has been added in the above commit. It should be possible to use the setup wizard like this to set up an outlook/hotmail account:

nmail -s outlook-oauth2

I've only tested it with my personal hotmail-address (which also happen to be the Azure AD admin for the nmail app) so any feedback on if it's working with other outlook / hotmail accounts would be very welcome. 🙂

I haven't reached the ms365 admin of the company yet to give a definitive answer, but it seems to be on the right track (considering the packet capture I get and the interaction with browser, microsoft authentication, asking for admin, etc). I'll give a feedback as soon as I get approval.

Please take note of the reported issue #137 which affects Microsoft 365 business/organization account authentication/setup for nmail. A fix is expected to be merged tomorrow.

@krackout, were you able to get nmail working with your company's Microsoft 365 system?

Sending emails started to return Send failed (no sasl mechs). Overwrite draft (y) or queue send (n)? since this morning with my work MS Exchange account, while it was working the day before, and still works on non-Exchange accounts. I received no information from my IT department about any change, but I'm wondering if they quietly deprecated the old system I was using, and if nmail car work with the new one.

Thanks! I hope my issue is not the same, because there's no way they'll approve a new application, let alone one that only one employee is using. I really don't want to change my emailing workflow, nmail has been perfect for several years now, it would really feel like a regression to get back to a GUI client.

[Edit] Turns out my issue was totally related, it was entirely a humanKabouik-machine issue.