From 499d1e6a4cf9281bf8e163051aa590bb46412119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Fri, 20 Sep 2002 18:55:41 +0000 Subject: [PATCH] fix "use of uninitialized variable" warnings git-svn-id: https://svn.perl.org/qpsmtpd/trunk@76 958fd67b-6ff1-0310-b445-bb7760255be9 --- Changes | 8 ++++++++ lib/Qpsmtpd.pm | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 7d51283..9c19bb2 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,15 @@ +2002/09/20 + Avoid "use of uninitialized variable" warning when the "MAIL" or the + "RCPT" command is executed without a parameter. + + Compatibility with perl 5.5.3. + + 2002/09/12 Fix "Could not print" error message in the TcpServer object. (Thanks to Ross Mueller ) + 2002/09/10 dnsbl plugin queues lookups in the background upon connect but doesn't block for the results until they are needed, greatly diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index 23624aa..14c8900 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -157,7 +157,7 @@ sub ehlo { sub mail { my $self = shift; - return $self->respond(501, "syntax error in parameters") if $_[0] !~ m/^from:/i; + return $self->respond(501, "syntax error in parameters") if !$_[0] or $_[0] !~ m/^from:/i; # -> from RFC2821 # The MAIL command (or the obsolete SEND, SOML, or SAML commands) @@ -219,7 +219,7 @@ sub mail { sub rcpt { my $self = shift; - return $self->respond(501, "syntax error in parameters") unless $_[0] =~ m/^to:/i; + return $self->respond(501, "syntax error in parameters") unless $_[0] and $_[0] =~ m/^to:/i; return $self->respond(503, "Use MAIL before RCPT") unless $self->transaction->sender; my ($rcpt) = ($_[0] =~ m/to:(.*)/i)[0];