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

Jeff Kowalczyk jtk at yahoo.com
Thu Jun 12 20:02:26 EEST 2008

On Thu, 12 Jun 2008 10:19:48 -0500, Kyle Wheeler wrote:
> 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

Thanks, I'm going to do that. And per dmeissler, I'm going to consider

(http://dmiessler.com/study/find/) :

 "... With xargs, you build up the input into bundles and run them through
 the called command as few times as possible, which is usually just once.
 When dealing with hundreds or thousands of elements this is a big win for

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.


More information about the dovecot mailing list