Simon L Jackson
2006-Sep-20 08:54 UTC
[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 at carringbush.net <mailto:simon.jackson at 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 +- -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://dovecot.org/pipermail/dovecot/attachments/20060920/5e926328/attachment-0001.html>
Timo Sirainen
2006-Sep-22 15:04 UTC
[Dovecot] Limiting number of IMAP connections per user
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. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20060922/5d0dc456/attachment.bin>