From b2532e8daafb8251b20dc499bfdb683270482dd3 Mon Sep 17 00:00:00 2001 From: Radu Greab Date: Thu, 1 May 2008 06:20:45 +0000 Subject: [PATCH] $msg is an arrayref, dereference it before passing to $self->respond. Before this, the SMTP responses contained the reference stringification instead of the real message, when a plugin denied the mail at the DATA stage: 554 ARRAY(0x9362f10) git-svn-id: https://svn.perl.org/qpsmtpd/trunk@881 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/PollServer.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Qpsmtpd/PollServer.pm b/lib/Qpsmtpd/PollServer.pm index 81f0d6d..262be79 100644 --- a/lib/Qpsmtpd/PollServer.pm +++ b/lib/Qpsmtpd/PollServer.pm @@ -183,22 +183,26 @@ sub data_respond { return; } elsif ($rc == DENY) { - $self->respond(554, $msg || "Message denied"); + $msg->[0] ||= "Message denied"; + $self->respond(554, @$msg); $self->reset_transaction(); return; } elsif ($rc == DENYSOFT) { - $self->respond(451, $msg || "Message denied temporarily"); + $msg->[0] ||= "Message denied temporarily"; + $self->respond(451, @$msg); $self->reset_transaction(); return; } elsif ($rc == DENY_DISCONNECT) { - $self->respond(554, $msg || "Message denied"); + $msg->[0] ||= "Message denied"; + $self->respond(554, @$msg); $self->disconnect; return; } elsif ($rc == DENYSOFT_DISCONNECT) { - $self->respond(451, $msg || "Message denied temporarily"); + $msg->[0] ||= "Message denied temporarily"; + $self->respond(451, @$msg); $self->disconnect; return; }