On 8.12.2019 22.10, Michael Grimm via dovecot wrote:
Hi,
I do store mail in mdbox format of 150m in size (dovecot 2.3.9).
Once in a while I do experience mdbox files of smaller size, even after applying 'doveadm purge' and previous expunges by the users. like:
-rw------- 1 vmail dovecot 104854595 Feb 9 2019 /var/mail/.maildirs/userX/storage/m.22 -rw------- 1 vmail dovecot 29088478 Mar 8 2019 /var/mail/.maildirs/userX/storage/m.31 -rw------- 1 vmail dovecot 98210890 Mar 20 2019 /var/mail/.maildirs/userX/storage/m.39
(Currently the counter is at file number 129.)
Well, I never experienced missing mail or alike, but these "holes" in filesize irritates me, and yes, it is more or less a cosmetic issue.
Nevertheless, I do sometimes want to get rid of these "holes" by backing up all mail and re-injecting the backup into a vanilla account of that user. And I used this approach when I wanted to store all mail messages in larger mdbox files; again, rather a cosmetic issue.
BUT that takes a very, very long time contrary to the speed of 'doveadm purge'. Unfortunately, that command starts somewhere with more recent mdbox files and never from scratch (oldest mdbox file).
Whishlist: Would it be much of an effort to implement an option like:
'doveadm purge -f' and '-f' standing for 'force' or 'from scratch' or 'from the very first message found' or 'you name it'?
Thanks in advance and thanks for Dovecot and with kind regards, Michael
What purge does is that it removes mails that have refcount=0, so "from scratch" makes no sense. Renumbering the files "for neatness" is rather heavy operation, as you'd need to move mails around quite a lot. This is very little benefit to just cater for holes.
Aki