Inert Ramblings

Everything worth saying has already been said…

Add more Courier-IMAP connections under Plesk

By default, UNIX-based servers running Plesk and the Courier-IMAP e-mail server drastically limit the number of inbound connections to prevent users from opening up too many concurrent sessions. Unfortunately, this artificially-low restriction can impact legitimate users who have multiple computers connecting to the Courier-IMAP server from behind a firewall or a single computer that runs an IMAP client that takes advantage of mailbox caching.

Plesk comes configured with a limit of 4 connections per IP address and a limit of 40 connections total. Modern IMAP clients such as Mozilla Thunderbird use mailbox caching to open up multiple connections to increase performance. In the case of Thunderbird, it opens up 5 connections by default which is already 1 connection more than Courier-IMAP’s default restriction. Add another few family or corporate computers behind a firewall and those additional users won’t be able to connect at all since a single Thunderbird client is already utilizing all 4 connections.

To increase this restriction, modify the /etc/courier-imap/imapd configuration file and change MAXDAEMONS and MAXPERIP to a more sane number. In the case of my configuration, I changed MAXDAEMONS from 40 to 80 and MAXPERIP from 4 to 40. This allows all the machines behind my home firewall to connect to multiple accounts on the e-mail server with mailbox caching enabled.

But even those numbers may be too low for a corporate colocated server that services an entire company. Tweak those numbers based on your employee base; if 50 employees are connecting to the e-mail server from behind the same firewall then MAXPERIP could need to go as high as 250 (50 employees times 5 cached mailbox connections). Add e-mail clients of people working from home and MAXDAEMONS could go as high as 300 or 400.

Obviously, the connection limits are to prevent the Courier-IMAP server from using too many memory and CPU resources on the machine. Tweak the numbers based on the memory footprint of each daemon process and how much memory you have.

September 22, 2006 - Posted by Sciri | Gnus, IDTENT | | 18 Comments

18 Comments »

  1. I was not aware of Plesk’s oddly low default settings. I mean until I started getting errors in Thunderbird about connection caching and then googled this post ;) Thanks for the great post!

    -Joel

    Comment by Joel | October 11, 2006

  2. [...] BTW, here’s the fix for increasing Plesk’s default Courier-IMAP connections. I was receiving the following error in Thunderbird 1.5.0.7 on XP: [...]

    Pingback by Joel Mama’s Blog » Plesk Courier-IMAP connections/I love the internet | October 11, 2006

  3. [...] from: http://www.inertramblings.com/2006/09/22/add-more-courier-imap-connections-under-plesk/ Plesk comes configured with a limit of 4 connections per IP address and a limit of 40 connections total. Modern IMAP clients such as Mozilla Thunderbird use mailbox caching to open up multiple connections to increase performance. In the case of Thunderbird, it opens up 5 connections by default which is already 1 connection more than Courier-IMAP’s default restriction. Add another few family or corporate computers behind a firewall and those additional users won’t be able to connect at all since a single Thunderbird client is already utilizing all 4 connections. [...]

    Pingback by Interversal Blog » Blog Archive » Useful commands on plesk | December 15, 2006

  4. Thanks a lot for the tip! Apple Mail.app has severe problems with just 4 connections, so this saved my day!

    Comment by Oscar | January 9, 2007

  5. It also makes sense to check the authdaemonrc options. Too few daemons can be another bottleneck–but of course, when configuring settings, tweak and balance for the particular system’s resources and other services.

    Comment by Central-B | January 11, 2007

  6. Thanks a ton for the info! I found it pretty strange that the settings weren’t working for me at work, since relatively few people are using IMAP here. Things make a lot more sense after looking at the configuration file that’s set so low.

    Comment by VC | May 16, 2007

  7. [...] In principe heeft plesk een limiet van 4 imap connecties, dus 2 zou ook goed moeten gaan (tenzij outlook ze niet goed afsluiten of open houdt). Je kan bij wijze van test dit aantal ophogen om te kijken of dit het probleem is? linkje. [...]

    Pingback by Imap - mail server - webhostingtalk.nl | June 2, 2007

  8. What a great post - thanks. I just got a (dv) hosting account from Media Temple and was wondering why Apple Mail was throwing lots of errors. I think for this to work though I had to restart the courier server with:
    /etc/init.d/courier-imap restart

    Thanks
    Ben

    Comment by Ben Vallack | September 15, 2007

  9. [...] Google und joelmama.com stiess ich auf inertramblings.com auf dessen die Lösung für mein Problem [...]

    Pingback by stefanpausch.com » Blog Archive » Tutorkial: Plesk + Imap + Thunderbird = “Maximale Verbindungen erreicht” | September 24, 2007

  10. [...] permalink Falls es noch akut ist, hatte auch das Problem. Das hier hat geholfen: Inert Ramblings » Blog Archive » Add more Courier-IMAP connections under Plesk [...]

    Pingback by IMAP und Outlook - Server Support Forum | October 16, 2007

  11. Thanks for the infos… hope this will help me too… Got the problem now since a long time and it’s making me sick!!

    Comment by houserocker | January 25, 2008

  12. You just stopped me from pulling all my hair out. Thanks!

    Comment by Nick | March 14, 2008

  13. Very useful post. Thanks!

    Comment by Max | April 13, 2008

  14. Thank you so much for figuring this out. I want to love Plesk, but I keep bumping into these kind of stupid issues with their software.

    Comment by Joe | April 27, 2008

  15. This saved my day, too - Apple Mail was driving me insane. ;-)

    Comment by Boris | June 19, 2008

  16. great tip. Works. God knows why tech support at theplanet did not tell me this. They said to add a gig of ram, which surprise surprise did not work, but costs $20 a month extra.

    Comment by mark brown | June 30, 2008

  17. Also wasn’t aware of the low default settings. The above poster shows how little calldesks ever know. They tend to just dish out advice from sucking their thumb, but they never do their research. If they (at least) Googled the problem they probably would have found this post or details about the default settings. Rather, they just opted for the easy option. Quite typical of calldesks.

    Comment by online shopping | July 24, 2008

  18. Eggggscelent

    Comment by imapper | October 2, 2008

Leave a comment