Dovecot: "Warning: service(imap-login): process_limit reached, client connections are being dropped"

I've been seeing this warning in the last few months, when my email client is unable to connect to our dovecot IMAP server.

Warning: service(imap-login): process_limit reached, client connections are being dropped

Googling this I've seen suggestions to just up the limit (currently it's set to 144). Also a suggestion that some email clients using IMAP IDLE are holding open connections too long, so I should break the connection after 30 minutes.

Should I do one or both?


Dovecot have two modes for login-services.

First is "secure mode". Each connection processed by separate instance of pop/imap-login that is persistent until client disconnects. There is limit for maximum concurrent connection and if it is exhausted new connections will be refused because of process_limit reached.

Second is the "performance mode". All connections processed by single instance that hasn't limits. Have to say that performance mode not so insecure as you can suppose, but rather "secure mode" is "supersecure".

If you got the message you can increase process_limit or switch login to performance mode:

service imap-login {
  inet_listener imap {
    port        = 143
  }
  service_count = 0 # performance mode. set to 1 for secure mode
  process_min_avail = 1
}