From db3d27ba4efb12d016eb82f4322d40347ab43d91 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Fri, 22 Jun 2012 05:44:42 -0400 Subject: [PATCH] removed check_badrcptto_patterns: merged into check_badrcptto --- plugins/check_badrcptto_patterns | 48 -------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 plugins/check_badrcptto_patterns diff --git a/plugins/check_badrcptto_patterns b/plugins/check_badrcptto_patterns deleted file mode 100644 index 807eb69..0000000 --- a/plugins/check_badrcptto_patterns +++ /dev/null @@ -1,48 +0,0 @@ -#!perl -w -=pod - -=head1 SYNOPSIS - -This plugin checks the badrcptto_patterns config. This allows -special patterns to be denied (e.g. percent hack, bangs, -double ats). - -=head1 CONFIG - -config/badrcptto_patterns - -Patterns are stored in the format pattern\sresponse, where pattern -is a Perl pattern expression. Don't forget to anchor the pattern if -you want to restrict it from matching anywhere in the string. - -qpsmtpd already ensures that the address contains an @, with something -to the left and right of the @. - -=head1 AUTHOR - -Copyright 2005 Gordon Rowell - -This software is free software and may be distributed under the same -terms as qpsmtpd itself. - -=cut - -sub hook_rcpt -{ - my ($self, $transaction, $recipient) = @_; - - return (DECLINED) if $self->qp->connection->relay_client(); - - my @badrcptto = $self->qp->config("badrcptto_patterns") or return (DECLINED); - my $host = lc $recipient->host; - my $to = lc($recipient->user) . '@' . $host; - - for (@badrcptto) - { - my ($pattern, $response) = split /\s+/, $_, 2; - - return (DENY, $response) if ($to =~ /$pattern/); - } - - return (DECLINED); -}