use Cwd qw(getcwd);
use PublicInbox::MID qw(mid2path);
use PublicInbox::Git;
+use PublicInbox::InboxWritable;
use PublicInbox::TestCommon;
+use PublicInbox::Import;
my ($tmpdir, $for_destroy) = tmpdir();
my $home = "$tmpdir/pi-home";
my $pi_home = "$home/.public-inbox";
"no error on undeliverable ($msg)");
my $rev = $git->qx(qw(rev-list HEAD));
chomp $rev;
- is($rev, $good_rev, "bad revision not commited ($msg)");
+ is($rev, $good_rev, "bad revision not committed ($msg)");
@f = glob("$faildir/*/*");
is(scalar @f, 1, "faildir written to");
[ $in, $out, $err ];
"spamc mock found (run in top of source tree");
is(1, mkdir($home, 0755), "setup ~/ for testing");
is(1, mkdir($pi_home, 0755), "setup ~/.public-inbox");
- is(0, system(qw(git init -q --bare), $maindir), "git init (main)");
+ PublicInbox::Import::init_bare($maindir);
open my $fh, '>>', $pi_config or die;
print $fh <<EOF or die;
use PublicInbox::MDA;
use PublicInbox::Address;
use Encode qw/encode/;
- my $mbox = 't/utf8.mbox';
- open(my $fh, '<', $mbox) or die "failed to open mbox: $mbox\n";
- my $str = eval { local $/; <$fh> };
- close $fh;
- my $msg = Email::MIME->new($str);
-
+ my $eml = 't/utf8.eml';
+ my $msg = PublicInbox::InboxWritable::mime_from_path($eml) or
+ die "failed to open $eml: $!";
my $from = $msg->header('From');
my ($author) = PublicInbox::Address::names($from);
my ($email) = PublicInbox::Address::emails($from);