[Dovecot] get maildir current quota usage from external program

Timo Sirainen tss at iki.fi
Mon Jan 26 03:22:09 EET 2009


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20090125/0a8d797b/attachment.bin 


More information about the dovecot mailing list