I need to setup a regex catch-all function on postfix such that:
- tom.(anything)@domain.com goes to email@example.com
- phil.(anything)@domain.com goes to firstname.lastname@example.org
How can this be achieved in postfix?
Add this to your main.cf:
See the regexp table documentation for additional information.
I don't know Postfix, but the regex you're looking for is:
Then you substitute the first matching group with nothing (empty string), and the second group with "other".
As an example, in Perl you would do:
Of course this works only if email address has "domain" as domain. If you want domain to be anything, then the regex would be: