Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3 Server: Create a postfix catch-all email account OS X Server
In Jaguar server, the GUI admin tool had a section to add an account for all email to be sent if the user did not exist. This feature is not part of Panther Server. After much trial and error, and many readings of many forums, I figured out a simple, if annoying way to do this.
  1. As root, vi /etc/postfix/main.cf and include the following line (I put mine at the bottom of the file):
    virtual_alias_maps = hash:/etc/postfix/virtual
    
  2. As root, vi /etc/postfix/virtual and add the following:
    ########### 
    # local users 
    ########### 
    localUser1@domain.com       localUser1 
    localUser2@domain.com      localUser2 
    localUser3@domain.com      localUser3 
    localUser4@domain.com      localUser4
    
    ########## 
    # catch-all 
    ########## 
    @domain.com               catch-all
    
    I put this at the top above the comments. You must include all local users or the catch-all account will get all mail. localUser# is used in place of the actual user account name for local users. catch-all is used in place of the account you designate as the catch-all. domain.com is used in place of your domain name. There are tabs between the entries on each line. There is a caveat -- if you create an alias, that email will go to the catch-all account as well as to the aliased accounts.

  3. As root, run postmap /etc/postfix/virtual

  4. As root, run postfix reload
That is it!

[robg adds: I don't have Server, so I can't attest to the workability of this fix...]
    •    
  • Currently 2.00 / 5
  You rated: 5 / 5 (9 votes cast)
 
[35,969 views]  

10.3 Server: Create a postfix catch-all email account | 11 comments | Create New Account
Click here to return to the '10.3 Server: Create a postfix catch-all email account' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3 Server: Create a postfix catch-all email account
Authored by: Alejandra on Nov 12, '03 12:37:50PM

You dont need a Server version, postfix run at no server version of Mac OS X as well.



[ Reply to This | # ]
10.3 Server: Create a postfix catch-all email account
Authored by: MtnBiker on Nov 12, '03 01:30:39PM

Has anyone posted a tutorial on how to get all of this working in the non-server Panther? And how to deal with a router (Netgear 314)? There is http://www.roadstead.com/weblog/Tutorials/PostfixEnabler.html, but it does it all for you and hard to tell what has been done and where. Confusing when one is making other changes such as web serving and php which may change some of the same files.

---
Hermosa Beach, CA USA



[ Reply to This | # ]
10.3 Server: Create a postfix catch-all email account
Authored by: mcroft on Nov 12, '03 02:09:52PM

A 'catchall' account is considered harmful by many mailadmins. You should think carefully before doing this, and probably research the topic on some web sites. In addition to violating the RFCs, it's not helpful to the people trying to send you mail.



[ Reply to This | # ]
10.3 Server: Create a postfix catch-all email account
Authored by: lipids on Nov 12, '03 02:52:21PM

How is it "not helpful" to people trying to send you mail?



[ Reply to This | # ]
10.3 Server: Create a postfix catch-all email account
Authored by: mcroft on Nov 12, '03 11:30:37PM

in the same way that Verisign's wildcard domain resolution is not helpful. It doesn't bounce properly. In this case, it (generally) relies on human re-routing.

Like I said, search the web before you implement this. There are plenty of screeds out there from people who feel more strongly about it than I do.

Even if you decide to implement a catch-all, it's worthwhile to know that some people consider it a harmful mail administration technique. You can't make an informed decision about it unless you know that there are reasons not to do so.



[ Reply to This | # ]
10.3 Server: Create a postfix catch-all email account
Authored by: RandyMan on Nov 13, '03 10:55:20AM

I find it an EXTREMELY useful feature; although I've not moved over to PostFix yet, I'm running EIMS, and have it set to forward messages sent to unknown users to my normal account.

What this allows me to do is hand out address willy-nilly to all those Internet commerce sites that require an email address. I use "site.name@my.domain" (for example, amazon.com@my_domain.com) as the address they require. I still get the mail, and if they've lied about their privacy policy, and I start getting spam to that address, I know *EXACTLY* whose fault it is. At that point, I explicitly disable that account, and the spam bounces appropriately, and that company loses what could have been a very loyal customer.



[ Reply to This | # ]
10.3 Server: Create a postfix catch-all email account
Authored by: searcher on Nov 13, '03 05:33:30PM

I agree w/ mcroft on this. If anyone chooses to use this catchall email go for it, it's your domain and mailserver. Choice is what makes the 'Net great. I find it to be a PITA though.

Not only does it breed inaccuracy, like mentioned above, but it also allows more spam in. Since the domain will accept mail to <anything>@domain.com, spam will definately increase. Compare the amount of messages rejected for "User unknown" w/ and w/out the catchall.



[ Reply to This | # ]
10.3 Server: Create a postfix catch-all email account
Authored by: DaveM on Mar 31, '04 05:00:27AM

I have tried this by following your instructions, but I am not familiar with Terminal Window and Unix commands. I have logged in as root and typed the first line of your instruction followed bt "Enter." I then get a long file explaining the PostFix configuration......???I can't seem to follow your explanantion step by step....

Your assistance would be really appreciated as this looks like a helpful hint.



[ Reply to This | # ]
10.3 Server: Create a postfix catch-all email account
Authored by: sfleming on Apr 17, '04 03:04:43PM

Unfortunately, it looks like your hint requires manual editing each time I add a user. Since I do that a *lot* (hosting a high school), that's not really practical for me.

The postfix help files imply that I can set up a 'luser_relay' address to make a catch-all account, but it doesn't work. I've started a new thread on the topic. Suggestions welcome!



[ Reply to This | # ]
using luser_relay for catch-all with blacklist
Authored by: kg23 on May 19, '05 07:50:47PM
I was able to get "luser_relay" to work for my "one user" email domain. This allowed me to set up a catch-all without virtual_alias_maps. This also offered the ability to add known spammer email targets (like 'nospam') to a blacklist. Mail to the blacklisted addresses go to /dev/null.

I make no claims to the efficacy or security of this setup. It's working for me.

Add to main.cf:
luser_relay=CATCHALL@DOMAIN.COM
local_recipient_maps =

The local_recipient_map is empty.

Add to /etc/postfix/aliases:
devnull: /dev/null
KNOWNSPAMMER: devnull
Add "KNOWNSPAMMERS" addresses as they get discovered and annoy. Be aware that email to these addresses will receive no bounce messages.

As root:
newaliases
postfix reload


[ Reply to This | # ]

using luser_relay for catch-all with blacklist
Authored by: lipids on Jun 06, '05 07:34:32PM

the luser_relay may be a deprecated feature. I am unsure. However, this does certainly seem more elegant than my solution. I am going to try it.



[ Reply to This | # ]