[Dovecot] Need a quick, safe method to empty /home/user/Maildir/{.Junk, .Trash}

Timo Sirainen tss at iki.fi
Fri Jun 13 01:17:12 EEST 2008


On Thu, 2008-06-12 at 11:10 -0400, Bill Cole wrote:
> At 9:22 AM -0400 6/12/08, Jeff Kowalczyk wrote:
> >I have some (Thunderbird client, dovecot-1.0.13, Maildir) users who get an
> >appalling amount of spam-with-attachment, and it's causing backups to take
> >an inordinate amount of time.
> >
> >I'll implement some quota and server-side spam management when I go to
> >dovecot-1.1, but in the meantime:
> >
> >What is the safest way to empty all messages within, but not delete, the
> >following folders from the server command line:
> >
> >/home/user/Maildir/.Junk
> >/home/user/Maildir/.Trash
> >
> >I don't want the Thunderbird-2.0.14 client to report corrupt
> >indexing, or worse not show the folder at next use.
> 
> The way to do that in a shell (rather than via Dovecot) would be to 
> remove all of the current message files and all of Dovecot's indexing 
> and metadata caching:
> 
> 
> cd /home/user/Maildir/.Junk
> rm dovecot-index* cur/*
> cd /home/user/Maildir/.Trash
> rm dovecot-index* cur/*

There's no real need to delete dovecot.index*. They get updated
automatically. Probably better if you don't delete them, because if
client has the mailbox opened at that time Dovecot will probably log
errors about losing the files.

> 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.)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080613/f0bec0c8/attachment.bin 


More information about the dovecot mailing list