for domains configured only for reporting, don't reject messages to that domain during smtp submission

you can configure a domain only to accept dmarc/tls reports. those domains
won't have addresses for that domain configured (the reporting destination
address is for another domain). we already handled such domains specially in a
few places. but we were considering ourselves authoritative for such domains if
an smtp client would send a message to the domain during submit. and we would
reject all recipient addresses. but we should be trying to deliver those
messages to the actual mx hosts for the domain, which we will now do.
This commit is contained in:
Mechiel Lukkien
2024-01-26 19:51:23 +01:00
parent a524c3a50b
commit 1d9e80fd70
4 changed files with 34 additions and 10 deletions

View File

@ -54,7 +54,9 @@ func FindAccount(localpart smtp.Localpart, domain dns.Domain, allowPostmaster bo
}
d, ok := Conf.Domain(domain)
if !ok {
if !ok || d.ReportsOnly {
// For ReportsOnly, we also return ErrDomainNotFound, so this domain isn't
// considered local/authoritative during delivery.
return "", "", config.Destination{}, ErrDomainNotFound
}