add "disconnect" hook

git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@35 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Ask Bjørn Hansen 2002-07-15 11:49:49 +00:00
parent 2fe35f1b8d
commit d9d509019d
3 changed files with 19 additions and 1 deletions

View File

@ -85,3 +85,11 @@ Allowed return codes:
All other codes will qpsmtpd do the default response. All other codes will qpsmtpd do the default response.
=head2 disconnect
Called just before we shutdown a connection.
The return code is ignored. If a plugin returns anything but DECLINED
the following plugins will not be run (like with all other hooks).

View File

@ -273,7 +273,12 @@ sub quit {
if ($rc != DONE) { if ($rc != DONE) {
$self->respond(221, $self->config('me') . " closing connection. Have a wonderful day."); $self->respond(221, $self->config('me') . " closing connection. Have a wonderful day.");
} }
exit; $self->disconnect();
}
sub disconnect {
my $self = shift;
$self->run_hooks("disconnect");
} }
sub data { sub data {

View File

@ -52,5 +52,10 @@ sub respond {
return 1; return 1;
} }
sub disconnect {
my $self = shift;
$self->SUPER::disconnect(@_);
exit;
}
1; 1;