Email – too many connections or connection timed out

Posted by James Brindle on March 2, 2011.

Are you getting “too many connections” or “connection to the server timed out” errors in your email client?  Are you scratching your head or losing sleep over this issue? Is your boss constantly ringing you and you can hear the sighs from the users and you just don’t have an answer?

That was me for the last couple of weeks with one client.  I’ve been helping stage migration to IMAP folders instead of the traditional POP3 mailboxes that most people use.  They’re a better way of being resilient and are more software independent as the message is kept on the server instead of on your PC.

Because of the way this client is structured, a blanket change wasn’t going to be possible so it’s been a slow process to get people over to the new system.

On and off we’ve been experiencing problems with timeouts and connections and of course, ambiguous errors that Outlook produces when there’s a problem.

As frustration grows, you look to more and more obscure methods of resolving a problem – the Sherlock Holmes support methodology and as a last ditch attempt, I recommended that a particular user should start using Thunderbird instead of Outlook.  They’re considering moving to it anyway as they have Mac’s, Windows and Linux users to support so a client that was available for all operating systems was seen as a good idea.

I’d just completed the labour of creating the accounts for one user and everything seemed working when there was an exclamation – “too many connections” – suicide was a consideration here I can assure you, however, they hadn’t paid last month’s invoice at this point so they weren’t getting away with it that easily.

At least “too many connections” tells me something so I did a google search and found this page on somebody else’s blog explaining what was going on and how to fix it.

I’ll not regugitate the article here but the meat and potatoes of it is that there were too many client connections from a single IP which i’ll explain the problem below.

In your office you probably have multiple computers with multiple email accounts on each PC, especially if you want to have personal and departmental shared email (ie john.doe@company.com and accountsdept@company.com) and want to reply individually.

Even though each computer gets an IP address of its own on your network, when your computers reach the internet, they are all one IP address that your broadband provider gives you so when connecting to your incoming mail server you are several connections from the same IP address from its perspective.

This issue may lie with other IMAP mail servers as well but specifically they use Courier-IMAP to store and retrieve the emails.  This software has a limit on the number of connections from a single address which the default is just 20.

The problem here when you analyse it is they have 20 workstations and some have at least 5 mailboxes, well even if each had one mailbox you’d be on the limit very quickly.

The solution – up the limit – what’s that I hear you cry?  Where’s your planning?  Where’s your sense of capacity etc?  Unfortunately this isn’t that practical in this case, you’ve just got to bite the bullet and do it.

The magic file is /etc/courier/imapd on a standard installation of Courier-IMAP, you edit the MAXDAEMONS and MAXPERIP lines as appropriate – more specifically the latter.

I’ve set theirs to 128 which will give some spare capacity for now and hopefully this will clear the problem.

About the Author

James Brindle is a freelance technology consultant based in Blackburn, Lancashire with over 20 years of experience in the IT, Media and Telecommunications industries with specialties in Web and Mobile Application development, Voice over IP (VoIP) deployment and integration, media storage and distribution systems and wide area solutions. He has a passion for retro gaming and volunteers as a presenter and acts as vice-chairman of Blackburn's Hospital Radio service.

Share Our Posts

  • Delicious
  • Digg
  • Newsvine
  • RSS
  • StumbleUpon
  • Technorati

Comments

There are no comments on this entry.

Trackbacks

There are no trackbacks on this entry

Add a Comment

You must be logged in to post a comment.