async: check return values from pre-connection hook

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@900 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Hanno Hecker 2008-05-12 14:42:41 +00:00
parent b901440dfe
commit a9e2089ab7

View File

@ -55,7 +55,21 @@ sub new {
$self->{mode} = 'connect';
$self->load_plugins;
$self->load_logging;
$self->run_hooks("pre-connection");
my ($rc, @msg) = $self->run_hooks("pre-connection");
if ($rc == DENYSOFT || $rc == DENYSOFT_DISCONNECT) {
@msg = ("Sorry, try again later")
unless @msg;
$self->respond(451, @msg);
$self->disconnect;
}
elsif ($rc == DENY || $rc == DENY_DISCONNECT) {
@msg = ("Sorry, service not available for you")
unless @msg;
$self->respond(550, @msg);
$self->disconnect;
}
return $self;
}