prometheus / alertmanager

Prometheus Alertmanager
https://prometheus.io
Apache License 2.0
6.68k stars 2.16k forks source link

SMTP Authentication unsuccessful when using auth_password_file #3710

Closed KevDi closed 9 months ago

KevDi commented 9 months ago

What did you do? I want to send out Emails and specifying the SMTP Password in a separate file

What did you expect to see? Email should be send to the configured receivers

What did you see instead? Under which circumstances? If an alert fires i got the following error:

alertmanager[2143392]: ts=2024-02-06T08:58:50.982Z caller=notify.go:745 level=warn component=dispatcher receiver=email integration=email[0] aggrGroup={}/{}:{} msg="Notify attempt failed, will retry later" attempts=1 err="*email.loginAuth auth: 535 5.7.3 Authentication unsuccessful"

If i directly configure the auth_password it works.

Environment

This is basicly the content of the smtp-password file:

password
KevDi commented 9 months ago

I was able to reproduce and solve the issue. It seems to be the problem with the missing trim of the password. I did not had any whitespace in the password file but it seems there were some whitespaces added during reading of the file. This PR solves this problem but it is not part of the latest release. #3680