X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FImport.pm;h=07d1859920003ea820c8ccd70cb536acee9e2f74;hb=0283273a14e1871955f6a9132f4f3f7884ec8a3f;hp=95d654f667221711de6897ffd632b197bd6d10cf;hpb=6ae5319be740b48370f32fe043d112bf09dd18da;p=public-inbox.git diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index 95d654f6..07d18599 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -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'); @@ -212,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); @@ -354,7 +355,7 @@ sub v1_mid0 ($) { my $hdr = $mime->header_obj; my $mids = mids($hdr); - if (!scalar(@$mids)) { # spam often has no Message-Id + if (!scalar(@$mids)) { # spam often has no Message-ID my $mid0 = digest2mid(content_digest($mime), $hdr); append_mid($hdr, $mid0); return $mid0; @@ -374,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};