Virtomize / mail2most

watch emails and send them to mattermost
MIT License
74 stars 19 forks source link

IMAP Auth for O365? #80

Open JJedrasik opened 11 months ago

JJedrasik commented 11 months ago

Describe the bug I've been trying to configure the emailer through an office365 account, but regularly just get ERRO[2023-09-07T22:26:32Z] Error reaching mailserver Error="LOGIN failed." Server="outlook.office365.com:993"

My mail profile seems fine, and the login works otherwise:

[[Profile]]
  IgnoreDefaults = false
  [Profile.Mail]
  ImapServer = "outlook.office365.com:993"
  Username = "my@outlook.com"
  Password = "myPass"
  ReadOnly = true
  ImapTLS = false
  StartTLS = true
  GenerateLocalUIDs = false

I read that MS turned off basic auth for IMAP recently, could this be the reason? Anyone have any luck with this?

c-seeger commented 11 months ago

Hi @JJedrasik "Login failed." is the message returned by outlooks mailserver so it looks like your username or password is not matching. Please check again. Your configuration looks fine.

LTech-Corey commented 11 months ago

@JJedrasik Have you had any luck with this? I'm running into the same issue with known working credentials

c-seeger commented 11 months ago

Sorry for the long reply time will check once i have some time

LTech-Corey commented 11 months ago

I did some digging in the interim, it looks like IMAP with 365 must use the OAuth flow now: https://techcommunity.microsoft.com/t5/exchange-team-blog/exchange-online-email-applications-stopped-signing-in-or-keep/ba-p/3641943

Hope this helps!

JJedrasik commented 11 months ago

This is the only lead I've been able to find - in that basic auth IMAP doesn't work anymore - haven't been able to get it configured though. Did you manage to get it working @LTech-Corey ?

LTech-Corey commented 11 months ago

Unfortunately not. It seems like a limitation of this software for now, hopefully an update to support OAuth is something the contributors are willing to do!