1

Topic: Incorrect domain quota and usage information

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.7 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Ubuntu 20.04.6 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

We are facing a strange issue with domain and user quotas.

In some domains, we can see the quota and current usage, but some other domains show the quota, the percentage of usage but not the actual usage. Please see the attached screenshot for an example.

I have already run the Force Dovecot to recalculate mailbox quota command as described here:
https://docs.iredmail.org/recalculate.m … quota.html

But the issue persists.

Any thoughts on how to fix this?

Post's attachments

Screenshot at Jan 09 12-16-36.png
Screenshot at Jan 09 12-16-36.png 18.17 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Incorrect domain quota and usage information

Any comments?

3

Re: Incorrect domain quota and usage information

Excuse me, what do you mean "the percentage of usage but not the actual usage"?
Could you please describe it with more details? Or even better, attach a screenshot with some text to explain the issue.

4

Re: Incorrect domain quota and usage information

In your screenshot, first row displays 2 progress bars, first one is percentage of actual used quota, second one is percentage of allocated quota.
Second and third rows display only percentage of allocated quota because there's no actual usage at all (0).

5

Re: Incorrect domain quota and usage information

ZhangHuangbin wrote:

In your screenshot, first row displays 2 progress bars, first one is percentage of actual used quota, second one is percentage of allocated quota.
Second and third rows display only percentage of allocated quota because there's no actual usage at all (0).

Thanks for getting back to me!
I can see the mistake now. It looks like we misunderstood the definitions of the elements of the Quota.

So when I see the following:
73% (0 / 7.32 GB) / 10 GB

73% means allocated quota to users (not actual used space)
The 0 means actually disk usage
7.32 GB is the total allocated space to users
10 GB is the total allocate quota for the domain

Is this correct?

6

Re: Incorrect domain quota and usage information

grupow wrote:

Is this correct?

Correct.
You can move cursor on the numbers, it will popup a tooltip with some more text.

7

Re: Incorrect domain quota and usage information

ZhangHuangbin wrote:
grupow wrote:

Is this correct?

Correct.
You can move cursor on the numbers, it will popup a tooltip with some more text.

Upon further investigation, I discovered that the quota is not working as expected on a user level.

Domains that show 0 usage actually have several users storing emails on the server and it's just not showing the actual disk usage in iRedadmin.

Domains that are showing some usage are basically from suspended users that haven't been deleted from the server. However, several other users from the same domain occupy space on the server, being reported as zero.

Attached is a screenshot of an example of a suspended user showing usage, but all other users are at zero, although they are using space on the server.

I have also checked the quota and usage of another email via the doveadm command on the command line and can see the number of emails, usage, and limit, as expected. Please find the screenshot attached.

However, when I search for that information on Mysql, the used_quota is empty. See screenshot.

It looks like email cannot record the information in the database.

All usernames and passwords are working correctly. The screenshots of the database check were done using the username and passwords configured in /etc/dovecot/dovecot-used-quota.conf

Have you experienced something similar? Any ideas?

Post's attachments

doveadm Screenshot.png
doveadm Screenshot.png 34.43 kb, file has never been downloaded. 

Mysql used_quota Screenshot.png
Mysql used_quota Screenshot.png 64.47 kb, file has never been downloaded. 

Screenshot at Jan 22 18-28-55.png
Screenshot at Jan 22 18-28-55.png 53.05 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

8

Re: Incorrect domain quota and usage information

The problem was caused due to migration(?), when i login to “vmail” database as “vmailadmin” user, and tried to insert a new record, it reported error:

MariaDB [vmail]> insert into used_quota (username,bytes,messages,domain) values ("test", 1,1,"a.io");
ERROR 1449 (HY000): The user specified as a definer ('root'@'%') does not exist

This table was created by sql user “root”@“%”, instead of default “root”@“localhost” (or “127.0.0.1”).
I dropped the table and re-created it, then the issue is gone.

9

Re: Incorrect domain quota and usage information

Thank you for your help! All seems to be working now!

ZhangHuangbin wrote:

The problem was caused due to migration(?), when i login to “vmail” database as “vmailadmin” user, and tried to insert a new record, it reported error:

MariaDB [vmail]> insert into used_quota (username,bytes,messages,domain) values ("test", 1,1,"a.io");
ERROR 1449 (HY000): The user specified as a definer ('root'@'%') does not exist

This table was created by sql user “root”@“%”, instead of default “root”@“localhost” (or “127.0.0.1”).
I dropped the table and re-created it, then the issue is gone.