By default, Linux based servers running Plesk and the Courier-IMAP 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. 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

On the server login to shell (root access needed) then edit the following configuration file:

vi /etc/courier-imap/imapd

You should see something like this:

##NAME: MAXDAEMONS:0
#
#  Maximum number of IMAP servers started
#
#
# DEFAULT SETTING from /etc/courier-imap/imapd.dist:
#
#MAXDAEMONS=40
#

MAXDAEMONS=40

##NAME: MAXPERIP:0
#
#  Maximum number of connections to accept from the same IP address
#
# DEFAULT SETTING from /etc/courier-imap/imapd.dist:
#
#MAXPERIP=4
#

MAXPERIP=4

Search for MAXPERIP and MAXDAEMONS and increase the corresponding figure.

In the case of my configuration, I could changed MAXDAEMONS from 40 to 80 and MAXPERIP from 4 to 40. This allows all the machines behind my firewall to connect to multiple accounts on the e-mail server with mailbox caching enabled.

Remember to restart the IMAP service

service courier-imap restart

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.

Related Posts

  1. SSL certs for POP3, IMAP and SMTP on Plesk
  2. Increase maximum number of addesses that can be added to the Spamassassin White or Black list
  3. PCI Compliance for Plesk (linux)
  4. Your folder could not be created: the IMAP server refused to create it
  5. How to configure Microsoft IIS to not accept SSLv2 connections