From a2f455320e38204d190d0f04ff5a28043bb05c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Tue, 10 Sep 2002 16:24:23 +0000 Subject: [PATCH] fix bug that made us get stuck if we got RCPT before MAIL. git-svn-id: https://svn.perl.org/qpsmtpd/trunk@70 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index 8058d57..23624aa 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -220,11 +220,12 @@ sub mail { sub rcpt { my $self = shift; return $self->respond(501, "syntax error in parameters") unless $_[0] =~ m/^to:/i; - return(503, "Use MAIL before RCPT") unless $self->transaction->sender; + return $self->respond(503, "Use MAIL before RCPT") unless $self->transaction->sender; my ($rcpt) = ($_[0] =~ m/to:(.*)/i)[0]; $rcpt = $_[1] unless $rcpt; $rcpt = (Mail::Address->parse($rcpt))[0]; + return $self->respond(501, "could not parse recipient") unless $rcpt; my ($rc, $msg) = $self->run_hooks("rcpt", $rcpt);