-# Copyright (C) 2018-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2018-2020 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
use warnings;
use Test::More;
-use PublicInbox::MIME;
use Fcntl qw(SEEK_SET);
use Cwd;
use PublicInbox::TestCommon;
+use PublicInbox::Eml;
require_git(2.6);
my $V = 2;
name => 'test-v2writable',
address => [ 'test@example.com' ],
};
-my $mime = PublicInbox::MIME->create(
- header => [
- From => 'a@example.com',
- To => 'test@example.com',
- Subject => 'this is a subject',
- Date => 'Fri, 02 Oct 1993 00:00:00 +0000',
- 'Message-ID' => '<foo@bar>',
- 'List-ID' => '<test.example.com>',
- ],
- body => "hello world\n",
-);
+my $mime = PublicInbox::Eml->new(<<'EOF');
+From: a@example.com
+To: test@example.com
+Subject: this is a subject
+Date: Fri, 02 Oct 1993 00:00:00 +0000
+Message-ID: <foo@bar>
+List-ID: <test.example.com>
+hello world
+EOF
my $main_bin = getcwd()."/t/main-bin";
my $fail_bin = getcwd()."/t/fail-bin";
local $ENV{PI_DIR} = "$tmpdir/foo";
}
my $msgs = $ibx->search->query('');
is(scalar(@$msgs), 1, 'only got one message');
-my $saved = $ibx->smsg_mime($msgs->[0]);
-is($saved->{mime}->as_string, $mime->as_string, 'injected message');
+my $eml = $ibx->smsg_eml($msgs->[0]);
+is($eml->as_string, $mime->as_string, 'injected message');
{
my @new = glob("$faildir/new/*");
my $config = "$ENV{PI_DIR}/config";
ok(-f $config, 'config exists');
my $k = 'publicinboxmda.spamcheck';
- is(system('git', 'config', "--file=$config", $k, 'none'), 0,
+ is(xsys('git', 'config', "--file=$config", $k, 'none'), 0,
'disabled spamcheck for mda');
ok(run_script(['-mda'], undef, $rdr), 'mda did not die');