diff -Nur -x '*.orig' -x '*.rej' qpsmtpd-0.40/plugins/check_badrcptto mezzanine_patched_qpsmtpd-0.40/plugins/check_badrcptto --- qpsmtpd-0.40/plugins/check_badrcptto 2008-01-07 02:55:53.000000000 -0700 +++ mezzanine_patched_qpsmtpd-0.40/plugins/check_badrcptto 2008-01-07 02:53:20.000000000 -0700 @@ -1,20 +1,22 @@ -# this plugin checks the badrcptto config (like badmailfrom for rcpt address) +# this plugin checks the badrcptto config (like badmailfrom for sender) use Qpsmtpd::DSN; sub hook_rcpt { my ($self, $transaction, $recipient, %param) = @_; + return Qpsmtpd::DSN->no_such_user("recipient address must include local part") + unless $recipient->user; return (DECLINED) if $self->qp->connection->relay_client; my @badrcptto = $self->qp->config("badrcptto") or return (DECLINED); return (DECLINED) unless $recipient->host && $recipient->user; my $host = lc $recipient->host; - my $from = lc($recipient->user) . '@' . $host; + my $to = lc($recipient->user) . '@' . $host; for my $bad (@badrcptto) { $bad = lc $bad; $bad =~ s/^\s*(\S+)/$1/; return Qpsmtpd::DSN->no_such_user("mail to $bad not accepted here") - if $bad eq $from; + if $bad eq $to; return Qpsmtpd::DSN->no_such_user("mail to $bad not accepted here") - if substr($bad,0,1) eq '@' && $bad eq "\@$host"; + if $bad eq "\@$host"; } return (DECLINED); }