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.

Limit Number of IMAP connections to Mail Server ...?

Greetings,

My host is complaining that Mail's IMAP opens too many connections (and keeps them open too long)... which is causing some issues on the hosting end.

Is there any way to limit the amount of connections Mail makes?

IMAP-IDLE is already turned off on all the accounts.

mini, Mac OS X (10.6.4)

Posted on Aug 17, 2010 9:59 PM

Reply
63 replies

May 15, 2011 2:52 PM in response to JoeWMpls

JoeWMpls, you're completely right, this is a very old problem... and Apple now is only about selling iPhones and iPads and MacBook Air with a future OSX (Lion) where the bullets in the dock aren't even there so the users that come from windows don't freak out with the concept of closing a window and leaving an app running...


It's bad... this is an old and boring problem... nobody is using POP3 anymore... it doesn't even make sense... the world now is all about "could" and data in a server available across multiple devices...


***?!? Steve it's a ******* **** socket...! It's not hard to close them or use the same! for god sake!

Jun 29, 2011 2:52 PM in response to badtz

another person affected by this. I have noticed that apple are quite active on these discussion boards... When the problem is the users fault. When there is a big issue that is perhaps down to them, they go completely quiet. Its diabolical that they cant just make Mail close its bl**dy connections when its not using them.

Jul 4, 2011 4:01 PM in response to badtz

I discovered this issue once we moved to HostGator. I've already switched hosts enough, I'm not moving my company's e-Com site once again just because of an email client problem. Because of this issue I've had to move to Outlook.


Unfortunately, Mail's prolific connection habit made me paranoid, especially after my site was blocked for half a day and I ended up creating most of the email accounts as POP3, which is fine as I oversee them. But, it just means that now I have to migrate everything from POP3 to IMAP, assuming MS didn't screw up Outlook like Apple did Mail. My biggest problem is that I can't even use Mail on the iPad to check my business email as I don't want to create POP3 accounts on a device with limited storage.


I can't believe that after all this time Apple *still* hasn't fixed this issue. Maybe with Lion? Anyone have a Preview version that can let us know if Lion's Mail.app fixes this issue?

Jul 4, 2011 4:19 PM in response to Richard Schwalb

Hi Richard,


Yep that a really crappy problem, since I'm a beta tester I've been sending emails to Apple since Leopard's first beta and even now with Lion I sent another email asking to solve this issue but they keep saying that it's a know issue and the engineering team is over it... but in the last years they didn't do anything at all.


I was hoping that with iOS and Mail for iPhone they solved this but not even that time.

Today the bug is still present in the last version of Lion. Sorry.


Last time I email them I got this (like all other times):


Hello,


After further review it has been determined that the feedback you provided is known to engineering and a solution is currently under investigation.


Thank you for reporting this.


It's a shame really...


In the overall Apple is not interested in the professionals and in their needs see Final Cut Pro X? See XServer and OSX Server? I'm really starting hate Apple. And... by the way, the workflow in Lion is very slow, too much eye candy and the "fast moving windows around in Spaces" is now a pain in the *** with Mission Control...

Safari is slower than ever and crashing with flash and facebook and the system is really heavy in a Core 2 Duo 2.5Ghz 8GB of RAM machine, the computer is always with the fans turned on just to browser two or three websites and mail.


God **** it Steve, if you don't have any more inovation to do just don't make the system look like a crappy buggy windows.

Jul 5, 2011 12:23 PM in response to iTCB13

Hi iTCB13,

That's really a shame to find out. I don't mind Outlook, but as I rarely use the rest of the MS Office Suite it seems such a waste. Plus, I can't check my company email from my iPad unless I want to go into cPanel and kill the connections once I'm done. Which, honestly, is a huge pain.


Looks like I'll be looking to migrate all my POP3 accounts in Outlook to IMAP, no Mail.app anytime soon. I'd use Thunderbird/Postbox, but that's for my personal email.


Thanks for the heads up, greatly appreciated.

Jul 5, 2011 12:48 PM in response to Richard Schwalb

Hi Richard,


I've had that problems with HG before, lucky now and since my company sells network services, including hosting, I'm not a HG client anymore.


Anyway, there are two options to go around your problem, the first one is simply use Outlook or much mcuhhh better Thunderbird for Mac (yes they do sockets right!) 😉 also... the very nice PostBox, I really love that program 😉


