Disconnect hosts in rhsbl

This commit is contained in:
Charlie Brady 2009-07-20 12:59:32 +02:00 committed by Filippo Carletti
parent 7efee7b1af
commit a138bcf5a4
2 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,6 @@
Disconnect host in rhsbl (Charlie Brady)
POD cleanups (Steve Kemp) POD cleanups (Steve Kemp)
check_spamhelo disconnects after denying a 'helo' (Filippo Carletti) check_spamhelo disconnects after denying a 'helo' (Filippo Carletti)

View File

@ -1,5 +1,15 @@
#!perl -w #!perl -w
sub register {
my ($self, $qp, $denial ) = @_;
if ( defined $denial and $denial =~ /^disconnect$/i ) {
$self->{_rhsbl}->{DENY} = DENY_DISCONNECT;
}
else {
$self->{_rhsbl}->{DENY} = DENY;
}
}
sub hook_mail { sub hook_mail {
my ($self, $transaction, $sender, %param) = @_; my ($self, $transaction, $sender, %param) = @_;
@ -49,12 +59,12 @@ sub hook_rcpt {
my $result = $self->process_sockets; my $result = $self->process_sockets;
if ($result && defined($self->{_rhsbl_zones_map}{$result})) { if ($result && defined($self->{_rhsbl_zones_map}{$result})) {
if ($result =~ /^$host\./ ) { if ($result =~ /^$host\./ ) {
return (DENY, "Mail from $host rejected because it " . $self->{_rhsbl_zones_map}{$result}); return ($self->{_rhsbl}->{DENY}, "Mail from $host rejected because it " . $self->{_rhsbl_zones_map}{$result});
} else { } else {
return (DENY, "Mail from HELO $hello rejected because it " . $self->{_rhsbl_zones_map}{$result}); return ($self->{_rhsbl}->{DENY}, "Mail from HELO $hello rejected because it " . $self->{_rhsbl_zones_map}{$result});
} }
} }
return (DENY, $result) if $result; return ($self->{_rhsbl}->{DENY}, $result) if $result;
return DECLINED; return DECLINED;
} }