Re: Running a mutt macro from crontab

2010-02-19 Thread Alex Polite
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/




Re: Running a mutt macro from crontab

2010-02-18 Thread Javier Rojas
On Thu, Feb 18, 2010 at 10:14:09PM +0100, O Polite wrote:
> I've got a nifty macro that deletes stale threads in my mailing list
> folders. I'd like to run it automatically from cron. How do I do that?

what do you mean by "stale threads"? threads that lack a parent message?

anyway, you might want to run that macro as a folder-hook. Something
like this:

folder-hook lists/.* 'push "your_macro_goes_here"'

If I understood what you want correctly, then the following might be useful to
you:

http://devnull.li/~jerojasro/blog/posts/mutt_mute_thread/

-- 
Javier Rojas

GPG Key ID: 0x24E00D68


signature.asc
Description: Digital signature