Catch All email alias *@domain.com

In other email servers, it works fine to add an alias that catch all emails sent to other email addresses, than the ones explicity defined in the user db.

I have tried to set this as a shortname alias for a user. Both *@domain.com and @domain.com
Nothing works. Every test is returned with error saying that: Diagnostic-Code: X-Postfix; User unknown in virtual alias table

How could I make this work as expected ?

MacBook Pro, Mac OS X (10.6.2)

Posted on Mar 9, 2010 4:35 AM

6 replies

Mar 10, 2010 12:09 PM in response to Gordon Davisson

Hi Gordon

Yeah, I know of this, but there are 2 issues;
1) This deliver a copy of the message, but still reply to sender that the user is not known
2) I have several virtual domains and don't want catch all to catch all domains. I want a different account for each domain.

Mar 10, 2010 9:29 PM in response to Community User

Multiple domains makes things a bit more complicated. I haven't tested this at all, but I think you could do it with a [regexp:|http://www.postfix.org/regexp_table.5.html] or [pcre:|http://www.postfix.org/pcre_table.5.html] format alias map (note: the reason you can't do it with the standard alias file is that it's stored in an exact-match-only database format). Try creating a file named /etc/aliases-pcre, with the line "/@domain\.com$/ catchall@example.com", then edit /etc/postfix/main.cf and add the line "alias_maps = hash:/etc/aliases, pcre:/etc/aliases-pcre" (you might want to use [aliasdatabase|http://www.postfix.org/postconf.5.html#aliasdatabase] instead of [aliasmaps|http://www.postfix.org/postconf.5.html#aliasmaps] -- I'm not entirely clear on the difference).

Mar 16, 2010 3:08 AM in response to jaydisc

i jaydisc

That sound great and I tried that.
However, the log now comes with this message:
warning: database /etc/postfix/virtual_users.db is older than source file /etc/postfix/virtual_users

I have tried to look at the virtual_users.db, but it has special chars and I don't know how to edit this. Also tried to move it, to see if the system would recreate, but it didn't

Do you have any idéas ?

Mar 16, 2010 3:41 AM in response to Community User

Whenever you make changes to /etc/postfix/virtual, you need to convert it to virtual.db with:

sudo postmap /etc/postfix/virtual


and then you need to restart postfix:

sudo postfix reload


However, it doesn't sound like you have Postfix-style aliases set up. Check out pages 74-76 of the mail services manual. It explains how to enable Postfix-style and it even explains how to do domain-specific catch alls too (including recommending against them)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Catch All email alias *@domain.com

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.