Linux – Where to set catch-all address in Postfix (virtual mailboxes in affect)

linuxpostfix

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     catchall@otherdomain.com

Thanks for your help!

Best Answer

The catchall should be in the virtual_alias_maps file (in your case /etc/postfix/virtual) and not in the virtual_mailbox file.

Take a look here, search the page for Mail forwarding domains and you'll find this example:

1 /etc/postfix/main.cf:
2     virtual_alias_domains = example.com ...other hosted domains...
3     virtual_alias_maps = hash:/etc/postfix/virtual
4 
5 /etc/postfix/virtual:
6     postmaster@example.com postmaster
7     joe@example.com        joe@somewhere
8     jane@example.com       jane@somewhere-else
9     # Uncomment entry below to implement a catch-all address
10     # @example.com         jim@yet-another-site
11     ...virtual aliases for more domains...
Related Topic