On 3/22/2021 10:39 PM, Simon Wilson wrote:
...
I think that is correct?
Not exactly.
virtual_alias_maps can be considered a general-purpose alias
mechanism, having nothing directly to do with virtual domains.
That's why you can use it to easily rewrite your local domain addresses.
*ALL* mail is processed by and can be rewritten by
virtual_alias_maps - incoming, outgoing, local domains, virtual
domains, even off-site domains. virtual_alias_maps has the added
benefit of built-in duplicate elimination and recursion, which is
one reason Viktor suggests using virtual_alias_maps rather than
"aliases" for all local address rewriting.
Viktor goes one step further, suggesting you use virtual domains for
your locally delivered domains. This gives you more flexibility and
control over the users and rewrite process, at the expense of
changes to a mostly working configuration. Consider doing this if
you have the time and interest.
The documentation notes about virtual domains needing to be
rewritten to a different domain apply when a domain is defined as
virtual in virtual_alias_domain. The default setting
"virtual_alias_domains=$virtual_alias_maps" is an ancient
compatibility holdover. If you're not using virtual_alias_domains it
can be set explicitly empty "virtual_alias_domain="
This is documented in the various README files and man pages
http://www.postfix.org/ADDRESS_CLASS_README.html
http://www.postfix.org/ADDRESS_REWRITING_README.html
http://www.postfix.org/VIRTUAL_README.html
and several others.
-- Noel Jones