From 9cd26b24c4f5df0a71be0dfdf0adef1e740bcdfb Mon Sep 17 00:00:00 2001 From: John Peacock Date: Fri, 24 Sep 2004 15:17:07 +0000 Subject: [PATCH] * spamassassin Must replace any existing X-Spam headers with local score, rather than adding. Don't care what other SA instances thought. (Michael Holzt) git-svn-id: https://svn.perl.org/qpsmtpd/trunk@330 958fd67b-6ff1-0310-b445-bb7760255be9 --- plugins/spamassassin | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/spamassassin b/plugins/spamassassin index 02a89ef..f68e5a4 100644 --- a/plugins/spamassassin +++ b/plugins/spamassassin @@ -144,7 +144,7 @@ sub check_spam { my $line0 = ; # get the first protocol lines out if ($line0) { $self->log(6, "check_spam: spamd: $line0"); - $transaction->header->add("X-Spam-Check-By", $self->qp->config('me'), 0); + $transaction->header->replace("X-Spam-Check-By", $self->qp->config('me'), 0); } my ($flag, $hits, $required); @@ -162,8 +162,8 @@ sub check_spam { $flag = $flag eq 'True' ? 'Yes' : 'No'; $self->log(6, "check_spam: finished reading from spamd"); - $transaction->header->add('X-Spam-Flag', 'YES', 0) if ($flag eq 'Yes'); - $transaction->header->add('X-Spam-Status', + $transaction->header->replace('X-Spam-Flag', 'YES', 0) if ($flag eq 'Yes'); + $transaction->header->replace('X-Spam-Status', "$flag, hits=$hits required=$required\n" . "\ttests=$tests", 0); $self->log(5, "check_spam: $flag, hits=$hits, required=$required, " .