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

Re: automatically flagging messages based on content



* On 2004.06.04, in <20040604201916.GA26043@xxxxxxx>,
*       "steVe" <steve@xxxxxxx> wrote:
> 
> anyone know the best way to have mutt automatically flag messages when
> they come in?  i know you can do some things like this in procmail and
> have them sent to a certain place, or add a special header or
> whatever, but how can one make mutt flag messages ONLY if the search

A mutt "flag" is indicated in the on-disk mail file, in the X-Status:
header. So you can flag them with procmail, if you like. For example, I
have this:

:0 f
* ^(Importance: High|Priority: Urgent)
| formail -I "X-Status: F"


> succeeds?  i thought me's user-defined macro patch might help, but it 
> only seems to just name certain macros.  there still seems to be no 
> ability to do simple if-then kind of conditions.
> 
> folder-hook blah push "/~s (plumbing\|linux) ~b 'steve\|poop'\nF"

That patch lets you name a macro with a symbol. But you can do what you
want with a macro or a hook, with or without the patch.

With a macro (this is all one line):
macro index \;f "<tag-pattern>~s '(plumbing\|linux)' ~b 
'steve\|poop'<enter><tag-prefix><set-flag>!"

or with a hook (likewise):
folder-hook blah "push <tag-pattern>~s '(plumbing\|linux)' ~b 
'steve\|poop'<enter><tag-prefix><set-flag>!"

-- 
 -D.    dgc@xxxxxxxxxxxx                                  NSIT::ENSS
        No money,  no book.  No book,  no study.  No study, no pass.
        No pass, no graduate. No graduate, no job. No job, no money.
             T h e   U n i v e r s i t y   o f   C h i c a g o