Other solution I never tried is to write a little PHP script that works like this:


1st - Check if the website is online

2nd - If is NOT online keep running, else exit

3rd - Login to cPanel

4th - Kill all IMAP connections


Then place this file in your host, out of the public_html folder (just security) and set up a cron job to run that every 5 minutes... That's a way to go it probably will work fine.... Just check if the PHP still runs after all IMAP connections are used 😉


Have fun 😉

Jul 5, 2011 1:02 PM in response to Csound1

Hi Csound1,


You're true about that, but it's a very high unnecessary server load, in my company we deal with others using Mac Mail and now we've the servers just killing old unused sockets because otherwise we would run out of ports ahah lol


It's really a pain in the *** the server load caused by Mac Mail... 😟 They should really fix that problem....

Nov 27, 2011 9:31 AM in response to badtz

Well, I have always wondered why I have three or four IMAP logins for each user on my Mac OS X Server. This is covered pretty good on a NewGator discussion:


Mac Mail leaves one connection open for each IMAP folder, that is, INBOX, OUTBOX, TRASH, and any custom folders you may have.


So once users started getting iPhones and iPads in addition to their MacBooks, that number increased.


While not a great solution, it explained rather clearly to me what was going on. Hope it helps.



http://support.hostgator.com/articles/specialized-help/email/mac-mail-setup


The text part you want to read:


Too many [email] connections, 500 errors? Here is a fix.


Thunderbird is normally the route I suggest, however the main problem with Mac Mail I've seen is with the IDLE setting, basically this leaves the connection to the server open to check for new messages as soon as they arrive rather than trying to connect every say 5 minutes or so.


NOTE: Before this fix will work, you may need to kill your hanging processes. You can simply ask HostGator to kill all of your current processes.


This link describes the setting and how to change it in Mac Mail: http://email.about.com/od/macosxmail..._imap_idle.htm


And I'll copy the relevant parts here:


To have emails appear instantly in IMAP accounts in Mac OS X Mail:


Select Mail | Preferences... from the menu.

Choose Accounts.

Select the desired IMAP account.

Go to the Advanced tab.

Make sure Use IDLE command if the server supports it.

You can additionally uncheck Include when automatically checking for new mail. Keep in mind that Mac OS X Mail receives instant updates only for the open folder, though.

While this may be the desired affect, to get your emails instantly, Mac Mail leaves one connection open for each IMAP folder, that is, INBOX, OUTBOX, TRASH, and any custom folders you may have.


My simple suggestion: Turn off the IDLE function and set it to check every 5 minutes or longer, and monitor your connections.

Jan 3, 2012 9:23 AM in response to timoto

Has anyone written Apple directly for assistance? My protection plan is no longer good so they want me to pay to get an answer on this. I can't believe it's gone on this long without a resolution. Come on people. My host wants me to delete my IMAP accounts and just foward all my accts to one catch-all gmail acct. How dumb is that? I am the admin to many websites, how unprofessional will it look if I'm responding to inquiries with one generic gmail acct for all of them? There's got to be a resolution other than this and switching hosts, please.

Jan 12, 2012 6:00 AM in response to hoaxnheimer

No Apple solution so far as I'm aware of.


The first thing is to make sure as few emails as possible are in the top level "Inbox". Users need to have their email put into "sub-folders" per project or whatever catagories make sense..


However, when sub-folders with lots of mails are opened the number of IMAP connections rises.


It kind of kills the point of "smart mailboxes" as you end up having to maintain a fixed folder structure and possibly more mail filtering for those that can't be bothered to manually move their mail into sub-folders.


The only way to kill the number of connections from the client end is to quit mail.app and start again.


From the server side connections can be killed with a command that could be put into an automated cron job. However if the users need to access greater numbers of emails on a constant basis, then the problem will not be resolved.

Jan 12, 2012 6:06 AM in response to badtz

Aloha,


i really cannot seriously tell all our employees to restart their mail-clients all the time 🙂


neither i can tell my bosses to user thunderbird or anything else due to the fact, that they spend a lot of money in buying M$ Office licences


In addition i do not have any access to the IMAP Server since its a hosted service.


Since i am very new to this community, does no one from the Apple support team read or comment this kind of conversations?


grtx

Limit Number of IMAP connections to Mail Server ...?

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