user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 00/13] eml: pure-Perl replacement for Email::MIME
@ 2020-05-07 21:05  7% Eric Wong
  2020-05-07 21:05  1% ` [PATCH 12/13] remove most internal Email::MIME usage Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-05-07 21:05 UTC (permalink / raw)
  To: meta

Eric Wong (13):
  msg_iter: make ->each_part method for PublicInbox::MIME
  msg_iter: pass $idx as a scalar, not array
  filter/rubylang: avoid recursing subparts to strip trailers
  smsg: use capitalization for header retrieval
  eml: pure-Perl replacement for Email::MIME
  switch read-only Email::Simple users to Eml
  replace most uses of PublicInbox::MIME with Eml
  EmlContentFoo: Email::MIME::ContentType replacement
  EmlContentFoo: relax Encode version requirement
  eml: remove dependency on Email::MIME::Encodings
  xt: eml comparison tests
  remove most internal Email::MIME usage
  eml: drop trailing blank line on missing epilogue

 Documentation/mknews.perl          |   4 +-
 INSTALL                            |  26 +-
 MANIFEST                           |   7 +
 Makefile.PL                        |   7 +-
 ci/deps.perl                       |   3 -
 lib/PublicInbox/Admin.pm           |   2 +-
 lib/PublicInbox/Eml.pm             | 421 +++++++++++++++++++++++++++++
 lib/PublicInbox/EmlContentFoo.pm   | 317 ++++++++++++++++++++++
 lib/PublicInbox/Filter/RubyLang.pm |  32 ++-
 lib/PublicInbox/Filter/Vger.pm     |   4 +-
 lib/PublicInbox/Import.pm          |  11 +-
 lib/PublicInbox/Inbox.pm           |   4 +-
 lib/PublicInbox/InboxWritable.pm   |   4 +-
 lib/PublicInbox/MDA.pm             |   1 -
 lib/PublicInbox/MIME.pm            |   6 +
 lib/PublicInbox/Mbox.pm            |  16 +-
 lib/PublicInbox/MboxGz.pm          |   4 +-
 lib/PublicInbox/MsgIter.pm         |  21 +-
 lib/PublicInbox/MsgTime.pm         |   8 +-
 lib/PublicInbox/NNTP.pm            |  19 +-
 lib/PublicInbox/SearchIdx.pm       |   8 +-
 lib/PublicInbox/SearchIdxShard.pm  |   3 +-
 lib/PublicInbox/Smsg.pm            |  24 +-
 lib/PublicInbox/SolverGit.pm       |   4 +-
 lib/PublicInbox/TestCommon.pm      |  11 +-
 lib/PublicInbox/V2Writable.pm      |  17 +-
 lib/PublicInbox/View.pm            |  28 +-
 lib/PublicInbox/WWW.pm             |   8 +-
 lib/PublicInbox/WatchMaildir.pm    |   4 +-
 lib/PublicInbox/WwwAttach.pm       |  15 +-
 script/public-inbox-edit           |   8 +-
 script/public-inbox-learn          |   4 +-
 script/public-inbox-mda            |  16 +-
 script/public-inbox-purge          |   4 +-
 t/altid.t                          |   4 +-
 t/altid_v2.t                       |   4 +-
 t/cgi.t                            |   8 +-
 t/content_id.t                     |   6 +-
 t/convert-compact.t                |   4 +-
 t/edit.t                           |  20 +-
 t/eml.t                            | 363 +++++++++++++++++++++++++
 t/eml_content_disposition.t        | 102 +++++++
 t/eml_content_type.t               | 289 ++++++++++++++++++++
 t/feed.t                           |   6 +-
 t/filter_base.t                    |   4 +-
 t/filter_mirror.t                  |   2 +-
 t/filter_rubylang.t                |   8 +-
 t/filter_subjecttag.t              |   4 +-
 t/filter_vger.t                    |   6 +-
 t/html_index.t                     |   4 +-
 t/httpd.t                          |   4 +-
 t/import.t                         |   6 +-
 t/indexlevels-mirror.t             |   4 +-
 t/mda.t                            |   4 +-
 t/mda_filter_rubylang.t            |   2 +-
 t/mid.t                            |   4 +-
 t/mime.t                           |  82 +++---
 t/msg_iter.t                       |  10 +-
 t/msgtime.t                        |   6 +-
 t/multi-mid.t                      |   6 +-
 t/nntp.t                           |   4 +-
 t/nntpd-tls.t                      |   4 +-
 t/nntpd.t                          |   6 +-
 t/nulsubject.t                     |   2 +-
 t/plack.t                          |  10 +-
 t/precheck.t                       |  10 +-
 t/psgi_attach.t                    |   2 +-
 t/psgi_bad_mids.t                  |   4 +-
 t/psgi_mount.t                     |   4 +-
 t/psgi_multipart_not.t             |   4 +-
 t/psgi_scan_all.t                  |   4 +-
 t/psgi_search.t                    |   8 +-
 t/psgi_text.t                      |   2 +-
 t/psgi_v2.t                        |   6 +-
 t/purge.t                          |   2 +-
 t/replace.t                        |  12 +-
 t/reply.t                          |   4 +-
 t/search-thr-index.t               |   6 +-
 t/search.t                         |  26 +-
 t/solver_git.t                     |   4 +-
 t/spamcheck_spamc.t                |   8 +-
 t/thread-cycle.t                   |   3 +-
 t/time.t                           |   4 +-
 t/v1-add-remove-add.t              |   4 +-
 t/v1reindex.t                      |   4 +-
 t/v2-add-remove-add.t              |   4 +-
 t/v2mda.t                          |   4 +-
 t/v2mirror.t                       |   4 +-
 t/v2reindex.t                      |   8 +-
 t/v2writable.t                     |   8 +-
 t/watch_filter_rubylang.t          |   2 +-
 t/watch_maildir.t                  |   2 +-
 t/watch_maildir_v2.t               |   2 +-
 t/www_altid.t                      |   2 +-
 t/xcpdb-reshard.t                  |   4 +-
 xt/cmp-msgstr.t                    | 108 ++++++++
 xt/cmp-msgview.t                   |  95 +++++++
 xt/msgtime_cmp.t                   |  12 +-
 xt/perf-msgview.t                  |   2 +-
 99 files changed, 2084 insertions(+), 353 deletions(-)
 create mode 100644 lib/PublicInbox/Eml.pm
 create mode 100644 lib/PublicInbox/EmlContentFoo.pm
 create mode 100644 t/eml.t
 create mode 100644 t/eml_content_disposition.t
 create mode 100644 t/eml_content_type.t
 create mode 100644 xt/cmp-msgstr.t
 create mode 100644 xt/cmp-msgview.t


^ permalink raw reply	[relevance 7%]

* [PATCH 12/13] remove most internal Email::MIME usage
  2020-05-07 21:05  7% [PATCH 00/13] eml: pure-Perl replacement for Email::MIME Eric Wong
@ 2020-05-07 21:05  1% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-05-07 21:05 UTC (permalink / raw)
  To: meta

We no longer load or use Email::MIME outside of comparison
tests.
---
 INSTALL                       | 26 +++++------
 Makefile.PL                   |  5 ---
 ci/deps.perl                  |  3 --
 lib/PublicInbox/Import.pm     |  8 ++--
 lib/PublicInbox/MIME.pm       |  3 ++
 lib/PublicInbox/MsgTime.pm    |  8 ++--
 lib/PublicInbox/TestCommon.pm |  3 +-
 t/altid.t                     |  4 +-
 t/altid_v2.t                  |  4 +-
 t/cgi.t                       |  8 ++--
 t/content_id.t                |  6 +--
 t/convert-compact.t           |  4 +-
 t/edit.t                      | 20 ++++-----
 t/feed.t                      |  6 +--
 t/filter_base.t               |  4 +-
 t/filter_mirror.t             |  2 +-
 t/filter_subjecttag.t         |  4 +-
 t/filter_vger.t               |  6 +--
 t/html_index.t                |  4 +-
 t/httpd.t                     |  4 +-
 t/import.t                    |  4 +-
 t/indexlevels-mirror.t        |  4 +-
 t/mda.t                       |  4 +-
 t/mda_filter_rubylang.t       |  2 +-
 t/mid.t                       |  4 +-
 t/mime.t                      | 83 +++++++++++++++++++----------------
 t/msg_iter.t                  |  8 ++--
 t/msgtime.t                   |  6 +--
 t/multi-mid.t                 |  6 +--
 t/nntp.t                      |  4 +-
 t/nntpd-tls.t                 |  4 +-
 t/nntpd.t                     |  6 +--
 t/nulsubject.t                |  2 +-
 t/plack.t                     | 10 ++---
 t/precheck.t                  | 10 ++---
 t/psgi_attach.t               |  2 +-
 t/psgi_bad_mids.t             |  4 +-
 t/psgi_mount.t                |  4 +-
 t/psgi_multipart_not.t        |  4 +-
 t/psgi_scan_all.t             |  4 +-
 t/psgi_search.t               |  8 ++--
 t/psgi_text.t                 |  2 +-
 t/psgi_v2.t                   |  6 +--
 t/purge.t                     |  2 +-
 t/replace.t                   | 12 ++---
 t/reply.t                     |  4 +-
 t/search-thr-index.t          |  6 +--
 t/search.t                    | 26 +++++------
 t/solver_git.t                |  4 +-
 t/spamcheck_spamc.t           |  8 ++--
 t/thread-cycle.t              |  3 +-
 t/time.t                      |  4 +-
 t/v1-add-remove-add.t         |  4 +-
 t/v1reindex.t                 |  4 +-
 t/v2-add-remove-add.t         |  4 +-
 t/v2mda.t                     |  4 +-
 t/v2mirror.t                  |  4 +-
 t/v2reindex.t                 |  8 ++--
 t/v2writable.t                |  8 ++--
 t/watch_filter_rubylang.t     |  2 +-
 t/watch_maildir.t             |  2 +-
 t/watch_maildir_v2.t          |  2 +-
 t/www_altid.t                 |  2 +-
 t/xcpdb-reshard.t             |  4 +-
 xt/msgtime_cmp.t              | 12 ++---
 xt/perf-msgview.t             |  2 +-
 66 files changed, 228 insertions(+), 226 deletions(-)

diff --git a/INSTALL b/INSTALL
index 2dd7dcff..80cee753 100644
--- a/INSTALL
+++ b/INSTALL
@@ -36,15 +36,18 @@ Beyond that, there is a long list of Perl modules required, starting with:
 * Digest::SHA                      typically installed with Perl
                                    rpm: perl-Digest-SHA
 
-* Email::MIME                      deb: libemail-mime-perl
-                                   pkg: p5-Email-MIME
-                                   rpm: perl-Email-MIME
-
 * URI::Escape                      deb: liburi-perl
                                    pkg: p5-URI
                                    rpm: perl-URI
                                    (for HTML/Atom generation)
 
+Email::MIME will be optional as of public-inbox v1.5.0,
+it may still be used in maintainer comparison tests:
+
+* Email::MIME                      deb: libemail-mime-perl
+                                   pkg: p5-Email-MIME
+                                   rpm: perl-Email-MIME
+
 Plack and Date::Parse are optional as of public-inbox v1.3.0,
 but required for older releases:
 
@@ -86,6 +89,11 @@ Numerous optional modules are likely to be useful as well:
                                    (speeds up process spawning on Linux,
                                     see public-inbox-daemon(8))
 
+- Email::Address::XS               deb: libemail-address-xs-perl
+                                   pkg: pkg-Email-Address-XS
+                                   (correct parsing of tricky email
+                                    addresses, phrases and comments)
+
 - Plack::Middleware::ReverseProxy  deb: libplack-middleware-reverseproxy-perl
                                    pkg: p5-Plack-Middleware-ReverseProxy
                                    rpm: perl-Plack-Middleware-ReverseProxy
@@ -108,16 +116,6 @@ Numerous optional modules are likely to be useful as well:
 The following modules are typically pulled in by dependencies listed
 above, so there is no need to explicitly install them:
 
-- Email::MIME::ContentType         deb: libemail-mime-contenttype-perl
-                                   pkg: p5-Email-MIME-ContentType
-                                   rpm: perl-Email-MIME-ContentType
-                                   (pulled in by Email::MIME)
-
-- Email::Simple                    deb: libemail-simple-perl
-                                   pkg: p5-Email-Simple
-                                   rpm: perl-Email-Simple
-                                   (pulled in by Email::MIME)
-
 * Encode                           deb: libperl5.$MINOR (or libencode-perl)
                                    pkg: perl5
                                    rpm: perl-Encode
diff --git a/Makefile.PL b/Makefile.PL
index 59345edb..efbb59cb 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -122,11 +122,6 @@ WriteMakefile(
 		# `perl5' on FreeBSD
 		# perl-Digest-SHA on RH-based
 		'Digest::SHA' => 0,
