29 Aug
2017
29 Aug
'17
12:55 p.m.
For the archives:
On 23-8-2017 21:56, Noel wrote:
Perhaps you can adjust your query or your database to return the desired result. Otherwise, use your scripting skills to generate a file, then automate the procedure.
I ended up creating a file /etc/postfix/olddomain with this contents:
/^([^@]*)@olddomain.com/ $(1)@newdomain.com
and reference that in main.cf like:
virtual_alias_maps = regexp:/etc/postfix/olddomain
That seems to to the job nicely:
Emails for existing@olddomain.com are delivered to existing@newdomain.com, and mails sent to nonexisting@olddomain.com receive DSN Undelivered Mail Returned to Sender, with:
<nonexisting@newdomain.com> (expanded from <nonexisting@olddomain.com>): user unknown
Perfect. :-)