MESSAGE quota resource implemention

Julien Coloos julien.coloos at
Mon Sep 12 10:46:52 EDT 2011

Le 09/09/2011 14:18, Greg Banks a écrit :
> Ok, here you go. Not completely tested yet, so caveat emptor.

Had to change two things:
  - mailbox_quota_check now expects a quota diff array which is good :), 
but change is now really applied if all diffs are '> 0' (instead of '>= 
0' previously); in some cases '0' is used to check that mailbox is not 
currently overquota (e.g. in LMTP service), so either we should go back 
to testing '>= 0', or change callers that did rely on that test
  - changing the value of annotations quota storage in the index 
(mailbox_use_annot_quota function) do dirty the quota, but not the 
index; the new value is thus not committed (at least when setting 
mailbox annotations), and the quota entry becomes false when later 
deleting the mailbox

If needed, you can look in our 'cyrus-imapd' repository at the 
'gnb/annotate/fixes' branch. There is one commit for those matters.

Remaining things concerning annotations:
  - when deleting messages, annotations length is not substracted; the 
solution may not be that simple, since I believe users are allowed to 
unexpunge mails: so since index entry is still here - until real 
unlinking -, annotations may have to stay there too - until unlinking too
  - for 'old' mailboxes (those created before the annotation storage 
usage field in the index header), current annotations usage shall be 
computed (and added to the quota entry) upon upgrading; this way users 
won't have to run 'quota -f' for all quotaroots after switching to this 
new version ;)

>> Then maybe some of the cassandane tests I pushed on our repository would
>> need to be refreshed (at least the one that checks what happens for
>> legacy mailboxes on which we add one of the newly handled quota resources).
> That's next week's focus I think.
Actually I just gave up the 'old' test: there is no easy way to simulate 
upgrading mailbox index, or at least I don't feel confident enough to 
make it in cassandane :(
Other tests do work. Once the annotations usage is subtracted upon 
messages deletion (see before), all tests shall pass :)

I rebased the 'quotamessage/gnb/annotate' branch of our 'cassandane' 
repository today, leaving that test aside.


More information about the Cyrus-devel mailing list