dspam/spamassassin: adjust karma awards
dspam: be more conservative when learning from karma sa: added an SA autolearn bonus
This commit is contained in:
parent
2f3127359d
commit
e433796b96
@ -634,13 +634,13 @@ sub autolearn_karma {
|
||||
my $karma = $self->connection->notes('karma');
|
||||
return if ! defined $karma;
|
||||
|
||||
if ( $karma < -1 && $response->{result} eq 'Innocent' ) {
|
||||
if ( $karma < -2 && $response->{result} eq 'Innocent' ) {
|
||||
$self->log(LOGINFO, "training bad karma ($karma) FN as spam");
|
||||
$self->train_error_as_spam( $transaction );
|
||||
return 1;
|
||||
};
|
||||
|
||||
if ( $karma > 1 && $response->{result} eq 'Spam' ) {
|
||||
if ( $karma > 2 && $response->{result} eq 'Spam' ) {
|
||||
$self->log(LOGINFO, "training good karma ($karma) FP as ham");
|
||||
$self->train_error_as_ham( $transaction );
|
||||
return 1;
|
||||
|
@ -394,9 +394,12 @@ sub reject {
|
||||
};
|
||||
|
||||
my $ham_or_spam = $sa_results->{is_spam} eq 'Yes' ? 'Spam' : 'Ham';
|
||||
if ( $ham_or_spam eq 'Spam' ) {
|
||||
$self->adjust_karma( -1 );
|
||||
};
|
||||
my $status = "$ham_or_spam, $score";
|
||||
my $learn = '';
|
||||
my $al = $sa_results->{autolearn};
|
||||
my $al = $sa_results->{autolearn}; # subject to local SA learn scores
|
||||
if ( $al ) {
|
||||
$self->adjust_karma( 1 ) if $al eq 'ham';
|
||||
$self->adjust_karma( -1 ) if $al eq 'spam';
|
||||
@ -404,7 +407,7 @@ sub reject {
|
||||
};
|
||||
|
||||
my $reject = $self->{_args}{reject} or do {
|
||||
$self->log(LOGERROR, "pass, reject disabled ($status, $learn)");
|
||||
$self->log(LOGERROR, "error, reject disabled ($status, $learn)");
|
||||
return DECLINED;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user