2
0
forked from drew/smtprelay

Discard mail if remote_host is not set

This is useful for test environments.
This commit is contained in:
Jonathon Reinhart
2021-03-13 00:02:39 -05:00
parent d1933a2e35
commit 20ca816160
3 changed files with 13 additions and 2 deletions

View File

@@ -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