[Dovecot] dovecot-uidlist cleanup

Bill Cole dovecot-20061108 at billmail.scconsult.com
Tue Jun 17 23:52:17 EEST 2008

At 9:00 PM +0200 6/17/08, Thomas Zajic wrote:
>>From http://www.dovecot.org/list/dovecot/2008-June/031235.html:
>>  > I have noticed that the entries in the dovecot-uidlist files don't seem
>>>  to get updated when an email is deleted or moved to .Trash. It appears
>>>  that this list list would just keep growing over time, being full of no
>>>  longer used filenames, and must tend to increase its processing
>>>  overhead.
>>The deleted entries are removed when a new message arrives to the
>>mailbox. So it's just an optimization not to waste disk I/O on rewriting
>>the file when it's not necessary. If this isn't happening, there's
>>something wrong or you're misunderstanding something.
>>From http://www.dovecot.org/list/dovecot/2008-June/031403.html:
>>  > However, I DO clobber the dovecot-uidlist in .Trash as part of 
>>my > monthly housekeeping because it tends to get very large
>>All the expunged messages get removed from it the next time a new
>>message is added to the mailbox. So there should be no need to delete
>>it. (v1.1 doesn't always recreate the file, but it gets rewritten if the
>>resulting file would be 70% of the current size or less.)
>If I understand this correctly, dovecot is supposed to clean out all
>deleted/expunged messages from dovecot-uidlist whenever a new message
>is added to the respective mailbox - right?

That's what Timo was saying, but as I noted in 
http://www.dovecot.org/list/dovecot/2008-June/031435.html it isn't 
happening for me on 1.0.0.

>  This doesn't actually seem
>to be the case at least with dovecot-1.0:
>[root at airframe]:~# dovecot --version

That eliminates my hypothesis that it might have been fixed in later 
1.0.x versions.

>[root at airframe]:~# [root at airframe]:~# du -h 
>~user/Maildir/.Trash/dovecot-uidlist 13M 
>	/home/user/Maildir/.Trash/dovecot-uidlist
>[root at airframe]:~# wc -l < ~user/Maildir/.Trash/dovecot-uidlist
>[root at airframe]:~# ls -1 ~user/Maildir/.Trash/cur/ | wc -l
>[root at airframe]:~# [root at airframe]:~# du -h 
>~user/Maildir/.Logs.System\ Checks/dovecot-uidlist 3,5M 
>	/home/user/Maildir/.Logs.System Checks/dovecot-uidlist
>[root at airframe]:~# wc -l < ~user/Maildir/.Logs.System\ Checks/dovecot-uidlist
>[root at airframe]:~# ls -1 ~user/Maildir/.Logs.System\ Checks/cur/ | wc -l
>The only mailbox where this seems to work properly is INBOX:
>[root at airframe]:~# du -h ~user/Maildir/.INBOX/dovecot-uidlist 4,0K 
>	/home/user/Maildir/.INBOX/dovecot-uidlist
>[root at airframe]:~# wc -l < ~user/Maildir/.INBOX/dovecot-uidlist
>[root at airframe]:~# ls -1 ~user/Maildir/.INBOX/cur/ | wc -l
>[root at airframe]:~#
>The server runs sendmail, the LDA is procmail, not dovecot's deliver. The
>.procmailrc is empty except for the bare minimum, though, all other sorting
>is done either via Thunderbird message filters or manually:
>[root at airframe]:~# cat ~user/.procmailrc MAILDIR=$HOME/Maildir
>[root at airframe]:~#
>Any hints?

Your observations are consistent with mine: normal delivery with 
procmail (i.e. leaving a new message in the 'new' directory) of any 
mailbox results in Dovecot cleaning up the dovecot-uidlist file, but 
adding a message to a mailbox via the IMAP  "UID COPY" command does 
not. That's the natural command to use for client filtering to move a 
message from one mailbox to another under the same account, so it is 
probably what T-Bird uses.

Bill Cole                                  
bill at scconsult.com

More information about the dovecot mailing list