headers: smite poorly behaved senders with -karma
This commit is contained in:
parent
e47d431aa9
commit
b43f369dbe
@ -133,6 +133,7 @@ sub hook_data_post {
|
||||
|
||||
foreach my $h ( @required_headers ) {
|
||||
next if $header->get($h);
|
||||
$self->adjust_karma( -1 );
|
||||
return $self->get_reject( "We require a valid $h header", "no $h header");
|
||||
};
|
||||
|
||||
@ -140,11 +141,18 @@ sub hook_data_post {
|
||||
next if ! $header->get($h); # doesn't exist
|
||||
my @qty = $header->get($h);
|
||||
next if @qty == 1; # only 1 header
|
||||
return $self->get_reject("Only one $h header allowed. See RFC 5322, Section 3.6", "too many $h headers");
|
||||
$self->adjust_karma( -1 );
|
||||
return $self->get_reject(
|
||||
"Only one $h header allowed. See RFC 5322, Section 3.6",
|
||||
"too many $h headers",
|
||||
);
|
||||
};
|
||||
|
||||
my $err_msg = $self->invalid_date_range();
|
||||
return $self->get_reject($err_msg, $err_msg) if $err_msg;
|
||||
if ( $err_msg ) {
|
||||
$self->adjust_karma( -1 );
|
||||
return $self->get_reject($err_msg, $err_msg);
|
||||
};
|
||||
|
||||
$self->log( LOGINFO, 'pass' );
|
||||
return (DECLINED);
|
||||
|
Loading…
Reference in New Issue
Block a user