alertmanager icon indicating copy to clipboard operation
alertmanager copied to clipboard

Alert manager unable to send unsecured emails

Open orlmar opened this issue 8 years ago • 9 comments

We just upgraded Alertmanager from version 0.9.1 to 0.13.0 and Prometheus from 1.8.1 to 2.1. The Alertmanager's email receiver doesn't work anymore with identical configuration.

In the log, we have an error: msg="Notify attempt failed" attempt=10 integration=email err="*smtp.plainAuth failed: unencrypted connection"

Could it be related to this issue in net/smtp? https://github.com/golang/go/issues/22166

Th smtp related configuration is:

global: smtp_smarthost: 'smtpserver:25' smtp_from: 'user@domain' smtp_auth_username: 'user' smtp_requiere_tls: false ... receivers:

  • name: 'emailreceiver' email_configs:
    • to: 'user@domain' headers: subject: 'testing' html: 'some body'

Also we tested requiere_tls parameter in email_configs section for the case it doesn't read the global parameter.

orlmar avatar Feb 12 '18 09:02 orlmar

The issue you linked says the fix for that regression was added to go1.9.2, which was used to compile v0.13.0.

stuartnelson3 avatar Feb 13 '18 09:02 stuartnelson3

i have same problem

# ../bin/alertmanager --version
alertmanager, version 0.14.0 (branch: HEAD, revision: 30af4d051b37ce817ea7e35b56c57a0e2ec9dbb0)
  build user:       root@37b6a49ebba9
  build date:       20180213-08:16:42
  go version:       go1.9.2

justlooks avatar May 03 '18 02:05 justlooks

level=error ts=2018-05-23T16:22:43.848809749Z caller=dispatch.go:266 component=dispatcher msg="Notify forr="*smtp.plainAuth failed: unencrypted connection"

I have the same....

Dose anyone know how to fix this problem?

Alertmanager.yml

global: smtp_smarthost: '.........com:25' smtp_from: '.............' smtp_auth_username: '...........' smtp_auth_password: '..........' smtp_require_tls: false

@brian-brazil , we need your help

CadenOf avatar May 24 '18 00:05 CadenOf

I also had this problem. This issue (https://github.com/golang/go/issues/22166) suggest that it has been fixed in Go 1.10.x although I doubt it. I ran dockerized alertmanager 0.15.0-rc.3 which is built with go1.10.3 and I still have the same problem.

According to https://github.com/AcalephStorage/consul-alerts/issues/208 Go SMTP lib does not support non-TLS connection against non-local servers.

note avatar Jun 21 '18 11:06 note

As stated in the SMTP godoc, the library will allow plain authentication only if TLS is used or the server is local. So you'll have to fulfill one of the conditions to make it work. I'm afraid there's nothing much that can be done on the AlertManager's side.

simonpasquier avatar Jun 21 '18 12:06 simonpasquier

@simonpasquier That's understandable then but I would say that it would be nice to have it stated in the alertmanager's docs. If the application exposes smtp_require_tls and the documentation does not states that it's not effective (outside of localhost) then it's quite confusing for the user.

note avatar Jun 21 '18 14:06 note

Bump. Running into the same issue, need answers.

rschmitz87 avatar Jul 10 '19 00:07 rschmitz87

just change the global.smtp_require_tls from false to true

xkfen avatar Mar 04 '20 09:03 xkfen

As discussed this is a limitation of underlying libraries. Also it is not good practice to use plain-text credentials over unencrpted channels. If you still require this feature, pleas re-open this issue or even better, provide a PR implementing it.

TheMeier avatar Dec 13 '25 11:12 TheMeier