]> Sergey Matveev's repositories - public-inbox.git/commitdiff
replace most uses of PublicInbox::MIME with Eml
authorEric Wong <e@yhbt.net>
Thu, 7 May 2020 21:05:50 +0000 (21:05 +0000)
committerEric Wong <e@yhbt.net>
Sat, 9 May 2020 08:59:10 +0000 (08:59 +0000)
PublicInbox::Eml has enough functionality to replace the
Email::MIME-based PublicInbox::MIME.

21 files changed:
Documentation/mknews.perl
lib/PublicInbox/Admin.pm
lib/PublicInbox/Filter/Vger.pm
lib/PublicInbox/Import.pm
lib/PublicInbox/Inbox.pm
lib/PublicInbox/InboxWritable.pm
lib/PublicInbox/MDA.pm
lib/PublicInbox/SearchIdx.pm
lib/PublicInbox/SearchIdxShard.pm
lib/PublicInbox/TestCommon.pm
lib/PublicInbox/V2Writable.pm
lib/PublicInbox/View.pm
lib/PublicInbox/WWW.pm
lib/PublicInbox/WatchMaildir.pm
lib/PublicInbox/WwwAttach.pm
script/public-inbox-edit
script/public-inbox-learn
script/public-inbox-mda
script/public-inbox-purge
t/filter_rubylang.t
t/import.t

index a9dede004aee78b5b37fa5e72684b8760e44d9ab..3bdebfce7a5c1a9ab4fe98f77eb9d8fd25a51c23 100755 (executable)
@@ -5,7 +5,7 @@
 # this uses unstable internal APIs of public-inbox, and this script
 # needs to be updated if they change.
 use strict;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::View;
 use PublicInbox::MsgTime qw(msg_datestamp);
 use PublicInbox::MID qw(mids mid_escape);
@@ -76,7 +76,7 @@ sub release2mime {
        my ($release, $mtime_ref) = @_;
        my $f = "$dir/$release.eml";
        open(my $fh, '<', $f) or die "open($f): $!";
-       my $mime = PublicInbox::MIME->new(do { local $/; <$fh> });
+       my $mime = PublicInbox::Eml->new(\(do { local $/; <$fh> }));
        # Documentation/include.mk relies on mtimes of each .eml file
        # to trigger rebuild, so make sure we sync the mtime to the Date:
        # header in the .eml
index 62ddbe82e707e9a5ff8b1a83d999654b30790992..2c8d191a7618fa905279a6e07fadfed5419ed7ce 100644 (file)
@@ -122,7 +122,7 @@ EOF
 }
 
 # TODO: make Devel::Peek optional, only used for daemon
-my @base_mod = qw(Email::MIME Devel::Peek);
+my @base_mod = qw(Devel::Peek);
 my @over_mod = qw(DBD::SQLite DBI);
 my %mod_groups = (
        -index => [ @base_mod, @over_mod ],
index e746238c7e6c1abcdbac883b5fe84d49d059c157..2c73738d82cc89a6ed1a19ae8537f0b265d868eb 100644 (file)
@@ -5,7 +5,7 @@
 package PublicInbox::Filter::Vger;
 use base qw(PublicInbox::Filter::Base);
 use strict;
-use warnings;
+use PublicInbox::Eml;
 
 my $l0 = qr/-+/; # older messages only had one '-'
 my $l1 =
@@ -25,7 +25,7 @@ sub scrub {
        # so in multipart (e.g. GPG-signed) messages, the list trailer
        # becomes invisible to MIME-aware email clients.
        if ($s =~ s/$l0\n$l1\n$l2\n$l3\n($l4\n)?\z//os) {
-               $mime = PublicInbox::MIME->new(\$s);
+               $mime = PublicInbox::Eml->new(\$s);
        }
        $self->ACCEPT($mime);
 }
index de8ff55f4abd9c23c7b0be5bfe888a15f348fd40..98aa7785efb1815f985fffe56b70aad772bca206 100644 (file)
@@ -15,6 +15,7 @@ use PublicInbox::Address;
 use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp);
 use PublicInbox::ContentId qw(content_digest);
 use PublicInbox::MDA;
