From 37724c7e792ca0e1df9f64cfc17cebf7359ca9f0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 16 Oct 2019 00:39:56 +0000 Subject: mda: support --no-precheck option 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 --- t/mda.t | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 't/mda.t') diff --git a/t/mda.t b/t/mda.t index 3cab590b..92e8ad0d 100644 --- a/t/mda.t +++ b/t/mda.t @@ -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(< +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(); -- cgit v1.2.3-24-ge0c7