Add X-Spam-Level header in spamassassin plugin (idea from Werner Fleck)

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@795 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Ask Bjørn Hansen 2007-09-24 20:45:09 +00:00
parent 2361ca606d
commit 475203689d
2 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,7 @@
0.41
Add X-Spam-Level header in spamassassin plugin (idea from Werner Fleck)
Remove the auth/authnull sample plugin (there are plenty proper examples now
so we don't have to include this insecure plugin)

View File

@ -186,11 +186,18 @@ sub hook_data_post { # check_spam
$self->_cleanup_spam_header($transaction, 'X-Spam-Flag');
$self->_cleanup_spam_header($transaction, 'X-Spam-Status');
$self->_cleanup_spam_header($transaction, 'X-Spam-Level');
$transaction->header->add('X-Spam-Flag', 'YES', 0) if ($flag eq 'Yes');
$transaction->header->add('X-Spam-Status',
"$flag, hits=$hits required=$required\n" .
"\ttests=$tests", 0);
my $length = int($hits);
$length = 1 if $length < 1;
$length = 50 if $length > 50;
$transaction->header->add('X-Spam-Level', '*' x $length, 0);
$self->log(LOGNOTICE, "check_spam: $flag, hits=$hits, required=$required, " .
"tests=$tests");