I successfully configured Postfix to deliver messages to virtual mailboxes.
I can set aliases and pipes inside /etc/postfix/virtual and mailboxes inside /etc/postfix/virtual_mailbox files.
However, whenever I set a catch-all domain and point to a remote email address, it overrides all other virtual mailboxes and virtual aliases set in postfix. How can I set a catch-all forwarding to the remote email address when virtual mailbox is enabled?
I set catch-all like this:
@mydomain.com [email protected]
Thanks for your help!
The catchall should be in the
virtual_alias_maps
file (in your case/etc/postfix/virtual
) and not in thevirtual_mailbox
file.Take a look here, search the page for
Mail forwarding domains
and you'll find this example:To us the simplest solution was giving THREE entries for virtual_alias_maps, they are executed in order until the first match eg.
The first entry is a 'classic' local file virtual, it may forward from .com to .net domain if you need something like this, eg.
The second entry is a database, sql or ldap or anything else. When an account matches, postfix serves exactly the mail it was queried for and exits here - successfully forwarding the mail to more or less itself (postfix logic :))
The third entry is another simple local file. Postfix will do lookups here only if the database lookups do not succeed, here you can place your catch-all address