<<< Date Index >>>     <<< Thread Index >>>

Re: How to automatically delete empty maildirs?



On 19Jan2007 11:40, Stefano Sabatini <stefano.sabatini-lala@xxxxxxxx> wrote:
| On date Thursday 2007-01-18 14:36:17 +1100, Cameron Simpson muttered:
| > It might be better, but absent that I have a script called "rm0maildir" 
which
| > removes a maildir if it is empty:
| >   http://www.cskk.ezoshosting.com/cs/css/bin/rm0maildir
| > It uses a few other scripts from the same directory. You could install the
| > whole lot, or pick and choose what you want.
| > Of course this isn't integrated into mutt at all, so you'd need to run it by
| > hand somehow.
| 
| Thanks Cameron, I'll give it a try. 
| 
| An idea could be to delete the empty maildirs when exiting mutt, but
| it's not completely safe (since a procmail process could be delivering
| mails into a removed maildirs right in that moment).

Yes. rm0maildir is also not completely safe - it uses rmdir, so cannot
remove a directory with something in it, but it could break a delivery
(procmail: "folder exists - I don't need to create it", rm0maildir:
"remove empty folder", procmail: "try to make file in folder/tmp -
it's not there!").
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

The Force. It surrounds us; It enfolds us; It gets us dates on Saturday
Nights. - Obi Wan Kenobi, Famous Jedi Knight and Party Animal.