I did a little digging and found out a little of what OSX tries to do to auto-configure an email account.
In system preferences when adding a mail account, OSX makes a POST to https://mac-services.apple.com/iconfig/dconf the post parameters are:
domain: EMAIL_DOMAIN_THE_USER_ENTERED.com
version: 1
capabilities: MACOSX
For a service like gmail the following is returned:
<domain>
<name>gmail.com</name>
<description>Gmail</description>
<service>
<hostname>imap.gmail.com</hostname>
<port>993</port>
<protocol>IMAP</protocol>
<ssl/>
<requires>MACOSX</requires>
<authentication>PLAIN</authentication>
</service>
<service>
<hostname>smtp.gmail.com</hostname>
<port>587</port>
<protocol>SMTP</protocol>
<ssl/>
<requires>MACOSX</requires>
<authentication>PLAIN</authentication>
<usernameIncludesDomain/>
</service>
</domain>
Unfortunately, for my domain I receive the following response:
<domain>
<name>EMAIL_DOMAIN_THE_USER_ENTERED.com</name>
<unknown/>
</domain>
As far as I can tell after an unknown response OSX gives up and requires a user to enter the details manually. Capturing network packets I see no attempt by OSX to fallback to using SRV DNS records, or the Exchange Autodiscover.xml mechanism.
If I get a chance I will open a support ticket with apple to see how one gets added to their mac-services list.
This sounds like a DNS caching issue still. I know that most web browsers do cache their own DNS as well, and I am sure Mail does, but I think that cache empties after exiting.
I always try to telnet into port 25 on a remote mail server to test the connection when something is weird. Port 25 is for SMTP traffic, or what sends the mail. If you get a valid connection, you can actually interact with this interface. With your comments though, this probably did not work.
DNS is a very strange beast, because so many different services do many things, not to mention the different hardware on your network. In this case you have:
- router
- Mac, but DNS cache and hosts file
In the end, it sounds like you discovered this in your hosts file. I can't count the number of times (I do a bit of web dev) that I set something up in the hosts file and then got confused why something was acting wrong.
Best Answer
You can
You can probably also do this directly (old IMAP to new IMAP) but I run into IMAP implementations in the past which weren't too stable during batch copying. So keeping a local copy (at least for a short time) is recommended.
If a local copy is not possible due to mailbox size, you can alternatively try to copy old IMAP to new iMAP folder by folder. Be sure to verify each step at least visually.