I am using Google Apps/Gmail with Apple Mail on OS X Mavericks. For some reason, sending email is extremely slow (minutes to hours) and I constantly get this message:

The server returned the error: The connection to the server “imap.gmail.com” on port 993 timed out.

There are often (but not always) little error triangles on the inboxes.

Does anyone know why this happens and what I can do to solve the issue?

3 Answers 3


Close Apple Mail and flush your DNS cache - imap.gmail.com is actually a collection of servers and occasionally your DNS will send you a bad one.

In El Capitan the command is sudo dscacheutil -flushcache

It's different for earlier versions.

Even the connection logging in Mail didn't show that DNS was the problem, only that it was a timeout in my case. Unfortunately this is only one possibility.

A way to check is by running the following in Terminal:

$ telnet imap.gmail.com 993
Connected to gmail-imap.l.google.com.
Escape character is '^]'.

FConnection closed by foreign host.

(I typed test there, and the server doesn't understand that so I get disconnected. This proves that the connection between the computer and GMail is fine)


There are many discussions of this around (example). One thing that seems to work for some is:

Try pointing at imap.googlemail.com instead of imap.gmail.com.


Try pointing at imap.googlemail.com instead of imap.gmail.com.

This seems to help, but doesn't entirely resolve the issue.

Here's a screenshot showing how to change the 'Incoming Mail Server' setting in the Mail.app preference pane.

Google Settings for Mail.app


  • Can you add some more details about what needs to be changed where to accomplish this? This would allow less experienced users to try this solution as well.
    – nohillside
    Commented Jan 13, 2014 at 16:19

You must log in to answer this question.

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