On 22.4.2005, at 02:26, Thomas Wouters wrote:
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.
Hmm. I currently cheat, casting the struct_mailbox to a struct index_storage and using its 'dir' member. I don't even check that it is an index_storage struct; I know I should, but when wouldn't it be ?
For now, yes.. I thought I had moved "dir" already out of it to mbox_storage though. Guess I did it only with index_mailbox.
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?
The one I ran into was cmd_getquotaroot not checking the return value of quota_root_iter_init(), and my quota_root_iter_init() was failing.
It's not supposed to fail :) But I guess that iteration needs error checking as well. I changed quota_root_iter_deinit() return "int" where you can return -1 if it fails (just make init() return some dummy struct which causes next() to return NULL and deinit() to return -1).
Updated the plugin in web page.
Something else I noticed was that the storage quota name should (for Thunderbird, at least) be allcaps, or it won't recognize it as storage quota. Thunderbird doesn't do message quota (which I implemented as 'inode quota', as I'm maildir-centric) but I suspect that should probably be allcaps as well, for interoperability if nothing else.
It should be treated case-insensitive. Looks like Dovecot was using strcmp() to check its name, changed that. Changed also to use uppercase when sending the reply.
And there's the bit where you need to set the MODULE_DIR and QUOTA environment variables and start imap by hand, rather than by dovecot. I hacked around that by hardcoding both in the source.
module_dir can be set in configuration file? Quota environment is also now forwarded from userdb as well. So it'd work at least with SQL and static userdbs..