Ralph Johnston:
> I also wish there was a way to specify "all subdomains" in the virtual
> file. I tried using @.abc.com, but it didn't work. I also tried adding
> virtual_alias_maps to parent_domain_matches_subdomains, but that didn't
> work either.
Virtual alias lookups are documented (man 5 virtual).
As a quick read shows, tables such as Berkeley DB or *SQL are
searched with the full address, the address localpart, and the
@domain. There is no mention of parent_domain_matches_subdomains
in the virtual(5) manpage.
To match "all subdomains", you need to implement the table with
regular expressions.
/etc/postfix/main.cf:
virtual_alias_maps =
hash:/etc/postfix/virtual_alias
pcre:/etc/postfix/virtual_alias.pcre
/etc/postfix/virtual_alias:
# One-on-one mappings here.
[email protected] [email protected]
/etc/postfix/virtual_alias.pcre:
# Wild-card mappings here.
/^(.*)@([a-z0-9_]+\.)*example\.com$/ [email protected]
References:
http://www.postfix.org/virtual.5.html
http://www.postfix.org/pcre_table.5.html
http://www.postfix.org/DATABASE_README.html
Instead of browsing blogs, you could save yourself time and
review the Postfix documentation.
Wietse