Perform checks on MAIL-FROM and RCPT-TO case insensitively.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@248 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
8d07a36fcc
commit
4f2f9889d0
@ -30,11 +30,12 @@ sub mail_handler {
|
||||
and $sender->host && $sender->user);
|
||||
|
||||
my $host = lc $sender->host;
|
||||
my $from = $sender->user . '@' . $host;
|
||||
my $from = lc($sender->user) . '@' . $host;
|
||||
|
||||
for my $bad (@badmailfrom) {
|
||||
$bad =~ s/^\s*(\S+).*/$1/;
|
||||
next unless $bad;
|
||||
$bad = lc $bad;
|
||||
warn "Bad badmailfrom config: No \@ sign in $bad\n" and next unless $bad =~ m/\@/;
|
||||
$transaction->notes('badmailfrom', "Mail from $bad not accepted here")
|
||||
if ($bad eq $from)
|
||||
|
@ -10,8 +10,9 @@ sub check_for_badrcptto {
|
||||
my @badrcptto = $self->qp->config("badrcptto") or return (DECLINED);
|
||||
return (DECLINED) unless $recipient->host && $recipient->user;
|
||||
my $host = lc $recipient->host;
|
||||
my $from = $recipient->user . '@' . $host;
|
||||
my $from = lc($recipient->user) . '@' . $host;
|
||||
for my $bad (@badrcptto) {
|
||||
$bad = lc $bad;
|
||||
$bad =~ s/^\s*(\S+)/$1/;
|
||||
return (DENY, "mail to $bad not accepted here")
|
||||
if $bad eq $from;
|
||||
|
Loading…
Reference in New Issue
Block a user