Regex multiple catch-all setup in postfix
I need to setup a regex catch-all function on postfix such that:
- tom.(anything)@domain.com goes to [email protected]
- phil.(anything)@domain.com goes to [email protected]
How can this be achieved in postfix?
Add this to your main.cf:
alias_maps = regexp:/etc/postfix/aliases
Then create /etc/postfix/aliases
as follows:
/^tom\..*@domain.com$/ [email protected]
/^phil\..*@domain.com$/ [email protected]
See the regexp table documentation for additional information.
I'll add this for people who are wondering if it is possible to handle multiple address aliases with less configuration:
/^(.*)\..*@domain.com$/ [email protected]
This will forward:
<anything>.<part_b>@domain.com
to
<anything>@other.com