From c3562e256d60a622567b6c075ff4fc69815d94a5 Mon Sep 17 00:00:00 2001 From: Matt Sergeant Date: Wed, 6 Jul 2005 22:16:08 +0000 Subject: [PATCH] Allow DENY to be returned from unrecognised_command again git-svn-id: https://svn.perl.org/qpsmtpd/trunk@476 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/SMTP.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Qpsmtpd/SMTP.pm b/lib/Qpsmtpd/SMTP.pm index 542ef13..536127f 100644 --- a/lib/Qpsmtpd/SMTP.pm +++ b/lib/Qpsmtpd/SMTP.pm @@ -52,12 +52,13 @@ sub dispatch { if ($cmd !~ /^(\w{1,12})$/ or !exists $self->{_commands}->{$1}) { my ($rc, $msg) = $self->run_hooks("unrecognized_command", $cmd); - if ($rc == DENY_DISCONNECT or $rc == DENY) { - $self->log(LOGWARN, "Returning DENY for the unrecognized_command hook is deprecated; use DENY_DISCONNECT") - if $rc == DENY; + if ($rc == DENY_DISCONNECT) { $self->respond(521, $msg); $self->disconnect; } + elsif ($rc == DENY) { + $self->respond(521, $msg); + } elsif ($rc == DONE) { 1; }