From 1143918ec92762e59c7fa271b9943004b63262e1 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Mon, 20 Jul 2015 09:56:18 -0700 Subject: [PATCH] badrcpt use reason, and defined-ness test as reported by frank on the QP mailing list --- plugins/badrcptto | 7 ++----- plugins/relay | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/badrcptto b/plugins/badrcptto index 0dec099..2acdd7f 100644 --- a/plugins/badrcptto +++ b/plugins/badrcptto @@ -66,12 +66,9 @@ sub hook_rcpt { if ($self->is_match($to, lc($bad), $host)) { $self->adjust_karma(-2); if ($reason) { - return DENY, "mail to $bad not accepted here"; - } - else { - return Qpsmtpd::DSN->no_such_user( - "mail to $bad not accepted here"); + return DENY, $reason; } + return Qpsmtpd::DSN->no_such_user("mail to $bad not accepted here"); } } $self->log(LOGINFO, 'pass'); diff --git a/plugins/relay b/plugins/relay index fdae3ad..6c7974b 100644 --- a/plugins/relay +++ b/plugins/relay @@ -230,7 +230,7 @@ sub hook_connect { return DECLINED; } - if ($ENV{RELAYCLIENT}) { + if (defined $ENV{RELAYCLIENT}) { $self->qp->connection->relay_client(1); $self->log(LOGINFO, "pass, enabled by env"); return DECLINED;