-# Copyright (C) 2014-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2014-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# FIXME: this test is too slow and most non-CGI-requirements
# should be moved over to things which use test_psgi
use strict;
use warnings;
use Test::More;
-use Email::MIME;
+use PublicInbox::Eml;
use PublicInbox::TestCommon;
use PublicInbox::Import;
require_mods(qw(Plack::Handler::CGI Plack::Util));
use_ok 'PublicInbox::Config';
my $cfg = PublicInbox::Config->new($pi_config);
my $ibx = $cfg->lookup_name('test');
-my $im = PublicInbox::InboxWritable->new($ibx)->importer;
+my $im = PublicInbox::InboxWritable->new($ibx)->importer(0);
{
local $ENV{HOME} = $home;
# inject some messages:
- my $mime = Email::MIME->new(<<EOF);
+ my $mime = PublicInbox::Eml->new(<<EOF);
From: Me <me\@example.com>
To: You <you\@example.com>
Cc: $addr
ok($im->add($mime), 'added big message');
# deliver a reply, too
- $mime = Email::MIME->new(<<EOF);
+ $mime = PublicInbox::Eml->new(<<EOF);
From: You <you\@example.com>
To: Me <me\@example.com>
Cc: $addr
ok($im->add($mime), 'added reply');
my $slashy_mid = 'slashy/asdf@example.com';
- my $slashy = Email::MIME->new(<<EOF);
+ my $slashy = PublicInbox::Eml->new(<<EOF);
From: You <you\@example.com>
To: Me <me\@example.com>
Cc: $addr
my ($in, $out, $err) = ("", "", "");
my $rdr = { 0 => \$in, 1 => \$out, 2 => \$err };
run_script(['.cgi'], \%env, $rdr);
- die "unexpected error: \$?=$?" if $?;
+ die "unexpected error: \$?=$? ($err)" if $?;
my ($head, $body) = split(/\r\n\r\n/, $out, 2);
{ head => $head, body => $body, err => $err }
}