Mail app breaks with IMAP: Unable to connect, The server cannot contacted on port 993
Mail app has stopped working with all IMAP email accounts on multiple OS X machines, all running 10.9.4. This appears to be a longstanding Mail and/or authentication and/or keychain bug. This affects Apple iCloud email, Google gmail, Comcast, OS X Server email. Mail says that all IMAP accounts are offline with the triangle-! error that says upon a click, "Unable to connect, … The server imap.gmail.com cannot contacted on port 993". Substitute gmail and port 143 for any/all other IMAP account.
All these email accounts are online and accessible ON THE SAME COMPUTER without any issues using other mail clients such as Microsoft Outlook or webmail. And a port scan of the servers shows that port 993/143 are all open. This is only a problem with the Mail app, and I see the exact same problem on a Mac Mini server and a completely different MacBook Pro on completely different networks.
Has anyone figured out a way to reset Mail to factory settings and fix this issue without doing a fresh install of the OS?
I've done all the obvious and not-so-obvious troubleshooting:
Delete and reenter email accounts
Fix Permissions
PRAM reset
Safe reboot and Shift-login
Power cycle router
sudo killall -HUP mDNSResponder
Keychain Access>Delete all email authentication entries
Tried online fixes suggested:
http://apple.stackexchange.com/questions/68702/the-server-returned-the-error-the -server-imap-gmail-com-cannot-be-contacted-o
Nothing fixes Maill app's problems. I'm also on tier 2 support from AppleCare on a new box that has a fresh install of Mavericks with the same problem—the tech couldn't figure out the issue from screen sharing sessions or the EDC logs and has suggest ANOTHER fresh install of Mavericks.
At this point I'm ready to give up, declare the Mail app to be broken, and replace it with Postbox.
Has anyone been able to fix Mail app after it breaks on IMAP accounts?
Mac mini, OS X Mavericks (10.9), Server, 16 GB, EyeTV+Turbo.264 HD