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

/^(.*)_(.*)@example.com$/    ${1}[email protected]
/^(.*)_(.*)@example.org$/    ${1}[email protected]
/^(.*)_(.*)@example.net$/    ${1}[email protected]

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 [email protected] it gets rewritten to [email protected] 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