11 Replies Latest reply: May 29, 2013 9:13 AM by swissbaldo
Jim Miller2 Level 2 Level 2 (165 points)

I just installed OS X Server, and having a variety of problems with the mail configuration.  I'll probably be posting a number of issues here in the next few days; let's take this one as a start...

 

Yes, the "catchall" question has been posted before, but I've never seen it really answered, and I'm not at all clear on whether the discussions from five years ago are still relevant.  I've tried putting an entry into /etc/postfix/virtual, etc, but I keep getting the "Recipient address rejected" error in mail.log.  Any solutions out there?


Mac Pro, OS X Mountain Lion, plus Server
  • 1. Re: How do you set up a catchall mail account in 10.8 server?
    AnalogKid Level 1 Level 1 (10 points)

    I haven't tried this specifically, but I believe the controlling cf file is in /Library/Server/Mail/Config/postfix directory.

     

    What I don't know is if this file is safe to edit, or if manual changes are "sticky" after updates.

  • 2. Re: How do you set up a catchall mail account in 10.8 server?
    redshift82r Level 2 Level 2 (325 points)

    Hi - try this.

     

    There should be a file in your /Library/Server/Mail/Config/Postfix directory called "virtual_users"

     

    Add an entry

     

    @jimsdomain.com        jim

     

    where

    "jimsdomain.com" is your email domain and

    "jim" is the Mac Account short name that you would like to receive any misaddressed mail to.

     

    Then:

    $ sudo postmap /Library/Server/Mail/Config/postfix/virtual_users

    $ sudo postfix reload  (or stop start mail via sudo serveradmin or via server.app)

     

    Hope that helps!

    cheers

    Gerry

  • 3. Re: How do you set up a catchall mail account in 10.8 server?
    Jim Miller2 Level 2 Level 2 (165 points)

    Hmm -- that's a new place to try.  FWIW, the appropriate file in that directory is "virtual" rather than "virtual_users", but it may be the right version of the file to try (i.e., not the one in /etc/postfix).

     

    I have to say that starting the Server mail server royally screwed up mail delivery and receipt on my server.  After several hours of dealing with rejected connections and the like, I shut it down and went back to my previous solution, MailServe from cutedgesystems.com.  I'm in kind of a crunch on some other things right now, but I'll check into this when I get back into it.  Thanks!

     

    BTW, a followup question that should really be a separate issue -- If the "virtual" thing works, I assume that the "aliases" file in this directory would similarly be the right place to put aliases.  Is this the only way to manage aliases with Server, or is there some hidden part of the app's UI to do this.  (I don't think so, but...)

  • 4. Re: How do you set up a catchall mail account in 10.8 server?
    redshift82r Level 2 Level 2 (325 points)

    Actually - virtual_users is the file you want.

    "virtual" is for a different purpose - virtual alias domains.

     

    So you may need to create "virtual_users".  Do a

     

    $ cat main.cf | grep virtual and

    $ cat main.cf | grep alias

     

     

    To see where postfix wants to find things. You're right about the aliases file in this directory. Postfix seems to now want it here.

     

    Here's a final tip.  Set the response codes for unknown local user to 450 in main.cf  while your mucking around.  That way any mail not delivered will be sent again by the sending smtp server. This will keep the users happy!!

     

    unknown_local_recipient_reject_code = 450

     

    Cheers

  • 5. Re: How do you set up a catchall mail account in 10.8 server?
    Jim Miller2 Level 2 Level 2 (165 points)

    Reporting back --

     

    * /Library/Server/Mail/Config/postfix does seem to be the right path -- when I launch the server app, main.cf gets a new modification date (even though the mail server is still disabled).  So that's good news.

     

    * Not much evidence of "virtual" stuff in main.cf -- grepping for "virtual" in main.cf returns only this:

     

    #myhostname = virtual.domain.tld

    # Do not specify the names of virtual domains - those domains are

    #   /etc/passwd, /etc/aliases, or the $virtual_alias_maps files.

    #   the $virtual_mailbox_maps files.

    # - destinations that match $virtual_alias_domains,

    # - destinations that match $virtual_mailbox_domains.

    # local(8), relocated(5) and virtual(5) for the effects this has on

    # aliases, canonical, virtual, relocated and .forward file lookups.

    virtual_alias_maps = $virtual_maps

     

    For that matter, there's no evidence of ANY .db files being accessed by main.cf, even though the postfix folder contains virtual_domains.db, system_user_maps.db, and rbl_whitelist.db.  Meanwhile, the current contents of the "virtual" file is the man page for "virtual - Postfix virtual alias table format", which sure makes it sound like this is where user aliases should go.  You've been really helpful, but I confess I'm more puzzled than ever...  Thanks again!

  • 6. Re: How do you set up a catchall mail account in 10.8 server?
    redshift82r Level 2 Level 2 (325 points)

    Ok, interesting!!

     

    My main.cf has the following line in it.

     

    virtual_alias_maps = $virtual_maps hash:/Library/Server/Mail/Config/postfix/virtual_users

     

    Try adding that and then add the virtual_users file and do the postmap command as above.

     

    Cheers

    Gerry

  • 7. Re: How do you set up a catchall mail account in 10.8 server?
    rbut Level 1 Level 1 (0 points)

    I simply set an Alias under User -> Select a User -> Advanced Options in Server.app of "@domain.com" and it now receives all email for @domain.com.

  • 8. Re: How do you set up a catchall mail account in 10.8 server?
    A Bigger Bite Level 1 Level 1 (0 points)

    rbut got the solutiuon, but just to make it a bit more clear:

     

    1. Create a user in Server.app that you want to be the catch all account and enable email for it.

    2. Open Workgroup Manager for 10.8 (http://support.apple.com/kb/DL1567)

    3. Select the same user and doubleclick the row under the shortname (you can add aliases to the same account here too)

    4. add "@<yourdomain>", save.

    5. Verify by sending a test email to a non-existing email for the domain. (You may have to restart mailservice?)

     

    Done.

  • 9. Re: How do you set up a catchall mail account in 10.8 server?
    Jim Miller2 Level 2 Level 2 (165 points)

    Interesting; thanks!  I'm going to take a day and try to get Server really working, and will give it a shot.

  • 10. Re: How do you set up a catchall mail account in 10.8 server?
    Mark23 Level 3 Level 3 (975 points)

    I now do want to catch all email as it has become my lives work to report spam.

     

    So I figured out an easier way to catch all email using simply the serveradmin command-line tool (this only takes email that would otherwise bounce):

     

    sudo serveradmin settings mail:imap:lmtp_luser_relay_enabled = yes

    sudo serveradmin settings mail:imap:lmtp_luser_relay = catchallusername

    sudo postfix reload

  • 11. Re: How do you set up a catchall mail account in 10.8 server?
    swissbaldo Level 1 Level 1 (0 points)

    I tried it, but had no luck. I tried with the mac short user name and with address@domain.com.

     

    It did not work. Now I will try with rbut's solution. Thanks guys for your efforts!!!