I have DoPenalty set to 'monitor/messageScoring', DoPenaltyExtreme set 'disabled', DoPenaltyExtremeSMTP set 'disabled', and PenaltyExtreme is set to the default of '150'.
But I am still getting log messages as follows:
Message-Score: added 25 for Extreme Bad History (460), total score for this message is now 25
I believe there is a bug in the code where it should be checking the value of 'DoPenaltyExtreme' but it is not.
Would it make more sense to have the first "return 1" line in the code I list below, look as follows?
- Code: Select all
return 1 if !$PenaltyExtreme || !$DoPenaltyExtreme;
- Code: Select all
sub PBExtremeOK {
my ( $fh, $myip, $skipcip) = @_;
--- cut ----
return 1 if !$PenaltyExtreme;
return 1 if ( !exists $PBBlack{&ipNetwork( $myip, $PenaltyUseNetblocks )} );
return 1 if matchIP( $myip, 'noExtremePB', $fh );
return 1 if matchSL( &batv_remove_tag(0,$this->{mailfrom},''), 'noExtremePBAddresses' );
my $tlit = tlit($main::DoPenaltyExtreme);
my ( $ct, $ut, $level, $totalscore, $sip, $reason, $counter ) =
split( ' ', $PBBlack{&ipNetwork( $myip, $PenaltyUseNetblocks )} );
if ( $totalscore >= $PenaltyLimit && $totalscore < $PenaltyExtreme ) {
$this->{messagereason} = "Bad IP History";
pbAdd( $fh, $myip, $pbValencePB, "BadHistory", 1 );
}
if ( $PenaltyExtreme && $totalscore >= $PenaltyExtreme ) {
$this->{messagereason} = "Extreme Bad History ($totalscore)";
pbAdd( $fh, $myip, $pbeValencePB, "ExtremeHistory", 1 );
return 1 if !$DoPenaltyExtreme;
$this->{prepend} = "[Extreme]";
$this->{messagereason} = "score for $myip is $totalscore, surpassing extreme level of $PenaltyExtreme";
mlog( $fh,"$tlit (totalscore for '$myip' is $totalscore, surpassing extreme level of $PenaltyExtreme, last penalty was '$reason')")
if $PenaltyExtremeLog >= 2 && $DoPenaltyExtreme >= 2;
return 1 if $DoPenaltyExtreme >= 2;
$Stats{pbextreme}++;
return 0;
}
return 1;
}
