On Wed, May 09, 2012 at 10:39:17PM +0100, Tim wrote:
Thanks Leon
I changed my SQL to the following after trying a few combinations:
user_query = SELECT maildir, 5000 as uid, 5000 as gid,concat('maildir:bytes=',quota) as quota FROM virtual_mailbox WHERE username = '%u'
Try the above but with quota changed to quota_rule:
user_query = SELECT maildir, 5000 as uid, 5000 as gid,maildir:bytes=1 as quota_rule FROM virtual_mailbox WHERE username = '%u'
And also have at least something like
plugin { quota = maildir:User quota }
You could also do
plugin { quota = maildir:User quota quota_rule = *:storage=1 }
to have the quota_rule fixed in dovecot.conf and then only
user_query = SELECT maildir, 5000 as uid, 5000 as gid FROM virtual_mailbox WHERE username = '%u'
as query.
I don't have my users in mysql though so other will probably have more insights.
HTH, Leon
It seems that Dovecot didn't understand the * backend for some reason (even though it's mentioned in the documentation)
and my logs now seem to picking up on this
May 09 22:29:09 IMAP(test@example.com): Info: Effective uid=mailuser, gid=mailgroup, home=(none) May 09 22:29:09 IMAP(test@example.com): Info: Quota root: name=bytes=1 backend=maildir args=
But the address in question is still receiving mail - should I be doing something additional to cease mail delivery?
Thanks in advance!
Tim
On Tue, 2012-05-08 at 22:12 +0200, Leon Meßner wrote:
On Tue, May 08, 2012 at 01:59:38AM -0700, tcsmith1978 wrote:
Hello,
I have been looking at enforcing quotas for users of my mail system (postfix and Dovecot v1.2). Have tried to follow a few tuts on the web but its not having the desired effect. Essentially I can still send and receive mail on an account that I believe has had its quota exceeded.
In my main.cf, I have:
userdb sql { args = /etc/dovecot/mysql/dovecot-mysql.conf } passdb sql { args = /etc/dovecot/mysql/dovecot-mysql.conf }
and...
protocol lda { mail_plugins = quota }
protocol imap { mail_plugins = quota imap_quota }
plugin { quota_exceeded_message = You have exceeded the maximum quota for your mailbox }
the dovecot sql (mysql) file has the following query for pulling out user ids and quotas etc:
user_query = SELECT maildir, mymailuser as uid, mymailgroup as gid,concat('maildir:storage=',quota) as quota FROM virtual_mailbox WHERE username = '%u'
I have set one of my users to have a quota of 1 (so one byte I believe) so it should be over the limit pretty much immedisoemately.
Looking at the logs I can see that the system is picking up on the quota limit but doesn't seem to enforce it.
Apr 27 10:29:02 deliver(test@testdomain.com): Info: auth input: quota=maildir:storage=1 Apr 27 10:29:02 deliver(test@testdomain.com): Info: Quota root: name=storage=1 backend=maildir args=
Any ideas? Am i missing something?
i would try something like in the wiki: plugin { quota = maildir:User quota quota_exceeded_message = You have exceeded }
Never used mysql for userdb or passdb though. Perhaps this would work:
user_query = SELECT maildir, mymailuser as uid, mymailgroup as gid,concat('*:storage=',quota) as quota_rule FROM virtual_mailbox WHERE username = '%u
-- View this message in context: http://old.nabble.com/Enforcing-Dovecot-Quotas-tp33763561p33763561.html Sent from the Dovecot mailing list archive at Nabble.com.
-- Tim tcsmith1978@googlemail.com