Regex multiple catch-all setup 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

Tags:

Ubuntu

Postfix