-# Copyright (C) 2016 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2021 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
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;
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;