Daniel Parthey wrote:
Timo Sirainen wrote:
The message still has 5 visible instances, even though in mdbox they don't use up any more disk space than 1. It would be nice for quota plugin to realize this, but it's a big and probably difficult change. I've thought about it once in a while though.
Maybe I should have a deeper look into how to reproduce this. Originally, I did an imap-sync[1] from dbmail to dovecot through the director IMAP port. After some days of mailbox usage in dovecot the quota values were obviously incorrect from the administrators view, but I'm not sure whether the user kept his mailbox and IMAP connection open the whole week. I will try to find this out.
I now repeated a fresh imap-sync from a dbmail mailbox containing 60216 mails and dovecot displays exactly 60216 mails, this seems correct:
mail01:~# doveadm quota get -u user1@example.org; du -sb /mail/dovecot/example.org/user1/mail Quota name Type Value Limit % User quota STORAGE 1252372 - 0 User quota MESSAGE 60216 - 0 1338670280 /mail/dovecot/example.org/user1/mail
I assume the reason for the wrong quota values was the following:
The user has already had a dovecot test account before his mailbox has been migrated from dbmail to dovecot. If you clear/remove a mailbox using rm -rf, the storage values in database are not touched. And then the storage/quota_usage becomes wrong if you don't do a doveadm quota recalc for this user after moving his mail folder out of the way.
Any additional imported/incoming mails will only increase the storage values, but not the size of the mails which have been deletedv from the filesystem.
Kind regards, Daniel