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 exist...@olddomain.com are delivered to
exist...@newdomain.com, and mails sent to nonexist...@olddomain.com
receive DSN Undelivered Mail Returned to Sender, with:
<nonexist...@newdomain.com> (expanded from <nonexist...@olddomain.com>):
user unknown
Perfect. :-)