View Issue Details

IDProjectCategoryView StatusLast Update
0005683SOGoGUIpublic2023-01-31 13:45
ReporterAlex Vogt Assigned Tosebastien  
Status resolvedResolutionfixed 
Platform[Server] LinuxOSRHEL/CentOSOS Version7
Product Version5.8.0 
Fixed in Version5.8.1 
Summary0005683: Large quotas incorrectly displayed

For a sufficiently large mail quota (15GB for me), "NaN" is displayed in
the sidebar toolbar quota indicator. For smaller values (e.g., 2GB)
everything is working fine and the correct percentage and progress bar
is shown. I suspect an overflow happening here.

Screenshots are attached.

Steps To Reproduce

Use an IMAP account with a mailquota of 15GB.

TagsNo tags attached.


Alex Vogt

Alex Vogt

2023-01-23 19:23


quota_indicator_2GB.png (5,660 bytes)   
quota_indicator_2GB.png (5,660 bytes)   
quota_indicator_15GB.png (6,374 bytes)   
quota_indicator_15GB.png (6,374 bytes)   


2023-01-23 19:47

administrator   ~0016579

Hi can you provide SOGo imap logs (with ImapDebugEnabled = YES; in conf) ?


Alex Vogt

Alex Vogt

2023-01-23 19:59

reporter   ~0016580

Last edited: 2023-01-24 08:38

For the Account with 2GB:

C[0x55646991e1c0]: 7 getquotaroot "INBOX"
S[0x556469a24680]: * QUOTAROOT INBOX userquota
S[0x556469a24680]: * QUOTA userquota (STORAGE 350323 2097152)
S[0x556469a24680]: 7 OK Getquotaroot completed (0.001 + 0.000 secs).
C[0x55646991e1c0]: 8 logout

With 20GB:

C[0x556469ba5300]: 13 getquotaroot "INBOX"
S[0x556469c6cf50]: * QUOTAROOT INBOX userquota
S[0x556469c6cf50]: * QUOTA userquota (STORAGE 10927513 20971520 MESSAGE 53487 10000000)
S[0x556469c6cf50]: 13 OK Getquotaroot completed (0.001 + 0.000 secs).
C[0x556469ba5300]: 14 logout

Is this related to ?
My Objective C is a bit rusty - but are you casting the value to an int here?

Alex Vogt

Alex Vogt

2023-01-23 20:07

reporter   ~0016581

I think I found it... data.maxQuota contains the message quota as well (see screenshot)



2023-01-24 08:53

administrator   ~0016586

It is related to the IMAP response format QUOTA userquota (STORAGE 10927513 20971520 MESSAGE 53487 10000000)

I guess SOGo will try to convert 20971520 MESSAGE 53487 10000000 into long value.

I cannot reproduce this case on my dev env. The question is why your IMAP server output this ?

Alex Vogt

Alex Vogt

2023-01-24 09:24

reporter   ~0016587

This is fully within the spec of the quota extension:

"The name is followed by a S-expression format list of the resource
usage and limits of the quota root. The list contains zero or
more triplets. Each triplet conatins a resource name, the current
usage of the resource, and the resource limit."

I am using a default Dovecot installation with both storage and message quotas enabled for this account. From the code you linked I see that you are assuming that there is always exactly one triplet provided.



2023-01-25 18:09

administrator   ~0016600

Thanks for clarification I'll do a fix



2023-01-25 18:53

administrator   ~0016601

Fix :

I can't reproduce your case, can you try next nightly build ?

Alex Vogt

Alex Vogt

2023-01-26 19:13

reporter   ~0016611

Hi Sebastien, thanks a lot for this hotfix! I can now see my storage quota correctly. The way I understand your patch is that you take whatever the IMAP server presents first (message OR storage quota) and base the web UI on that information. The second criterion is ignore. Is that correct?
Theoretically, this could lead to the case where a quota is reached for one (e.g., the max. number of mail is reached) but it is not recognized in the UI (because there is still storage space left). I agree this is probably a corner case since nowadays message quotas are less an issue, but I think it should be documented somewhere.



2023-01-30 08:03

administrator   ~0016622

Hi Alex, thanks for the feedback !

It will always take storage quota because it searches for a character on the buffer from a position. It will first take the space character as stop char. If not found, try with (
For example :
In this case :

S[0x556469c6cf50]: * QUOTA userquota (STORAGE 10927513 101010101 MESSAGE 53487 10000000)

and this case

In this case :

S[0x556469c6cf50]: * QUOTA userquota (STORAGE 10927513 101010101)

will extract 101010101

Can I close this issue ?


Issue History

Date Modified Username Field Change
2023-01-23 19:23 Alex Vogt New Issue
2023-01-23 19:23 Alex Vogt File Added: quota_indicator_2GB.png
2023-01-23 19:23 Alex Vogt File Added: quota_indicator_15GB.png
2023-01-23 19:47 sebastien Note Added: 0016579
2023-01-23 19:59 Alex Vogt Note Added: 0016580
2023-01-23 20:07 Alex Vogt Note Added: 0016581
2023-01-23 20:07 Alex Vogt File Added: Screenshot from 2023-01-23 21-06-49.png
2023-01-24 08:38 sebastien Note Edited: 0016580
2023-01-24 08:53 sebastien Note Added: 0016586
2023-01-24 09:24 Alex Vogt Note Added: 0016587
2023-01-25 18:09 sebastien Note Added: 0016600
2023-01-25 18:09 sebastien Assigned To => sebastien
2023-01-25 18:09 sebastien Status new => assigned
2023-01-25 18:53 sebastien Note Added: 0016601
2023-01-26 19:13 Alex Vogt Note Added: 0016611
2023-01-30 08:03 sebastien Note Added: 0016622
2023-01-31 13:45 sebastien Status assigned => resolved
2023-01-31 13:45 sebastien Resolution open => fixed
2023-01-31 13:45 sebastien Fixed in Version => 5.8.1