[Dovecot] Quota plugin rewrite
Backported from CVS HEAD to branch_1_0. You can get it as a patch from http://dovecot.org/patches/1.0/quota-rewrite.diff
New features include support for multiple quota roots, so you could have eg. per-user quota and a larger domain quota (although no backend actually supports this yet..).
The more important feature is that you can configure specific mailboxes to have a bit more space available for them, such as Trash or Spam. The configuration has also changed. Normally you'd use something like this:
quota = maildir # 1GB quota in general quota_rule = *:storage=1048576 # Trash mailbox gets 100MB more (so max. 1,1GB) quota_rule2 = Trash:storage=102400 # Spam mailbox gets also +100MB (still maxes at 1,1GB, not 1,2GB) quota_rule3 = Spam:storage=102400
You can place all the above into plugin { .. } section in dovecot.conf. In userdb if users have different quotas you'd then need to override only quota_rule (not quota, quota_rule2 and quota_rule3).
I tested quickly that this seemed to work as described above. Please test and report. :)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
hi timo,
Backported from CVS HEAD to branch_1_0. You can get it as a patch from http://dovecot.org/patches/1.0/quota-rewrite.diff
New features include support for multiple quota roots, so you could have eg. per-user quota and a larger domain quota (although no backend actually supports this yet..).
...
I tested quickly that this seemed to work as described above. Please test and report. :)
do i understand correctly that _this_ (in dovecot.conf) is the way, now, to specify per-user quota, _rather_ than in, e.g., userdb static { spec?
richard
/"
\ / ASCII Ribbon Campaign
X against HTML email, vCards
/ \ & micro$oft attachments
[GPG] OpenMacNews at gmail dot com fingerprint: 50C9 1C46 2F8F DE42 2EDB D460 95F7 DDBD 3671 08C6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin)
iEYEARECAAYFAkUJkoYACgkQlffdvTZxCMYecQCgsXIniFG6yaSWop/BjYz8yF4K 7AwAnjxZozTlOPEUgxc2dgzelHOKfdop =VJXs -----END PGP SIGNATURE-----
hi,
-- On September 14, 2006 3:31:54 PM +0300 Timo Sirainen tss@iki.fi wrote:
In userdb if users have different quotas you'd then need to override only quota_rule (not quota, quota_rule2 and quota_rule3).
could you please provide a specific example of the format for per-user quota override in a static userdb? (the wiki has example just for sql query ...)
i've tried a number of various formats suggested @ wiki & @ list, and have been, to date, unable to override the setting from the global conf file. no errors fire, simply no change is accepted.
thanks,
richard
--
/"
\ / ASCII Ribbon Campaign
X against HTML email, vCards
/ \ & micro$oft attachments
[GPG] OpenMacNews at gmail dot com fingerprint: 50C9 1C46 2F8F DE42 2EDB D460 95F7 DDBD 3671 08C6
On Fri, 2006-09-22 at 06:52 -0700, OpenMacNews wrote:
hi,
-- On September 14, 2006 3:31:54 PM +0300 Timo Sirainen tss@iki.fi wrote:
In userdb if users have different quotas you'd then need to override only quota_rule (not quota, quota_rule2 and quota_rule3).
could you please provide a specific example of the format for per-user quota override in a static userdb? (the wiki has example just for sql query ...)
Umm.. With static userdb all the users have the exact same settings. Where could it even get the per-user quota then? Sounds like you'd want to user passwd-file as the userdb, or maybe checkpassword as passdb +userdb, or anything but static userdb..
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
- -- On September 22, 2006 5:08:34 PM +0300 Timo Sirainen tss@iki.fi wrote:
On Fri, 2006-09-22 at 06:52 -0700, OpenMacNews wrote:
hi,
-- On September 14, 2006 3:31:54 PM +0300 Timo Sirainen tss@iki.fi wrote:
In userdb if users have different quotas you'd then need to override only quota_rule (not quota, quota_rule2 and quota_rule3).
could you please provide a specific example of the format for per-user quota override in a static userdb? (the wiki has example just for sql query ...)
Umm.. With static userdb all the users have the exact same settings. Where could it even get the per-user quota then? Sounds like you'd want to user passwd-file as the userdb, or maybe checkpassword as passdb +userdb, or anything but static userdb..
this approach is what has been repeatedly suggested to me, given my use ONLY of virtual users (hence, the static userdb)
also,
@ http://wiki.dovecot.org/Quota "The above example shows how to set the same quota globally for everyone. You can override this for one or all users by returning a quota field from the user database. See UserDatabase for more information about how to set them for the user database you are using. "
and, @ http://wiki.dovecot.org/UserDatabase "Currently supported user databases are: ..."
implies, to my read, that _all_ userdb types are 'supported' for quota overrides.
atm, in my 'dovecot.conf':
... protocol lda { ... mail_plugins = quota cmusieve mail_plugin_dir = /usr/local/dovecot-plugins/lda plugin { quota = maildir:storage=10240 # 10 MB quota limit } } ... auth default { ... passdb passwd-file { args = /var/Mail/USERS/imap_user_file } userdb static { args = static uid=301 gid=301 home=/var/Mail/Domains/%d/Accounts/%n nice=10 } }
and, in '/var/Mail/USERS/imap_user_file':
testuser1@mydomain.com:{PLAIN}testpass1::::::quota=maildir:storage=4096
testuser2@mydomain.com:{PLAIN}testpass2::::::quota=maildir:storage=2048
are you, instead, instructing that i need to replace:
userdb static { args = static uid=301 gid=301 home=/var/Mail/Domains/%d/Accounts/%n nice=10 }
with:
userdb passwd-file { args = /var/Mail/USERS/imap_user_file }
?
and redundantly state the identical uid/gid/home for each entry in the userdb passwd-file, in order to get per-user quota overrides?
thanks,
richard
/"
\ / ASCII Ribbon Campaign
X against HTML email, vCards
/ \ & micro$oft attachments
[GPG] OpenMacNews at gmail dot com fingerprint: 50C9 1C46 2F8F DE42 2EDB D460 95F7 DDBD 3671 08C6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin)
iEYEARECAAYFAkUT81UACgkQlffdvTZxCMa4zQCgskVsew4WqIvmvr9vDJORUzLP iUEAoLuVbpVYtSHMsXTTHb2hl4zeKjc/ =RPVK -----END PGP SIGNATURE-----
On Fri, 2006-09-22 at 07:29 -0700, OpenMacNews wrote:
@ http://wiki.dovecot.org/Quota "The above example shows how to set the same quota globally for everyone. You can override this for one or all users by returning a quota field from the user database. See UserDatabase for more information about how to set them for the user database you are using. "
and, @ http://wiki.dovecot.org/UserDatabase "Currently supported user databases are: ..."
implies, to my read, that _all_ userdb types are 'supported' for quota overrides.
Sure, you can override the quota in also static userdb, as long as you can figure out a way to do that with the possible %variables. For example you could set quota=%p which would override the quota and set it to same as the current process ID. Not very useful though ;)
passdb passwd-file { args = /var/Mail/USERS/imap_user_file } userdb static { args = static uid=301 gid=301 home=/var/Mail/Domains/%d/Accounts/%n nice=10 } }
and, in '/var/Mail/USERS/imap_user_file':
testuser1@mydomain.com:{PLAIN}testpass1::::::quota=maildir:storage=4096 testuser2@mydomain.com:{PLAIN}testpass2::::::quota=maildir:storage=2048
Ah, since you're using passwd-file as the passdb, it should be possible to do it this way. Just change quota to userdb_quota.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
hi timo,
and, in '/var/Mail/USERS/imap_user_file':
testuser1@mydomain.com:{PLAIN}testpass1::::::quota=maildir:storage= 4096 testuser2@mydomain.com:{PLAIN}testpass2::::::quota=maildir:storage= 2048
Ah, since you're using passwd-file as the passdb, it should be possible to do it this way. Just change quota to userdb_quota.
per suggestion, i've changed to:
testuser1@mydomain.com:{PLAIN}testpass1::::::userdb_quota=maildir:storag e=4096 testuser2@mydomain.com:{PLAIN}testpass2::::::userdb_quota=maildir:storag e=2048
and restarted.
alas, the quota overrides are STILL ignored ... i'm still getting quota, e.g. of INBOX, as that set in the global dovecot.conf file.
thx,
richard
/"
\ / ASCII Ribbon Campaign
X against HTML email, vCards
/ \ & micro$oft attachments
[GPG] OpenMacNews at gmail dot com fingerprint: 50C9 1C46 2F8F DE42 2EDB D460 95F7 DDBD 3671 08C6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin)
iEYEARECAAYFAkUcDG8ACgkQlffdvTZxCMZ/oACgxgOrhnRhi34cbF3i1LBAgjh8 tGcAoMNbg6pFFpeYP4xwi7scZgN7M+/R =xPn6 -----END PGP SIGNATURE-----
participants (2)
-
OpenMacNews
-
Timo Sirainen