Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to limit the number of concurrent connections to a POP3 mailbox on a Dovecot server?

The current situation is that if two clients connect to the same mailbox, then the server accepts both connections, but only one can run commands on the server (like LIST, RETR, etc). If you try to use of one these commands from the second connection, it will be locked until the first one disconnects.

I was wondering if there is a way to make the server refuse the second connection.

share|improve this question
Did you try setting "mail_max_userip_connections = 1"? – Khaled Nov 19 '10 at 11:38
How about using IMAP instead? – grawity Nov 19 '10 at 14:05
@Khaled -- to my best understanding, this will only restrict multiple connections from the same IP. I need it to block across many addresses. – arikfr Nov 19 '10 at 14:54
@grawity - I don't control all the elements of the setup, therefore restricted to only POP3. – arikfr Nov 19 '10 at 14:55

You can tell iptables to only allow each IP address to connect once to port 110. There are a couple of disadvantages to that:

  1. That stops a client accessing more than one mailbox;
  2. That might stop badly written clients who don't close old connections from making new connections, if they won't clear up their mess. I'm guessing this means that maybe you don't want what you think you want.

If you're worried about lots of idle pop3-login processes cluttering up your process space, I recommend having cron periodically issue a HUP to the master dovecot process. It doesn't sound like the right thing, but it's clean enough.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.