From a138bcf5a43fc553255e77f892166c7dd7a1cd8b Mon Sep 17 00:00:00 2001 From: Charlie Brady Date: Mon, 20 Jul 2009 12:59:32 +0200 Subject: [PATCH] Disconnect hosts in rhsbl --- Changes | 2 ++ plugins/rhsbl | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index ddd16e0..94d2b27 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,6 @@ + Disconnect host in rhsbl (Charlie Brady) + POD cleanups (Steve Kemp) check_spamhelo disconnects after denying a 'helo' (Filippo Carletti) diff --git a/plugins/rhsbl b/plugins/rhsbl index 03a0585..2a613a3 100644 --- a/plugins/rhsbl +++ b/plugins/rhsbl @@ -1,5 +1,15 @@ #!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 { my ($self, $transaction, $sender, %param) = @_; @@ -49,12 +59,12 @@ sub hook_rcpt { my $result = $self->process_sockets; if ($result && defined($self->{_rhsbl_zones_map}{$result})) { 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 { - 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; }