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

Jeff Kowalczyk jtk at yahoo.com
Thu Jun 12 20:25:31 EEST 2008

On Thu, 12 Jun 2008 19:07:36 +0200, Alexander Prinsier wrote:

> Jeff Kowalczyk wrote:
>> Any thoughts on a variant using find -name that could safely iterate over
>> /home/*/Maildir for all users? Otherwise I would script it in python.
> What about:
> find /home/*/Maildir/.Junk/cur -type f -delete

find /home/*/Maildir/{.Junk,.Trash}/cur -type d

Seems to work well as a sanity check. It even showed me that a few users
don't have .Junk folders, and I should get in touch with them to configure
their Thunderbird clients to process Junk mail.

But about the safety of that wildcard, are there any edge cases where that
wildcard could find the whole user directory (and delete it)? All
usernames a flname form (jsmith), so no punctuation involved in users
created on my watch.


More information about the dovecot mailing list