[Dovecot] Quota

Daniel Parthey
Sun, 04 Nov 2012 21:57:11 -0000

Christian R??ner wrote:
> is it possible to ask Dovecot for a users quota by talking to the Dovecot
> server over TCP? I know about doveadm quota -u <user>, but I would
like to
> know, if I can query for that over a network connection (on the Postfix ML
> they suggested writing a policy service that checks quota. Postfix is not
> always on the same server as Dovecot is).
>
> Does the LMTP protocol give that information somehow?
> I am not so familiar with LMTP. Or some Unix-Socket to
> query that could also be configured as inet_listener?

LMTP only returns an error if you're already over quota.

You can query the quota of a specific mailbox
via IMAP using GETQUOTAROOT:
http://tools.ietf.org/rfc/rfc2087.txt

Several script languages provide helper functions for this:

perl: IMAP::Admin->get_quotaroot
php:  imap_get_quota
ruby: Net::IMAP::MailboxQuota

Regards
Daniel
--