My better half told me that she recently started to have trouble getting emails on some of her accounts. I of-course started digging into it, (who wouldn’t ; ) and found out that the email accounts were on the same server, I looked over the courier-imap config an all looked fine:
##NAME: MAXDAEMONS:0
#
# Maximum number of IMAP servers started
#
MAXDAEMONS=40
##NAME: MAXPERIP:0
#
# Maximum number of connections to accept from the same IP address
MAXPERIP=20

It didn’t make much sense to me, since the limits set in the config were fine. So I started to dig a little deeper, and found out that she was running through courier-imap-ssl. I checked the config for courier-imap-ssl and found that non of these settings were set in the ssl config. Now to the really strange part, when running the init scripts that follows in the debian pacakge, the values are taken from the imapd config, so it shouldn’t actually do a different. But I decided to add them with the same values as in the imapd config either way and guess what, it solved the problem. So if you run into the same issue “Maximum connection limit reached for *”, check if you have the correct values in both the imapd and imapd-ssl config. I will try to find out why it does what it does, since logically it makes no sense.
When doing ps faux | grep imapd-ssl you get the same result with and without the lines added to the imapd-ssl config.