Hello,

All of my mailboxes are virtual, e.g. `al...@example.com` and 
`b...@example.com`.
I would like to set up a catch-all virtual mailbox `catch...@example.com`
such that mail sent to any other address `*@example.com` gets sent to
`catch...@example.com`.

Here is an excerpt of my config:

> == /etc/postfix/main.cf ==
> mydestination =
> virtual_mailbox_domains = example.com
> virtual_mailbox_maps    = hash:/etc/postfix/virtual_mailboxes
> virtual_alias_maps      = hash:/etc/postfix/virtual_aliases
> virtual_mailbox_base    = /var/mail/virtual

> == /etc/postfix/virtual_mailboxes ==
> al...@example.com   example.com/alice/
> b...@example.com     example.com/bob/

> == /etc/postfix/virtual_aliases ==
> @example.com            catch...@example.com
> al...@example.com       al...@example.com       ##
> b...@example.com         b...@example.com         ##
> postmas...@example.com  al...@example.com


Notably, the lines marked `##` are *required* for mail delivery to work as
expected. If they are omitted, then *all* mail for example.com ends up in the
`catch...@example.com` mailbox --- Alice and Bob can't see their mail!
Based on [1], my understanding is that the `@example.com` syntax was designed
for true mail-forwarding domains, i.e. those where no mailboxes exist, so all
mail must be forwarded to one or more other domains. However, my question is
whether simpler syntax/configuration exists for partial forwarding such as the
internal catch-all behaviour I'm after (or, indeed, just a simpler config for my
particular use case) --- is there another way to set this up so that, in future,
as more mailboxes are added to the domain, there isn't a need to include a
"redundant" alias like `##` for every mailbox besides the catch-all one?

Thanks,
Jivan

[1] Mail forwarding domains:
  http://www.postfix.org/VIRTUAL_README.html#forwarding

Reply via email to