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 unsuccessful when using auth_password_file #3710

Closed
KevDi opened this issue Feb 6, 2024 · 1 comment
Closed

SMTP Authentication unsuccessful when using auth_password_file #3710

KevDi opened this issue Feb 6, 2024 · 1 comment

Comments

@KevDi
Copy link

KevDi commented Feb 6, 2024

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

  • System information:

    Linux 5.14.0-362.8.1.el9_3.x86_64 x86_64

  • Alertmanager version:

    alertmanager, version 0.26.0 (branch: HEAD, revision: d7b4f0c)
    build user: root@df8d7debeef4
    build date: 20230824-11:11:58
    go version: go1.20.7
    platform: linux/amd64
    tags: netgo

  • Prometheus version:

    prometheus, version 2.45.2 (branch: HEAD, revision: 3d6b7e665928a78c4a18675802436fe92f3f4e04)
    build user: root@3b1b6808f1b0
    build date: 20231219-14:07:38
    go version: go1.21.5
    platform: linux/amd64
    tags: netgo,builtinassets,stringlabels

  • Alertmanager configuration file:

global:
  resolve_timeout: 5m
  smtp_auth_password_file: '/etc/alertmanager/smtp-password'
route:
  receiver: "email"
  routes:
    - receiver: 'msteams'
      group_wait: 30s
      continue: true
    - receiver: 'email'
      group_wait: 30s
  group_wait: 30s
  group_interval: 5m
  repeat_interval: 4h
receivers:
  - name: "email"
    email_configs:
      - to: 'to address'
        from: 'from address'
        smarthost: 'smtpserver:25'
        auth_username: 'user'
        tls_config:
          insecure_skip_verify: true
  - name: "msteams"
    msteams_configs:
      - webhook_url: webhook
        send_resolved: true

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

password
  • Logs:
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"
@KevDi
Copy link
Author

KevDi commented Feb 7, 2024

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

@KevDi KevDi closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant