Clete2 / random_email_sender

MIT License
3 stars 0 forks source link

Add oauth2 support for the mailbox reader #1

Open AndiDoe opened 1 month ago

AndiDoe commented 1 month ago

Hi Clete, I used your reandom_email_sender without any problems until today.

Microsoft (outlook.office365.com) only supports oauth2 authentication. That's why I recieve an authentication error. (Login failed)

I've tried app-password without success. Maybe you have time and fun to implement oauth support :)

Nice greetings from Germany, Andi

Clete2 commented 1 month ago

Hi @AndiDoe thanks for your issue.

Can you confirm: are you using Hotmail / MSN mail, corporate hosted Office 365, or an O365 personal account? And what domain does your email address end in?

AndiDoe commented 1 month ago

Thanks for your reply. I use a personal Account - @outlook.de ;) I did a connection test with betterbird. The autoconfiguration brought me to the login screen. In the config is authtype set to: "oauth2/modern"

Clete2 commented 1 month ago

I will try to reproduce. This is a side project for me so may be this weekend till I can look into it.

While I’m open to supporting modern auth I do want to see if we can find an alternative that works.

My setup still works, but I am using a very old msn.com account. I’ll start by setting up Outlook.com (or .de if I can) account.

AndiDoe commented 1 month ago

That's cool. Thank you.

AndiDoe commented 1 month ago

Little Update... I experiment with n8n too. I've created an outlook reader there... it was easy. And I think I will try to implement oauth2 connection in your app :) Learning a little bit rust might be great.

Here is a good start what is needed to implement an oauth2 connection.

https://docs.n8n.io/integrations/builtin/credentials/microsoft/?utm_source=n8n_app&utm_medium=credential_settings&utm_campaign=create_new_credentials_modal#related-resources

Clete2 commented 1 month ago

Good morning.

This morning I tried with a new Outlook.com account, since I am in the USA I can't get a .de address.

First I enabled 2 factor authentication, next I created an app password, and finally I enabled IMAP/POP support in Outlook.com's settings:

image

After doing that I was able to connect via IMAP and it worked to read the message.

Feel free to attempt to get some Oauth2 support. It seems Microsoft is working to phase out basic authentication.