+use PublicInbox::Eml;
 use POSIX qw(strftime);
 
 sub new {
@@ -137,7 +138,7 @@ sub check_remove_v1 {
        $info =~ m!\A100644 blob ([a-f0-9]{40})\t!s or die "not blob: $info";
        my $oid = $1;
        my $msg = _cat_blob($r, $w, $oid) or die "BUG: cat-blob $1 failed";
-       my $cur = PublicInbox::MIME->new($msg);
+       my $cur = PublicInbox::Eml->new($msg);
        my $cur_s = $cur->header('Subject');
        $cur_s = '' unless defined $cur_s;
        my $cur_m = $mime->header('Subject');
index 186eb420255e481c8adc5a3faea0d98c433f1ac5..617b692b14ca10688c57ce84c9148a56a1340940 100644 (file)
@@ -7,7 +7,7 @@ use strict;
 use warnings;
 use PublicInbox::Git;
 use PublicInbox::MID qw(mid2path);
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 
 # Long-running "git-cat-file --batch" processes won't notice
 # unlinked packs, so we need to restart those processes occasionally.
@@ -328,7 +328,7 @@ sub msg_by_smsg ($$;$) {
 sub smsg_mime {
        my ($self, $smsg, $ref) = @_;
        if (my $s = msg_by_smsg($self, $smsg, $ref)) {
-               $smsg->{mime} = PublicInbox::MIME->new($s);
+               $smsg->{mime} = PublicInbox::Eml->new($s);
                return $smsg;
        }
 }
index 31aa76c627b8897c891cfd186fb888868a4aed17..3558403bca655dec35a9aba29bcf427a3c578fc8 100644 (file)
@@ -117,7 +117,7 @@ sub mime_from_path ($) {
                local $/;
                my $str = <$fh>;
                $str or return;
-               return PublicInbox::MIME->new(\$str);
+               return PublicInbox::Eml->new(\$str);
        } elsif ($!{ENOENT}) {
                # common with Maildir
                return;
@@ -162,7 +162,7 @@ sub mb_add ($$$$) {
        } elsif ($variant eq 'mboxo') {
                $$msg =~ s/^>From /From /gms;
        }
-       my $mime = PublicInbox::MIME->new($msg);
+       my $mime = PublicInbox::Eml->new($msg);
        if ($filter) {
                my $ret = $filter->scrub($mime) or return;
                return if $ret == REJECT();
index 33696528f8c1468e8b2b05d597df4e84675c21cd..57b436b984e354c19550697d3eb766ac519a97e9 100644 (file)
@@ -5,7 +5,6 @@
 package PublicInbox::MDA;
 use strict;
 use warnings;
-use Email::Simple;
 use PublicInbox::MsgTime;
 use constant MAX_SIZE => 1024 * 500; # same as spamc default, should be tunable
 use constant MAX_MID_SIZE => 244; # max term size - 1 in Xapian
index f357a8fa5f2ea4c95fed69a73b22b993eba8387f..4bdd69f540b58e769499e5abd72f8349293712ed 100644 (file)
@@ -10,7 +10,7 @@ package PublicInbox::SearchIdx;
 use strict;
 use warnings;
 use base qw(PublicInbox::Search PublicInbox::Lock);
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::InboxWritable;
 use PublicInbox::MID qw/mid_clean mid_mime mids_for_index/;
 use PublicInbox::MsgIter;
@@ -371,7 +371,7 @@ sub _msgmap_init ($) {
 }
 
 sub add_message {
-       # mime = Email::MIME object
+       # mime = PublicInbox::Eml or Email::MIME object
        my ($self, $mime, $smsg) = @_;
        my $hdr = $mime->header_obj;
        my $mids = mids_for_index($hdr);
@@ -560,7 +560,7 @@ sub do_cat_mail {
        my ($git, $blob, $sizeref) = @_;
        my $str = $git->cat_file($blob, $sizeref) or
                die "BUG: $blob not found in $git->{git_dir}";
-       PublicInbox::MIME->new($str);
+       PublicInbox::Eml->new($str);
 }
 
 # called by public-inbox-index
index 06bcd4035a1fe43cf81a34fc8fca768050612a8b..e754b038c54b0b5f4a83cdef61496eb4dcfdf2fd 100644 (file)
@@ -8,6 +8,7 @@ use strict;
 use warnings;
 use base qw(PublicInbox::SearchIdx);
 use IO::Handle (); # autoflush
+use PublicInbox::Eml;
 
 sub new {
        my ($class, $v2writable, $shard) = @_;
@@ -75,7 +76,7 @@ sub shard_worker_loop ($$$$$) {
                        $self->begin_txn_lazy;
                        my $n = read($r, my $msg, $bytes) or die "read: $!\n";
                        $n == $bytes or die "short read: $n != $bytes\n";
-                       my $mime = PublicInbox::MIME->new(\$msg);
+                       my $mime = PublicInbox::Eml->new(\$msg);
                        my $smsg = bless {
                                bytes => $bytes,
                                num => $num + 0,
index 600843f006663815a3b0f95b1f61a1c24dfa3899..978c3cd7bafaf4a1cc82a7a78724296453f49cbd 100644 (file)
@@ -8,12 +8,15 @@ use parent qw(Exporter);
 use Fcntl qw(FD_CLOEXEC F_SETFD F_GETFD :seek);
 use POSIX qw(dup2);
 use IO::Socket::INET;
+use PublicInbox::MIME; # temporary
 our @EXPORT = qw(tmpdir tcp_server tcp_connect require_git require_mods
        run_script start_script key2sub xsys xqx mime_load eml_load);
 
 sub mime_load ($) {
        my ($path) = @_;
        open(my $fh, '<', $path) or die "open $path: $!";
+       # test should've called: require_mods('Email::MIME')
+       require PublicInbox::MIME;
        PublicInbox::MIME->new(\(do { local $/; <$fh> }));
 }
 
index 01b8bed6d7aabbc9a96e220a0895cfe2c553c1d5..f599e0a03d80af5ec2bd64800c3ca2756ca6d80e 100644 (file)
@@ -9,7 +9,7 @@ use warnings;
 use base qw(PublicInbox::Lock);
 use 5.010_001;
 use PublicInbox::SearchIdxShard;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Git;
 use PublicInbox::Import;
 use PublicInbox::MID qw(mids references);
@@ -357,9 +357,10 @@ sub content_ids ($) {
        my ($mime) = @_;
        my @cids = ( content_id($mime) );
 
+       # We still support Email::MIME, here, and
        # Email::MIME->as_string doesn't always round-trip, so we may
        # use a second content_id
-       my $rt = content_id(PublicInbox::MIME->new(\($mime->as_string)));
+       my $rt = content_id(PublicInbox::Eml->new(\($mime->as_string)));
        push @cids, $rt if $cids[0] ne $rt;
        \@cids;
 }
@@ -405,7 +406,7 @@ sub rewrite_internal ($$;$$$) {
                                next; # continue
                        }
                        my $orig = $$msg;
-                       my $cur = PublicInbox::MIME->new($msg);
+                       my $cur = PublicInbox::Eml->new($msg);
                        if (content_matches($cids, $cur)) {
                                $gone{$smsg->{num}} = [ $smsg, $cur, \$orig ];
                        }
@@ -842,7 +843,7 @@ sub content_exists ($$$) {
                        warn "broken smsg for $mid\n";
                        next;
                }
-               my $cur = PublicInbox::MIME->new($msg);
+               my $cur = PublicInbox::Eml->new($msg);
                return 1 if content_matches($cids, $cur);
 
                # XXX DEBUG_DIFF is experimental and may be removed
@@ -870,7 +871,7 @@ sub mark_deleted ($$$$) {
        my ($self, $sync, $git, $oid) = @_;
        return if PublicInbox::SearchIdx::too_big($self, $git, $oid);
        my $msgref = $git->cat_file($oid);
-       my $mime = PublicInbox::MIME->new($$msgref);
+       my $mime = PublicInbox::Eml->new($$msgref);
        my $mids = mids($mime->header_obj);
        my $cid = content_id($mime);
        foreach my $mid (@$mids) {
@@ -901,7 +902,7 @@ sub reindex_oid_m ($$$$;$) {
        $self->{current_info} = "multi_mid $oid";
        my ($num, $mid0, $len);
        my $msgref = $git->cat_file($oid, \$len);
-       my $mime = PublicInbox::MIME->new($$msgref);
+       my $mime = PublicInbox::Eml->new($$msgref);
        my $mids = mids($mime->header_obj);
        my $cid = content_id($mime);
        die "BUG: reindex_oid_m called for <=1 mids" if scalar(@$mids) <= 1;
@@ -999,7 +1000,7 @@ sub reindex_oid ($$$$) {
        my ($num, $mid0, $len);
        my $msgref = $git->cat_file($oid, \$len);
        return if $len == 0; # purged
-       my $mime = PublicInbox::MIME->new($$msgref);
+       my $mime = PublicInbox::Eml->new($$msgref);
        my $mids = mids($mime->header_obj);
        my $cid = content_id($mime);
 
@@ -1193,7 +1194,7 @@ sub unindex_oid ($$$;$) {
        my ($self, $git, $oid, $unindexed) = @_;
        my $mm = $self->{mm};
        my $msgref = $git->cat_file($oid);
-       my $mime = PublicInbox::MIME->new($msgref);
+       my $mime = PublicInbox::Eml->new($msgref);
        my $mids = mids($mime->header_obj);
        $mime = $msgref = undef;
        my $over = $self->{over};
index 3328c865d516f552de7bd190a46fd82d91f47081..ef5f4b3a25eb8199f51eac10072e86a949b5d134 100644 (file)
@@ -56,7 +56,7 @@ sub msg_page {
        } else {
                $first = $ibx->msg_by_mid($mid) or return;
        }
-       my $mime = PublicInbox::MIME->new($first);
+       my $mime = PublicInbox::Eml->new($first);
        $ctx->{-obfs_ibx} = $ibx->{obfuscate} ? $ibx : undef;
        my $hdr = $ctx->{hdr} = $mime->header_obj;
        $ctx->{obuf} = _msg_page_prepare_obuf($hdr, $ctx, 0);
index 1ff857dec0585b81c04dcbf31bb46d2e0f3a4d4f..289d0ce48e255a9bf4e315164ed380da284f2fe4 100644 (file)
@@ -152,7 +152,7 @@ sub preload {
        require PublicInbox::Feed;
        require PublicInbox::View;
        require PublicInbox::SearchThread;
-       require PublicInbox::MIME;
+       require PublicInbox::Eml;
        require PublicInbox::Mbox;
        require PublicInbox::ViewVCS;
        require PublicInbox::WwwText;
index 71bd84fc0d13c62941ca6a66a65aae03ab3029c8..7ca35403517ecd82e9e1a08f72c21c1d0234b08c 100644 (file)
@@ -6,7 +6,7 @@
 package PublicInbox::WatchMaildir;
 use strict;
 use warnings;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::InboxWritable;
 use File::Temp 0.19 (); # 0.19 for ->newdir
 use PublicInbox::Filter::Base qw(REJECT);
@@ -282,7 +282,7 @@ sub _spamcheck_cb {
                my ($mime) = @_;
                my $tmp = '';
                if ($sc->spamcheck($mime, \$tmp)) {
-                       return PublicInbox::MIME->new(\$tmp);
+                       return PublicInbox::Eml->new(\$tmp);
                }
                warn $mime->header('Message-ID')." failed spam check\n";
                undef;
index b10099077e1b2591a736b3483d49c7fb83dbf519..5b2914b393fdcc28ea3d220eeac3137004ae3b8d 100644 (file)
@@ -7,8 +7,7 @@ use strict;
 use warnings;
 use bytes (); # only for bytes::length
 use Email::MIME::ContentType qw(parse_content_type);
-use PublicInbox::MIME;
-use PublicInbox::MsgIter;
+use PublicInbox::Eml;
 
 sub get_attach_i { # ->each_part callback
        my ($part, $depth, $idx) = @{$_[0]};
@@ -38,7 +37,7 @@ sub get_attach ($$$) {
        my ($ctx, $idx, $fn) = @_;
        my $res = [ 404, [ 'Content-Type', 'text/plain' ], [ "Not found\n" ] ];
        my $mime = $ctx->{-inbox}->msg_by_mid($ctx->{mid}) or return $res;
-       $mime = PublicInbox::MIME->new($mime);
+       $mime = PublicInbox::Eml->new($mime);
        $res->[3] = $idx;
        $mime->each_part(\&get_attach_i, $res, 1);
        pop @$res; # cleanup before letting PSGI server see it
index 42f914a808d73413f12b7c3499b3b40c862c1f2c..e895a228386e9f58cbeff6b42dba4daa4d877d71 100755 (executable)
@@ -12,7 +12,7 @@ use File::Temp 0.19 (); # 0.19 for TMPDIR
 use PublicInbox::ContentId qw(content_id);
 use PublicInbox::MID qw(mid_clean mids);
 PublicInbox::Admin::check_require('-index');
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::InboxWritable;
 use PublicInbox::Import;
 
@@ -52,7 +52,7 @@ sub find_mid ($$$) {
                my ($id, $prev);
                while (my $smsg = $over->next_by_mid($mid, \$id, \$prev)) {
                        my $ref = $ibx->msg_by_smsg($smsg);
-                       my $mime = PublicInbox::MIME->new($ref);
+                       my $mime = PublicInbox::Eml->new($ref);
                        my $cid = content_id($mime);
                        my $tuple = [ $ibx, $smsg ];
                        push @{$found->{$cid} ||= []}, $tuple
@@ -205,8 +205,8 @@ W: possible message boundary splitting error
                $new_raw =~ s/^>(>*From )/$1/gm;
        }
 
-       my $new_mime = PublicInbox::MIME->new(\$new_raw);
-       my $old_mime = PublicInbox::MIME->new($old_raw);
+       my $new_mime = PublicInbox::Eml->new(\$new_raw);
+       my $old_mime = PublicInbox::Eml->new($old_raw);
 
        # make sure we don't compare unwanted headers, since mutt adds
        # Content-Length, Status, and Lines headers:
index 4c10b68b994506bd4949e197028bd7caa2d8a7f1..a33d813ad01eb389ff5f184f4f98ed6497fba90f 100644 (file)
@@ -9,7 +9,7 @@ use strict;
 use warnings;
 use PublicInbox::Config;
 use PublicInbox::InboxWritable;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Address;
 use PublicInbox::Spamcheck::Spamc;
 my $train = shift or die "usage: $usage\n";
@@ -20,7 +20,7 @@ if ($train !~ /\A(?:ham|spam|rm)\z/) {
 my $spamc = PublicInbox::Spamcheck::Spamc->new;
 my $pi_config = PublicInbox::Config->new;
 my $err;
-my $mime = PublicInbox::MIME->new(do{
+my $mime = PublicInbox::Eml->new(do{
        local $/;
        my $data = <STDIN>;
        $data =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
index 54d0af01414a64c9458a7cf9d3005143bc5f9616..42d0e00cbb72687bbdaf5e67e1fb0c6c379ba9b1 100755 (executable)
@@ -15,8 +15,7 @@ my $do_exit = sub {
        exit $code;
 };
 
-use Email::Simple;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::MDA;
 use PublicInbox::Config;
 use PublicInbox::Emergency;
@@ -32,7 +31,7 @@ $ems = PublicInbox::Emergency->new($emergency);
 my $str = do { local $/; <STDIN> };
 $str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
 $ems->prepare(\$str);
-my $simple = Email::Simple->new(\$str);
+my $eml = PublicInbox::Eml->new(\$str);
 my $config = PublicInbox::Config->new;
 my $key = 'publicinboxmda.spamcheck';
 my $default = 'PublicInbox::Spamcheck::Spamc';
@@ -44,7 +43,7 @@ if (defined $recipient) {
        push @$dests, $ibx if $ibx;
 }
 if (!scalar(@$dests)) {
-       $dests = PublicInbox::MDA->inboxes_for_list_id($config, $simple);
+       $dests = PublicInbox::MDA->inboxes_for_list_id($config, $eml);
        if (!scalar(@$dests) && !defined($recipient)) {
                die "ORIGINAL_RECIPIENT not defined in ENV\n";
        }
@@ -61,7 +60,7 @@ my $err;
                0;
        # pre-check, MDA has stricter rules than an importer might;
        } elsif ($precheck) {
-               !!PublicInbox::MDA->precheck($simple, $ibx->{address});
+               !!PublicInbox::MDA->precheck($eml, $ibx->{address});
        } else {
                1;
        }
@@ -69,7 +68,7 @@ my $err;
 
 $do_exit->(67) if $err && scalar(@$dests) == 0;
 
-$simple = undef;
+$eml = undef;
 my $spam_ok;
 if ($spamc) {
        $str = '';
@@ -101,9 +100,10 @@ my @rejects;
 for my $ibx (@$dests) {
        mda_filter_adjust($ibx);
        my $filter = $ibx->filter;
-       my $mime = PublicInbox::MIME->new($str);
+       my $mime = PublicInbox::Eml->new($str);
        my $ret = $filter->delivery($mime);
-       if (ref($ret) && $ret->isa('Email::MIME')) { # filter altered message
+       if (ref($ret) && ($ret->isa('PublicInbox::Eml') ||
+                       $ret->isa('Email::MIME'))) { # filter altered message
                $mime = $ret;
        } elsif ($ret == PublicInbox::Filter::Base::IGNORE) {
                next; # nothing, keep looping
index 8301b06d359aaa9ddf162dfa656ccda0871e1925..82a63b80265110b11e5ee3826ea7827495ff29cf 100755 (executable)
@@ -10,7 +10,7 @@ use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use PublicInbox::AdminEdit;
 PublicInbox::Admin::check_require('-index');
 use PublicInbox::Filter::Base qw(REJECT);
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 require PublicInbox::V2Writable;
 
 my $usage = "$0 [--all] [INBOX_DIRS] </path/to/message";
@@ -26,7 +26,7 @@ $data =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
 my $n_purged = 0;
 
 foreach my $ibx (@ibxs) {
-       my $mime = PublicInbox::MIME->new($data);
+       my $mime = PublicInbox::Eml->new($data);
        my $v2w = PublicInbox::V2Writable->new($ibx, 0);
 
        my $commits = $v2w->purge($mime) || [];
index 05e1b324da5742caf35d58d622c9444b2bdc46b7..e6c53f98579cad39600def34c10962fba1d7ea6e 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::TestCommon;
 use_ok 'PublicInbox::Filter::RubyLang';
 
@@ -17,7 +17,7 @@ keep this
 Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
 <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
 EOF
-my $mime = PublicInbox::MIME->new($msg);
+my $mime = PublicInbox::Eml->new($msg);
 my $ret = $f->delivery($mime);
 is($ret, $mime, "delivery successful");
 is($mime->body, "keep this\n", 'normal message filtered OK');
@@ -41,7 +41,7 @@ X-Mail-Count: 12
 Message-ID: <a@b>
 
 EOF
-       $mime = PublicInbox::MIME->new($msg);
+       $mime = PublicInbox::Eml->new($msg);
        $ret = $f->delivery($mime);
        is($ret, $mime, "delivery successful");
        my $mm = PublicInbox::Msgmap->new($git_dir);
@@ -53,7 +53,7 @@ Message-ID: <b@b>
 
 EOF
 
-       $mime = PublicInbox::MIME->new($msg);
+       $mime = PublicInbox::Eml->new($msg);
        $ret = $f->delivery($mime);
        is($ret, 100, "delivery rejected without X-Mail-Count");
 }
index d2264102dc4fdbd0e544bdf762afdfb234570d61..ba4abd9cb321e0cba0c741ed8168285e590a56c6 100644 (file)
@@ -75,7 +75,7 @@ $im->done;
 is(scalar @revs, 26, '26 revisions exist after mass import');
 my ($mark, $msg) = $im->remove($mime);
 like($mark, qr/\A:\d+\z/, 'got mark');
-is(ref($msg), 'PublicInbox::MIME', 'got old message deleted');
+like(ref($msg), qr/\bPublicInbox::(?:Eml|MIME)\b/, 'got old message deleted');
 
 is(undef, $im->remove($mime), 'remove is idempotent');