POD update, and change variable name for recipient address ($from => $to).
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@810 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
7d4605fdbc
commit
1cfd62c6d3
@ -1,4 +1,5 @@
|
|||||||
# this plugin checks the badrcptto config (like badmailfrom for rcpt address)
|
# this plugin checks the badrcptto config (like badmailfrom, but for rcpt address
|
||||||
|
# rather than sender address)
|
||||||
use Qpsmtpd::DSN;
|
use Qpsmtpd::DSN;
|
||||||
|
|
||||||
sub hook_rcpt {
|
sub hook_rcpt {
|
||||||
@ -6,12 +7,12 @@ sub hook_rcpt {
|
|||||||
my @badrcptto = $self->qp->config("badrcptto") or return (DECLINED);
|
my @badrcptto = $self->qp->config("badrcptto") or return (DECLINED);
|
||||||
return (DECLINED) unless $recipient->host && $recipient->user;
|
return (DECLINED) unless $recipient->host && $recipient->user;
|
||||||
my $host = lc $recipient->host;
|
my $host = lc $recipient->host;
|
||||||
my $from = lc($recipient->user) . '@' . $host;
|
my $to = lc($recipient->user) . '@' . $host;
|
||||||
for my $bad (@badrcptto) {
|
for my $bad (@badrcptto) {
|
||||||
$bad = lc $bad;
|
$bad = lc $bad;
|
||||||
$bad =~ s/^\s*(\S+)/$1/;
|
$bad =~ s/^\s*(\S+)/$1/;
|
||||||
return Qpsmtpd::DSN->no_such_user("mail to $bad not accepted here")
|
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")
|
return Qpsmtpd::DSN->no_such_user("mail to $bad not accepted here")
|
||||||
if substr($bad,0,1) eq '@' && $bad eq "\@$host";
|
if substr($bad,0,1) eq '@' && $bad eq "\@$host";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user