Bob Eastbrook:
> Forgive me if this is a FAQ, but I've looked all over and I don't see
> it addressed.
>
> I have a wildcard MX record for *.example.com which points to
> mail.example.com. I know how to configure postfix to accept
> individual virtual domains such as host1.example.com, but how can I
> set it up to handle any domains which match the wildcard MX record?
> e.g.:
>
> [email protected]
> [email protected]
> [email protected]
>
> ... should all map to [email protected]. I'm only concerned about
> the user "bob" if that matters. I won't know in advance all the hosts
> in example.com, so I can't add them one at a time.
APPEND a regular expression map to your virtual_alias_maps
definition.
/etc/postfix/main.cf:
virtual_alias_maps =
...stuff you perhaps already have...
pcre:/etc/postfix/virtual_alias.pcre
/etc/postfix/virtual_alias.pcre:
# Send [email protected] to [email protected].
/^bob@([^.]+\.)+example\.com$/ [email protected]
Further reading:
man 5 virtual (http://www.postfix.org/virtual.5.html)
man 5 pcre_table (http://www.postfix.org/pcre_table.5.html)
man pcrepattern (http://www.pcre.org/pcre.txt, look for section "PCREPATTERN")
Wietse