check_earlytalker plugin. Deny the connection if the client talks

before we show our SMTP banner.  (From Devin Carraway)

  Patch Qpsmtpd::SMTP to allow connect plugins to give DENY and
  DENYSOFT return codes.  Based on patch from Devin Carraway.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@133 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Ask Bjørn Hansen 2003-04-15 17:01:43 +00:00
parent 224fe807e1
commit 22ca786bac
5 changed files with 27 additions and 2 deletions

View File

@ -5,6 +5,7 @@ check_badmailfrom and check_mailrcptto plugins.
Devin Carraway <qpsmtpd@devin.com>: Patch to not accept half mails if
the connection gets dropped at the wrong moment. Support and enable
taint checking. MAIL FROM host dns check configurable. HELO hook.
initial earlytalker plugin.
Andrew Pam <xanni@glasswings.com.au>: fixing the maximum message size
(databytes) stuff.

View File

@ -1,5 +1,11 @@
0.26-dev
check_earlytalker plugin. Deny the connection if the client talks
before we show our SMTP banner. (From Devin Carraway)
Patch Qpsmtpd::SMTP to allow connect plugins to give DENY and
DENYSOFT return codes. Based on patch from Devin Carraway.
Support morercpthosts.cdb
config now takes an extra "type" parameter. If it's "map" then a

View File

@ -7,7 +7,10 @@
# http_config http://localhost/~smtpd/config/ http://www.example.com/smtp.pl?config=
quit_fortune
#check_earlytalker
require_resolvable_fromhost
rhsbl
dnsbl
check_badmailfrom

View File

@ -73,9 +73,21 @@ sub start_conversation {
# this should maybe be called something else than "connect", see
# lib/Qpsmtpd/TcpServer.pm for more confusion.
my ($rc, $msg) = $self->run_hooks("connect");
if ($rc != DONE) {
if ($rc == DENY) {
$self->respond(550, ($msg || 'Connection from you denied, bye bye.'));
return $rc;
}
elsif ($rc == DENYSOFT) {
$self->respond(450, ($msg || 'Connection from you temporarily denied, bye bye.'));
return $rc;
}
elsif ($rc == DONE) {
return $rc;
}
elsif ($rc != DONE) {
$self->respond(220, $self->config('me') ." ESMTP qpsmtpd "
. $self->version ." ready; send us your mail, but not your spam.");
return DONE;
}
}

View File

@ -1,5 +1,7 @@
package Qpsmtpd::TcpServer;
use Qpsmtpd::SMTP;
use Qpsmtpd::Constants;
@ISA = qw(Qpsmtpd::SMTP);
use strict;
@ -25,7 +27,8 @@ sub run {
# should be somewhere in Qpsmtpd.pm and not here...
$self->load_plugins;
$self->start_conversation;
my $rc = $self->start_conversation;
return if $rc != DONE;
# this should really be the loop and read_input should just get one line; I think