Courier imap connections limit error

To fix courier-imap connections limit errors like shown below:

e-mail client imap connection error

Thunderbird
Unable to connect to your IMAP server. You may have exceeded the maximum number of connections to this server. If so, use the Advanced IMAP Server Settings dialog to reduce the number of cached connections.

Edit configuration file /etc/courier-imap/imapd parameters:

  • MAXDAEMONS=40
  • MAXPERIP=4

Restart courier-imap service.