2
0
forked from drew/smtprelay

Don't allow a configuration requiring auth with a non-TLS listener

This fixes #26
This commit is contained in:
Jonathon Reinhart
2021-03-31 22:38:16 -04:00
parent 45a676e274
commit 247d187576

View File

@@ -157,6 +157,14 @@ func splitProto(s string) protoAddr {
func setupListeners() {
for _, listenAddr := range strings.Split(*listenStr, " ") {
pa := splitProto(listenAddr)
if localAuthRequired() && pa.protocol == "" {
log.WithField("address", pa.address).
Fatal("Local authentication (via allowed_users file) " +
"not allowed with non-TLS listener")
}
listenAddrs = append(listenAddrs, pa)
}
}