Skip to content

Support XOAUTH2 for email sending for google and microsoft's smtp services dropping basic smtp auth #1213

@drdamour

Description

@drdamour

google and microsoft are deprecating SMTP basic auth in their services and pushing for XOAUTH2 in MS case https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth

saw that https://github.com/wneessen/go-mail supports XOAUTH2...might be a path to move from net/smtp to that as net/smtp is marked frozen/not getting updates per golang/go#40817

but even getting the access token to use XOAUTH2 is very platform specific. I bet a lot of them support some form of client credentials flow. U've already got the parts for that from OAuth config so could piggy back on that to get an access token for email send with XOAUTH2 ... course i'm sure the resource/scope request part of the token acquisition would need to be platform specific.

if you wanted to get very azure/ms heavy in support adding an option to leverage manage identity via https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication?tabs=bash#option-3-use-a-managed-identity for access token fetch would be really slick that's how most folks would want it to work in azure...in the ends that's a wrapper around an http calls to 169 address space that azure will fulfill.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions