You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mail Connections Lost After Sleep (Ports Fail)

I am having the problem that others are having regarding Mail reconnecting after sleep. Typically, it fails to connect to my Company IMAP server, and the IMAP Gmail server (but connects to the Gmail SMTP server). It looks like this in Connection Doctor:


User uploaded file


I have done the following already:

1. Deleted and reinstalled the accounts

2. Reinstalled Mountain Lion from network

3. Reset my SMC


I have searched for any firewall that would mess it up, but have come up with nothing. Here is the readout from Terminal:


ls: /Library/InputManagers: No such file or directory

ls: /Library/Mail/Bundles: No such file or directory

ls: /Users/KyleEssary/Library/Mail/Bundles: No such file or directory

/Library/LaunchAgents:

com.Cvnt.start.plist

com.amazon.sendtokindle.launcher.plist


/Library/LaunchDaemons:

com.Cvnt.daemon.plist

com.adobe.fpsaud.plist


/Library/StartupItems:


/Users/KyleEssary/Library/LaunchAgents:

com.apple.AddressBook.ScheduledSync.PHXCardDAVSource.DB72A0D3-A7F5-42AA-B8C0-B9F DD21F52AE.plist


The CVnt plist is from an app that I added long after I noticed this problem. The problem was the same before and after installing that app.


Whenever I run the Network Utility following a wake from sleep on typical ports, I get this:


User uploaded file


Whatever the issue may be, it apparently starts on sleep because Power Nap has yet to work. I have had this issue since installing Mountain Lion and would appreciate any help.

MacBook Air (13-INCH, MID 2011), OS X Mountain Lion (10.8.1)

Posted on Sep 5, 2012 12:36 AM

Reply
127 replies

Jan 13, 2013 3:23 PM in response to scott321

Hey, some real progress.


I changed to DNS in System Pref to the Apple suggested ones and I switched the Modem/Router back to the default ones (Let ISP manager DNS) and restarted the computer and the modem.


If I click Get Mail straight away I sometimes get the dreaded triangle, but if I keep my eye on the Dropbox icon and/or the WiFi icon until they come live (usually only a few seconds) all seems well with mail.


This is 99% better than having to restart Mail each time.


Very happy indeed.

Jan 22, 2013 12:56 AM in response to Rangeressary

I have been getting the problem since I switched to Mountain Lion ten days ago. As with others, I get the dreaded triangular icons when I come back from Sleep, but if I quit Mail and then re-start it everything is resolved.


I presume that this is a DNS problem, but it is occurring for me in different network set-ups (but not all...). In most of the set-ups I use, the DNS servers are Google (8.8.8.8 and 4.4.4.4). I have had for a long time other DNS problems that I have not been able to solve, that seem to affect my Mac and not other computers, and which are visible when browsing (I use Chrome), so I am inclined to be suspicious of DNS.


In the networks where I am administrator, I have ensured that the WiFi access points and the routers (if separate) have the latest software. However, I have just tested this with WiFi disconnected and Ethernet connected, and the problem is the same.


I usually run Google Drive, but I have quit this program and the problem still continues.


I am assuming that one of these days Apple will release a software update that fixes the problem. It seems to me to be a bug that one cannot even manually get the Mail program to re-test the connections without having to quit and re-start the program.

Jan 22, 2013 12:52 PM in response to robolz

Yes, the problem is definitely DNS speeds, mine was also initially fixed using the Google DNS Server numbers (actually these are 8.8.8.8 & 8.8.4.4).

But there is an even better (read faster) way to come up with the best option/s for your own situation.

Download the free utility 'namebench' and run it multiple times then collate the results to find the fastest DNS servers in your area.

Mine turned out to be those run by iiNet subsidiaries (Internode and Westnet) and Telstra. It's an interesting exercise.

Suffice to say I'm delighted by the results.

Jan 23, 2013 12:31 AM in response to lamont_ancient

Thank you lamont_ancient (for the correction to the secondary Google DNS address and for the pointer to Namebench).


In fact, it turned out that I already had Namebench installed, but I had forgotten about it. I set it running to check out DNS servers, but it was still running after a couple of hours when I had to move office. Clearly this has to be run when the computer is going to stay put for a long time (not so suitable for my mobile laptop).


I have tried to test out further the Mail connectivity problem and somehow, for now, I have managed to get the problem to go away...


From Mail's 'Connectivity Doctor' I could see that the problem was only reported from Google's IMAP connections (not others) and that it was the SMTP connection was failing. I therefore did a tidy-up of the SMTP server definitions. Nearly all my connections to smtp.gmail.com were going via port 587 (specified by Google for TLS). I first changed these to port 465 (the other SSL port). This didn't seem to fix the problem, so I went through and changed all the smtp.gmail.com port definitions to "Use default ports (25, 465, 587).


I have been through the sleep cycle 3 times since without a problem (when there used to a problem on every occasion before at the current location), so fingers crossed!


NB: I got a pointer to this solution because, in my frustration, I installed Postbox as a replacement for Apple Mail, and Postbox complained about the IMAP smtp connection to Google via port 587. However, when I changed the connections to go via port 465, the problem went away.


I do not believe that that I have any firewall intervention of connections via port 587, but there is quite possibly also some network issue involved. Nevertheless, I have achieved a major improvement (and maybe a solution) without DNS changes.

Jan 24, 2013 5:54 PM in response to robolz

I apologize if I have misled anyone. Changing the SMTP port settings did NOT fix my problem.


