diff options
author | Eric Wong <e@80x24.org> | 2019-10-16 00:39:56 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-10-16 08:13:11 +0000 |
commit | 37724c7e792ca0e1df9f64cfc17cebf7359ca9f0 (patch) | |
tree | 60363627f5760625a2589d65c48a2d18f23304d8 /t/mda.t | |
parent | 356e1db5135802ed468719dfcd1f1c3f9dba9fff (diff) | |
download | public-inbox-37724c7e792ca0e1df9f64cfc17cebf7359ca9f0.tar.gz |
Since -mda now supports List-ID to better support mirroring of existing mailing lists, it probably makes sense to support disabling the precheck function to provide more accurate (though potentially spammier) mirrors of lists
Diffstat (limited to 't/mda.t')
-rw-r--r-- | t/mda.t | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -293,6 +293,21 @@ EOF my $path = mid2path($mid); my $msg = `git --git-dir=$maindir cat-file blob HEAD:$path`; like($msg, qr/\Q$list_id\E/, 'delivered message w/ List-ID matches'); + + # try a message w/o precheck + $simple = Email::Simple->new(<<EOF); +To: You <you\@example.com> +List-Id: <$list_id> + +this message would not be accepted without --no-precheck +EOF + $in = $simple->as_string; + my ($out, $err) = ('', ''); + IPC::Run::run([$mda, '--no-precheck'], \$in, \$out, \$err); + is($?, 0, 'mda OK with List-Id match and --no-precheck'); + my $cur = `git --git-dir=$maindir diff HEAD~1..HEAD`; + like($cur, qr/this message would not be accepted without --no-precheck/, + '--no-precheck delivered message anyways'); } done_testing(); |