icouto

Q: How to Fix Wrongly Entered External Email Forwarding Address?

I feel so stupid... I'm setting up a client's server, and I thought it would be a great idea to setup an 'alias' email address at the client's domain, that would automatically redirect/forward their email support questions to our support address. So, I created a 'support' user in their server, with the email address "support@theirserver.com". I then went into the mail options for the user, and set it to forward all messages to "support@ourserver.com".

 

Apparently, the OS X Mail Server only forwards messages between accounts on the same server - ie., it will not relay the messages to a third party. But it does not bounce the messages, either. So the sender believes that their message was sent, but the message never arrives at the destination.

 

I deleted the dummy 'support' user, but surprisingly, that did not solve the problem of the disappearing messages: now, although there are no more users set to forward messages to "support@ourserver.com", no messages are ever sent to that address. That is, if a 'normal' user on that server wants to send us a message at that address, their message never reaches us - and they don't get a bounce. It's as if their server is eating all the messages to that address!

 

I'm guessing that when I set up the forwarding to an external address I must have created some 'loop', or corrupted some preference, which is now causing all messages to that external address to either be thrown out, or eternally queued. Questions:

 

1) How can I fix this?

 

2) Is there a way to configure redirection to an external address without hacking away at config files that are likely to be overwritten at the next update?

Posted on Sep 14, 2013 3:14 PM

Close

