consul-alerts icon indicating copy to clipboard operation
consul-alerts copied to clipboard

Authentication should be optional

Open timurstrekalov opened this issue 8 years ago • 3 comments

If the server does not advertise the PLAIN auth mechanism (e.g. when it supports others like CRAMMD5), Go's net.smtp.plainAuth.Start method will fail (understandably, because you're using no encryption while the server clearly supports it).

Ideally, EmailNotifier should detect the supported authentication mechanisms and act accordingly instead of simply using PlainAuth for all connections. However, first of all, not all servers require authentication, and simply not filling out username/password should be enough to suggest that authentication is not required, therefore passing auth as nil to net.smtp.SendMail (which would work perfectly fine).

timurstrekalov avatar Mar 19 '16 18:03 timurstrekalov

+1 for this patch - I have to use it to build a consul-alerts package for production. When Postfix is compiled with SASL support, even if you enable PLAIN authentication, sending an empty username and password results in "warning: SASL authentication failure: All-whitespace username."

I leave localhost:25 open to all mail and forward everything through a secure relay - without this patch I am unable to receive any email alerts at all.

ghost avatar Mar 06 '18 12:03 ghost

@consul-alerts team, is there any reason not look into this issue? patch is there with test, what is the showstopper? as issue created in 2016

rizwan-ishtiaq avatar Oct 13 '20 11:10 rizwan-ishtiaq

I think it was mainly that it never appeared as a PR and only exists as an entry on his personal fork and was posted before I became a maintainer. @rizwan-ishtiaq I will be announcing an "official" fork today as I am the only active maintainer and need assistance but the only power I don't have is to grant more maintainers.

fusiondog avatar Oct 15 '20 18:10 fusiondog