+my $msgs = $ibx->over->recent;
+is(scalar(@$msgs), 1, 'only got one message');
+my $eml = $ibx->smsg_eml($msgs->[0]);
+is($eml->as_string, $mime->as_string, 'injected message');
+
+{
+ my @new = glob("$faildir/new/*");
+ is_deeply(\@new, [], 'nothing in faildir');
+ local $ENV{PATH} = $fail_path;
+ $mime->header_set('Message-ID', '<bar@foo>');
+ $rdr->{0} = \($mime->as_string);
+ ok(run_script(['-mda'], undef, $rdr), 'mda did not die on "spam"');
+ @new = glob("$faildir/new/*");
+ is(scalar(@new), 1, 'got a message in faildir');
+ $msgs = $ibx->over->recent;
+ is(scalar(@$msgs), 1, 'no new message');
+
+ my $config = "$ENV{PI_DIR}/config";
+ ok(-f $config, 'config exists');
+ my $k = 'publicinboxmda.spamcheck';
+ is(xsys('git', 'config', "--file=$config", $k, 'none'), 0,
+ 'disabled spamcheck for mda');
+
+ ok(run_script(['-mda'], undef, $rdr), 'mda did not die');
+ my @again = glob("$faildir/new/*");
+ is_deeply(\@again, \@new, 'no new message in faildir');
+ $msgs = $ibx->over->recent;
+ is(scalar(@$msgs), 2, 'new message added OK');
+}