Q: How to Fix Wrongly Entered External Email Forwarding Address?

  • All replies
  • Helpful answers

  • by MrHoffman,

    MrHoffman MrHoffman Sep 14, 2013 5:19 PM in response to icouto
    Level 6 (15,637 points)
    Mac OS X
    Sep 14, 2013 5:19 PM in response to icouto

    OS X Server mail server can be configured to relay, but enabling email forwarding (autoforwarding) (HT5032) is probably a better option.

  • by icouto,

    icouto icouto Sep 14, 2013 6:09 PM in response to MrHoffman
    Level 1 (4 points)
    Servers Enterprise
    Sep 14, 2013 6:09 PM in response to MrHoffman

    Definitely do NOT want to open the mail server for relay! *shudder*

     

    I was trying to do the autoforwarding using the GUI, and that's when I got into trouble. As far as I can tell, following the GUI instructions from the quoted knowledgebase article above, you can only autoforward to other users in the same machine - ie., to other accounts held by the same mail server.

     

    Is that correct, or did I miss an obvious way to autoforward mail to an external address using the GUI?

     

    In any case, I think I'm starting to see where the problem may be: reading up on the set_user_mail_opts command mentioned in the article above, I ran the following command, with the following result:

     

    administrator$ sudo set_user_mail_opts -f, --auto_fwd list local user auto-forward settings -------------------------------- user: mary: <anne@theirserver.com>

    user: postmaster: <admin@theirserver.com>

    user: webmaster: <admin@theirserver.com>

    user: info: <john@theirserver.com>

    user: (null): <support@ourserver.com>

     

    There seems to be a 'null' user, that is still 'forwarding' to "support@ourserver.com". Could that be the cause of the problem - and if so, how do I get rid of it?...

  • by MrHoffman,

    MrHoffman MrHoffman Sep 14, 2013 7:26 PM in response to icouto
    Level 6 (15,637 points)
    Mac OS X
    Sep 14, 2013 7:26 PM in response to icouto

    Has (other) outbound mail from the server been tested, and reached the target server successfully?

     

    Anything in the logs around the mail message failure?

  • by icouto,

    icouto icouto Sep 14, 2013 7:52 PM in response to MrHoffman
    Level 1 (4 points)
    Servers Enterprise
    Sep 14, 2013 7:52 PM in response to MrHoffman

    Has (other) outbound mail from the server been tested, and reached the target server successfully?

     

    I have just created a new test account, and tried sending mail. It seems that mail is functioning fine, and all messages reach their destination, except for messages that are sent to "ourserver.com". It seems that any messages from their server to ours - regardless of what account it's from or to - just doesn't get here.

     

    Anything in the logs around the mail message failure?

     

    I'm posting the most recent log dump below. The domain names and IP addresses have been changed to protect the innocent:

    Sep 14 22:32:02 theirserver.com postfix/smtp[80390]: connect to mail.ourserver.com[123.45.67.89]:25: Operation timed out

    Sep 14 22:32:02 theirserver.com postfix/smtp[80390]: 42F8D8012F: to=<support@ourserver.com>, relay=none, delay=30, delays=0/0/30/0, dsn=4.4.1, status=deferred (connect to mail.ourserver.com[123.45.67.89]:25: Operation timed out)

    Sep 14 22:34:27 theirserver.com postfix/qmgr[80065]: 68D818009D: from=<support@ourserver.com>, size=1123, nrcpt=1 (queue active)

    Sep 14 22:34:27 theirserver.com postfix/qmgr[80065]: BC7A37AE21: from=<support@ourserver.com>, size=1123, nrcpt=1 (queue active)

    Sep 14 22:34:57 theirserver.com postfix/smtp[80511]: connect to mail.ourserver.com[123.45.67.89]:25: Operation timed out

    Sep 14 22:34:57 theirserver.com postfix/smtp[80512]: connect to mail.ourserver.com[123.45.67.89]:25: Operation timed out

    Sep 14 22:34:57 theirserver.com postfix/smtp[80511]: 68D818009D: to=<support@ourserver.com>, relay=none, delay=500, delays=470/0.02/30/0, dsn=4.4.1, status=deferred (connect to mail.ourserver.com[123.45.67.89]:25: Operation timed out)

    Sep 14 22:34:57 theirserver.com postfix/smtp[80512]: BC7A37AE21: to=<support@ourserver.com>, relay=none, delay=63244, delays=63214/0.02/30/0, dsn=4.4.1, status=deferred (connect to mail.ourserver.com[123.45.67.89]:25: Operation timed out)

    Sep 14 22:35:52 theirserver.com postfix/anvil[80345]: statistics: max connection rate 1/60s for (smtpd:98.76.54.32) at Sep 14 22:26:37

    Sep 14 22:35:52 theirserver.com postfix/anvil[80345]: statistics: max connection count 1 for (smtpd:98.76.54.32) at Sep 14 22:26:37

    Sep 14 22:35:52 theirserver.com postfix/anvil[80345]: statistics: max cache size 1 at Sep 14 22:26:37

     

    I should also mention, that following information in the man page for the set_user_mail_opts command, I found the .mailusersettings.plist file, deleted the entry for the 'null' user, and restarted the mail server. The testing above was done after these changes had already been made...

     

    Any suggestions would be most welcome.

  • by MrHoffman,

    MrHoffman MrHoffman Sep 15, 2013 9:02 AM in response to icouto
    Level 6 (15,637 points)
    Mac OS X
    Sep 15, 2013 9:02 AM in response to icouto

    You need to find out why the mail server is receiving those timeouts.  That could be either from the mail server setup, from some IP-level routing or firewall issue, or from problems with the DNS setup or the DNS cache.   

     

    Easiest way will probably be to get somebody to ARD screen share into the box, and have a look around. 

     

    Failing that (and particularly if the environment isn't something that you'd consider "pristine"; if it's been tweaked and retweaked in some key areas), nuke and pave the box, and (re)do the minimum to get the box configured and online as the end-user of the system require it.

     

    ps: A more general request: please don't obfuscate with real IP addresses, nor with real and registered domains.  Use example.com, example.org or example.net as domains, and use completely bogus IP addresses.  Thanks!

  • by icouto,

    icouto icouto Sep 15, 2013 8:23 PM in response to MrHoffman
    Level 1 (4 points)
    Servers Enterprise
    Sep 15, 2013 8:23 PM in response to MrHoffman

    MrHoffman, following your troubleshooting suggestions, I disabled the firewal on both servers, then connected remotely to "theirserver" and flushed the DNS cache - twice, just for good measure. I then checked that it could reach the data centre's DNS server, and that it could resolve "ourserver" to the correct IP address. It could.

     

    I then tried pinging 'ourserver' from 'theirserver'. Request time out. I tried pinging other servers from "theirserver" - other clients' domains in the same datacentre, other domains in other providers, etc. Everything works flawlessly, the pings happen with no packet loss. The *only* domain it has difficulty with is "ourserver". It cannot ping it, it cannot view its webpage in Safari, it cannot access it via fileshare, ftp, or using any other protocol. It's as if the IP address for 'ourserver' has been blacklisted or blocked somewhere internally in the machine.

     

    Is there perhaps a DNS or routing config file somewhere, that could have been messed up when I set the autoforwarding, and which could be causing this 'blockage'?

     

    Where should I start looking?...

  • by icouto,

    icouto icouto Sep 15, 2013 11:02 PM in response to icouto
    Level 1 (4 points)
    Servers Enterprise
    Sep 15, 2013 11:02 PM in response to icouto

    Since writing the post above, I tried having a look at the routing tables - open Network Utility, go to the 'Netstat' tab. The first time I looked, the routing table seemed 'clean' - ie., there were no entries there that related to 'ourserver'.

     

    A couple of minutes later, I checked the routing tables again, and saw 'ourserver' listed there, like this:

    Routing tables

     

    Internet:

    Destination        Gateway            Flags        Refs      Use   Netif Expire

    default            888.88.88.1       UGSc           17       37     en0

    127                127.0.0.1          UCS             0        0     lo0

    127.0.0.1          127.0.0.1          UH              8  2125626     lo0

    888.88.88         link#4             UCS             4        0     en0

    888.88.88.1       0:0:c:7:ac:64      UHLWIir        18        0     en0   1189

    888.88.88.2       0:8:a4:e:3b:40     UHLWIi          0        0     en0   1196

    888.88.88.3       0:d0:6:f3:e0:0     UHLWIi          0        0     en0   1087

    888.88.88.19      127.0.0.1          UHS             0     1487     lo0

    777.77.77.68      link#4             UHRLWIi         1        9     en0     13

     

    Where "777.77.77.68" is the IP address of 'ourserver'.

     

    Waiting another couple of minutes, and checking the routing tables again, this entry is gone. Something seems to be adding and removing the entry to the routing table.

     

    The most obvious part of Server that I thought could be causing this via some misconfiguration would be Mail. I made a copy of the /Library/Server/Mail/Config folder, and grepped it for 'ourserver' and its ip address - but came up empty.

     

    What else can I try?... Any suggestions would be most welcome.

  • by MrHoffman,

    MrHoffman MrHoffman Sep 16, 2013 5:08 PM in response to icouto
    Level 6 (15,637 points)
    Mac OS X
    Sep 16, 2013 5:08 PM in response to icouto

    Get somebody in to look at the configuration?   This is getting far too deep into the what-if sequences, where somebody might be able to screen-share in and potentially find out what's going on with these configurations.

  • by petrahu,

    petrahu petrahu Jun 11, 2014 2:15 AM in response to icouto
    Level 1 (0 points)
    Jun 11, 2014 2:15 AM in response to icouto

    May be is to late:

     

    /Applications/Server.app/Contents/ServerRoot/usr/bin/set_user_mail_opts -f list | grep null

    user: (null):   <false@mail.address.tld>

     

    Check the contents of /Library/Server/Mail/Data/db/.mailusersettings.plist

    Search the uncorrect mail addresses.

    Search the correspondending user-guid, like 1AB9F9F6-024E-4D1F-9623-D22BDD93B826

     


    <key>1AB9F9F6-024E-4D1F-9623-D22BDD93B826</key>

    <dict>


    <key>kAutoForwardValue</key>


    <string>false@mail.address.tld</string>


    <key>kMailAccountState</key>


    <string>Forward</string>

    </dict>

     

    Run:

    /Applications/Server.app/Contents/ServerRoot/usr/bin/set_user_mail_opts --auto_fwd reset -g 1AB9F9F6-024E-4D1F-9623-D22BDD93B826 

     

    Regards. Petra.