On Thursday, June 12 at 11:10 AM, quoth Bill Cole:
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/*

(restructure that as you like, I've written it that way to make the operations clear)

If you have a *TON* of messages in those folders (i.e. several thousand), your shell may complain that there are too many arguments to the rm command. If that happens, these may be better commands to delete them:

find /home/user/Maildir/.Junk/cur -type f -delete
find /home/user/Maildir/.Trash/cur -type f -delete

... and then get rid of the index files as indicated above, of course.

~Kyle
--
Men, as an organization, are getting more women than any other group working anywhere in the world. Wherever women are, we have men looking into it.
                                                     -- Jerry Seinfeld

Attachment: pgpNC8uAxiTJC.pgp
Description: PGP signature

Reply via email to