Bug 282 - addition of X-Spam-Hits header
Summary: addition of X-Spam-Hits header
Status: RESOLVED WONTFIX
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 2.20
Hardware: All All
: P2 enhancement
Target Milestone: ---
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-05 22:41 UTC by Jeff Kellem
Modified: 2002-06-09 17:31 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
x-spam-hits.patch patch None Jeff Kellem [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Kellem 2002-05-05 22:41:38 UTC
[ This is way overdue.  I've been a bit swamped to open a bug for it, though.
  And, as of version 2.20, I see that it's similar to the X-Spam-Level header,
  though an integer instead of asterisks.  Personally, this is more useful to
  me, using mh, and preferable to compare against. The patch included doesn't
  modify the tests in the t directory. ]

Justin,

I added the following feature to my local copy of spamassassin back in
January:

    o X-Spam-Hits header indicates the hits value for the mail message.

but have been a bit too busy lately to send a patch off to you.  So,
I'm quickly sending it off to you, in case it takes me a while to get
back to it.  [It took a while for me to get to it, afterall.  I'll
attempt to attach the patch after submitting this.]

I wanted something simple that I could use quickly with MH's scan
format to show the spamassassin hits value for each message.

This is just an old MH (or nmh) scan.default modified to display the
X-Spam-Hits value (after the patch below has been applied).

%5(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
%02(mon{date})/%02(mday{date})%<{date} %|*%>\
%<(mymbox{from})%<{to}To:%14(decode(addr{to}))%>%>\
%<(zero)%17(decode(addr{from}))%>  \
%<{x-spam-hits}%3(putnumf(compval{x-spam-hits}))%| %>  \
%(decode{subject})%<{body}<<%{body}>>%>

If the above is in "$HOME/`mhparam Path`/scan.spam", using
"scan -form scan.spam cur", one might see something like:

    1  03/04 1029912675861n13@   26  ****PROBABLY-SPAM**** Live life to the Ful

Of course, the "****PROBABLY-SPAM****" is a local config.  That
example message had a hits value of 26.2.  The X-Spam-Hits header
would look like:

X-Spam-Hits: 26.2

Just something that I thought would be useful for me to visually see
estimate spamassassin hit values in large amounts of mail, using my
regular MH tools. :)  (The main part of this came from wanting to verify
what spamassassin thought was spam versus my own view in archives.)
If MH's format files supported arbitrary parsing of subsections of headers,
I would've just pulled it from the X-Spam-Status header.

This was a quick hack.  So, I make no guarantees that it fits with
everything else nor is documented clearly. ;-)  The original patch was made
against spamassassin v2.01, but applied cleanly to v2.11.  The one attached
will be against v2.20.

I'm looking forward to getting back to playing with spamassassin.  Keep
up the good work.
Comment 1 Jeff Kellem 2002-05-05 22:45:28 UTC
Created attachment 93 [details]
x-spam-hits.patch
Comment 2 Jeff Kellem 2002-05-06 08:45:02 UTC
Minor correction: as you can see from the note and the patch, X-Spam-Hits is the
actual Hits value, not just the integer portion.  I only display the integer
portion when scanning with mh.  [ The bracketed note at the top was incorrect. ]
Comment 3 Craig Hughes 2002-06-10 01:31:16 UTC
I think this information is already captured in enough possible places that we needn't add yet 
another header.  I'll leave the patch here though in case anyone else wants to grab it after a 
search through the whole DB.