mirror of
https://github.com/decke/smtprelay.git
synced 2026-11-06 07:51:36 -06:00
Allow "allowed_nets" to be empty, meaning any network is allowed
This commit is contained in:
1 parent
ef3f9c8ea0
commit
0503c12ccd
2 files changed
+5
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user