On Wed, 2006-09-20 at 18:54 +1000, Simon L Jackson wrote:
Hi,
Is there a way of limiting the number of IMAP connections (i.e. processes) per user?
Despite asking users to set their email client settings to limit themselves to 2 connections, some still have this set to 10 or more.
Unfortunately not. This doesn't really fit into Dovecot's current architecture so it'd require somewhat ugly hacks or larger changes. Nothing in Dovecot keeps track of how many connections a user has.
Hmm. Except you could write a wrapper imap binary, which works something like:
#!/bin/sh
# increase user's connection counter (sql command, or txt file) /usr/local/libexec/dovecot/imap # decrease user's connection counter
Best would be if you stored it in SQL, and then in pass_query you'd fail the connection if the counter was too high (and preferrably also return reason-field which contains some "Too many connections" string).
Or if you can't use SQL, you can just check the connection counter in the script.