Using Postfix (2.11.3) I want to redirect all mail to an external address.
virtual_alias_maps = regexp:/etc/postfix/rewrite
Sending mail to
email@example.com, the following error occurs:
[...] to=<firstname.lastname@example.org>, orig_to=<email@example.com> [...] status=bounced (User unknown in virtual alias table)
Valid recipient addresses are listed with the virtual_alias_maps parameter. The Postfix SMTP server rejects invalid recipients with "User unknown in virtual alias table".
Turns out, the error has to do something with validation of virtual alias domains:
virtual_alias_domains by default is
$virtual_alias_maps, setting it to anything else (to a non-matching domain or even leaving it empty) resolves the issue.
Another solution I found in an answer is giving the regular expression in another form:
So my question is, how does validation of alias domains works when using regular expression tables for virtual aliasing? Why does setting
virtual_alias_domains to anything else solves the issue? How is the above two, address-mapping-wise equivalent patterns different?
postconf -n is:
config_directory = /etc/postfix inet_interfaces = loopback-only inet_protocols = ipv4 mydestination = myhostname = example.org myorigin = $myhostname virtual_alias_domains = virtual_alias_maps = regexp:/etc/postfix/rewrite