Check $addr is defined before using it (#266)

Prevent the following error if we receive an invalid RCPT TO (eg <"relaytest%nmap.scanme.org">)

Can't call method "qp" on an undefined value at /usr/share/perl5/vendor_perl/Qpsmtpd.pm line 451.
/usr/bin/qpsmtpd-forkserver[17472]: command 'rcpt' failed unexpectedly
This commit is contained in:
Daniel B 2016-05-15 19:19:02 +02:00 committed by Matt Simerson
parent f8c66145a1
commit 03c9d045f4

View File

@ -448,7 +448,7 @@ sub auth_mechanism {
sub address {
my $self = shift;
my $addr = Qpsmtpd::Address->new(@_);
$addr->qp($self);
$addr->qp($self) if $addr;
return $addr;
}