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.
You can tell iptables to only allow each IP address to connect once to port 110. There are a couple of disadvantages to that:
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.