[Dovecot] Quota

Timo Sirainen tss at iki.fi
Thu Apr 21 22:12:43 EEST 2005


On 20.4.2005, at 04:52, Thomas Wouters wrote:

> The plugin seems a bit out-of-date, by the way; it passes the wrong 
> number
> of arguments to 'mailbox_open', and uses a nonexistant function
> 'i_stream_get_size'.

Fixed and uploaded new quota.tar.gz to same place.

> The rquotad plugin is done, more or less, except for figuring
> out how to properly get at a mailbox's physical location, if it has 
> one. I
> really don't want to maintain a static list in an environment 
> variable; we
> currently use 10 different filesystems (all NFS) for mail storage, and 
> they
> all have different quotas and usage.

Well, that requires mbox/maildir-specific storage code then to get the 
path.. I think zlib plugin checks that it works only with mboxes, that 
might be helpful.

> I don't particularly care about
> checking quotas before an attempted write, but I implemented that as 
> best I
> could; I still need to figure out how to decode the 
> mail_transaction_context
> to see where a mail is moved from/to in order to finish it.

Probably just by checking if it's mbox/maildir and then casting struct 
mailbox to struct maildir_mailbox and looking what it contains.. Or if 
you actually want to see the filenames it gets more difficult.

> The quota-plugin thing obviously isn't quite done yet (at least, not 
> the
> tarball version from the patches/1.0 directory) -- it lacks some error
> checking, I think,

I don't remember leaving anything intentionally?

> and a capability hook from what I can tell. (There *is* a
> capability for quotas, I hope, in IMAP ?) If you lack time but have an 
> idea
> as to what needs to be done, I can work on it and submit patches.

After login you should be able to modify capability_string directly. 
Just append QUOTA there. But I think you'll have to modify the 
pre-login capability as well because some clients don't check it 
afterwards. I haven't really figured out yet what to do about it. One 
possibility would be to add some plugin_capability() function into the 
plugin and let login processes get capabilities of all plugins. But 
maybe it's not such a good idea. Easiest way would be just to put the 
capability string into config file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://dovecot.org/pipermail/dovecot/attachments/20050421/78616a91/attachment-0001.bin>


More information about the dovecot mailing list