laminas / laminas-mail

Provides generalized functionality to compose and send both text and MIME-compliant multipart e-mail messages
https://docs.laminas.dev/laminas-mail/
BSD 3-Clause "New" or "Revised" License
93 stars 64 forks source link

Add OAuth support #197

Open griesi007 opened 2 years ago

griesi007 commented 2 years ago

Microsoft Office365 / Exchange Online will finally turn off current BasicAuth standard authentication for POP3 on 2022/10/01. From then on only XOAUTH2 is supported for POP3. Also Microsoft is already switching "Basic Auth" off for certain exchange online instances.

It would be great if Laminas Mail could support POP with XOAUTH2

Ocramius commented 2 years ago

Send a patch 👍

griesi007 commented 2 years ago

@Ocramius yes that´s what I am currently planning.

griesi007 commented 2 years ago

@Ocramius Just provided a pull request.

Ocramius commented 2 years ago

Keeping this open until feature actually landed

Ocramius commented 2 years ago

Closing as Won't fix as per https://github.com/laminas/laminas-mail/pull/199#discussion_r932123007

Slamdunk commented 2 years ago

199 has been correctly rejected as contributor is not going to fulfil this library requirements, but OAuth support needs to land here eventually, both in IMAP/POP and SMTP protocols

OAuth2 has no specific binding to Microsoft, it's just the first major email provider to ban other auth mechanisms: https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-deprecation-in-exchange-online-may-2022/ba-p/3301866

I say let's reopen this issue and wait for a proper implementation

Ocramius commented 2 years ago

Works for me :+1:

griesi007 commented 2 years ago

@Slamdunk Your comment "OAuth2 has no specific binding to Microsoft" is not completely true. The POP3 XOAUTH procedure is done differently by Micrsoft than by Google. With Microsoft it is a 2 step process requiring first a "AUTH XOAUTH2" request beeing sent and afterwards a separate request providing the XOAUT2 string. Google does that in one request

https://docs.microsoft.com/de-de/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth

RalfEggert commented 1 year ago

I have no idea how to implement this but I will need OAuth SMTP Support für Laminas\Mail some day. So I just subscribed to see how its going.

EmeryEx commented 1 year ago

227 Resolves Oauth for SMTP