Have you tried reordering your config so that individual stuff gets picked
up first and then if nothing succeeds use the catch all? I believe this is
just a logic flaw inside your config.

On Fri, Mar 6, 2020, 17:24 Jivan Pal <[email protected]> wrote:

> Hello,
>
> All of my mailboxes are virtual, e.g. `[email protected]` and `
> [email protected]`.
> I would like to set up a catch-all virtual mailbox `[email protected]`
> such that mail sent to any other address `*@example.com` gets sent to
> `[email protected]`.
>
> 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 ==
> > [email protected]   example.com/alice/
> > [email protected]     example.com/bob/
>
> > == /etc/postfix/virtual_aliases ==
> > @example.com            [email protected]
> > [email protected]       [email protected]       ##
> > [email protected]         [email protected]         ##
> > [email protected]  [email protected]
>
>
> 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
> `[email protected]` 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