[Dovecot] get maildir current quota usage from external program
Hello,
i want to get the maildir current quota usage of an user, but i'd know what is the better way to do.
in imap clients my quota usage, in example, show: 505KB, but if i sum only the size of each message from Maildir, i get total: 440KB, trying to use real and apparent block size but the sum differs from value showed in imap client.
is quota usage based on why, have another way to do this?
thanks
Hi!
I am also trying to write a php application to display the quota usage using the dict quota values stored in te quota MySql table but I cannot understand how to interprete the values in the table because some of them are <0 !
mysql> select * from quota; +------------------------+----------------+-------------+ | username | path | current | +------------------------+----------------+-------------+ | mlattari | quota/storage | -6976 | | mlattari | quota/messages | -3 | | llattari | quota/storage | -2147483648 | | llattari | quota/messages | -874 | | mlattari_archivum_imap | quota/storage | 282475 | | mlattari_archivum_imap | quota/messages | 5 | | agnieszka | quota/storage | -2610 | | agnieszka | quota/messages | -1 | +------------------------+----------------+-------------+ 8 rows in set (0.00 sec)
best regards
michael
On Fri, 2009-01-23 at 10:42 -0200, Allison Vollmann wrote:
Hello,
i want to get the maildir current quota usage of an user, but i'd know what is the better way to do.
in imap clients my quota usage, in example, show: 505KB, but if i sum only the size of each message from Maildir, i get total: 440KB, trying to use real and apparent block size but the sum differs from value showed in imap client.
is quota usage based on why, have another way to do this?
Dovecot counts quota using messages' real sizes in bytes. You could detect if Dovecot has done a miscalculation somewhere by deleting maildirsize file and seeing if it's still the same after recalculation.
Anyway one possibility of getting the quota is just to log in and get the quota. For example you could set up a master user (see wiki) and allow it to log in only from localhost. Or maybe you could run imap directly, something like:
USER=wanted_user dovecot --exec-mail imap 1 GETQUOTAROOT INBOX
participants (3)
-
Allison Vollmann
-
michael@lattari.pl
-
Timo Sirainen