Fix deny plugin which stopped working.

Call deny plugin for _DISCONNECT constants.
Make Plugin.pm %hooks a global rather than lexical so we can do evil things later.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@320 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2004-09-19 18:49:05 +00:00
parent d86da9f944
commit 11c12711ee
2 changed files with 5 additions and 2 deletions

View File

@ -272,7 +272,9 @@ sub run_hooks {
}
# should we have a hook for "OK" too?
if ($r[0] == DENY or $r[0] == DENYSOFT) {
if ($r[0] == DENY or $r[0] == DENYSOFT or
$r[0] == DENY_DISCONNECT or $r[0] == DENYSOFT_DISCONNECT)
{
$r[1] = "" if not defined $r[1];
$self->log(LOGDEBUG, "Plugin $code->{name}, hook $hook returned $r[0], $r[1]");
$self->run_hooks("deny", $code->{name}, $r[0], $r[1]) unless ($hook eq "deny");

View File

@ -1,10 +1,11 @@
package Qpsmtpd::Plugin;
use strict;
my %hooks = map { $_ => 1 } qw(
our %hooks = map { $_ => 1 } qw(
config queue data data_post quit rcpt mail ehlo helo
auth auth-plain auth-login auth-cram-md5
connect reset_transaction unrecognized_command disconnect
deny
);
sub new {