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:

me@example.com              example.com/me/
@example.com                example.com/me/

foo@example.com             example.com/foo/
bar@example.com             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 foo@example.com & bar@example.com -mails from beeing delivered to my mailbox?

I would like to stay with the wildcard.


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:

foo@example.com foo@example.com
bar@example.com bar@example.com

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.