On Thu, Feb 18, 2010 at 07:59:24PM -0500, Javier Rojas wrote:
> what do you mean by "stale threads"? threads that lack a parent message?
A stale thread would be one that haven't had any activity for some
time. I subscribe to a lot of lists that I only really use/read once a
year or so. It's a bit a annoying to have to wait for mutt to open a
mailbox with 3 messages in it, so I'd like a way to get rid of them
automatically.
> anyway, you might want to run that macro as a folder-hook. Something
> like this:
>
> folder-hook lists/.* 'push "your_macro_goes_here"'
Following your clue this is what I came up with.
First you need a separate muttrc-file just for thread pruning.
~/mutt/muttrc_prune_stale_threads
set spoolfile="/home/oivvio/imap"
set folder="/home/oivvio/imap"
alternates
"(oiv...@polite.se|myli...@polite.se|oivvioslis...@polite.se|oiv...@gmail.com)"
set delete=yes
folder-hook . 'push "!(~(~d <2m)) !(~(~P|~F))q"'
This hook will delete all threads that have not had any activity for 2
months and that do not have any messages that I've written or flagged.
It will then quit.
Then I can run the whole thing from cron every night against my folder of
email lists. Notice that I use maildir and not mailbox.
find /home/oivvio/imap/notmyprivateemail_gmail -maxdepth 1 -mindepth 1 -type d
-exec mutt -F ~/mutt/muttrc_prune_stale_threads -f {} \;
oivvio
--
http://pipedreams.polite.se/about/