rhsbl: make sure $transaction->sender defined before accessing it

This commit is contained in:
Matt Simerson 2012-06-27 03:21:22 -04:00
parent bc793a87c7
commit 6988fa5377

View File

@ -103,10 +103,12 @@ sub hook_mail {
$self->log(LOGINFO, "fail, $result"); $self->log(LOGINFO, "fail, $result");
if ( $transaction->sender ) {
my $host = $transaction->sender->host; my $host = $transaction->sender->host;
if ($result =~ /^$host\./ ) { if ($result =~ /^$host\./ ) {
return $self->get_reject( "Mail from $host rejected because it $result" ); return $self->get_reject( "Mail from $host rejected because it $result" );
}; };
};
my $hello = $self->qp->connection->hello_host; my $hello = $self->qp->connection->hello_host;
return $self->get_reject( "Mail from HELO $hello rejected because it $result" ); return $self->get_reject( "Mail from HELO $hello rejected because it $result" );