From ff347408239d3444c3bba98bd9304e67ce68cea9 Mon Sep 17 00:00:00 2001 From: Hanno Hecker Date: Wed, 15 Aug 2007 16:11:36 +0000 Subject: [PATCH] make the documented DENY{,SOFT}_DISCONNECT work in the data-post hook git-svn-id: https://svn.perl.org/qpsmtpd/trunk@771 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/SMTP.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Qpsmtpd/SMTP.pm b/lib/Qpsmtpd/SMTP.pm index d55bdd8..c420215 100644 --- a/lib/Qpsmtpd/SMTP.pm +++ b/lib/Qpsmtpd/SMTP.pm @@ -728,6 +728,18 @@ sub data_post_respond { # DATA is always the end of a "transaction" return $self->reset_transaction; } + elsif ($rc == DENY_DISCONNECT) { + $msg->[0] ||= "Message denied"; + $self->respond(552, @$msg); + $self->disconnect; + return 1; + } + elsif ($rc == DENYSOFT_DISCONNECT) { + $msg->[0] ||= "Message denied temporarily"; + $self->respond(452, @$msg); + $self->disconnect; + return 1; + } else { $self->queue($self->transaction); }