about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-16 00:39:56 +0000
committerEric Wong <e@80x24.org>2019-10-16 08:13:11 +0000
commit37724c7e792ca0e1df9f64cfc17cebf7359ca9f0 (patch)
tree60363627f5760625a2589d65c48a2d18f23304d8 /t
parent356e1db5135802ed468719dfcd1f1c3f9dba9fff (diff)
downloadpublic-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')
-rw-r--r--t/mda.t15
1 files changed, 15 insertions, 0 deletions
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(<<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();