forked from drew/smtprelay
Discard mail if remote_host is not set
This is useful for test environments.
This commit is contained in:
6
main.go
6
main.go
@@ -180,6 +180,12 @@ func mailHandler(peer smtpd.Peer, env smtpd.Envelope) error {
|
||||
"host": *remoteHost,
|
||||
"uuid": generateUUID(),
|
||||
})
|
||||
|
||||
if (*remoteHost == "") {
|
||||
logger.Warning("remote_host not set; discarding mail")
|
||||
return nil
|
||||
}
|
||||
|
||||
logger.Info("delivering mail from peer using smarthost")
|
||||
|
||||
var auth smtp.Auth
|
||||
|
||||
Reference in New Issue
Block a user