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

Re: Coloring message in index for SPAM



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday, June 11 at 04:21 PM, quoth Dave Waxman:
>On Jun 11 16:06, Kyle Wheeler wrote:
> 
>> That looks like a SpamAssassin header, and if that's true, then you 
>> may find it useful to match on the X-Spam-Level header instead. Then 
>> you can do matches like this:
>> 
>> color index brightred default '~h "^X-Spam-Status: [*]{5,9}"'
>> 
>
>Indeed it is SA.  I am not sure what the extra [*] will do, but I'll
>give it a shot.  The problem I have is messages are being rated all the
>way to 99 and not getting flagged as red.  

Ooops, there's a typo in that. Here's what the pattern in 
double-quotes should be:

^X-Spam-Level: [*]{5,9}$
||            | |  |   `-- means "the end of the line"
|`------------' |  `-- means "between 5 and 9 of the preceeding
|       |       |      element"
|       |       `----- means "an asterisk" (an asterisk by itself
|       |              means "any number of the preceeding element")
|       `-------------- means "the literal string 'X-Spam-Flag: '
`---------------------- means "at the beginning of the line"

In other words, SpamAssassin by default adds two headers to most 
email: an X-Spam-Status header and an X-Spam-Level header. 
X-Spam-Status is something like "X-Spam-Status: No, score=-2.4..." and 
X-Spam-Level is just a series of (by default) asterisks, one for every 
point in the score the mail generated. The pattern here matches based 
on the number of asterisks, and specifically, matches between 5 and 9 
asterisks, which translates to messages with scores >= 5 and <= 9.

~Kyle
- -- 
Almost everything about a human creature is ridiculous, except its 
ability to suffer bravely and die gallantly for whatever it loves and 
believes in. The validity of that belief, the appropriateness of that 
love, is irrelevant; it is the bravery and the gallantry that count.
                       -- Robert A. Heinlein, Job: A Comedy of Justice
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFEjXMVBkIOoMqOI14RAvodAJ4vDSFPNo8aa7TtxKGEDG2DKHc0YQCg+4aT
9nMsLQJK6tkbxSYKqMoh+Po=
=E0zc
-----END PGP SIGNATURE-----