Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAUTH2 support #954

Open
rampaq opened this issue Jul 26, 2023 · 5 comments
Open

OAUTH2 support #954

rampaq opened this issue Jul 26, 2023 · 5 comments

Comments

@rampaq
Copy link
Contributor

rampaq commented Jul 26, 2023

Hi, as my university microsoft mail transfered to OAUTH2 without option to fallback, I modified my client config.

I enclose a pull request to support OAUTH2 mail solutions which should work with Microsoft and Google.
An example on how to create the token file is in manpage and requires ClientID and ClientSecret app registration.

My university does not support custom app registration so I used Mozilla Thunderbird's credentials ones here. Code to generate the token with microsoft:

$ /usr/share/neomutt/oauth2/mutt_oauth2.py -v -t \
    --authorize --client-id "9e5f94bc-e8a4-4e73-b8be-63364c29d753" --client-secret "" \
    --email "<your email>" --provider microsoft \
    --encryption-pipe "gpg --encrypt --recipient <your_gpg_key>" \
    token_path
@rampaq
Copy link
Contributor Author

rampaq commented Jul 26, 2023

It also should not be too hard to incorporate the mutt_oauth2.py script directly into mw

@ayushjaipuriyar
Copy link

Is this still not possible ? Cause without oauth there seems to be no point in using neomutt

@pahlse
Copy link

pahlse commented Sep 3, 2023

As to your question if mutt-wizard does this for you: NO!

But you can always do it yourself. If you have access to your client secret on Azure it shouldn't be a problem. Just follow the mutt_oauth2.py or similar configuration instructions.

If you don't have access to the client secret (which is the case with many corporate or university microsoft accounts) you will have to set up a davmail server on a vps or similar. This is fairly straight forward, just needs a bit more effort. See thread #601 for more details. In the last comment I describe my setup. Works flawlessly for me.

@ayushjaipuriyar
Copy link

As to your question if mutt-wizard does this for you: NO!

But you can always do it yourself. If you have access to your client secret on Azure it shouldn't be a problem. Just follow the mutt_oauth2.py or similar configuration instructions.

If you don't have access to the client secret (which is the case with many corporate or university microsoft accounts) you will have to set up a davmail server on a vps or similar. This is fairly straight forward, just needs a bit more effort. See thread #601 for more details. In the last comment I describe my setup. Works flawlessly for me.

Okay got it, will try to replicate your setup

@aabbccddeeffggj
Copy link

aabbccddeeffggj commented Apr 17, 2024

Recently, I got blocked from sending emails from my main email account (I can receive the emails just fine at least):

msmtp: authentication failed (method LOGIN)
msmtp: server message: 535 5.7.139 Authentication unsuccessful, account locked.
Contact your administrator. [CP5P284CA0025.BRAP284.PROD.OUTLOOK.COM
2024-04-17T16:43:08.320Z 08DC5E4AE6FF6F00]
msmtp: could not send mail (account [email protected] from /home/xxx/.msmtprc)

I updated the application password and sent an email to test, it worked, but then the next day my account turns out to be blocked again (I did it twice).

I have another email address and I can send emails from that without a problem (both are hotmail).

I wonder if it's Microsoft slowly implementing the OAuth2 and I'm one of the lucky ones whose account got surprised by it. Do you think that's the case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants