Mailing List Archive

Show test scores on not-spam and is-spam
How can I make spamassassin include the per rule score it used rather
than just listing the tests?

I looked at spamassassin code where the headers are generated (I
think) but don't grok enough perl to really see what it is doing.

I want a way to easily tell when my override scores from local.rc are
used and when the stock scores are used.

Currently I have scripting in place that reports the scores I want
used but I see discrepancy in total score. Like sometimes they are
not used. Anyway, to make it easier to see what is actually
happening with scoring how can I make spamassasin append the score it
used to the rules listed in:

X-Spam-Status: No, hits=4.1 required=5.0 tests=AWL,DATE_IN_PAST_96_XX,
MIME_BASE64_NO_NAME,MIME_BASE64_TEXT autolearn=no version=2.63

I'd like to see (scores are just examples):
X-Spam-Status: No, hits=4.1 required=5.0 tests=AWL,DATE_IN_PAST_96_XX:1.032,
MIME_BASE64_NO_NAME:.065,MIME_BASE64_TEXT:1.036 autolearn=no version=2.63

Or something equally easy to see exactly what was done.
Re: Show test scores on not-spam and is-spam [ In reply to ]
Hello Harry,

Wednesday, February 4, 2004, 3:55:03 AM, you wrote:

HP> I want a way to easily tell when my override scores from local.rc are
HP> used and when the stock scores are used.

The method I use is to differ from the stock rule naming convention.
Per http://www.exit0.us/index.php/RM_RuleNaming I identify all non-stock
rules so I hopefully know where they came from, and at least know they
aren't stock rules.

I agree with you that it'd be good to be able to see what scores were
applied in emails that did not get flagged as spam.

Bob Menschel
Re: Show test scores on not-spam and is-spam [ In reply to ]
Robert Menschel <Robert@Menschel.net> writes:

> The method I use is to differ from the stock rule naming convention.
> Per http://www.exit0.us/index.php/RM_RuleNaming I identify all non-stock
> rules so I hopefully know where they came from, and at least know they
> aren't stock rules.
>
> I agree with you that it'd be good to be able to see what scores were
> applied in emails that did not get flagged as spam.

It turns out to be pretty easy to do this with version 2.63. I just
hadn't noticed when this stuff appeared in the documentation of
Mail::SpamAssassin::Conf

A private poster has shown me how to use `tags' that will produce the
exact result I was after:

In local.cf:
add_header all Report _REPORT_
Will produce a header like this:

X-Spam-Report:
* 0.2 HTML_FONT_FACE_ODD BODY: HTML font face is not a commonly used face
* 0.1 HTML_FONTCOLOR_BLUE BODY: HTML font color is blue
* 0.2 HTML_MESSAGE BODY: HTML included in message
* 0.1 HTML_FONT_FACE_BAD BODY: HTML font face is not a word
* 0.3 HTML_FONT_BIG BODY: HTML has a big font
* 0.7 HTML_50_60 BODY: Message is 50% to 60% HTML
* 0.1 HTML_FONTCOLOR_RED BODY: HTML font color is red
* 1.8 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date
* 0.9 MIME_BOUND_NEXTPART Spam tool pattern in MIME boundary
* 0.9 MSGID_FROM_MTA_HEADER Message-Id was added by a relay

Or for a little less info (just rule and score)
add_header all HP _TESTSSCORES(,)_

Will produce this header:

X-Spam-HP: DATE_IN_FUTURE_12_24=1.754,HTML_50_60=0.699,
HTML_FONTCOLOR_BLUE=0.1,HTML_FONTCOLOR_RED=0.1,HTML_FONT_BIG=0.271,
HTML_FONT_FACE_BAD=0.063,HTML_FONT_FACE_ODD=0.185,HTML_MESSAGE=0.16,
MIME_BOUND_NEXTPART=0.942,MSGID_FROM_MTA_HEADER=0.915

So with your tecnique of putting keys in your custom rules either of
above would make it immediately apparent what happened.
Re: Show test scores on not-spam and is-spam [ In reply to ]
Robert Menschel <Robert@Menschel.net> writes:

> The method I use is to differ from the stock rule naming convention.
> Per http://www.exit0.us/index.php/RM_RuleNaming I identify all non-stock
> rules so I hopefully know where they came from, and at least know they
> aren't stock rules.

When I first saw your response I thought .... Jeez what a dope I am
.... But as I'm sure you'd know, that is not really possible in the
situaiton where you override the score of an existing rule.

I use home scripting that prepends a `D:' for default or Distro or an
`S:' for system. (These are appended to Rule and score in my home
script inserted header)

Now since a private poster has shown me how to use `Tags' from
perldoc Mail::SpamAssassin::Conf I can see what rule and what score
was actually used so can tell if my override score got used or not.

I'd found it doesn't at times... like because of syntax errors or the
like.