mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:44:35 +03:00
implement a catchall address for a domain
by specifying a "destination" in an account that is just "@" followed by the domain, e.g. "@example.org". messages are only delivered to the catchall address when no regular destination matches (taking the per-domain catchall-separator and case-sensisitivity into account). for issue #18
This commit is contained in:
@ -43,7 +43,10 @@ func FindAccount(localpart smtp.Localpart, domain dns.Domain, allowPostmaster bo
|
||||
|
||||
accAddr, ok := Conf.AccountDestination(canonical)
|
||||
if !ok {
|
||||
return "", "", config.Destination{}, ErrAccountNotFound
|
||||
if accAddr, ok = Conf.AccountDestination("@" + domain.Name()); !ok {
|
||||
return "", "", config.Destination{}, ErrAccountNotFound
|
||||
}
|
||||
canonical = "@" + domain.Name()
|
||||
}
|
||||
return accAddr.Account, canonical, accAddr.Destination, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user