I have a Gmail IMAP account in Mail, which up until installing Mountain Lion has always worked smoothly.

Now after the upgrade, I find that if I have Mail open for a while in the background or I put my computer to sleep while Mail is running, when I return to it, Mail shows the error:

"Unable to Connect

There may be a problem with the mail server or network. Verify the settings for account "Gmail" or try again.

The server returned the error: The server "imap.gmail.com" cannot be contacted on port 993."

Here is a screenshot.

I've verified my IMAP settings are correct. The only way to fix it at the moment is to quit and reopen Mail. Then it breaks after a while and the process repeats!

Do you have any ideas why it might be doing this? I'm on an early 2011 MBP. Thanks in advance for any help you can give!

3 Answers 3


This happened to me while in Snow Leopard. It's a different situation, however I fixed it by removing the mail account, and re-adding it fresh. Worked forever after that.


  • Okay thanks, if using imap.googlemail.com doesn't fix the issue I'll have to give this a go!
    – Michael
    Commented Aug 7, 2012 at 4:44

Would be interesting to know if the port is really unavailable to you…

Can you use Network Utility to do a port scan on the host/port in question?

Also you may wish to try the alternate server "imap.googlemail.com".

  • I entered both imap.gmail.com and imap.googlemail.com into the Port Scan tab in Network Utility, but both seem to hang, showing: Port Scan has started… Port Scanning host: Should I be seeing some ports appear here? I have set my server in Mail to imap.googlemail.com to see if that makes a difference for now. Thanks for your help.
    – Michael
    Commented Aug 7, 2012 at 4:21
  • You really only need to check port 993.
    – AllInOne
    Commented Aug 7, 2012 at 17:36

I am having problem login into yahoo and gmail accounts. The error message it gives me is that there is no connection to the imap server.

I used to have lion and the mail application used to work good with both yahoo and gmail; however, ever since I did the upgrade to mountain lion the mail application has not worked.

My frustration with my apple started since I changed from snow leopard.

  • I solved the problem by following austin's advice, deleting the account and re-adding it. All is back to normal now.
    – Michael
    Commented Aug 21, 2012 at 23:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .