How can I fix an error with too many IMAP connections in Mac Mail?


robre
Asked:
2012-02-04 7:48 pm EST

Hits: 5,515
So, basically I found out the hard way today, two days after transferring my mail and websites to you guys, that for "business class" hosting there is a user connection limit for email?

I have 8 employees in my small business with two websites and each user has a 2 or 3 imap email accounts hosted, so at any one time I'll need to have 8 mail browsers open on the network seeking to connect to about 25 mail accounts. On our previous mail server (Xserve running OSX Server) this was no problem. Not so with inmotion "business class."

With inmotion, if I have more than 4 or so mail browsers open (total of about 10-12 email accounts), anyone else is shut out and the inmotion mailserver will refuse the connection.

After three unhelpful calls to customer service today, I basically figured this out on my own and when I told the customer service rep was advised I had to upgrade to a VPS, which I reluctantly agreed to do.

Not happy. Hoping I can get this running before Monday when everyone shows up and wants to check their mail . . .


EDIT: Same issue with or without SSL imap

You must login before you can ask a follow up question.

You must login before you can submit an answer.

Curious if you ever got resolution to this issue. Been having an array of issues around the "too many connections" problem, including but not limited to being unable to send / receive emails because of the connection limits, as well as having different devices using the same accounts not syncing properly to imap, to a proliferation of draft emails.

Here are some of the things we worked out:
- Regarding too many connections. IMH staff repeatedly suggested switching email clients -- to Thunderbird, for instance. Tried this. It seemed to reduce the number of connections, but the problem remained. Tried limiting the number of accounts in use. This also helped but didn't resolve the problem.

IMH team's often-repeated advice to turn off IDLE in the Apple Mail settings did NOT resolve the problem, and in fact, for us, created an additional ones: Apple Mail stopped syncing properly to the IMAP server. We actually dared to turn IDLE back on. That reduced the number of sync issues but didn't eliminate them. We quit and relaunch mail whenever there seems to arise a sync problem, and this, temporarily resolves the problem.

Best solution so far was to create php script to run, on a once-per-minute interval, a couple of unix commands. The first command "ps aux | grep imapd" gets a listing of all your currently open IMAP connections. That listing includes, among other things, a PID (process id) for each of those connections and a timestamp representing when it was opened. For each connection older than, say, 2 minutes, run a second unix command "kill -9 [pid#]" to kill those IMAP old, unnecessary connections. My understanding is you cannot run these commands through Terminal (Mac) or as a cron job; IMH doesn't permit it on shared hosting, because the "kill" command risks compromising other customers. So by instead running the commands via a PHP script, your kills are limited to your account only.

Caveats: Requires having an available computer that can sit around doing this 24/7. Also, for IMAP processes that take a long time -- e.g. sending or receiving a huge file or moving large numbers of emails off the server to a local archive -- the per-minute connection kills above could cause a problem, so consider this solution with caution. So far it's been a pretty good hack for our purposes. (3 people, 8 total email accounts, 2-3 devices each)

The other solution -- upgrading to VPS -- we have not tried yet.
Trillion
3 Points
2014-11-09 03:16 pm EST

OTHER ANSWERS

0

Tim S.
Staff
9,967 Points
2012-02-06 10:35 am EST
Hi robre,

Thanks for posting your question. I'm more than happy to assist you today. Please keep us updated on your progress. We've seen this issue, specifically with Mac Mail. It has to do how Mac Mail handles idle connections and opens connections for individual mail. You'll want to make sure to disable the imap idle setting in mac mail.

Also, it may help if you change the frequency in which Mac Mail checks the server for new mail. Also, switching to POP3 would resolve the issue, as the email would be downloaded and stored on the local computer.

I did want to take the time to explain the issue a little further using a post office analogy. POP3 email is like you going to the post office once, and getting the mail. The post office (the server in this example) only has that mail until you pick it up. Once you have picked it up, it's no longer at the post office.

IMAP, is like you having a post office box at the post office (again this is the server). It would be like you going to the post office, opening the PO Box, reading your mail, and putting it back into the PO box, for storage. The mail is still on the server or post office.

Now, what's happening in your case, is you have multiple users trying to stick their hands in the post office box all at once and get the mail. If one user has all their hands on all the mail, at one time, it makes it harder for others to access the mail.

With that being said, have you thought about setting up email forwarders and having the specific emails you need to check to forward to one email account. That way, you don't need to have 25 mail accounts open at once. Emails would be forwarded to the appropriate person/ people and they would check the one account. This would reduce the number of IMAP connections, and be easier to manage.

I hope this helps! If you need further assistance please feel free to contact us.

Thanks!

Tim S

You must login before you can post a comment about this answer.

0

johnpaulb-imhs1
Staff
10,994 Points
2014-11-10 10:32 am EST
Hello Trillian,

Thank you for your question. Unfortunately, we've seen some problems with the way that Apple's Mac Mail handles this function of the IMAP protocol, it seems to leave open multiple IMAP connections instead of just one and over time they can pile up and become problematic.

If you are experiencing problems, I recommend Disabling IMAP Idle in Mac Mail.

If you have any further questions feel free to post them below.

Thank you,
John-Paul

You must login before you can post a comment about this answer.

Thanks John-Paul, there are a couple of problems associated with IMH's suggestion of disabling the IDLE feature in Apple Mail.

1 - It doesn't solve the problem. Even with IDLE turned off, Apple mail on IMH leaves open multiple connections. In fact, even changing mail clients -- in our case to Thunderbird, those connections remain open.
2 - It introduces at new problems. a) With IDLE disables IMAP accounts don't sync properly. In other words, emails that are sent or received on a different device, say mobile phone or tablet, aren't seen in Apple Mail even running a "Get Mail" command. b) When composing a new email draft copies of that email pile up in the drafts mailbox. Ordinarily, while composing, drafts on the server are updated and replaced every few seconds. But with IDLE off they pile up in succession, each one representing the latest changes to the email being composed. By turning doing exactly the opposite of IMH's stated policy -- turning ON IDLE -- those problems were resolved.

Here's a challenge for IMH: We've got IMAP accounts on the same computers, using the same email clients on different hosting providers. We don't have any of these problems with those hosting providers. That suggests 1) This is not a solely a problem caused by Apple Mail; 2) It's not a problem with our computers; 3) It is an issue that can be resolve by the hosting provider.

Would be great if you could look into this issue in greater detail.
Trillion
3 Points
2014-11-11 1:33 pm EST
Hello Trillion,

Thank you for contacting us. Keep in mind every device you connect to your email, creates additional IMAP connections. Unlike Mac mail, Thunderbird has the ability to limit the "Maximum number of server connections to cache." This stops Thunderbird from exceeding a specified amount of connections.

With IMAP, the emails and folders are stored on the server, so each client should see the same thing. Ensure you are subscribed to the IMAP folders in Mac Mail, and also setup the Sent folder. This allows you to view and access/folders on the mail server, and save sent emails to the server.

Shared server environments have limitations due to the nature of the shared resources. This is to protect the performance of everyone's website and email on the server.

Shared Hosting is very similar to living in an Apartment Complex. All residents are in the same location and must share the available resources with everyone - such as the pool, parking lot, and play ground. In shared hosting, all accounts (sites) must share the available resources with all the other accounts on the server - such as CPU time, memory, and disk space.

If you have any further questions, feel free to post them below.

Thank you,
John-Paul
johnpaulb-imhs1
10,994 Points
Staff
2014-11-11 2:40 pm EST
Like this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!