I have a file /etc/postfix/virtual.pcre that contains lines like this:

/^(.*)_(.*)@example.com$/    ${1}+$...@example.com
/^(.*)_(.*)@example.org$/    ${1}+$...@example.org
/^(.*)_(.*)@example.net$/    ${1}+$...@example.net

etc etc. This is to allow the _ to act as an additional address extension character to get around the legion of retarded website admins that reject '+' addresses as invalid.

I would like to have a single line

/^(.*)_(.*)@(.*)$/  ${1}+$...@${3}

since that would mean I would not have to update this file each time I add a virtual domain; but that won't work as it will rewrite the addresses on OUTBOUND email as well as inbound email, so if someone sends an email to first_l...@outboundexample.com it gets rewritten to first+l...@outboundexample.com and bounces.

So, other than manually listing every virtual domain, is there something else I could do? Is there a way to use mysql:/usr/local/etc/ postfix/mysql_virtual_domains_maps.cf in some way so that the pcre expression will only match for those domains that are listed in the map?


--
Criticizing evolutionary theory because Darwin was limited is like
        claiming computers don't work because Chuck Babbage didn't
        foresee Duke Nukem 3.

Reply via email to