[Dovecot] Maildir quota reporting
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I'm little confused with the way dovecot (1.2.4) is reporting quota.
with this config
protocols: imaps ssl: required ssl_ca_file: /root/cert/CA_Bundle_Trans.crt ssl_cert_file: /root/cert/mails.crt ssl_key_file: /root/cert/mails-key.pem.rsa disable_plaintext_auth: yes login_dir: /var/run/dovecot/login login_executable: /usr/libexec/dovecot/imap-login mail_location: maildir:%h/Maildir mail_debug: yes mail_plugins: quota imap_quota lda: postmaster_address: postmaster@example.com mail_plugins: quota cmusieve mail_plugin_dir: /usr/lib/dovecot/lda auth default: mechanisms: plain login passdb: driver: pam userdb: driver: passwd plugin: quota: maildir:User quota quota_rule: ?:storage=20G sieve: ~/.dovecot.sieve
everything works fine. TB says, there 20G quota. Command
echo "1 GETQUOTAROOT INBOX" | USER=foo dovecot --exec-mail imap
reports
- QUOTAROOT "INBOX" "User quota"
- QUOTA "User quota" (STORAGE 0 20971520) 1 OK Getquotaroot completed.
Now I change the first line in foo's maildirsize file to "0S" to allow unlimited quota. Then I boost it's size to force recalculation (just to be sure)
dd if=/dev/zero bs=1k count=6 >> ~foo/Maildir/maildirsize
- From now, TB still reports 20GB quota for user foo, the above "echo" command still reports 20971520, but(!), quota is actually unlimited for user foo.
OK, now I stop dovecot, delete maildirsize, change line in dovecot.conf
quota_rule = ?:storage=0
and start dovecot again. The same result - TB still reports 20GB quota for user foo, the above "echo" command still reports 20971520, but(!), quota is actually unlimited for anyone. When I set some limit in ~foo/Maildir/maildirsize now, same values 20971520) are reported, although the limit works!
Looks like LDA (deliver) works fine, but imap_quota plugin is doing something weird.
Finally, the question ;-) Where does that value (20971520) come from? Is it a feature or a bug?
David Kmoch -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkqfhQoACgkQsUUM+N2AWobj7ACgh3yCU9LVfe1Pp2lO0nBG9iKf zbgAn15UvkVM0AeCxaUlDeYgFu++8TOn =CAoG -----END PGP SIGNATURE-----
On Thu, 2009-09-03 at 10:57 +0200, David Kmoch wrote:
and start dovecot again. The same result - TB still reports 20GB quota for user foo, the above "echo" command still reports 20971520, but(!), quota is actually unlimited for anyone. When I set some limit in ~foo/Maildir/maildirsize now, same values 20971520) are reported, although the limit works!
Something weird is going on. What does it log about quota with mail_debug=yes?
Finally, the question ;-) Where does that value (20971520) come from? Is it a feature or a bug?
It's not a hard coded value for sure. Maybe it's reading a different maildirsize file. Maybe you have quota_rule=*:storage=20G coming from somewhere else.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Thanks for a kick in the right direction ;)
command
echo "1 getquotaroot inbox" | USER=foo dovecot --exec-mail imap
doesn't work as expected
( HOME=/home/foo; USER=foo; echo "1 getquotaroot inbox" | dovecot
- --exec-mail imap )
works much better
Now, with quota_rule = ?:storage=0
and a test user with maildirsize content 102400S:
the above command shows
- PREAUTH [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOG reportsIN-REFERRALS ID ENABLE SORT THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH QUOTA] Logged in as foo
- QUOTAROOT "inbox" "User quota"
- QUOTA "User quota" (STORAGE 0 100) 1 OK Getquotaroot completed.
result of that command in dovecot log with "mail_debug = yes"
ubik IMAP(foo): : Loading modules from directory: /usr/lib/dovecot/imap ubik IMAP(foo): : Module loaded: /usr/lib/dovecot/imap/lib10_quota_plugin.so ubik IMAP(foo): : Module loaded: /usr/lib/dovecot/imap/lib11_imap_quota_plugin.so ubik IMAP(foo): : Effective uid=0, gid=0, home=/home/foo ubik IMAP(foo): : Quota root: name=User quota backend=maildir args= ubik IMAP(foo): : Quota rule: root=User quota mailbox=? bytes=0 messages=0 ubik IMAP(foo): : maildir: data=/home/foo/Maildir ubik IMAP(foo): : maildir++: root=/home/foo/Maildir, index=, control=, inbox=/home/foo/Maildir ubik IMAP(foo): : Namespace : Using permissions from /home/foo/Maildir: mode=0700 gid=-1 ubik IMAP(foo): : Connection closed bytes=21/383
Is it OK, that "bytes=0" is reported?
Timo Sirainen napsal(a):
On Thu, 2009-09-03 at 10:57 +0200, David Kmoch wrote:
and start dovecot again. The same result - TB still reports 20GB quota for user foo, the above "echo" command still reports 20971520, but(!), quota is actually unlimited for anyone. When I set some limit in ~foo/Maildir/maildirsize now, same values 20971520) are reported, although the limit works!
Something weird is going on. What does it log about quota with mail_debug=yes?
Finally, the question ;-) Where does that value (20971520) come from? Is it a feature or a bug?
It's not a hard coded value for sure. Maybe it's reading a different maildirsize file. Maybe you have quota_rule=*:storage=20G coming from somewhere else.
David Kmoch Technical University of Liberec Department of Applied Informatics Halkova 6, 461 17 Liberec
tel: +420 485 353 633 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkq3SPoACgkQsUUM+N2AWobH6QCcCj/nvlWidqmf6h+tyYNo90cN EigAnjLMK82jF8ysCyQ0tlblVpRPH1DQ =s1V3 -----END PGP SIGNATURE-----
participants (2)
-
David Kmoch
-
Timo Sirainen