HT202360: OS X Server: Enabling and disabling email auto-forwarding

Learn about OS X Server: Enabling and disabling email auto-forwarding
Iglebekk

Q: After upgrading to Server 2.2, my mail server stopped forwarding. How to get i started again ?

I'm runnig a ML Server with mail server active and two mail domaines. Before updating the server app. everything worked fine. All my user where logged inn with username@domain1.com, and username@domain2.com was forwarding to username@domain1.com. After the update to server 2.2, forwarding stopped working.

 

Any one know how to fix ?

Mac Pro, OS X Server

Posted on Jan 30, 2013 4:08 AM

Close

Q: After upgrading to Server 2.2, my mail server stopped forwarding. How to get i started again ?

  • All replies
  • Helpful answers

  • by UptimeJeff,

    UptimeJeff UptimeJeff Jan 30, 2013 9:13 AM in response to Iglebekk
    Level 4 (3,477 points)
    Jan 30, 2013 9:13 AM in response to Iglebekk

    So alll mail to users at domain1.com are delivered normally?

    What happens to mail sent to domain2? Does it bounce?

    post relevant log detail.

  • by Iglebekk,

    Iglebekk Iglebekk Jan 31, 2013 5:25 AM in response to UptimeJeff
    Level 1 (0 points)
    Jan 31, 2013 5:25 AM in response to UptimeJeff

    Yes, all mail to users at domain1.com are delivered.

     

    Nothing happens. They just disappears. The log is not showing anything that can be linked to the issue. The only error in the log is this:

    Jan 31 14:21:30 server.ansic.no log[55469]: imap-login: Disconnected (no auth attempts): rip=192.168.1.10, lip=192.168.1.10, secured

    As I said, it worked fine before the update.

  • by Iglebekk,

    Iglebekk Iglebekk Jan 31, 2013 5:44 AM in response to Iglebekk
    Level 1 (0 points)
    Jan 31, 2013 5:44 AM in response to Iglebekk

    It looks like the server stores the mail in domain2.com's account, and for some reason won't forward it. I have tried to deactivate forwarding og activating again, but no luck...

     

    (why can't i edit my own post ?)

  • by UptimeJeff,

    UptimeJeff UptimeJeff Jan 31, 2013 7:02 AM in response to Iglebekk
    Level 4 (3,477 points)
    Jan 31, 2013 7:02 AM in response to Iglebekk

    Sounds like you are setup with domain2 as a virtual domain.

    This makes bob@domain1 and bob@domain2 separate mailboxes.

     

    If this is a server where

         bob@eitherdomain should go to the same mailbox

    and you have no cases where

        mary@domain1 and mary@domain2 should be separate mailboxs

    then you should not be using a virtual domain.

     

    Put both domains in the Domain Name field, separated with a comma

        domain1.com, domain2.com

     

    No forwarding is needed... mail 2 either domain will work for each user.

  • by Iglebekk,

    Iglebekk Iglebekk Jan 31, 2013 8:01 AM in response to UptimeJeff
    Level 1 (0 points)
    Jan 31, 2013 8:01 AM in response to UptimeJeff

    I can't type comma in Domain Name field. Server.app dosent allow that... And in user settings, it's only allowed with one "var@var.var".

     

    Domain2 is a virutal domain, yes.

  • by UptimeJeff,

    UptimeJeff UptimeJeff Jan 31, 2013 8:36 AM in response to Iglebekk
    Level 4 (3,477 points)
    Jan 31, 2013 8:36 AM in response to Iglebekk

    Oh.. Didn't realize the server.app didn't allow a comma there.

     

    You can enter it manually, when done it will appear in the Domain Name field with a comma.

     

    Here is how:

     

    Make sure you quit the Server app while making this change.

     

    You need to edit a server config file, use Terminal:

    sudo pico /Library/Server/Mail/Config/postfix/main.cf

    scroll way down near the bottom using the arrow keys.

    Find this line:

    mydomain = domain1.com

    Change it to

    mydomain = domain1.com, domain2.com

     

    hit ctrl-x to exit, hit y to save.

     

    Then run this in Terminal:

     

    sudo postfix reload

     

     

    Open Server app and you will see both domains and it will receive for both.

     

    You don't need to enter both domains in the user record. Both will work, any domain listed in 'Domain Name' will work for every user.

  • by UptimeJeff,

    UptimeJeff UptimeJeff Feb 2, 2013 11:06 AM in response to Iglebekk
    Level 4 (3,477 points)
    Feb 2, 2013 11:06 AM in response to Iglebekk

    Did you solve this?

     

    Here is an easier way to enter more than one domain  (assuming you don't need virtual domains)

     

    - Make sure you don't have any entries in Virtual Domains

    - Quite Server app

    - Then issue this in Terminal:

    sudo serveradmin settings mail:postfix:mydomain = "domain1.com, domain2.com"
    sudo postfix reload
    

     

     

    Re-open Server app and you'll see both domains listed.

  • by Iglebekk,

    Iglebekk Iglebekk Feb 4, 2013 3:29 PM in response to UptimeJeff
    Level 1 (0 points)
    Feb 4, 2013 3:29 PM in response to UptimeJeff

    Sorry, I was away.

     

    I tried your solution, but I keep geting a error in the SMTP-log

     

    Feb  5 00:27:05 server.ansic.no postfix/master[66859]: fatal: file /Library/Server/Mail/Config/postfix/main.cf: parameter mydomain: bad parameter value: domain1.no, domain2.no

  • by UptimeJeff,Solvedanswer

    UptimeJeff UptimeJeff Feb 4, 2013 3:56 PM in response to Iglebekk
    Level 4 (3,477 points)
    Feb 4, 2013 3:56 PM in response to Iglebekk

    Sorry- I made a mistake on that.

    IGNORE BOTH DIRECTIONS ABOVE:

     

    Revert the setting back to just your primary domain:

    sudo serveradmin settings mail:postfix:mydomain = "domain.com"

    sudo postfix reload

     

    The config errors should stop now.

     

    ############# What you really should do ###############################

     

    If you don't need virtual domains (and I don't think you do):

     

    Do this:

    sudo pico /Library/Server/Mail/Config/postfix/main.cf

     

    Scroll towards the bottom (many pages) and on the last page you should see:

     

    mydestination=

    It will probably look like this:

    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

     

    simply add your second domain to the end of whatever is there separated by a comma

    So it would be this:

    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, myotherdomain.com

     

    Then reload postfix with:

    sudo postfix reload

     

    That shoud do it.

     

    Sorry about the confusion


  • by Iglebekk,

    Iglebekk Iglebekk Mar 6, 2013 3:08 AM in response to UptimeJeff
    Level 1 (0 points)
    Mar 6, 2013 3:08 AM in response to UptimeJeff

    Sorry I have not answered. I have not had time to test this out.

     

    This worked and solved my problem, thank you!