1

are there syntax elements or another way to exclude one or more mailadresses from a wildcard in the virtual mailbox configuration of postfix?

My current working configuration is /etc/postfix/virtual_mailbox:

[email protected]              example.com/me/
@example.com                example.com/me/

[email protected]             example.com/foo/
[email protected]             example.com/bar/

i added two users: foo & bar, but i will still receive their mails due to the wildcard @example.com. Is it possible to exclude [email protected] & [email protected] -mails from beeing delivered to my mailbox?

I would like to stay with the wildcard.

1 Answer 1

2

As according to the postfix documentation, catchalls are by definition recursive

VIRTUAL(5) VIRTUAL(5) NAME virtual - Postfix virtual alias table format

SYNOPSIS postmap /etc/postfix/virtual

postmap -q "string" /etc/postfix/virtual

postmap -q - /etc/postfix/virtual

DESCRIPTION The optional virtual(5) alias table rewrites recipient addresses for all local, all virtual, and all remote mail destinations. This is unlike the aliases(5) table which is used only for local(8) delivery. Virtual aliasing is recursive

So, the solution is to create 1 to 1 mappings (to stop the recursion) for your actual users. In your virtual users file, you'd put things like this:

[email protected] [email protected]
[email protected] [email protected]

3
  • Wow, thats a simpler solution. I tought we would end up using regex :) Thank you! Mar 8, 2013 at 15:20
  • Glad it helped!
    – NickW
    Mar 8, 2013 at 15:22
  • wow, after googling for a while, I cannot believe it is that simple. many, many thanks, Nick! Mar 11, 2013 at 6:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .