courier-imap

Disabling IDLE in courier-imap

Apple and BlackBerry email clients has a configurable setting to use the IMAP IDLE functionality to stay logged in, periodically checking email. This causes imapd to run out of daemons and stop responding. One solution is to raise MAXDAEMONS in /etc/courier-imap/imapd, but will eventually cause high loads on the server.

The better solution is to disable IDLE entirely in /etc/courier-imap/imapd by removing "IDLE" option from "IMAP_CAPABILITY".

Change:

IMAP_CAPABILITY="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE"

To:

IMAP_CAPABILITY="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA"

Upon courier-imap restart, this should prevent connections from persisting.

Telnet to imap port 143 to verify that the IDLE option is not present anymore in CAPABILITY response from the server.

Plesk courier-imap imapd on port 143 fails

After Plesk upgrade to 9.5.4, imapd on port 143 did not come up.

On checking the maillog, it was complaining about:

imapd: Invalid -maxprocsarg option.
imapd-ssl: Invalid -maxprocsarg option.

I noticed /etc/courier-imap/imapd had both the below lines commented:

#MAXDAEMONS=40
#MAXPERIP=4

Once I uncommented those values, I was able to get the imap listener up upon a `service courier-imap restart`.

Plesk imap connections limit

By default Plesk IMAP maximum connections per IP is set to 4. If you are using an email client that checks multiple mailboxes, this limit is easily reached.

To increase the limit, edit "/etc/courier-imap/imapd":

MAXDAEMONS=80
MAXPERIP=40

Comment