From 37f4c95175d6b7e0dd2b1623c63356fa4bbcbacf Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Mon, 25 Mar 2013 01:53:16 -0400 Subject: [PATCH] spamassassin: karma scoring is dependent on the sessage learn status, not SA (global) autolearn setting. So, karma learning follows SA learning rules. --- plugins/spamassassin | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/spamassassin b/plugins/spamassassin index 1279681..6455d8f 100644 --- a/plugins/spamassassin +++ b/plugins/spamassassin @@ -396,10 +396,11 @@ sub reject { my $ham_or_spam = $sa_results->{is_spam} eq 'Yes' ? 'Spam' : 'Ham'; my $status = "$ham_or_spam, $score"; my $learn = ''; - if ( $sa_results->{autolearn} ) { - $self->adjust_karma( 1 ) if $ham_or_spam eq 'Ham'; - $self->adjust_karma( -1 ) if $ham_or_spam eq 'Spam'; - $learn = "learn=". $sa_results->{autolearn}; + my $al = $sa_results->{autolearn}; + if ( $al ) { + $self->adjust_karma( 1 ) if $al eq 'ham'; + $self->adjust_karma( -1 ) if $al eq 'spam'; + $learn = "learn=". $al; }; my $reject = $self->{_args}{reject} or do {