It turns out that I did not get a problem reconnecting via IMAP after Sleep because I was also running Postbox at the same time as running Apple Mail. Since Postbox is querying the same IMAP accounts (incidentally, without getting any problems), this seems to interact with the queries of Apple Mail and resolve the problems!


When I quit Postbox before entering Sleep, on re-start the IMAP connectivity problem returned to Mail.


It certainly seems that Mail's problem is an incompatibility between Mail and certain network configurations (possible DNS). On the two networks that always have the problem, DNS is being served from a Linux server running DHCPD - which potentially is a factor in common, since this DHCP service is a little slow to come up. I do not think that the problem is related to the selection of DNS servers, since I use Google DNS servers in several networks and the Mail problem has not shown itself when the DHCP server is the local router (WiFi access point).


I've used up all the time I can devote to this now, and I am switching to Postbox instead of Apple Mail.

Jan 24, 2013 6:23 PM in response to robolz

I have in fact found a few minutes to investigate my latest theory of the role of the DHCP server in this problem. I changed the DHCP setup to use the local WiFi router as the DHCP server.


This DID fix the problem - and I cycled through Sleep twice to verify this.


Presumably the Linux-server DHCPD set-up is working too slowly for Mail (the only explanation that I can think of, since the other parameters given out by this DHCP server are the same).


The frustrating issue about tracking down and resolving this problem is that there are so many solutions that can apparently provide a fix. However, I recommend anyone who is still having the problem to change their DCHP server. All WiFi routers have a DHCP server, that is enabled by default, which could be a reason that many people would never see the problem.


Of course, this solution does not work if you do not control the network...

Jan 24, 2013 7:42 PM in response to bajawil

Hello Bajawil, I was able to get it to work by changing to the router's DHCP server (which I had disabled before, since there is another DHCP server in the network). So, yes, I was recommending using the router's DHCP server.


However, I'm sorry that this is not working for you. There seem to be so many possible conditions that can cause, or fix, this problem - but no single solution seems to work for everyone.


I think that Apple will have to fix this once and for all in an update to Mail. In the meantime, I have moved to Postbox (that seems to be better than Mail in any case, and only costs $10), since I need to rely on having my email client working wherever I am without having to check it all the time.


Postbox can be found at http://www.postbox-inc.com/ Installation is well automated, and there is a free trial for a month. You can even use it in parallel to Apple Mail, if you are using IMAP accounts.

Jan 25, 2013 12:44 AM in response to robolz

robolz wrote:



Postbox can be found at http://www.postbox-inc.com/ Installation is well automated, and there is a free trial for a month. You can even use it in parallel to Apple Mail, if you are using IMAP accounts.


I tried this. Looks nice and has some cute features, but it didn't work for me.


This app won't let me send any mails at all because (it says) it can't connect to the SMTP server even when its connected online. At least Mail works when its connected!


Back to Mail...

Jan 25, 2013 1:33 AM in response to softwater

I've just been trying Postbox for a couple of days, and I'm sure to find some shortcomings - although the connections have worked without problems once I changed the SMTP port definitions from 587 to 465 (for connections to Google email accounts).


Softwater, what do you mean when you say "...when it's connected online"? How do you know if it is "connected online"?


I understand that IMAP (for downloading email titles or contents) works by polling, and that SMTP (for sending emails) works by establishing a connection for every send. Therefore, I don't think that the low-level connection is ever 'online'. This terminology is used by Mail and Postbox, but I think that it simply means it is currently configured to poll via IMAP regularly and that this is working. Mail seems to take the accounts 'offline' when there is a problem with SMTP, even if there is not a problem with IMAP.

Jan 25, 2013 2:42 AM in response to robolz

Yeah, you're probably right. I have no doubt I could get it up and running if I was prepared to invest the time.


The thing is rob, I spend a lot of time troubleshooting macs and OS X machines that have gone off the rails for one reason or another, but I'm just not really into troubleshooting a 3rd party app whose setup I followed to the letter but which didn't work out of the box. Life's too short.


I'll stick with Mail unless it causes me more timewasting than figuring out what's wrong with Postbox.


Thx for your reply.

Jan 26, 2013 4:01 PM in response to Rangeressary

I am having the same symptoms described by most people on this thread. I can use Mail after my MBPr wakes, but I have to wait about two minutes every time it wakes up. The beachball spins for that long and the program will not respond (resarting Mail does fix the problem, but that's a work arournd, not a solution).

I have read all the way through the thread, and I have to say I find it daunting. I know a lot more than most users, but I am not a networking specialist, and I get lost sometimes in the lingo.

I work for a college, and I have the problem both at home and at work. The machine behaves in an identical manner in both places. My DNS seetings under "Network/Advanced/DNS" have my router's IP address--192.168.1.1--listed, but it is greyed out, so I cannot modify it. My router DNS pulldown menu (using Tomatoe firmware 1.28 on an ASUS router) is set to "Use WAN IP Address173.31.182.38 (recommended)." This, I assume, means that my ASUS router is controlling the DNS and is using the 173.31.182.38 address. My level of expertise is not high when it comes to networking, so I would appreciate some addvice abou how to try a different (hopefully better) DNS server, as softwater and robolz have been suggesting. Where and how do I enter the address for a different DNS server? Will doing this affect how things work both at home and at my work setting (a college network, about which I know little)?

Tnx. BJ

Mail Connections Lost After Sleep (Ports Fail)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.