mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
fix incoming deliveries to the host-tlsrpt address
it was returning "550 not accepting mail for this domain" due to a missing check in the address/account lookup function.
This commit is contained in:
parent
8f55d0ada6
commit
1d02760f66
1 changed files with 10 additions and 0 deletions
|
@ -36,12 +36,22 @@ func FindAccount(localpart smtp.Localpart, domain dns.Domain, allowPostmaster bo
|
|||
return false
|
||||
}
|
||||
|
||||
// Check for special mail host addresses.
|
||||
if localpart == "postmaster" && postmasterDomain() {
|
||||
if !allowPostmaster {
|
||||
return "", "", config.Destination{}, ErrAccountNotFound
|
||||
}
|
||||
return Conf.Static.Postmaster.Account, "postmaster", config.Destination{Mailbox: Conf.Static.Postmaster.Mailbox}, nil
|
||||
}
|
||||
if localpart == Conf.Static.HostTLSRPT.ParsedLocalpart && domain == Conf.Static.HostnameDomain {
|
||||
// Get destination, should always be present.
|
||||
canonical := smtp.NewAddress(localpart, domain).String()
|
||||
accAddr, ok := Conf.AccountDestination(canonical)
|
||||
if !ok {
|
||||
return "", "", config.Destination{}, ErrAccountNotFound
|
||||
}
|
||||
return accAddr.Account, canonical, accAddr.Destination, nil
|
||||
}
|
||||
|
||||
d, ok := Conf.Domain(domain)
|
||||
if !ok {
|
||||
|
|
Loading…
Reference in a new issue