-		'Email::MIME' => 0,
-
-		# the following should be pulled in by Email::MIME:
-		'Email::MIME::ContentType' => 0,
-		'Email::Simple' => 0,
 
 		# libperl$PERL_VERSION or libencode-perl on Debian,
 		# `perl5' on FreeBSD
diff --git a/ci/deps.perl b/ci/deps.perl
index 06b4fbe0..48aaa9e4 100755
--- a/ci/deps.perl
+++ b/ci/deps.perl
@@ -20,9 +20,6 @@ my $profiles = {
 		perl
 		Devel::Peek
 		Digest::SHA
-		Email::Simple
-		Email::MIME
-		Email::MIME::ContentType
 		Encode
 		ExtUtils::MakeMaker
 		IO::Compress::Gzip
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index 98aa7785..07d18599 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -213,13 +213,13 @@ sub get_mark {
 }
 
 # returns undef on non-existent
-# ('MISMATCH', Email::MIME) on mismatch
-# (:MARK, Email::MIME) on success
+# ('MISMATCH', PublicInbox::Eml) on mismatch
+# (:MARK, PublicInbox::Eml) on success
 #
 # v2 callers should check with Xapian before calling this as
 # it is not idempotent.
 sub remove {
-	my ($self, $mime, $msg) = @_; # mime = Email::MIME
+	my ($self, $mime, $msg) = @_; # mime = PublicInbox::Eml or Email::MIME
 
 	my $path_type = $self->{path_type};
 	my ($path, $err, $cur, $blob);
@@ -375,7 +375,7 @@ sub clean_tree_v2 ($$$) {
 # returns undef on duplicate
 # returns the :MARK of the most recent commit
 sub add {
-	my ($self, $mime, $check_cb, $smsg) = @_; # mime = Email::MIME
+	my ($self, $mime, $check_cb, $smsg) = @_;
 
 	my ($name, $email, $at, $ct, $subject) = extract_cmt_info($mime, $smsg);
 	my $path_type = $self->{path_type};
diff --git a/lib/PublicInbox/MIME.pm b/lib/PublicInbox/MIME.pm
index b795b93b..9077386a 100644
--- a/lib/PublicInbox/MIME.pm
+++ b/lib/PublicInbox/MIME.pm
@@ -3,6 +3,9 @@
 #
 # The license for this file differs from the rest of public-inbox.
 #
+# We no longer load this in any of our code outside of maintainer
+# tests for compatibility.
+#
 # It monkey patches the "parts_multipart" subroutine with patches
 # from Matthew Horsfall <wolfsage@gmail.com> at:
 #
diff --git a/lib/PublicInbox/MsgTime.pm b/lib/PublicInbox/MsgTime.pm
index 920e8f8a..8596f01c 100644
--- a/lib/PublicInbox/MsgTime.pm
+++ b/lib/PublicInbox/MsgTime.pm
@@ -138,7 +138,7 @@ sub time_response ($) {
 }
 
 sub msg_received_at ($) {
-	my ($hdr) = @_; # Email::MIME::Header
+	my ($hdr) = @_; # PublicInbox::Eml
 	my @recvd = $hdr->header_raw('Received');
 	my ($ts);
 	foreach my $r (@recvd) {
@@ -153,7 +153,7 @@ sub msg_received_at ($) {
 }
 
 sub msg_date_only ($) {
-	my ($hdr) = @_; # Email::MIME::Header
+	my ($hdr) = @_; # PublicInbox::Eml
 	my @date = $hdr->header_raw('Date');
 	my ($ts);
 	foreach my $d (@date) {
@@ -168,7 +168,7 @@ sub msg_date_only ($) {
 
 # Favors Received header for sorting globally
 sub msg_timestamp ($;$) {
-	my ($hdr, $fallback) = @_; # Email::MIME::Header
+	my ($hdr, $fallback) = @_; # PublicInbox::Eml
 	my $ret;
 	$ret = msg_received_at($hdr) and return time_response($ret);
 	$ret = msg_date_only($hdr) and return time_response($ret);
@@ -177,7 +177,7 @@ sub msg_timestamp ($;$) {
 
 # Favors the Date: header for display and sorting within a thread
 sub msg_datestamp ($;$) {
-	my ($hdr, $fallback) = @_; # Email::MIME::Header
+	my ($hdr, $fallback) = @_; # PublicInbox::Eml
 	my $ret;
 	$ret = msg_date_only($hdr) and return time_response($ret);
 	$ret = msg_received_at($hdr) and return time_response($ret);
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index 978c3cd7..d952ee6d 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -8,7 +8,6 @@ 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);
 
@@ -23,7 +22,7 @@ sub mime_load ($) {
 sub eml_load ($) {
 	my ($path, $cb) = @_;
 	open(my $fh, '<', $path) or die "open $path: $!";
-	binmode $fh;
+	require PublicInbox::Eml;
 	PublicInbox::Eml->new(\(do { local $/; <$fh> }));
 }
 
diff --git a/t/altid.t b/t/altid.t
index c7a3601a..670a3963 100644
--- a/t/altid.t
+++ b/t/altid.t
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use Test::More;
 use PublicInbox::TestCommon;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 require_mods(qw(DBD::SQLite Search::Xapian));
 use_ok 'PublicInbox::Msgmap';
 use_ok 'PublicInbox::SearchIdx';
@@ -27,7 +27,7 @@ my $ibx;
 	my $git = PublicInbox::Git->new($git_dir);
 	my $im = PublicInbox::Import->new($git, 'testbox', 'test@example');
 	$im->init_bare;
-	$im->add(PublicInbox::MIME->new(<<'EOF'));
+	$im->add(PublicInbox::Eml->new(<<'EOF'));
 From: a@example.com
 To: b@example.com
 Subject: boo!
diff --git a/t/altid_v2.t b/t/altid_v2.t
index 3ac294f0..28a047d9 100644
--- a/t/altid_v2.t
+++ b/t/altid_v2.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::TestCommon;
 require_git(2.6);
 require_mods(qw(DBD::SQLite Search::Xapian));
@@ -31,7 +31,7 @@ my $ibx = {
 };
 $ibx = PublicInbox::Inbox->new($ibx);
 my $v2w = PublicInbox::V2Writable->new($ibx, 1);
-$v2w->add(PublicInbox::MIME->new(<<'EOF'));
+$v2w->add(PublicInbox::Eml->new(<<'EOF'));
 From: a@example.com
 To: b@example.com
 Subject: boo!
diff --git a/t/cgi.t b/t/cgi.t
index 42a343d3..d1f97150 100644
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -5,7 +5,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::TestCommon;
 use PublicInbox::Import;
 require_mods(qw(Plack::Handler::CGI Plack::Util));
@@ -45,7 +45,7 @@ my $im = PublicInbox::InboxWritable->new($ibx)->importer;
 	local $ENV{HOME} = $home;
 
 	# inject some messages:
-	my $mime = PublicInbox::MIME->new(<<EOF);
+	my $mime = PublicInbox::Eml->new(<<EOF);
 From: Me <me\@example.com>
 To: You <you\@example.com>
 Cc: $addr
@@ -62,7 +62,7 @@ EOF
 	ok($im->add($mime), 'added big message');
 
 	# deliver a reply, too
-	$mime = PublicInbox::MIME->new(<<EOF);
+	$mime = PublicInbox::Eml->new(<<EOF);
 From: You <you\@example.com>
 To: Me <me\@example.com>
 Cc: $addr
@@ -79,7 +79,7 @@ EOF
 	ok($im->add($mime), 'added reply');
 
 	my $slashy_mid = 'slashy/asdf@example.com';
-	my $slashy = PublicInbox::MIME->new(<<EOF);
+	my $slashy = PublicInbox::Eml->new(<<EOF);
 From: You <you\@example.com>
 To: Me <me\@example.com>
 Cc: $addr
diff --git a/t/content_id.t b/t/content_id.t
index 0325164d..9df81aa8 100644
--- a/t/content_id.t
+++ b/t/content_id.t
@@ -4,9 +4,9 @@ use strict;
 use warnings;
 use Test::More;
 use PublicInbox::ContentId qw(content_id);
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: b@example.com
 Subject: this is a subject
@@ -17,7 +17,7 @@ hello world
 EOF
 
 my $orig = content_id($mime);
-my $reload = content_id(PublicInbox::MIME->new($mime->as_string));
+my $reload = content_id(PublicInbox::Eml->new($mime->as_string));
 is($orig, $reload, 'content_id matches after serialization');
 
 foreach my $h (qw(From To Cc)) {
diff --git a/t/convert-compact.t b/t/convert-compact.t
index 1627e019..80efc19c 100644
--- a/t/convert-compact.t
+++ b/t/convert-compact.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Spawn qw(which);
 use PublicInbox::TestCommon;
 require_git(2.6);
@@ -26,7 +26,7 @@ ok(PublicInbox::Import::run_die([qw(git) , "--git-dir=$ibx->{inboxdir}",
 	qw(config core.sharedRepository 0644)]), 'set sharedRepository');
 $ibx = PublicInbox::Inbox->new($ibx);
 my $im = PublicInbox::Import->new($ibx->git, undef, undef, $ibx);
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: b@example.com
 Subject: this is a subject
diff --git a/t/edit.t b/t/edit.t
index d8833f9c..1a5698f6 100644
--- a/t/edit.t
+++ b/t/edit.t
@@ -28,7 +28,7 @@ my $file = 't/data/0001.patch';
 open my $fh, '<', $file or die "open: $!";
 my $raw = do { local $/; <$fh> };
 my $im = $ibx->importer(0);
-my $mime = PublicInbox::MIME->new($raw);
+my $mime = PublicInbox::Eml->new($raw);
 my $mid = mid_clean($mime->header('Message-Id'));
 ok($im->add($mime), 'add message to be edited');
 $im->done;
@@ -41,7 +41,7 @@ $t = '-F FILE'; {
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/boolean prefix/bool pfx/'";
 	$cmd = [ '-edit', "-F$file", $inboxdir ];
 	ok(run_script($cmd, undef, $opt), "$t edit OK");
-	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
+	$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
 	like($cur->header('Subject'), qr/bool pfx/, "$t message edited");
 	like($out, qr/[a-f0-9]{40}/, "$t shows commit on success");
 }
@@ -51,7 +51,7 @@ $t = '-m MESSAGE_ID'; {
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/bool pfx/boolean prefix/'";
 	$cmd = [ '-edit', "-m$mid", $inboxdir ];
 	ok(run_script($cmd, undef, $opt), "$t edit OK");
-	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
+	$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
 	like($cur->header('Subject'), qr/boolean prefix/, "$t message edited");
 	like($out, qr/[a-f0-9]{40}/, "$t shows commit on success");
 }
@@ -63,7 +63,7 @@ $t = 'no-op -m MESSAGE_ID'; {
 	$cmd = [ '-edit', "-m$mid", $inboxdir ];
 	ok(run_script($cmd, undef, $opt), "$t succeeds");
 	my $prev = $cur;
-	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
+	$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
 	is_deeply($cur, $prev, "$t makes no change");
 	like($cur->header('Subject'), qr/boolean prefix/,
 		"$t does not change message");
@@ -79,7 +79,7 @@ $t = 'no-op -m MESSAGE_ID w/Status: header'; { # because mutt does it
 	$cmd = [ '-edit', "-m$mid", $inboxdir ];
 	ok(run_script($cmd, undef, $opt), "$t succeeds");
 	my $prev = $cur;
-	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
+	$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
 	is_deeply($cur, $prev, "$t makes no change");
 	like($cur->header('Subject'), qr/boolean prefix/,
 		"$t does not change message");
@@ -94,7 +94,7 @@ $t = '-m MESSAGE_ID can change Received: headers'; {
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^Subject:.*/Received: x\\n\$&/'";
 	$cmd = [ '-edit', "-m$mid", $inboxdir ];
 	ok(run_script($cmd, undef, $opt), "$t succeeds");
-	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
+	$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
 	like($cur->header('Subject'), qr/boolean prefix/,
 		"$t does not change Subject");
 	is($cur->header('Received'), 'x', 'added Received header');
@@ -127,7 +127,7 @@ $t = 'mailEditor set in config'; {
 	local $ENV{GIT_EDITOR} = 'echo should not run';
 	$cmd = [ '-edit', "-m$mid", $inboxdir ];
 	ok(run_script($cmd, undef, $opt), "$t edited message");
-	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
+	$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
 	like($cur->header('Subject'), qr/bool pfx/, "$t message edited");
 	unlike($out, qr/should not run/, 'did not run GIT_EDITOR');
 }
@@ -137,20 +137,20 @@ $t = '--raw and mbox escaping'; {
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^\$/\\nFrom not mbox\\n/'";
 	$cmd = [ '-edit', "-m$mid", '--raw', $inboxdir ];
 	ok(run_script($cmd, undef, $opt), "$t succeeds");
-	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
+	$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
 	like($cur->body, qr/^From not mbox/sm, 'put "From " line into body');
 
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^>From not/\$& an/'";
 	$cmd = [ '-edit', "-m$mid", $inboxdir ];
 	ok(run_script($cmd, undef, $opt), "$t succeeds with mbox escaping");
-	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
+	$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
 	like($cur->body, qr/^From not an mbox/sm,
 		'changed "From " line unescaped');
 
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^From not an mbox\\n//s'";
 	$cmd = [ '-edit', "-m$mid", '--raw', $inboxdir ];
 	ok(run_script($cmd, undef, $opt), "$t succeeds again");
-	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
+	$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
 	unlike($cur->body, qr/^From not an mbox/sm, "$t restored body");
 }
 
diff --git a/t/feed.t b/t/feed.t
index 373a1de8..5ad90a07 100644
--- a/t/feed.t
+++ b/t/feed.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Feed;
 use PublicInbox::Import;
 use PublicInbox::Inbox;
@@ -36,7 +36,7 @@ my $im = PublicInbox::Import->new($git, $ibx->{name}, 'test@example');
 {
 	$im->init_bare;
 	foreach my $i (1..6) {
-		my $mime = PublicInbox::MIME->new(<<EOF);
+		my $mime = PublicInbox::Eml->new(<<EOF);
 From: ME <me\@example.com>
 To: U <u\@example.com>
 Message-Id: <$i\@example.com>
@@ -95,7 +95,7 @@ EOF
 	# add a new spam message
 	my $spam;
 	{
-		$spam = PublicInbox::MIME->new(<<EOF);
+		$spam = PublicInbox::Eml->new(<<EOF);
 From: SPAMMER <spammer\@example.com>
 To: U <u\@example.com>
 Message-Id: <this-is-spam\@example.com>
diff --git a/t/filter_base.t b/t/filter_base.t
index bbd64189..47d0220f 100644
--- a/t/filter_base.t
+++ b/t/filter_base.t
@@ -21,13 +21,13 @@ use_ok 'PublicInbox::Filter::Base';
 
 {
 	my $f = PublicInbox::Filter::Base->new;
-	my $email = mime_load 't/filter_base-xhtml.eml';
+	my $email = eml_load 't/filter_base-xhtml.eml';
 	is($f->delivery($email), 100, "xhtml rejected");
 }
 
 {
 	my $f = PublicInbox::Filter::Base->new;
-	my $email = mime_load 't/filter_base-junk.eml';
+	my $email = eml_load 't/filter_base-junk.eml';
 	is($f->delivery($email), 100, 'proprietary format rejected on glob');
 }
 
diff --git a/t/filter_mirror.t b/t/filter_mirror.t
index 0e641a03..5bc7f3f4 100644
--- a/t/filter_mirror.t
+++ b/t/filter_mirror.t
@@ -9,7 +9,7 @@ use_ok 'PublicInbox::Filter::Mirror';
 my $f = PublicInbox::Filter::Mirror->new;
 ok($f, 'created PublicInbox::Filter::Mirror object');
 {
-	my $email = mime_load 't/mda-mime.eml';
+	my $email = eml_load 't/mda-mime.eml';
 	is($f->ACCEPT, $f->delivery($email), 'accept any trash that comes');
 }
 
diff --git a/t/filter_subjecttag.t b/t/filter_subjecttag.t
index 9b397b8c..75effa27 100644
--- a/t/filter_subjecttag.t
+++ b/t/filter_subjecttag.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use_ok 'PublicInbox::Filter::SubjectTag';
 
 my $f = eval { PublicInbox::Filter::SubjectTag->new };
@@ -11,7 +11,7 @@ like($@, qr/tag not defined/, 'error without args');
 $f = PublicInbox::Filter::SubjectTag->new('-tag', '[foo]');
 is(ref $f, 'PublicInbox::Filter::SubjectTag', 'new object created');
 
-my $mime = PublicInbox::MIME->new(<<EOF);
+my $mime = PublicInbox::Eml->new(<<EOF);
 To: you <you\@example.com>
 Subject: =?UTF-8?B?UmU6IFtmb29dIEVsw4PCqWFub3I=?=
 
diff --git a/t/filter_vger.t b/t/filter_vger.t
index 9d71f16d..ca5a6ca7 100644
--- a/t/filter_vger.t
+++ b/t/filter_vger.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use_ok 'PublicInbox::Filter::Vger';
 
 my $f = PublicInbox::Filter::Vger->new;
@@ -21,7 +21,7 @@ More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 EOF
 
-	my $mime = PublicInbox::MIME->new($lkml);
+	my $mime = PublicInbox::Eml->new($lkml);
 	$mime = $f->delivery($mime);
 	is("keep this\n", $mime->body, 'normal message filtered OK');
 }
@@ -37,7 +37,7 @@ the body of a message to majordomo@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 EOF
 
-	my $mime = PublicInbox::MIME->new($no_nl);
+	my $mime = PublicInbox::Eml->new($no_nl);
 	$mime = $f->delivery($mime);
 	is('OSX users :P', $mime->body, 'missing trailing LF in original OK');
 }
diff --git a/t/html_index.t b/t/html_index.t
index 51897532..80f81577 100644
--- a/t/html_index.t
+++ b/t/html_index.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Feed;
 use PublicInbox::Git;
 use PublicInbox::Import;
@@ -32,7 +32,7 @@ my $im = PublicInbox::Import->new($git, 'tester', 'test@example');
 			$mid_line .= "In-Reply-To: $prev";
 		}
 		$prev = $mid;
-		my $mime = PublicInbox::MIME->new(<<EOF);
+		my $mime = PublicInbox::Eml->new(<<EOF);
 From: ME <me\@example.com>
 To: U <u\@example.com>
 $mid_line
diff --git a/t/httpd.t b/t/httpd.t
index f4fbd533..7404eb8b 100644
--- a/t/httpd.t
+++ b/t/httpd.t
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use Test::More;
 use PublicInbox::TestCommon;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use Socket qw(IPPROTO_TCP SOL_SOCKET);
 require_mods(qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status));
 
@@ -28,7 +28,7 @@ use_ok 'PublicInbox::Import';
 
 	# ensure successful message delivery
 	{
-		my $mime = PublicInbox::MIME->new(<<EOF);
+		my $mime = PublicInbox::Eml->new(<<EOF);
 From: Me <me\@example.com>
 To: You <you\@example.com>
 Cc: $addr
diff --git a/t/import.t b/t/import.t
index ba4abd9c..3f308299 100644
--- a/t/import.t
+++ b/t/import.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Git;
 use PublicInbox::Import;
 use PublicInbox::Spawn qw(spawn);
@@ -15,7 +15,7 @@ my ($dir, $for_destroy) = tmpdir();
 my $git = PublicInbox::Git->new($dir);
 my $im = PublicInbox::Import->new($git, 'testbox', 'test@example');
 $im->init_bare;
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: b@example.com
 Subject: this is a subject
diff --git a/t/indexlevels-mirror.t b/t/indexlevels-mirror.t
index dcd5dc39..704f7e11 100644
--- a/t/indexlevels-mirror.t
+++ b/t/indexlevels-mirror.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Inbox;
 use PublicInbox::InboxWritable;
 require PublicInbox::Admin;
@@ -12,7 +12,7 @@ my $PI_TEST_VERSION = $ENV{PI_TEST_VERSION} || 2;
 require_git('2.6') if $PI_TEST_VERSION == 2;
 require_mods(qw(DBD::SQLite));
 
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: test@example.com
 Subject: this is a subject
diff --git a/t/mda.t b/t/mda.t
index 03cc4bc3..759c0b02 100644
--- a/t/mda.t
+++ b/t/mda.t
@@ -62,7 +62,7 @@ local $ENV{GIT_COMMITTER_NAME} = eval {
 	use PublicInbox::MDA;
 	use PublicInbox::Address;
 	use Encode qw/encode/;
-	my $msg = mime_load 't/utf8.eml';
+	my $msg = eml_load 't/utf8.eml';
 	my $from = $msg->header('From');
 	my ($author) = PublicInbox::Address::names($from);
 	my ($email) = PublicInbox::Address::emails($from);
@@ -229,7 +229,7 @@ EOF
 		"learned ham idempotently ");
 
 	# ensure trained email is filtered, too
-	my $mime = mime_load 't/mda-mime.eml';
+	my $mime = eml_load 't/mda-mime.eml';
 	($mid) = ($mime->header_raw('message-id') =~ /<([^>]+)>/);
 	{
 		$in = $mime->as_string;
diff --git a/t/mda_filter_rubylang.t b/t/mda_filter_rubylang.t
index f2cbe9d5..483fcb85 100644
--- a/t/mda_filter_rubylang.t
+++ b/t/mda_filter_rubylang.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Config;
 use PublicInbox::TestCommon;
 require_git(2.6);
diff --git a/t/mid.t b/t/mid.t
index 0ad81d7d..3b8f4108 100644
--- a/t/mid.t
+++ b/t/mid.t
@@ -2,7 +2,7 @@
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::MID qw(mid_escape mids references mids_for_index id_compress);
 
 is(mid_escape('foo!@(bar)'), 'foo!@(bar)');
@@ -16,7 +16,7 @@ like(id_compress('foo%bar@wtf'), qr/\A[a-f0-9]{40}\z/,
 is(id_compress('foobar-wtf'), 'foobar-wtf', 'regular ID not compressed');
 
 {
-	my $mime = PublicInbox::MIME->new("Message-ID: <mid-1\@a>\n\n");
+	my $mime = PublicInbox::Eml->new("Message-ID: <mid-1\@a>\n\n");
 	$mime->header_set('X-Alt-Message-ID', '<alt-id-for-nntp>');
 	is_deeply(['mid-1@a'], mids($mime->header_obj), 'mids in common case');
 	$mime->header_set('Message-Id', '<mid-1@a>', '<mid-2@b>');
diff --git a/t/mime.t b/t/mime.t
index b9a4d66b..d17ec58e 100644
--- a/t/mime.t
+++ b/t/mime.t
@@ -1,16 +1,23 @@
+#!perl -w
 # Copyright (C) 2017-2020 all contributors <meta@public-inbox.org>
 # This library is free software; you can redistribute it and/or modify
 # it under the same terms as Perl itself.
 # Artistic or GPL-1+ <https://www.gnu.org/licenses/gpl-1.0.txt>
 use strict;
-use warnings;
 use Test::More;
-use_ok 'PublicInbox::MIME';
+use PublicInbox::TestCommon;
 use PublicInbox::MsgIter;
-
-local $SIG{__WARN__} = sub {};
-my $msg = PublicInbox::MIME->new(
-'From:   Richard Hansen <hansenr@google.com>
+my @classes = qw(PublicInbox::Eml);
+SKIP: {
+	require_mods('Email::MIME', 1);
+	push @classes, 'PublicInbox::MIME';
+};
+use_ok $_ for @classes;
+local $SIG{__WARN__} = sub {}; # needed for old Email::Simple (used by E::M)
+
+for my $cls (@classes) {
+	my $msg = PublicInbox::MIME->new(<<'EOF');
+From:   Richard Hansen <hansenr@google.com>
 To:     git@vger.kernel.org
 Cc:     Richard Hansen <hansenr@google.com>
 Subject: [PATCH 0/2] minor diff orderfile documentation improvements
@@ -40,10 +47,11 @@ Content-Description: (truncated) S/MIME Cryptographic Signature
 dkTlB69771K2eXK4LcHSH/2LqX+VYa3K44vrx1ruzjXdNWzIpKBy0weFNiwnJCGofvCysM2RCSI1
 --94eb2c0bc864b76ba30545b2bca9--
 
-');
+EOF
 
-my @parts = $msg->parts;
-my $exp = 'Richard Hansen (2):
+	my @parts = $msg->parts;
+	my $exp = <<EOF;
+Richard Hansen (2):
   diff: document behavior of relative diff.orderFile
   diff: document the pattern format for diff.orderFile
 
@@ -51,13 +59,12 @@ my $exp = 'Richard Hansen (2):
  Documentation/diff-options.txt | 3 ++-
  2 files changed, 6 insertions(+), 2 deletions(-)
 
-';
-
-ok($msg->isa('Email::MIME'), 'compatible with Email::MIME');
-is($parts[0]->body, $exp, 'body matches expected');
+EOF
 
+	is($parts[0]->body, $exp, 'body matches expected');
 
-my $raw = q^Date:   Wed, 18 Jan 2017 13:28:32 -0500
+	my $raw = <<'EOF';
+Date:   Wed, 18 Jan 2017 13:28:32 -0500
 From:   Santiago Torres <santiago@nyu.edu>
 To:     Junio C Hamano <gitster@pobox.com>
 Cc:     git@vger.kernel.org, peff@peff.net, sunshine@sunshineco.com,
@@ -92,28 +99,30 @@ Content-Type: application/pgp-signature; name="signature.asc"
 
 --r24xguofrazenjwe--
 
-^;
-
-$msg = PublicInbox::MIME->new($raw);
-my $nr = 0;
-msg_iter($msg, sub {
-	my ($part, $level, @ex) = @{$_[0]};
-	is($level, 1, 'at expected level');
-	if (join('fail if $#ex > 0', @ex) eq '1') {
-		is($part->body_str, "your tree directly? \r\n", 'body OK');
-	} elsif (join('fail if $#ex > 0', @ex) eq '2') {
-		is($part->body, "-----BEGIN PGP SIGNATURE-----\n\n" .
-				"=7wIb\n" .
-				"-----END PGP SIGNATURE-----\n",
-			'sig "matches"');
-	} else {
-		fail "unexpected part\n";
-	}
-	$nr++;
-});
-
-is($nr, 2, 'got 2 parts');
-is($msg->as_string, $raw,
-	'stringified sufficiently close to original');
+EOF
+
+	$msg = $cls->new($raw);
+	my $nr = 0;
+	msg_iter($msg, sub {
+		my ($part, $level, @ex) = @{$_[0]};
+		is($level, 1, 'at expected level');
+		if (join('fail if $#ex > 0', @ex) eq '1') {
+			is($part->body_str, "your tree directly? \r\n",
+			'body OK');
+		} elsif (join('fail if $#ex > 0', @ex) eq '2') {
+			is($part->body, "-----BEGIN PGP SIGNATURE-----\n\n" .
+					"=7wIb\n" .
+					"-----END PGP SIGNATURE-----\n",
+				'sig "matches"');
+		} else {
+			fail "unexpected part\n";
+		}
+		$nr++;
+	});
+
+	is($nr, 2, 'got 2 parts');
+	is($msg->as_string, $raw,
+		'stringified sufficiently close to original');
+}
 
 done_testing();
diff --git a/t/msg_iter.t b/t/msg_iter.t
index e8115e25..4ee3a201 100644
--- a/t/msg_iter.t
+++ b/t/msg_iter.t
@@ -8,7 +8,7 @@ use PublicInbox::Hval qw(ascii_html);
 use_ok('PublicInbox::MsgIter');
 
 {
-	my $mime = mime_load 't/msg_iter-order.eml';
+	my $mime = eml_load 't/msg_iter-order.eml';
 	my @parts;
 	msg_iter($mime, sub {
 		my ($part, $level, @ex) = @{$_[0]};
@@ -20,7 +20,7 @@ use_ok('PublicInbox::MsgIter');
 }
 
 {
-	my $mime = mime_load 't/msg_iter-nested.eml';
+	my $mime = eml_load 't/msg_iter-nested.eml';
 	my @parts;
 	msg_iter($mime, sub {
 		my ($part, $level, @ex) = @{$_[0]};
@@ -33,7 +33,7 @@ use_ok('PublicInbox::MsgIter');
 }
 
 {
-	my $mime = mime_load 't/iso-2202-jp.eml';
+	my $mime = eml_load 't/iso-2202-jp.eml';
 	my $raw = '';
 	msg_iter($mime, sub {
 		my ($part, $level, @ex) = @{$_[0]};
@@ -46,7 +46,7 @@ use_ok('PublicInbox::MsgIter');
 }
 
 {
-	my $mime = mime_load 't/x-unknown-alpine.eml';
+	my $mime = eml_load 't/x-unknown-alpine.eml';
 	my $raw = '';
 	msg_iter($mime, sub {
 		my ($part, $level, @ex) = @{$_[0]};
diff --git a/t/msgtime.t b/t/msgtime.t
index d9f8e641..89fd9e37 100644
--- a/t/msgtime.t
+++ b/t/msgtime.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::MsgTime;
 use PublicInbox::TestCommon;
 
@@ -11,7 +11,7 @@ our $received_date = 'Mon, 22 Jan 2007 13:16:24 -0500';
 sub datestamp ($) {
 	my ($date) = @_;
 	local $SIG{__WARN__} = sub {};  # Suppress warnings
-	my $mime = PublicInbox::MIME->new(<<"EOF");
+	my $mime = PublicInbox::Eml->new(<<"EOF");
 From: a\@example.com
 To: b\@example.com
 Subject: this is a subject
@@ -30,7 +30,7 @@ EOF
 sub timestamp ($) {
 	my ($received) = @_;
 	local $SIG{__WARN__} = sub {};  # Suppress warnings
-	my $mime = PublicInbox::MIME->new(<<"EOF");
+	my $mime = PublicInbox::Eml->new(<<"EOF");
 From: a\@example.com
 To: b\@example.com
 Subject: this is a subject
diff --git a/t/multi-mid.t b/t/multi-mid.t
index 5afb9693..91c8597e 100644
--- a/t/multi-mid.t
+++ b/t/multi-mid.t
@@ -2,7 +2,7 @@
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::TestCommon;
 use PublicInbox::InboxWritable;
 require_git(2.6);
@@ -11,7 +11,7 @@ require PublicInbox::SearchIdx;
 my $delay = $ENV{TEST_DELAY_CONVERT};
 
 my $addr = 'test@example.com';
-my $bad = PublicInbox::MIME->new(<<EOF);
+my $bad = PublicInbox::Eml->new(<<EOF);
 Message-ID: <a\@example.com>
 Message-ID: <b\@example.com>
 From: a\@example.com
@@ -20,7 +20,7 @@ Subject: bad
 
 EOF
 
-my $good = PublicInbox::MIME->new(<<EOF);
+my $good = PublicInbox::Eml->new(<<EOF);
 Message-ID: <b\@example.com>
 From: b\@example.com
 To: $addr
diff --git a/t/nntp.t b/t/nntp.t
index 35fb55b4..2a9f3a4f 100644
--- a/t/nntp.t
+++ b/t/nntp.t
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use Test::More;
 use PublicInbox::TestCommon;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 require_mods(qw(DBD::SQLite Data::Dumper));
 use_ok 'PublicInbox::NNTP';
 use_ok 'PublicInbox::Inbox';
@@ -107,7 +107,7 @@ use_ok 'PublicInbox::Inbox';
 					url => [ '//example.com/a' ]});
 	is($ng->base_url, $u, 'URL expanded');
 	my $mid = 'a@b';
-	my $mime = PublicInbox::MIME->new("Message-ID: <$mid>\r\n\r\n");
+	my $mime = PublicInbox::Eml->new("Message-ID: <$mid>\r\n\r\n");
 	my $hdr = $mime->header_obj;
 	my $mock_self = { nntpd => { grouplist => [], 
 				     servername => 'example.com' } };
diff --git a/t/nntpd-tls.t b/t/nntpd-tls.t
index 0ad29be0..3de219f1 100644
--- a/t/nntpd-tls.t
+++ b/t/nntpd-tls.t
@@ -23,7 +23,7 @@ unless (-r $key && -r $cert) {
 use_ok 'PublicInbox::TLS';
 use_ok 'IO::Socket::SSL';
 require PublicInbox::InboxWritable;
-require PublicInbox::MIME;
+require PublicInbox::Eml;
 require PublicInbox::SearchIdx;
 our $need_zlib;
 eval { require Compress::Raw::Zlib } or
@@ -63,7 +63,7 @@ EOF
 
 {
 	my $im = $ibx->importer(0);
-	my $mime = mime_load 't/data/0001.patch';
+	my $mime = eml_load 't/data/0001.patch';
 	ok($im->add($mime), 'message added');
 	$im->done;
 	if ($version == 1) {
diff --git a/t/nntpd.t b/t/nntpd.t
index 4993b29f..69f72ce1 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -7,7 +7,7 @@ use PublicInbox::TestCommon;
 use PublicInbox::Spawn qw(which);
 require_mods(qw(DBD::SQLite));
 require PublicInbox::InboxWritable;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use IO::Socket;
 use Socket qw(IPPROTO_TCP TCP_NODELAY);
 use Net::NNTP;
@@ -57,7 +57,7 @@ $ibx = PublicInbox::Inbox->new($ibx);
 
 	# ensure successful message delivery
 	{
-		my $mime = PublicInbox::MIME->new(<<EOF);
+		my $mime = PublicInbox::Eml->new(<<EOF);
 To: =?utf-8?Q?El=C3=A9anor?= <you\@example.com>
 From: =?utf-8?Q?El=C3=A9anor?= <me\@example.com>
 Cc: $addr
@@ -241,7 +241,7 @@ EOF
 		ok($date <= $t1, 'valid date before stop');
 	}
 	if ('leafnode interop') {
-		my $for_leafnode = PublicInbox::MIME->new(<<"");
+		my $for_leafnode = PublicInbox::Eml->new(<<"");
 From: longheader\@example.com
 To: $addr
 Subject: none
diff --git a/t/nulsubject.t b/t/nulsubject.t
index 03b1ee80..ccb60d52 100644
--- a/t/nulsubject.t
+++ b/t/nulsubject.t
@@ -14,7 +14,7 @@ my $git_dir = "$tmpdir/a.git";
 	my $git = PublicInbox::Git->new($git_dir);
 	my $im = PublicInbox::Import->new($git, 'testbox', 'test@example');
 	$im->init_bare;
-	$im->add(PublicInbox::MIME->new(<<'EOF'));
+	$im->add(PublicInbox::Eml->new(<<'EOF'));
 From: a@example.com
 To: b@example.com
 Subject: A subject line with a null =?iso-8859-1?q?=00?= see!
diff --git a/t/plack.t b/t/plack.t
index 4fff9773..37a6b394 100644
--- a/t/plack.t
+++ b/t/plack.t
@@ -31,7 +31,7 @@ my $git = PublicInbox::Git->new($inboxdir);
 my $im = PublicInbox::Import->new($git, 'test', $addr);
 # ensure successful message delivery
 {
-	my $mime = PublicInbox::MIME->new(<<EOF);
+	my $mime = PublicInbox::Eml->new(<<EOF);
 From: Me <me\@example.com>
 To: You <you\@example.com>
 Cc: $addr
@@ -50,15 +50,15 @@ EOF
 	chomp @ls;
 
 	# multipart with two text bodies
-	$mime = mime_load 't/plack-2-txt-bodies.eml';
+	$mime = eml_load 't/plack-2-txt-bodies.eml';
 	$im->add($mime);
 
 	# multipart with attached patch + filename
-	$mime = mime_load 't/plack-attached-patch.eml';
+	$mime = eml_load 't/plack-attached-patch.eml';
 	$im->add($mime);
 
 	# multipart collapsed to single quoted-printable text/plain
-	$mime = mime_load 't/plack-qp.eml';
+	$mime = eml_load 't/plack-qp.eml';
 	like($mime->body_raw, qr/hi =3D bye=/, 'our test used QP correctly');
 	$im->add($mime);
 
@@ -77,7 +77,7 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
 :(
 EOF
 	$crlf =~ s/\n/\r\n/sg;
-	$im->add(PublicInbox::MIME->new($crlf));
+	$im->add(PublicInbox::Eml->new($crlf));
 
 	$im->done;
 }
diff --git a/t/precheck.t b/t/precheck.t
index a8fd31b1..11193e38 100644
--- a/t/precheck.t
+++ b/t/precheck.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use Email::Simple;
+use PublicInbox::Eml;
 use PublicInbox::MDA;
 
 sub do_checks {
@@ -27,7 +27,7 @@ sub do_checks {
 }
 
 {
-	my $s = Email::Simple->new(<<'EOF');
+	my $s = PublicInbox::Eml->new(<<'EOF');
 From: abc@example.com
 To: abc@example.com
 Cc: c@example.com, another-list@example.com
@@ -43,7 +43,7 @@ EOF
 }
 
 {
-	do_checks(Email::Simple->new(<<'EOF'));
+	do_checks(PublicInbox::Eml->new(<<'EOF'));
 From: a@example.com
 To: b@example.com
 Cc: c@example.com
@@ -57,7 +57,7 @@ EOF
 }
 
 {
-	do_checks(Email::Simple->new(<<'EOF'));
+	do_checks(PublicInbox::Eml->new(<<'EOF'));
 From: a@example.com
 To: b+plus@example.com
 Cc: John Doe <c@example.com>
@@ -72,7 +72,7 @@ EOF
 
 {
 	my $recipient = 'b@example.com';
-	my $s = Email::Simple->new(<<'EOF');
+	my $s = PublicInbox::Eml->new(<<'EOF');
 To: b@example.com
 Cc: c@example.com
 Content-Type: text/plain
diff --git a/t/psgi_attach.t b/t/psgi_attach.t
index af0fbdd3..9a2b2411 100644
--- a/t/psgi_attach.t
+++ b/t/psgi_attach.t
@@ -29,7 +29,7 @@ $im->init_bare;
 	my $b64 = "b64\xde\xad\xbe\xef\n";
 	my $txt = "plain\ntext\npass\nthrough\n";
 	my $dot = "dotfile\n";
-	$im->add(mime_load('t/psgi_attach.eml'));
+	$im->add(eml_load('t/psgi_attach.eml'));
 	$im->done;
 
 	my $www = PublicInbox::WWW->new($config);
diff --git a/t/psgi_bad_mids.t b/t/psgi_bad_mids.t
index 43025a4d..81bd9356 100644
--- a/t/psgi_bad_mids.t
+++ b/t/psgi_bad_mids.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Config;
 use PublicInbox::TestCommon;
 my @mods = qw(DBD::SQLite HTTP::Request::Common Plack::Test
@@ -45,7 +45,7 @@ To: b\@example.com
 Date: Fri, 02 Oct 1993 00:00:0$i +0000
 
 
-	my $mime = PublicInbox::MIME->new(\$data);
+	my $mime = PublicInbox::Eml->new(\$data);
 	ok($im->add($mime), "added $mid");
 	$i++
 }
diff --git a/t/psgi_mount.t b/t/psgi_mount.t
index bd492dcb..b4de8274 100644
--- a/t/psgi_mount.t
+++ b/t/psgi_mount.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::TestCommon;
 my ($tmpdir, $for_destroy) = tmpdir();
 my $maindir = "$tmpdir/main.git";
@@ -25,7 +25,7 @@ my $git = PublicInbox::Git->new($maindir);
 my $im = PublicInbox::Import->new($git, 'test', $addr);
 $im->init_bare;
 {
-	my $mime = PublicInbox::MIME->new(<<EOF);
+	my $mime = PublicInbox::Eml->new(<<EOF);
 From: Me <me\@example.com>
 To: You <you\@example.com>
 Cc: $addr
diff --git a/t/psgi_multipart_not.t b/t/psgi_multipart_not.t
index ef86c015..e36820f4 100644
--- a/t/psgi_multipart_not.t
+++ b/t/psgi_multipart_not.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Config;
 use PublicInbox::TestCommon;
 my @mods = qw(DBD::SQLite Search::Xapian HTTP::Request::Common
@@ -22,7 +22,7 @@ my $ibx = PublicInbox::Inbox->new({
 my $im = PublicInbox::V2Writable->new($ibx, 1);
 $im->{parallel} = 0;
 
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 Message-Id: <200308111450.h7BEoOu20077@mail.osdl.org>
 To: linux-kernel@vger.kernel.org
 Subject: [OSDL] linux-2.6.0-test3 reaim results
diff --git a/t/psgi_scan_all.t b/t/psgi_scan_all.t
index 93603a33..46eb489f 100644
--- a/t/psgi_scan_all.t
+++ b/t/psgi_scan_all.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Config;
 use PublicInbox::TestCommon;
 my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape DBD::SQLite);
@@ -31,7 +31,7 @@ foreach my $i (1..2) {
 	my $im = PublicInbox::V2Writable->new($ibx, 1);
 	$im->{parallel} = 0;
 	$im->init_inbox(0);
-	my $mime = PublicInbox::MIME->new(<<EOF);
+	my $mime = PublicInbox::Eml->new(<<EOF);
 From: a\@example.com
 To: $addr
 Subject: s$i
diff --git a/t/psgi_search.t b/t/psgi_search.t
index 3c515d19..64f8b1ac 100644
--- a/t/psgi_search.t
+++ b/t/psgi_search.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Config;
 use PublicInbox::Inbox;
 use PublicInbox::InboxWritable;
@@ -27,7 +27,7 @@ my $im = $ibx->importer(0);
 my $digits = '10010260936330';
 my $ua = 'Pine.LNX.4.10';
 my $mid = "$ua.$digits.2460-100000\@penguin.transmeta.com";
-my $mime = PublicInbox::MIME->new(<<EOF);
+my $mime = PublicInbox::Eml->new(<<EOF);
 Subject: test
 Message-ID: <$mid>
 From: Ævar Arnfjörð Bjarmason <avarab\@example>
@@ -36,7 +36,7 @@ To: git\@vger.kernel.org
 EOF
 $im->add($mime);
 
-$mime = PublicInbox::MIME->new(<<'EOF');
+$mime = PublicInbox::Eml->new(<<'EOF');
 Subject:
 Message-ID: <blank-subject@example.com>
 From: blank subject <blank-subject@example.com>
@@ -45,7 +45,7 @@ To: git@vger.kernel.org
 EOF
 $im->add($mime);
 
-$mime = PublicInbox::MIME->new(<<'EOF');
+$mime = PublicInbox::Eml->new(<<'EOF');
 Message-ID: <no-subject-at-all@example.com>
 From: no subject at all <no-subject-at-all@example.com>
 To: git@vger.kernel.org
diff --git a/t/psgi_text.t b/t/psgi_text.t
index b7b5b2d4..833bcaba 100644
--- a/t/psgi_text.t
+++ b/t/psgi_text.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::TestCommon;
 my ($tmpdir, $for_destroy) = tmpdir();
 my $maindir = "$tmpdir/main.git";
diff --git a/t/psgi_v2.t b/t/psgi_v2.t
index 9c19b041..8f75a3fb 100644
--- a/t/psgi_v2.t
+++ b/t/psgi_v2.t
@@ -5,7 +5,7 @@ use warnings;
 use Test::More;
 use PublicInbox::TestCommon;
 require_git(2.6);
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Config;
 use PublicInbox::MID qw(mids);
 require_mods(qw(DBD::SQLite Search::Xapian HTTP::Request::Common Plack::Test
@@ -26,7 +26,7 @@ my $new_mid;
 my $im = PublicInbox::V2Writable->new($ibx, 1);
 $im->{parallel} = 0;
 
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From oldbug-pre-a0c07cba0e5d8b6a Fri Oct  2 00:00:00 1993
 From: a@example.com
 To: test@example.com
@@ -225,7 +225,7 @@ test_psgi(sub { $www->call(@_) }, sub {
 
 	# ensure conflicted attachments can be resolved
 	foreach my $body (qw(old new)) {
-		$mime = mime_load "t/psgi_v2-$body.eml";
+		$mime = eml_load "t/psgi_v2-$body.eml";
 		ok($im->add($mime), "added attachment $body");
 	}
 	$im->done;
diff --git a/t/purge.t b/t/purge.t
index dcc44039..2ca9edca 100644
--- a/t/purge.t
+++ b/t/purge.t
@@ -36,7 +36,7 @@ local $ENV{PI_CONFIG} = $cfgfile;
 open my $cfg_fh, '>', $cfgfile or die "open: $!";
 
 my $v2w = PublicInbox::V2Writable->new($ibx, {nproc => 1});
-my $mime = PublicInbox::MIME->new($raw);
+my $mime = PublicInbox::Eml->new($raw);
 ok($v2w->add($mime), 'add message to be purged');
 $v2w->done;
 
diff --git a/t/replace.t b/t/replace.t
index 2efa25f1..cef4e7aa 100644
--- a/t/replace.t
+++ b/t/replace.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::InboxWritable;
 use PublicInbox::TestCommon;
 use Cwd qw(abs_path);
@@ -24,7 +24,7 @@ sub test_replace ($$$) {
 		indexlevel => $level,
 	});
 
-	my $orig = PublicInbox::MIME->new(<<'EOF');
+	my $orig = PublicInbox::Eml->new(<<'EOF');
 From: Barbra Streisand <effect@example.com>
 To: test@example.com
 Subject: confidential
@@ -49,7 +49,7 @@ EOF
 	my $thread_a = $ibx->over->get_thread('replace@example.com');
 
 	my %before = map {; delete($_->{blob}) => $_ } @{$ibx->recent};
-	my $reject = PublicInbox::MIME->new($orig->as_string);
+	my $reject = PublicInbox::Eml->new($orig->as_string);
 	foreach my $mid (['<replace@example.com>', '<extra@example.com>'],
 				[], ['<replaced@example.com>']) {
 		$reject->header_set('Message-ID', @$mid);
@@ -61,7 +61,7 @@ EOF
 
 	# prepare the replacement
 	my $expect = "Move along, nothing to see here\n";
-	my $repl = PublicInbox::MIME->new($orig->as_string);
+	my $repl = PublicInbox::Eml->new($orig->as_string);
 	$repl->header_set('From', '<redactor@example.com>');
 	$repl->header_set('Subject', 'redacted');
 	$repl->header_set('Date', 'Sat, 02 Oct 2010 00:00:00 +0000');
@@ -80,7 +80,7 @@ EOF
 	is($changed_epochs, 1, 'only one epoch changed');
 
 	$im->done;
-	my $m = PublicInbox::MIME->new($ibx->msg_by_mid('replace@example.com'));
+	my $m = PublicInbox::Eml->new($ibx->msg_by_mid('replace@example.com'));
 	is($m->body, $expect, 'replaced message');
 	is_deeply(\@warn, [], 'no warnings on noop');
 
@@ -159,7 +159,7 @@ sub pad_msgs {
 			($i, $irt) = each %$i;
 		}
 		my $sec = sprintf('%0d', $i);
-		my $mime = PublicInbox::MIME->new(<<EOF);
+		my $mime = PublicInbox::Eml->new(<<EOF);
 From: foo\@example.com
 To: test\@example.com
 Message-ID: <$i\@example.com>
diff --git a/t/reply.t b/t/reply.t
index a6c38cfa..53162df5 100644
--- a/t/reply.t
+++ b/t/reply.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use_ok 'PublicInbox::Reply';
 
 my @q = (
@@ -19,7 +19,7 @@ while (@q) {
 	is($res, $expect, "quote $input => $res");
 }
 
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: from <from@example.com>
 To: to <to@example.com>
 Cc: cc@example.com
diff --git a/t/search-thr-index.t b/t/search-thr-index.t
index 1bea59fd..914807a8 100644
--- a/t/search-thr-index.t
+++ b/t/search-thr-index.t
@@ -6,7 +6,7 @@ use bytes (); # only for bytes::length
 use Test::More;
 use PublicInbox::TestCommon;
 use PublicInbox::MID qw(mids);
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 require_mods(qw(DBD::SQLite Search::Xapian));
 require PublicInbox::SearchIdx;
 require PublicInbox::Smsg;
@@ -42,7 +42,7 @@ my @mids;
 
 foreach (reverse split(/\n\n/, $data)) {
 	$_ .= "\n";
-	my $mime = PublicInbox::MIME->new(\$_);
+	my $mime = PublicInbox::Eml->new(\$_);
 	$mime->header_set('From' => 'bw@g');
 	$mime->header_set('To' => 'git@vger.kernel.org');
 	my $bytes = bytes::length($mime->as_string);
@@ -78,7 +78,7 @@ $rw->commit_txn_lazy;
 
 $xdb = $rw->begin_txn_lazy;
 {
-	my $mime = PublicInbox::MIME->new(<<'');
+	my $mime = PublicInbox::Eml->new(<<'');
 Subject: [RFC 00/14]
 Message-Id: <1-bw@g>
 From: bw@g
diff --git a/t/search.t b/t/search.t
index 83986837..6cd938dd 100644
--- a/t/search.t
+++ b/t/search.t
@@ -8,7 +8,7 @@ require_mods(qw(DBD::SQLite Search::Xapian));
 require PublicInbox::SearchIdx;
 require PublicInbox::Inbox;
 require PublicInbox::InboxWritable;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 my ($tmpdir, $for_destroy) = tmpdir();
 my $git_dir = "$tmpdir/a.git";
 my $ibx = PublicInbox::Inbox->new({ inboxdir => $git_dir });
@@ -60,7 +60,7 @@ sub oct_is ($$$) {
 }
 
 $ibx->with_umask(sub {
-	my $root = PublicInbox::MIME->new(<<'EOF');
+	my $root = PublicInbox::Eml->new(<<'EOF');
 Date: Fri, 02 Oct 1993 00:00:00 +0000
 Subject: Hello world
 Message-ID: <root@s>
@@ -69,7 +69,7 @@ To: list@example.com
 
 \m/
 EOF
-	my $last = PublicInbox::MIME->new(<<'EOF');
+	my $last = PublicInbox::Eml->new(<<'EOF');
 Date: Sat, 02 Oct 2010 00:00:00 +0000
 Subject: Re: Hello world
 In-Reply-To: <root@s>
@@ -126,7 +126,7 @@ sub filter_mids {
 $ibx->with_umask(sub {
 	$rw_commit->();
 	my $rmid = '<ghost-message@s>';
-	my $reply_to_ghost = PublicInbox::MIME->new(<<"EOF");
+	my $reply_to_ghost = PublicInbox::Eml->new(<<"EOF");
 Date: Sat, 02 Oct 2010 00:00:00 +0000
 Subject: Re: ghosts
 Message-ID: <ghost-reply\@s>
@@ -140,7 +140,7 @@ EOF
 	my $reply_id = $rw->add_message($reply_to_ghost);
 	is($reply_id, int($reply_id), "reply_id is an integer: $reply_id");
 
-	my $was_ghost = PublicInbox::MIME->new(<<"EOF");
+	my $was_ghost = PublicInbox::Eml->new(<<"EOF");
 Date: Sat, 02 Oct 2010 00:00:01 +0000
 Subject: ghosts
 Message-ID: $rmid
@@ -189,7 +189,7 @@ $ibx->with_umask(sub {
 	$rw_commit->();
 	$ro->reopen;
 	my $long_mid = 'last' . ('x' x 60). '@s';
-	my $long = PublicInbox::MIME->new(<<EOF);
+	my $long = PublicInbox::Eml->new(<<EOF);
 Date: Sat, 02 Oct 2010 00:00:00 +0000
 Subject: long message ID
 References: <root\@s> <last\@s>
@@ -209,7 +209,7 @@ EOF
 	my @res;
 
 	my $long_reply_mid = 'reply-to-long@1';
-	my $long_reply = PublicInbox::MIME->new(<<EOF);
+	my $long_reply = PublicInbox::Eml->new(<<EOF);
 Subject: I break references
 Date: Sat, 02 Oct 2010 00:00:00 +0000
 Message-ID: <$long_reply_mid>
@@ -233,7 +233,7 @@ EOF
 # quote prioritization
 $ibx->with_umask(sub {
 	$rw_commit->();
-	$rw->add_message(PublicInbox::MIME->new(<<'EOF'));
+	$rw->add_message(PublicInbox::Eml->new(<<'EOF'));
 Date: Sat, 02 Oct 2010 00:00:01 +0000
 Subject: Hello
 Message-ID: <quote@a>
@@ -243,7 +243,7 @@ To: list@example.com
 > theatre illusions
 fade
 EOF
-	$rw->add_message(PublicInbox::MIME->new(<<'EOF'));
+	$rw->add_message(PublicInbox::Eml->new(<<'EOF'));
 Date: Sat, 02 Oct 2010 00:00:02 +0000
 Subject: Hello
 Message-ID: <nquote@a>
@@ -267,7 +267,7 @@ EOF
 # circular references
 $ibx->with_umask(sub {
 	my $s = 'foo://'. ('Circle' x 15).'/foo';
-	my $doc_id = $rw->add_message(PublicInbox::MIME->new(<<EOF));
+	my $doc_id = $rw->add_message(PublicInbox::Eml->new(<<EOF));
 Subject: $s
 Date: Sat, 02 Oct 2010 00:00:01 +0000
 Message-ID: <circle\@a>
@@ -286,7 +286,7 @@ EOF
 });
 
 $ibx->with_umask(sub {
-	my $mime = mime_load 't/utf8.eml';
+	my $mime = eml_load 't/utf8.eml';
 	my $doc_id = $rw->add_message($mime);
 	ok($doc_id > 0, 'message indexed doc_id with UTF-8');
 	my $msg = $rw->query('m:testmessage@example.com', {limit => 1})->[0];
@@ -369,7 +369,7 @@ $ibx->with_umask(sub {
 }
 
 $ibx->with_umask(sub {
-	my $amsg = mime_load 't/search-amsg.eml';
+	my $amsg = eml_load 't/search-amsg.eml';
 	ok($rw->add_message($amsg), 'added attachment');
 	$rw_commit->();
 	$ro->reopen;
@@ -427,7 +427,7 @@ $ibx->with_umask(sub {
 	my $mid = "$ua.$digits.2460-100000\@penguin.transmeta.com";
 	is($ro->reopen->query("m:$digits", { mset => 1})->size, 0,
 		'no results yet');
-	my $pine = PublicInbox::MIME->new(<<EOF);
+	my $pine = PublicInbox::Eml->new(<<EOF);
 Subject: blah
 Message-ID: <$mid>
 From: torvalds\@transmeta
diff --git a/t/solver_git.t b/t/solver_git.t
index c483aba1..78cc0edd 100644
--- a/t/solver_git.t
+++ b/t/solver_git.t
@@ -15,7 +15,7 @@ chomp $git_dir;
 # needed for alternates, and --absolute-git-dir is only in git 2.13+
 $git_dir = abs_path($git_dir);
 
-use_ok "PublicInbox::$_" for (qw(Inbox V2Writable MIME Git SolverGit WWW));
+use_ok "PublicInbox::$_" for (qw(Inbox V2Writable Git SolverGit WWW));
 
 my ($inboxdir, $for_destroy) = tmpdir();
 my $opts = {
@@ -29,7 +29,7 @@ my $im = PublicInbox::V2Writable->new($ibx, 1);
 $im->{parallel} = 0;
 
 my $deliver_patch = sub ($) {
-	$im->add(mime_load($_[0]));
+	$im->add(eml_load($_[0]));
 	$im->done;
 };
 
diff --git a/t/spamcheck_spamc.t b/t/spamcheck_spamc.t
index edfacc62..2d9da631 100644
--- a/t/spamcheck_spamc.t
+++ b/t/spamcheck_spamc.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use Email::Simple;
+use PublicInbox::Eml;
 use IO::File;
 use Fcntl qw(:DEFAULT SEEK_SET);
 use PublicInbox::TestCommon;
@@ -28,19 +28,19 @@ Subject: test
 Message-ID: <testmessage@example.com>
 
 EOF
-ok($spamc->spamcheck(Email::Simple->new($src), \$dst), 'Email::Simple works');
+ok($spamc->spamcheck(PublicInbox::Eml->new($src), \$dst), 'PublicInbox::Eml works');
 is($dst, $src, 'input == output');
 
 $dst = '';
 $spamc->{checkcmd} = ['sh', '-c', 'cat; false'];
-ok(!$spamc->spamcheck(Email::Simple->new($src), \$dst), 'Failed check works');
+ok(!$spamc->spamcheck(PublicInbox::Eml->new($src), \$dst), 'Failed check works');
 is($dst, $src, 'input == output for spammy example');
 
 for my $l (qw(ham spam)) {
 	my $file = "$tmpdir/$l.out";
 	$spamc->{$l.'cmd'} = ['tee', $file ];
 	my $method = $l.'learn';
-	ok($spamc->$method(Email::Simple->new($src)), "$method OK");
+	ok($spamc->$method(PublicInbox::Eml->new($src)), "$method OK");
 	open my $fh, '<', $file or die "failed to open $file: $!";
 	is(eval { local $/, <$fh> }, $src, "$l command ran alright");
 }
diff --git a/t/thread-cycle.t b/t/thread-cycle.t
index d6545c6d..484ea443 100644
--- a/t/thread-cycle.t
+++ b/t/thread-cycle.t
@@ -3,8 +3,9 @@
 use strict;
 use warnings;
 use Test::More;
+use PublicInbox::TestCommon;
+require_mods 'Email::Simple';
 use_ok('PublicInbox::SearchThread');
-use Email::Simple;
 my $mt = eval {
 	require Mail::Thread;
 	no warnings 'once';
diff --git a/t/time.t b/t/time.t
index 71600b93..b491711d 100644
--- a/t/time.t
+++ b/t/time.t
@@ -4,9 +4,9 @@ use strict;
 use warnings;
 use Test::More;
 use POSIX qw(strftime);
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::MsgTime qw(msg_datestamp);
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: b@example.com
 Subject: this is a subject
diff --git a/t/v1-add-remove-add.t b/t/v1-add-remove-add.t
index 23f4fb11..2cd45f60 100644
--- a/t/v1-add-remove-add.t
+++ b/t/v1-add-remove-add.t
@@ -5,7 +5,7 @@ use warnings;
 use Test::More;
 use PublicInbox::Import;
 use PublicInbox::TestCommon;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 require_mods(qw(DBD::SQLite Search::Xapian));
 require PublicInbox::SearchIdx;
 my ($inboxdir, $for_destroy) = tmpdir();
@@ -15,7 +15,7 @@ my $ibx = {
 	-primary_address => 'test@example.com',
 };
 $ibx = PublicInbox::Inbox->new($ibx);
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: test@example.com
 Subject: this is a subject
diff --git a/t/v1reindex.t b/t/v1reindex.t
index e473fe7c..13605f8b 100644
--- a/t/v1reindex.t
+++ b/t/v1reindex.t
@@ -6,7 +6,7 @@ use Test::More;
 use PublicInbox::ContentId qw(content_digest);
 use File::Path qw(remove_tree);
 use PublicInbox::TestCommon;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 require_git(2.6);
 require_mods(qw(DBD::SQLite Search::Xapian));
 use_ok 'PublicInbox::SearchIdx';
@@ -18,7 +18,7 @@ my $ibx_config = {
 	-primary_address => 'test@example.com',
 	indexlevel => 'full',
 };
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: test@example.com
 Subject: this is a subject
diff --git a/t/v2-add-remove-add.t b/t/v2-add-remove-add.t
index 60a869ee..cfdc8cf1 100644
--- a/t/v2-add-remove-add.t
+++ b/t/v2-add-remove-add.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::TestCommon;
 require_git(2.6);
 require_mods(qw(DBD::SQLite Search::Xapian));
@@ -16,7 +16,7 @@ my $ibx = {
 	-primary_address => 'test@example.com',
 };
 $ibx = PublicInbox::Inbox->new($ibx);
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: test@example.com
 Subject: this is a subject
diff --git a/t/v2mda.t b/t/v2mda.t
index 4d3ec30d..36f43ff0 100644
--- a/t/v2mda.t
+++ b/t/v2mda.t
@@ -6,7 +6,7 @@ use Test::More;
 use Fcntl qw(SEEK_SET);
 use Cwd;
 use PublicInbox::TestCommon;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 require_git(2.6);
 
 my $V = 2;
@@ -18,7 +18,7 @@ my $ibx = {
 	name => 'test-v2writable',
 	address => [ 'test@example.com' ],
 };
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: test@example.com
 Subject: this is a subject
diff --git a/t/v2mirror.t b/t/v2mirror.t
index ecf96891..d588808d 100644
--- a/t/v2mirror.t
+++ b/t/v2mirror.t
@@ -15,7 +15,7 @@ use IO::Socket;
 use POSIX qw(dup2);
 use_ok 'PublicInbox::V2Writable';
 use PublicInbox::InboxWritable;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Config;
 # FIXME: too much setup
 my ($tmpdir, $for_destroy) = tmpdir();
@@ -38,7 +38,7 @@ $ibx->{version} = 2;
 my $v2w = PublicInbox::V2Writable->new($ibx, 1);
 ok $v2w, 'v2w loaded';
 $v2w->{parallel} = 0;
-my $mime = PublicInbox::MIME->new(<<'');
+my $mime = PublicInbox::Eml->new(<<'');
 From: Me <me@example.com>
 To: You <you@example.com>
 Subject: a
diff --git a/t/v2reindex.t b/t/v2reindex.t
index b97c6498..f16a0b0d 100644
--- a/t/v2reindex.t
+++ b/t/v2reindex.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::ContentId qw(content_digest);
 use File::Path qw(remove_tree);
 use PublicInbox::TestCommon;
@@ -24,7 +24,7 @@ my $agpl = do {
 	<$fh>;
 };
 my $phrase = q("defending all users' freedom");
-my $mime = PublicInbox::MIME->new(<<'EOF'.$agpl);
+my $mime = PublicInbox::Eml->new(<<'EOF'.$agpl);
 From: a@example.com
 To: test@example.com
 Subject: this is a subject
@@ -434,7 +434,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 	$config{indexlevel} = 'medium';
 	my $ibx = PublicInbox::Inbox->new(\%config);
 	my $im = PublicInbox::V2Writable->new($ibx);
-	my $m3 = PublicInbox::MIME->new(<<'EOF');
+	my $m3 = PublicInbox::Eml->new(<<'EOF');
 Date: Tue, 24 May 2016 14:34:22 -0700 (PDT)
 Message-Id: <20160524.143422.552507610109476444.d@example.com>
 To: t@example.com
@@ -465,7 +465,7 @@ Somehow we got a message with 3 sets of headers into one
 message, could've been something broken on the archiver side.
 EOF
 
-	my $m1 = PublicInbox::MIME->new(<<'EOF');
+	my $m1 = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: t@example.com
 Subject: [PATCH 12/13]
diff --git a/t/v2writable.t b/t/v2writable.t
index 07687052..e5a565ce 100644
--- a/t/v2writable.t
+++ b/t/v2writable.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::ContentId qw(content_digest content_id);
 use PublicInbox::TestCommon;
 use Cwd qw(abs_path);
@@ -20,7 +20,7 @@ my $ibx = {
 	-primary_address => 'test@example.com',
 };
 $ibx = PublicInbox::Inbox->new($ibx);
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: test@example.com
 Subject: this is a subject
@@ -63,7 +63,7 @@ if ('ensure git configs are correct') {
 	@warn = ();
 	$mime->header_set('Message-Id', '<a-mid@b>', '<c@d>');
 	is($im->add($mime), undef, 'secondary MID ignored if first matches');
-	my $sec = PublicInbox::MIME->new($mime->as_string);
+	my $sec = PublicInbox::Eml->new($mime->as_string);
 	$sec->header_set('Date');
 	$sec->header_set('Message-Id', '<a-mid@b>', '<c@d>');
 	ok($im->add($sec), 'secondary MID used if data is different');
@@ -90,7 +90,7 @@ if ('ensure git configs are correct') {
 	my $hdr = $mime->header_obj;
 	my $gen = PublicInbox::Import::digest2mid(content_digest($mime), $hdr);
 	unlike($gen, qr![\+/=]!, 'no URL-unfriendly chars in Message-Id');
-	my $fake = PublicInbox::MIME->new($mime->as_string);
+	my $fake = PublicInbox::Eml->new($mime->as_string);
 	$fake->header_set('Message-Id', "<$gen>");
 	ok($im->add($fake), 'fake added easily');
 	is_deeply(\@warn, [], 'no warnings from a faker');
diff --git a/t/watch_filter_rubylang.t b/t/watch_filter_rubylang.t
index 09217d94..2e7d402e 100644
--- a/t/watch_filter_rubylang.t
+++ b/t/watch_filter_rubylang.t
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use PublicInbox::TestCommon;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Config;
 require_mods(qw(Filesys::Notify::Simple DBD::SQLite Search::Xapian));
 use_ok 'PublicInbox::WatchMaildir';
diff --git a/t/watch_maildir.t b/t/watch_maildir.t
index c34d15f7..66955072 100644
--- a/t/watch_maildir.t
+++ b/t/watch_maildir.t
@@ -2,7 +2,7 @@
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use Cwd;
 use PublicInbox::Config;
 use PublicInbox::TestCommon;
diff --git a/t/watch_maildir_v2.t b/t/watch_maildir_v2.t
index dd5030ea..19a2da77 100644
--- a/t/watch_maildir_v2.t
+++ b/t/watch_maildir_v2.t
@@ -2,7 +2,7 @@
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use Cwd;
 use PublicInbox::Config;
 use PublicInbox::TestCommon;
diff --git a/t/www_altid.t b/t/www_altid.t
index a885c389..337303d9 100644
--- a/t/www_altid.t
+++ b/t/www_altid.t
@@ -26,7 +26,7 @@ if ('setup') {
 	my $ibx = PublicInbox::Inbox->new($opts);
 	$ibx = PublicInbox::InboxWritable->new($ibx, 1);
 	my $im = $ibx->importer(0);
-	my $mime = PublicInbox::MIME->new(<<'EOF');
+	my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 Message-Id: <a@example.com>
 
diff --git a/t/xcpdb-reshard.t b/t/xcpdb-reshard.t
index 0e1fea52..70012cc6 100644
--- a/t/xcpdb-reshard.t
+++ b/t/xcpdb-reshard.t
@@ -6,11 +6,11 @@ use Test::More;
 use PublicInbox::TestCommon;
 require_mods(qw(DBD::SQLite Search::Xapian));
 require_git('2.6');
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::InboxWritable;
 require PublicInbox::Search;
 
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: test@example.com
 Subject: this is a subject
diff --git a/xt/msgtime_cmp.t b/xt/msgtime_cmp.t
index 4ebf5b2c..95d7c64b 100644
--- a/xt/msgtime_cmp.t
+++ b/xt/msgtime_cmp.t
@@ -4,7 +4,7 @@
 use strict;
 use Test::More;
 use PublicInbox::TestCommon;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Inbox;
 use PublicInbox::Git;
 use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp);
@@ -48,7 +48,7 @@ sub quiet_is_deeply ($$$$$) {
 sub compare {
 	my ($bref, $oid, $type, $size) = @_;
 	local $SIG{__WARN__} = sub { diag "$oid: ", @_ };
-	my $mime = PublicInbox::MIME->new($$bref);
+	my $mime = PublicInbox::Eml->new($$bref);
 	my $hdr = $mime->header_obj;
 	my @cur = msg_datestamp($hdr);
 	my @old = Old::msg_datestamp($hdr);
@@ -116,7 +116,7 @@ sub time_response ($) {
 }
 
 sub msg_received_at ($) {
-	my ($hdr) = @_; # Email::MIME::Header
+	my ($hdr) = @_; # PublicInbox::Eml
 	my @recvd = $hdr->header_raw('Received');
 	my ($ts);
 	foreach my $r (@recvd) {
@@ -131,7 +131,7 @@ sub msg_received_at ($) {
 }
 
 sub msg_date_only ($) {
-	my ($hdr) = @_; # Email::MIME::Header
+	my ($hdr) = @_; # PublicInbox::Eml
 	my @date = $hdr->header_raw('Date');
 	my ($ts);
 	foreach my $d (@date) {
@@ -149,7 +149,7 @@ sub msg_date_only ($) {
 
 # Favors Received header for sorting globally
 sub msg_timestamp ($) {
-	my ($hdr) = @_; # Email::MIME::Header
+	my ($hdr) = @_; # PublicInbox::Eml
 	my $ret;
 	$ret = msg_received_at($hdr) and return time_response($ret);
 	$ret = msg_date_only($hdr) and return time_response($ret);
@@ -158,7 +158,7 @@ sub msg_timestamp ($) {
 
 # Favors the Date: header for display and sorting within a thread
 sub msg_datestamp ($) {
-	my ($hdr) = @_; # Email::MIME::Header
+	my ($hdr) = @_; # PublicInbox::Eml
 	my $ret;
 	$ret = msg_date_only($hdr) and return time_response($ret);
 	$ret = msg_received_at($hdr) and return time_response($ret);
diff --git a/xt/perf-msgview.t b/xt/perf-msgview.t
index a4445959..30fc07dc 100644
--- a/xt/perf-msgview.t
+++ b/xt/perf-msgview.t
@@ -38,7 +38,7 @@ my $obuf = '';
 my $m = 0;
 
 my $cb = sub {
-	$mime = PublicInbox::MIME->new(shift);
+	$mime = PublicInbox::Eml->new(shift);
 	PublicInbox::View::multipart_text_as_html($mime, $ctx);
 	++$m;
 	$obuf = '';

^ permalink raw reply related	[relevance 1%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-05-07 21:05  7% [PATCH 00/13] eml: pure-Perl replacement for Email::MIME Eric Wong
2020-05-07 21:05  1% ` [PATCH 12/13] remove most internal Email::MIME usage Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).