SA Bugzilla – Bug 5029
New function for adding/rewriting headers
Last modified: 2006-08-03 14:49:19 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");
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 ***