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:
parent
d86da9f944
commit
11c12711ee
@ -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");
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user