Hi,
in my dovecot setup the accounting database table shows wrong values which do not correspond with the actual disk space used.
The disk usage says 2.6 Gigabytes:
mail01:~# du -sh /mail/dovecot/example.org/username 2.6G /mail/dovecot/example.org/username
While the doveadm quota get says 7 Gigabytes for the same user:
mail01:~# doveadm -f tab quota get -u username@example.org Quota name Type Value Limit % User quota STORAGE 7065208 - 0 User quota MESSAGE 282024 - 0
mysql> select * from dovecot.dovecot_usage where username="username@example.org"; +----------------------+------------+----------+ | username | storage | messages | +----------------------+------------+----------+ | username@example.org | 7234773131 | 282024 | +----------------------+------------+----------+ 1 row in set (0.00 sec)
What might be the reason for such huge differences (several gigabytes) between storage value in dovecot_usage table and disk usage value?
After a quota recalc everything is correct:
mail01:~# doveadm quota recalc -u username@example.org mail01:~# doveadm -f tab quota get -u username@example.org Quota name Type Value Limit % User quota STORAGE 2630434 - 0 User quota MESSAGE 100714 - 0
mysql> select * from dovecot.dovecot_usage where username="username@example.org"; +----------------------+------------+----------+ | username | storage | messages | +----------------------+------------+----------+ | username@example.org | 2693565239 | 100714 | +----------------------+------------+----------+ 1 row in set (0.00 sec)
How can I keep the accounting data consistent with actual disk usage, without running a recalc cronjob every few hours?
There's running a dovecot director and mailbox instance on each of our servers with the mails being stored on NFS and received from postfix via LMTP through the director lmtp port 20024.
Configuration of director (dovecot-director.conf) and mailbox (dovecot.conf) is attached.
Kind regards Daniel