You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qpsmtpd/qpsmtpd-0.96-more_badrcptto...

41 lines
1.3 KiB
Diff

diff -Nur -x '*.orig' -x '*.rej' qpsmtpd-0.96/plugins/badrcptto mezzanine_patched_qpsmtpd-0.96/plugins/badrcptto
--- qpsmtpd-0.96/plugins/badrcptto 2016-02-16 23:52:02.000000000 +0100
+++ mezzanine_patched_qpsmtpd-0.96/plugins/badrcptto 2016-04-22 10:27:18.648307689 +0200
@@ -12,6 +12,13 @@
a complete email address, a host entry that starts with an @ symbol, or a
regular expression. For regexp pattern matches, see PATTERNS.
+=head1 CONFIG FILES
+
+=head2 more_badrcptto
+
+Optional additional file to look for badrcptto in I<config>. Same syntax
+as the default badrcptto
+
=head1 PATTERNS
This allows special patterns to be denied (e.g. percent hack, bangs,
@@ -46,6 +53,11 @@
use Qpsmtpd::Constants;
use Qpsmtpd::DSN;
+sub register {
+ my ($self, $qp, %arg) = @_;
+ $self->{_more_badrcptto} = $arg{more_badrcptto} if $arg{more_badrcptto};
+}
+
sub hook_rcpt {
my ($self, $transaction, $recipient, %param) = @_;
@@ -58,6 +70,10 @@
$self->log(LOGINFO, "skip, empty config");
return DECLINED;
};
+ if (defined $self->{_more_badrcptto}){
+ $self->log(LOGDEBUG, 'Loading additional badrcptto from ' . $self->{_more_badrcptto});
+ push @badrcptto, $self->qp->config($self->{_more_badrcptto});
+ }
for my $line (@badrcptto) {
$line =~ s/^\s+//g; # trim leading whitespace