[Dovecot] Limiting number of IMAP connections per user
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.
Cheers
-- Simon L Jackson Carringbush.Net
+- Carringbush.Net Hosting * Development * Advice
Web: www.carringbush.net <http://www.carringbush.net/> Email: simon.jackson@carringbush.net <mailto:simon.jackson@carringbush.net>
Office: +61 3 9411 4400 Support: +61 3 9411 4444 Fax: +61 3 9411 4499
Level 1 15 Bedford Street Collingwood VIC 3066 Australia
P.O. Box 1464 Collingwood VIC 3066 Australia +-
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.
participants (2)
-
Simon L Jackson
-
Timo Sirainen