diff --git a/main.go b/main.go index 6289bbc..cbd5993 100644 --- a/main.go +++ b/main.go @@ -20,6 +20,10 @@ func connectionChecker(peer smtpd.Peer) error { // This can't panic because we only have TCP listeners peerIP := peer.Addr.(*net.TCPAddr).IP + if len(allowedNets) == 0 { + // Special case: empty string means allow everything + return nil + } for _, allowedNet := range allowedNets { if allowedNet.Contains(peerIP) { diff --git a/smtprelay.ini b/smtprelay.ini index c1e90e8..91e1cc6 100644 --- a/smtprelay.ini +++ b/smtprelay.ini @@ -31,6 +31,7 @@ ;local_forcetls = false ; Networks that are allowed to send mails to us +; Defaults to localhost. If set to "", then any address is allowed. ;allowed_nets = 127.0.0.1/8 ::1/128 ; Regular expression for valid FROM EMail addresses