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

SMTP authentication otherthan basic auth as it is disabled in Microsoft 365 #3244

Open
sriharshabm opened this issue Feb 9, 2023 · 2 comments · May be fixed by #4123
Open

SMTP authentication otherthan basic auth as it is disabled in Microsoft 365 #3244

sriharshabm opened this issue Feb 9, 2023 · 2 comments · May be fixed by #4123

Comments

@sriharshabm
Copy link

As mentioned in https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-deprecation-in-exchange-online-september/ba-p/3609437, basic authentication is disabled in Microsoft 365.

Until last year, alert manager was able to send email via smtp authentication with the help of auth_username and auth_password/auth_password_file. Now if we try same scenario then following error is observed.

ts=2023-02-05T19:12:29.535Z caller=notify.go:732 level=warn component=dispatcher receiver=default-receiver integration=email[0] msg="Notify attempt failed, will retry later" attempts=2 err="*email.loginAuth auth: 535 5.7.139 Authentication unsuccessful, basic authentication is disabled. "

When I try to send email without basic authentication(i.e. without populating auth_username, auth_password and auth_password_file) then I'm getting following error.

ts=2023-02-08T05:04:35.370Z caller=notify.go:732 level=warn component=dispatcher receiver=default-receiver integration=email[0] msg="Notify attempt failed, will retry later" attempts=11 err="send MAIL command: 530 5.7.57 Client not authenticated to send mail. "
ts=2023-02-08T05:04:54.081Z caller=email.go:78 level=debug integration=email msg="smtp_auth_username is not configured. Attempting to send email without authenticating"

I see that "auth_secret" parameter is supported but I could not find any more detail.

As basic authentication is disabled now in Microsoft 365, please let us know any other procedure to send email after authentication.

@dswarbrick
Copy link

If you didn't re-enable basic SMTP auth for your Exchange Online before December 31, 2022, then you missed out, and are forced to use "modern authentication", i.e. OAUTH2.

Alertmanager does not support OAUTH2 for SMTP receivers, so you would need to use some intermediate mail relay such as Postfix. This might be a good starting point: https://mmogilvi.users.sourceforge.net/software/oauthbearer.html#setupPostfix

@simonpasquier
Copy link
Member

I'm wondering if we shouldn't have a specific integration for MS Office 365?
https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=go has some Go code snippets for sending emails via the Graph API but I'm worried that we have no capacity to test this without community help + github.com/microsoftgraph/msgraph-sdk-go is a huge dependency.

@jkroepke jkroepke linked a pull request Nov 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants