-use_ok 'PublicInbox::V2Writable';
-my ($inboxdir, $for_destroy) = tmpdir();
-my $cfgpath = "$inboxdir/$$.config";
-SKIP: {
- require_mods(qw(Plack::Test::ExternalServer), 1);
+my ($tmpdir, $for_destroy) = tmpdir();
+my $eml = PublicInbox::Eml->new(<<'EOF');
+From oldbug-pre-a0c07cba0e5d8b6a Fri Oct 2 00:00:00 1993
+From: a@example.com
+To: test@example.com
+Subject: this is a subject
+Message-ID: <a-mid@b>
+Date: Fri, 02 Oct 1993 00:00:00 +0000
+
+hello world
+EOF
+my $new_mid;
+my $ibx = create_inbox 'v2', version => 2, indexlevel => 'medium',
+ tmpdir => "$tmpdir/v2", sub {
+ my ($im, $ibx) = @_;
+ $im->add($eml) or BAIL_OUT;
+ $eml->body_set("hello world!\n");
+ my @warn;
+ local $SIG{__WARN__} = sub { push @warn, @_ };
+ $eml->header_set(Date => 'Fri, 02 Oct 1993 00:01:00 +0000');
+ $im->add($eml) or BAIL_OUT;
+ is(scalar(@warn), 1, 'got one warning');
+ my $mids = mids($eml->header_obj);
+ $new_mid = $mids->[1];
+ open my $fh, '>', "$ibx->{inboxdir}/new_mid" or BAIL_OUT;
+ print $fh $new_mid or BAIL_OUT;
+ close $fh or BAIL_OUT;
+};
+$new_mid //= do {
+ open my $fh, '<', "$ibx->{inboxdir}/new_mid" or BAIL_OUT;
+ local $/;
+ <$fh>;
+};
+my $cfgpath = "$ibx->{inboxdir}/pi_config";
+{