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

Re: 'score "~d <2w" 50' in folder-hook weirdness



On Mon 15 Sep 2003 at 08:34pm +0200, Joan Picanyol i Puig wrote:

> [old thread, I've been _too_ busy...]
> 
> * John Iverson <johni@xxxxxxxxx> [20030702 02:16]:
> > On Tue 01 Jul 2003 at 04:56pm -0700, John Iverson wrote:
> > > On Wed 02 Jul 2003 at 12:20am +0200, Joan Picanyol i Puig wrote:
> > > > Hi,
> > > > 
> > > > I want to automatically delete old messages from mailing lists folders,
> > > > so I have the following sourced from .muttrc:
> > > > 
> > > > folder-hook =lists*  set score_threshold_delete=1
> > > > folder-hook =lists*  set score
> > > > folder-hook =lists*  unscore *
> > > > folder-hook =lists*  score ~F 50
> > > > folder-hook =lists*  'score "~d <2w" 50'
> > > > folder-hook =lists*  set delete=yes
> > > 
> > > Why not just do something like:
> > > 
> > >    folder-hook =lists* 'push <delete-pattern>~r>2w<enter>'
> > > 
> > > To delete messages received more than 2 weeks ago.
> The problem was that mutt wouldn't tag the messages from deletion until
> the *second* time I enter the folder, which is rather incovinient. I
> still have the same problem with your approach, is there any workaround?

Maybe a problem with how you're setting/resetting the $delete
variable in more than one place.  If you just get rid of all the
scoring stuff and use:

    set delete=yes
    folder-hook =lists 'push <delete-pattern>~r>2w<enter>'

in your .muttrc, it should mark the appropriate messages for
deletion when you first enter the folder, and purge them when you
exit (or sync) the folder.

(You probably don't really want the trailing * on your folder
matching pattern.)

You may want to enhance the hook so it won't delete flagged or new
messages, like so:

    folder-hook =lists 'push <delete-pattern>!~F!~N~r>2w<enter>'

-- 
John