d99kris / nmail

Terminal-based email client for Linux and macOS
MIT License
138 stars 12 forks source link

Add support for Microsoft Outlook OAuth2.0 authentication #133

Closed d99kris closed 1 year ago

d99kris commented 1 year ago

Discussed in https://github.com/d99kris/nmail/discussions/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.
d99kris commented 1 year ago

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.

d99kris commented 1 year ago

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. 🙂

krackout commented 1 year ago

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.

d99kris commented 1 year ago

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.

Kabouik commented 1 year ago

@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.

krackout commented 1 year ago

Unfortunately my request for other e-mail client (nmail) wasn't approved. So I'm currently using nmail for personal mailboxes only, can't help on Microsoft 365 for the time being.

On 2023-04-21 15:38 Kabouik @.***> wrote:

@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.

--
Reply to this email directly or view it on GitHub: https://github.com/d99kris/nmail/issues/133#issuecomment-1517775175 You are receiving this because you were mentioned.

Message ID: @.***>

Kabouik commented 1 year ago

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.