[Dovecot] mdbox: Is there a tool to recover space used by refcount=0 messages in mdbox storage files?

William Blunn bill+dovecot at blunn.org
Fri May 14 11:45:58 EEST 2010


Pascal Volk wrote:
> On 05/13/2010 05:59 PM William Blunn wrote:
>> Is there a tool to recover space used by refcount=0 messages in mdbox
>> storage files?
>>
>> The wiki talks about it but it isn't clear where the tool is.
> ~ $ doveadm help purge
> doveadm purge [-u <user>|-A]
>
> doveadm purge -A will purge all 'deleted' mails from all users.
> doveadm purge -u john.doe at example.com will remove 'deleted' messages
> from john.doe at example.com's mail location. 

Thank-you for that suggestion.

I had a go with that. I used the "doveadm purge -u <user>" syntax. In 
the case of a system user that works with just a username.

Verily it did do the mdbox "pack" operation I was looking for.

# ls -l ~bill/dbox/storage/
total 1152
-rw-r--r-- 1 bill bill    1688 May 12 22:02 dovecot.map.index
-rw-r--r-- 1 bill bill   17064 May 13 11:03 dovecot.map.index.log
-rw-r--r-- 1 bill bill 1150037 May 13 11:00 m.1
# /opt/dovecot2/bin/doveadm purge -u bill
# ls -l ~bill/dbox/storage/
total 28
-rw-r--r-- 1 bill bill  1688 May 12 22:02 dovecot.map.index
-rw-r--r-- 1 bill bill 19044 May 14 08:26 dovecot.map.index.log
-rw-r--r-- 1 bill bill  3380 May 14 08:26 m.2

Suggestion point: This information should be easier to find. For example 
it may be an idea to link it from the Dovecot Wiki page which documents 
mdbox ("MailboxFormat/dbox", http://wiki.dovecot.org/MailboxFormat/dbox 
). (Should I edit the Wiki directly?)

A concern I had was that "doveadm purge" might also be removing messages 
which had been marked as deleted.

But there is an "expunge" command as well, so perhaps not.

My next step would be to look at the documentation, but searching for 
"doveadm" in the Dovecot Wiki turns up nothing. (Should I edit the Wiki 
directly?)

Regards,

Bill






More information about the dovecot mailing list