On Sun, Jan 29, 2023 at 03:45:03PM +0200, e wrote: > This is what the website says: "Subtle point: by default, address > masquerading is applied only to message headers and to envelope sender > addresses, but not to envelope recipients. This allows you to use > address masquerading on a mail gateway machine, while still being able > to forward mail from outside to users on individual machines." > > So if i have masquerade_domains = example.com And I send from > gg.example.com, the sender will get replaced to example.com so the > `return-path` is also example.com. When the receiver replies to the > message, how can gg.example.com receive it? Since it gets sent to > example.com
The "masquerade_domains" feature assumes that there is a flat logical email address namespace, so that every user can be addressed as: user@<masquerade-domain>. However, each user's physical mailbox can be located in one of many mailstores, and so internal delivery to the user's physical mailbox is directed to that mailbox after alias expansion: us...@example.com u...@mailstore1.example.com us...@example.com u...@mailstore2.example.com ... In the case of Postfix, the alias expansion is best performed via virtual(5) aliases, rather than the legacy Sendmail-compatible local aliases(5). The latter are best used for just subscription lists, with "owner-alias" bounce management, and perhaps a list manager handling the recipient list. -- Viktor.