mirror of
https://github.com/mjl-/mox.git
synced 2025-06-28 15:38:16 +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
@ -36,12 +36,22 @@ func FindAccount(localpart smtp.Localpart, domain dns.Domain, allowPostmaster bo
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for special mail host addresses.
|
||||||
if localpart == "postmaster" && postmasterDomain() {
|
if localpart == "postmaster" && postmasterDomain() {
|
||||||
if !allowPostmaster {
|
if !allowPostmaster {
|
||||||
return "", "", config.Destination{}, ErrAccountNotFound
|
return "", "", config.Destination{}, ErrAccountNotFound
|
||||||
}
|
}
|
||||||
return Conf.Static.Postmaster.Account, "postmaster", config.Destination{Mailbox: Conf.Static.Postmaster.Mailbox}, nil
|
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)
|
d, ok := Conf.Domain(domain)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user