How to increase the number of simultaneous IMAP connections in Plesk

Plesk-LogoBy default Plesk sets up the IMAP Email Service on your server so that four simultaneous connections can be made from the same IP address in the same timeframe. This is to protect your servers from too many connections.

This however isn’t cutting it if you have a small office full of people on the same IP, connecting from 4 computers, 16 iphones and 12 iPads every 5 minutes.

The solution: tweak the IMAP configuration file, restart the daemon and have a good life. Let me show you how to do it on Plesk 11 and CentOS 6.4.

The file you’ll want to tweak is called imapd and lives in

/etc/courier-imap/imapd

Log in to your server with root credentials and edit the file with your favourite text editor (like vi). Near the top you’ll find the following lines. They’re not directly underneath each other, but instead are separated by helpful comments to explain what they do:

MAXDAEMONS = 40
MAXPERIP = 4

You may have guessed what these do: the first limits the amount of simultaneous IMAP daemons at the same time, while the second one limits the amount of simultaneous connections from the same IP at the same time. Change them according to your needs: perhaps count the amount of devices/services that connect, then add a few more for good measure.

I’m setting mine to 80 daemons and 20 IP connections like so:

MAXDAEMONS = 80
MAXPERIP = 20

Next we need to restart the IMAP service for the changes to take effect:

service courier-imap restart

Alternatively you can restart the service like this:

/etc/init.d/courier-imap stop
/etc/init.d/courier-imap start

The rest, as they say, is history.

Help! I’ve messed up that file!

Fear not – here’s a clean copy, taken from Plesk 11.0.9 on CentOS 6.4. Just in case:

Further Reading





Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.