add "disconnect" hook
git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@35 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
2fe35f1b8d
commit
d9d509019d
@ -85,3 +85,11 @@ Allowed return codes:
|
||||
|
||||
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).
|
||||
|
||||
|
@ -273,7 +273,12 @@ sub quit {
|
||||
if ($rc != DONE) {
|
||||
$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 {
|
||||
|
@ -52,5 +52,10 @@ sub respond {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub disconnect {
|
||||
my $self = shift;
|
||||
$self->SUPER::disconnect(@_);
|
||||
exit;
|
||||
}
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user