Bug 5029 - New function for adding/rewriting headers
Summary: New function for adding/rewriting headers
Status: RESOLVED DUPLICATE of bug 2750
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 3.1.4
Hardware: HP Linux
: P5 enhancement
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-03 19:31 UTC by Chris St. Pierre
Modified: 2006-08-03 14:49 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Chris St. Pierre 2006-08-03 19:31:25 UTC
I switched to SpamAssassin from PureMessage and was accustomed to the GAUGE 
header tool in PureMessage.  It's similar to _STARS(*)_, but adds one star for 
every 10% probability over the threshold a given email has.  (PureMessage uses 
probabilities instead of SA scores, but they're basically the same.)  That means 
that if you count everything over 40% as spam, messages at 60% will only get 
'**', and even the spammiest of spam will only get '******' instead of 50 
asterisks.  This is much friendlier for rewriting the subject, so I added a 
simliar functionality, called _GAUGE(*)_, based heavily on the _STARS(*)_ 
function.  The diff follows:

--- Mail/SpamAssassin/PerMsgStatus.pm.bak       2006-08-03 13:52:55.000000000 -
0500
+++ Mail/SpamAssassin/PerMsgStatus.pm   2006-08-03 14:24:02.000000000 -0500
@@ -1230,6 +1230,13 @@

             AUTOLEARN => sub { return $self->get_autolearn_status(); },

+           GAUGE => sub {
+               my $arg = (shift || "*");
+               my $length = int($self->{score} / 10);
+               $length = 5 if $length > 5;
+               return $arg x $length;
+           },
+
             TESTS => sub {
               my $arg = (shift || ',');
               return (join($arg, sort(@{$self->{test_names_hit}})) || "none");
Comment 1 Theo Van Dinter 2006-08-03 21:49:19 UTC
Hi,

This sounds like a good candidate for a plugin (as opposed to modifying
PerMsgStatus).  However, as in bug 2750, it's generally too specific a use for
inclusion in the standard code.

Thanks. :)

*** This bug has been marked as a duplicate of 2750 ***