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