+ delete $config->{'publicinboxwatch.spamcheck'};
+}
+
+{
+ my $patch = 't/data/0001.patch';
+ open my $fh, '<', $patch or die "failed to open $patch: $!\n";
+ $msg = do { local $/; <$fh> };
+ PublicInbox::Emergency->new($maildir)->prepare(\$msg);
+ PublicInbox::Watch->new($config)->scan('full');
+ my $msgs = $srch->reopen->query('dfpost:6e006fd7');
+ is(scalar(@$msgs), 1, 'diff postimage found');
+ my $post = $msgs->[0];
+ $msgs = $srch->query('dfpre:090d998b6c2c');
+ is(scalar(@$msgs), 1, 'diff preimage found');
+ is($post->{blob}, $msgs->[0]->{blob}, 'same message');
+}
+
+# multiple inboxes in the same maildir
+{
+ my $v1repo = "$tmpdir/v1";
+ my $v1pfx = "publicinbox.v1";
+ my $v1addr = 'v1-public@example.com';
+ PublicInbox::Import::init_bare($v1repo);
+ my $cfg2 = <<EOF;
+$orig$v1pfx.address=$v1addr
+$v1pfx.inboxdir=$v1repo
+$v1pfx.watch=maildir:$maildir
+EOF
+ my $config = PublicInbox::Config->new(\$cfg2);
+ my $both = <<EOF;
+From: user\@example.com
+To: $addr, $v1addr
+Subject: both
+Message-Id: <both\@b.com>
+Date: Sat, 18 Jun 2016 00:00:00 +0000
+
+both
+EOF
+ PublicInbox::Emergency->new($maildir)->prepare(\$both);
+ PublicInbox::Watch->new($config)->scan('full');
+ my $msgs = $srch->reopen->query('m:both@b.com');
+ my $v1 = $config->lookup_name('v1');
+ my $msg = $v1->git->cat_file($msgs->[0]->{blob});
+ is($both, $$msg, 'got original message back from v1');
+ $msg = $ibx->git->cat_file($msgs->[0]->{blob});
+ is($both, $$msg, 'got original message back from v2');
+}
+
+{
+ my $want = <<'EOF';
+From: <u@example.com>
+List-Id: <i.want.you.to.want.me>
+Message-ID: <do.want@example.com>
+EOF
+ my $do_not_want = <<'EOF';
+From: <u@example.com>
+List-Id: <do.not.want>
+X-Mailing-List: no@example.com
+Message-ID: <do.not.want@example.com>
+EOF
+ my $cfg = $orig."$cfgpfx.listid=i.want.you.to.want.me\n";
+ PublicInbox::Emergency->new($maildir)->prepare(\$want);
+ PublicInbox::Emergency->new($maildir)->prepare(\$do_not_want);
+ my $config = PublicInbox::Config->new(\$cfg);
+ PublicInbox::Watch->new($config)->scan('full');
+ $ibx = $config->lookup_name('test');
+ my $num = $ibx->mm->num_for('do.want@example.com');
+ ok(defined $num, 'List-ID matched for watch');
+ $num = $ibx->mm->num_for('do.not.want@example.com');
+ is($num, undef, 'unaccepted List-ID matched for watch');
+
+ $cfg = $orig."$cfgpfx.watchheader=X-Mailing-List:no\@example.com\n";
+ $config = PublicInbox::Config->new(\$cfg);
+ PublicInbox::Watch->new($config)->scan('full');
+ $ibx = $config->lookup_name('test');
+ $num = $ibx->mm->num_for('do.not.want@example.com');
+ ok(defined $num, 'X-Mailing-List matched');