refuse to add an address when its localpart contains the domains catchall separator, or when its canonicalized address (e.g. lower cased when case-insensitive) is already present, and check at startup as well

such configurations are certainly errors, but were silently accepted and highly
likely not doing what you may have hoped. i suspect no one has configured mox
this way.
This commit is contained in:
Mechiel Lukkien
2023-03-29 10:55:05 +02:00
parent 9b57c69c1c
commit 51ad345dbb
3 changed files with 49 additions and 28 deletions

View File

@ -15,7 +15,7 @@ var (
ErrAccountNotFound = errors.New("account not found")
)
// FindAccount lookups the account for localpart and domain.
// FindAccount looks up the account for localpart and domain.
//
// Can return ErrDomainNotFound and ErrAccountNotFound.
func FindAccount(localpart smtp.Localpart, domain dns.Domain, allowPostmaster bool) (accountName string, canonicalAddress string, dest config.Destination, rerr error) {