]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SaPlugin/ListMirror.pm
treewide: run update-copyrights from gnulib for 2019
[public-inbox.git] / lib / PublicInbox / SaPlugin / ListMirror.pm
index 10101887bc668f45a141b941b8f69e33431a30d0..a2a549448c3fd9e49caca661b49e4fd273ae510a 100644 (file)
@@ -1,7 +1,7 @@
-# Copyright (C) 2016 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2020 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
-# Rules useful for running a mailing list mirror.  We want to:
+# SpamAssassin rules useful for running a mailing list mirror.  We want to:
 # * ensure Received: headers are really from the list mail server
 #   users expect.  This is to prevent malicious users from
 #   injecting spam into mirrors without going through the expected
@@ -37,6 +37,7 @@ sub check_list_mirror_received {
        foreach my $cfg (@{$pms->{conf}->{list_mirror_check}}) {
                my ($hdr, $hval, $host_re, $addr_re) = @$cfg;
                my $v = $pms->get($hdr) or next;
+               local $/ = "\n";
                chomp $v;
                next if $v ne $hval;
                return 1 if $recvd !~ $host_re;
@@ -53,6 +54,7 @@ sub check_list_mirror_bcc {
                my ($hdr, $hval, $host_re, $addr_re) = @$cfg;
                defined $addr_re or next;
                my $v = $pms->get($hdr) or next;
+               local $/ = "\n";
                chomp $v;
                next if $v ne $hval;
                return 1 if !$tocc || $tocc !~ $addr_re;