is_naughty is a setter now too
This commit is contained in:
parent
cf5f1bb9af
commit
9c095ab278
@ -307,7 +307,12 @@ sub is_immune {
|
||||
}
|
||||
|
||||
sub is_naughty {
|
||||
my $self = shift;
|
||||
my ($self, $setit) = @_;
|
||||
|
||||
if ( defined $setit ) {
|
||||
$self->connection->notes('naughty', $setit);
|
||||
$self->connection->notes('rejected', $setit);
|
||||
};
|
||||
|
||||
if ($self->connection->notes('naughty')) {
|
||||
|
||||
|
@ -294,7 +294,7 @@ sub hook_rcpt {
|
||||
"skip, don't blacklist special account: " . $rcpt->user);
|
||||
|
||||
# clear the naughty connection note here, if desired.
|
||||
$self->connection->notes('naughty', 0);
|
||||
$self->is_naughty(0);
|
||||
}
|
||||
|
||||
return DECLINED;
|
||||
|
@ -661,9 +661,7 @@ sub autolearn_naughty {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $self->connection->notes('naughty')
|
||||
&& $response->{result} eq 'Innocent')
|
||||
{
|
||||
if ( $self->is_naughty() && $response->{result} eq 'Innocent') {
|
||||
$self->log(LOGINFO, "training naughty FN message as spam");
|
||||
$self->train_error_as_spam($transaction);
|
||||
return 1;
|
||||
@ -707,7 +705,7 @@ sub autolearn_spamassassin {
|
||||
|
||||
my $sa = $transaction->notes('spamassassin');
|
||||
if (!$sa || !$sa->{is_spam}) {
|
||||
if (!$self->connection->notes('naughty')) {
|
||||
if (!$self->is_naughty()) {
|
||||
$self->log(LOGERROR, "SA results missing"); # SA skips naughty
|
||||
}
|
||||
return;
|
||||
|
@ -167,7 +167,7 @@ sub data_post_handler {
|
||||
if ($found) {
|
||||
$self->log(LOGNOTICE, "fail, found virus $found");
|
||||
|
||||
$self->connection->notes('naughty', 1); # see plugins/naughty
|
||||
$self->is_naughty(1); # see plugins/naughty
|
||||
$self->adjust_karma(-1);
|
||||
|
||||
if ($self->{_args}{deny_viruses}) {
|
||||
|
Loading…
Reference in New Issue
Block a user