unignore and regular expression help needed

2008-11-06 Thread Steve Searle
I want to only show a a spam status header when the score is positive.
In other words,

X-Spam-Status:\ No,\ score=2.4...

should be displayed, but

X-Spam-Status:\ No,\ score=-2.4...

shouldn't.

I have tried:

unignore X-Spam-Status:\ No,\ score=[^-]

expecting all lines that don't have a negative score to be displayed,
but this doesn't work.

Even

unignore X-Spam-Status:\ No,\ score=[23]

doesn't work, when I tried that as part of debugging.  However the
following does work:

unignore X-Spam-Status:\ No,\ score=2

What am I doing wrong?

Steve

-- 
 
(o www.stevesearle.com
//\ Powered by Fedora
V_/_No MS products were used in the creation of this message

 20:10:06 up  2:26,  1 user,  load average: 0.24, 0.19, 0.08


pgpUvQexSWPHR.pgp
Description: PGP signature


Re: unignore and regular expression help needed

2008-11-06 Thread David Champion
 I want to only show a a spam status header when the score is positive.
 In other words,
 
 X-Spam-Status:\ No,\ score=2.4...
 
 should be displayed, but
 
 X-Spam-Status:\ No,\ score=-2.4...
 
 shouldn't.

Consider upgrading to mutt 1.5.  Then you can do this:

spam X-Spam-Status: Yes, score=([^-][^ ]+) %1

Now %H in your $index_format will expand to a message's spam score, but
only if it's positive.

-- 
 -D.[EMAIL PROTECTED]NSITUniversity of Chicago


Re: unignore and regular expression help needed

2008-11-06 Thread Gary Johnson
On 2008-11-06, Steve Searle [EMAIL PROTECTED] wrote:
 I want to only show a a spam status header when the score is positive.
 In other words,
 
 X-Spam-Status:\ No,\ score=2.4...
 
 should be displayed, but
 
 X-Spam-Status:\ No,\ score=-2.4...
 
 shouldn't.
 
 I have tried:
 
 unignore X-Spam-Status:\ No,\ score=[^-]
 
 expecting all lines that don't have a negative score to be displayed,
 but this doesn't work.
 
 Even
 
 unignore X-Spam-Status:\ No,\ score=[23]
 
 doesn't work, when I tried that as part of debugging.  However the
 following does work:
 
 unignore X-Spam-Status:\ No,\ score=2
 
 What am I doing wrong?

The ignore command doesn't use regular expressions.  It compares the 
string you supply with the leading portion of each header.

Regards,
Gary



Re: unignore and regular expression help needed

2008-11-06 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thursday, November  6 at 08:14 PM, quoth Steve Searle:
unignore X-Spam-Status:\ No,\ score=[23]

What am I doing wrong?

You're assuming that it uses a full regexp, but it doesn't (check the 
documentation).

You *could* just be very explicit:

 unignore X-Spam-Status:\ No,\ score=1
 unignore X-Spam-Status:\ No,\ score=2
 unignore X-Spam-Status:\ No,\ score=3
 unignore X-Spam-Status:\ No,\ score=4
 unignore X-Spam-Status:\ No,\ score=5
 unignore X-Spam-Status:\ No,\ score=6
 unignore X-Spam-Status:\ No,\ score=7
 unignore X-Spam-Status:\ No,\ score=8
 unignore X-Spam-Status:\ No,\ score=9

Another way to do it would be to use a message-hook; that way you can 
get full regex control. Try something like this:

 message-hook . 'ignore * ; unignore Subject To From Date Cc'
 message-hook '~h X-Spam-Status: No, score=[^-]' \
 'unignore X-Spam-Status'

I think that gives you more power. :)

~Kyle
- -- 
The world is full of willing people, some willing to work, the rest 
willing to let them.
-- Robert Frost
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iEYEARECAAYFAkkTcUwACgkQBkIOoMqOI17GEgCfXLDhHamBMaHFhxaj8Qsl6Sxo
YjUAoOy4gmq6p2VRIOjqF841ZiHRsjJW
=sQHG
-END PGP SIGNATURE-