X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FSaPlugin%2FListMirror.pm;h=a2a549448c3fd9e49caca661b49e4fd273ae510a;hb=95bdac7f09c69036efed537a4d03d5bdd2ae4eb6;hp=10101887bc668f45a141b941b8f69e33431a30d0;hpb=3c24b7e7e47be9646226d921897cc9ec92e9be8a;p=public-inbox.git diff --git a/lib/PublicInbox/SaPlugin/ListMirror.pm b/lib/PublicInbox/SaPlugin/ListMirror.pm index 10101887..a2a54944 100644 --- a/lib/PublicInbox/SaPlugin/ListMirror.pm +++ b/lib/PublicInbox/SaPlugin/ListMirror.pm @@ -1,7 +1,7 @@ -# Copyright (C) 2016 all contributors +# Copyright (C) 2016-2020 all contributors # License: AGPL-3.0+ -# 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;