From 4f2f9889d0901893f2533aca13730b4cb4ffa398 Mon Sep 17 00:00:00 2001 From: Devin Carraway Date: Fri, 18 Jun 2004 05:47:45 +0000 Subject: [PATCH] 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 --- plugins/check_badmailfrom | 3 ++- plugins/check_badrcptto | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/check_badmailfrom b/plugins/check_badmailfrom index 45a7f0f..6a467eb 100644 --- a/plugins/check_badmailfrom +++ b/plugins/check_badmailfrom @@ -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) diff --git a/plugins/check_badrcptto b/plugins/check_badrcptto index 276015e..eb9e7c3 100644 --- a/plugins/check_badrcptto +++ b/plugins/check_badrcptto @@ -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;