Strange cyrus quota problem

Julien Coloos julien.coloos at atos.net
Thu Nov 24 08:30:11 EST 2011


Le 24/11/2011 11:09, Thomas Kirchtag a écrit :
> I am rather new to cyrus imap. We took over a client who uses it and has a
> strange quota problem. One single user keeps getting "Over quota" alerts
> although cyrus (as well as the client show very small quota usage (24%...)
>
> ...
>
>
> I gather from this that the server sends the "over quota" alert (    194 *
> NO [ALERT] Mailbox is over quota) and a few lines down the server finds that
> the user uses 24% of his quota (    204 * QUOTA user.<username>  (STORAGE
> 2441822 10000000))
>
> I tried setting the quota to several different values increasing, decreasing
> it from the 10000, even setting it to none but the result is always as
> above. I tried running quota -f and restarting cyrus several times without
> any result.
>

Hi,

The problem with versions older than 2.3 is that quota data are handled 
through 32-bits variables: signed for limit, unsigned for usage.
In your case quota usage is handled correctly (under the 2^32-1 limit), 
but your quota limit being 10000000 KiB triggers the quota alert because 
it is compared to the quota usage in bytes: 10000000*1024 exceeds the 
capacity of the 32-bit signed variable.

Actually I believe you are experiencing the same thing that we did with 
2.1.x versions some years ago: when overflowing a 32-bit value, the sign 
bit would be flipped (e.g. 2^31 in a signed variable would become -2^31).
So for example in your case cyrus would believe the actual limit is 
10000000*1024 - 2*(2^32)  (variable overflowed two times): the usage 
would thus be around 150%, that is over quota.

So in those old versions you will experience all kind of issues when 
dealing with quota over 2GiB.
Of course the code was reworked since cyrus 2.3 and now works as expected.


Regards


More information about the Info-cyrus mailing list