Skip to content

Commit

Permalink
badrcpt use reason, and defined-ness test
Browse files Browse the repository at this point in the history
as reported by frank on the QP mailing list
  • Loading branch information
msimerson committed Jul 20, 2015
1 parent 8f14cc0 commit 1143918
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions plugins/badrcptto
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion plugins/relay
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1143918

Please sign in to comment.