[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: automatically delete old emails from Maildir



* Shri Shrikumar (shri@vitalstate.co.uk) [020805 03:58]:
> Hi,
> 
> I use a Maildir with IMAP and once debian-user going over around 1,000
> messages, it takes a few seconds to read a message which can be very
> annoying. I dont know much about bash scripting and at one point I did
> try using a
> 
> 
> find -mtime +5 -exec rm
> 
> However, I am not sure if this kind of Maildir handling is safe and more
> importantly, I do *not* trust my own command adequately for this.
> 
> Another point is that it would be nice if it did not delete mark
> messages marked as important as well (and even better if it did not
> delete messages that are replies to messages marked as important)
> 
> Any ideas ?

Use mutt! =)

folder-hook debian-user 'push <delete-pattern>~r>5d!~F'

That does all but the last feature (saving threads containing flagged
messages).  It does save flagged messages themselves, and also has the
advantage of just marking the messages as deleted; they aren't purged
until you sync the folder (and mutt asks you if you're sure you really
want to "purge 378 messages?").  This may save you from accidentally
deleting something you want to save.

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
http://www.aclu.org/		It's all about Freedom.

Attachment: pgpBFlm8dSjMx.pgp
Description: PGP signature


Reply to: