mirror of
https://github.com/decke/smtprelay.git
synced 2025-12-26 02:52:31 -07:00
Don't allow a configuration requiring auth with a non-TLS listener
This fixes #26
This commit is contained in:
@@ -157,6 +157,14 @@ func splitProto(s string) protoAddr {
|
|||||||
func setupListeners() {
|
func setupListeners() {
|
||||||
for _, listenAddr := range strings.Split(*listenStr, " ") {
|
for _, listenAddr := range strings.Split(*listenStr, " ") {
|
||||||
pa := splitProto(listenAddr)
|
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)
|
listenAddrs = append(listenAddrs, pa)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user