[GH-ISSUE #133] Add support for Microsoft Outlook OAuth2.0 authentication #108

Closed
opened 2026-03-03 01:19:52 +03:00 by kerem · 7 comments
Owner

Originally created by @d99kris on GitHub (Jan 8, 2023).
Original GitHub issue: https://github.com/d99kris/nmail/issues/133

Originally assigned to: @d99kris on GitHub.

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.

Originally created by @d99kris on GitHub (Jan 8, 2023). Original GitHub issue: https://github.com/d99kris/nmail/issues/133 Originally assigned to: @d99kris on GitHub. ### Discussed in https://github.com/d99kris/nmail/discussions/132 <div type='discussions-op-text'> <sup>Originally posted by **krackout** January 5, 2023</sup> 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.</div>
kerem 2026-03-03 01:19:52 +03:00
Author
Owner

@d99kris commented on GitHub (Jan 11, 2023):

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.

<!-- gh-comment-id:1378719789 --> @d99kris commented on GitHub (Jan 11, 2023): 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.
Author
Owner

@d99kris commented on GitHub (Jan 14, 2023):

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

<!-- gh-comment-id:1382703901 --> @d99kris commented on GitHub (Jan 14, 2023): 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. 🙂
Author
Owner

@krackout commented on GitHub (Jan 16, 2023):

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.

<!-- gh-comment-id:1383623767 --> @krackout commented on GitHub (Jan 16, 2023): 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.
Author
Owner

@d99kris commented on GitHub (Mar 17, 2023):

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.

<!-- gh-comment-id:1473777388 --> @d99kris commented on GitHub (Mar 17, 2023): 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.
Author
Owner

@Kabouik commented on GitHub (Apr 21, 2023):

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

<!-- gh-comment-id:1517775175 --> @Kabouik commented on GitHub (Apr 21, 2023): @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.
Author
Owner

@krackout commented on GitHub (Apr 21, 2023):

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

<!-- gh-comment-id:1517783006 --> @krackout commented on GitHub (Apr 21, 2023): 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: ***@***.***>
Author
Owner

@Kabouik commented on GitHub (Apr 21, 2023):

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.

<!-- gh-comment-id:1517846211 --> @Kabouik commented on GitHub (Apr 21, 2023): 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 ~~human~~Kabouik-machine issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nmail#108
No description provided.