X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FSaPlugin%2FListMirror.pm;h=9acf86c0f399100a058106166c131931d72fdaf8;hb=af0b0fb7a454470a32c452119d0392e0dedb3fe1;hp=10101887bc668f45a141b941b8f69e33431a30d0;hpb=3c24b7e7e47be9646226d921897cc9ec92e9be8a;p=public-inbox.git diff --git a/lib/PublicInbox/SaPlugin/ListMirror.pm b/lib/PublicInbox/SaPlugin/ListMirror.pm index 10101887..9acf86c0 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-2021 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;