Allow email field to be empty in allowedUsers file

In this case, it is not checked.
This commit is contained in:
Jonathon Reinhart committed 2021-02-09 00:00:36 -05:00
1 parent 9040a456cf
commit f33105f83c
3 files changed
+16 -5

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ func senderChecker(peer smtpd.Peer, addr string) error {
return smtpd.Error{Code: 451, Message: "Bad sender address"}
}
if strings.ToLower(addr) != strings.ToLower(email) {
if email != "" && strings.ToLower(addr) != strings.ToLower(email) {
return smtpd.Error{Code: 451, Message: "Bad sender address"}
}
}