Mail.app keeps trying to connecting to old mail server

dnsemailimapmail.app

Yesterday my web host (Dreamhost) unexpectedly moved my email account to a new server. Most of my email clients didn't skip a beat, and continued to connect to the server and receive mail.

However, immediately after the server migration, Mail.app on my home computer stopped receiving mail. It continued to successfully login to the mail server, but did not find any email received post-migration. My assumption is that it was connecting to the old mail server.

Today, Mail.app fails to login to the mail server at all. My assumption is that the old server has now been decommissioned.

To me, it seems as if Mail.app has some sort of bad DNS cache, causing it to 'look' at the old server rather than the new one.

Steps I tried to resolve the issue:

  • Restarted Mail.app.
  • Rebooted computer.
  • Cleared OS X DNS cache.
  • Synchronized IMAP account with server.
  • Deleted email account from Mail.app, and recreated it.
  • Rebooted cable modem.

Not a spot of difference.

Is it possible that Mail.app is somehow caching DNS details for the email server, even after I clear the OS X DNS cache? If so, how could I force Mail.app to 'look' at the new server?

Setup: OS X Lion, IMAP email account

[SOLVED] See the comments for a description of the solution. The culprit was Avast Anti Virus.

Best Answer

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.