Chris Green chris@areti.co.uk
This is (distantly) related to my previous question, they're both results of my migration from mbox to maildir. I'm doing that so I can rsync my mail folder hierarchy from the system where I actually read my mail to my home system without losing old mails.
Can't mailsync do that without maildir? Maildir always looked to me like a third-choice format for normal users, after mbox and mh.
This involves finding any directory that has empty cur, tmp, and new subdirectories and deleting it. I can see all sorts of horribly clumsy ways of doing it but not any really neat way.
Any quick solutions anyone?
Quickest to my mind is the fugly
find $(find $(find $HOME/Maildir/ -name cur -type d -empty -printf '%h\n') \ -maxdepth 1 -name tmp -type d -empty -printf '%h\n') \ -maxdepth 1 -type d -name new -empty -printf '%h\n' \ | while read dir ; do rmdir -v "$dir/cur" "$dir/new" "$dir/tmp" "$dir/" done
which feeds the cur find paths to a limited tmp find and again to a limited new find, then tries to rmdir anything still found. You need to be sure you don't have newlines or other funnies in names.
It's a lot more complicated than the equivalent for mboxes (find $HOME/mail/ -type f -size 0 -exec rm -v '{}' ';')
Hope that helps,