]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import_vger_from_mbox: use PublicInbox::MIME and avoid clobbering
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 22 Feb 2018 17:55:36 +0000 (17:55 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 22 Feb 2018 18:31:36 +0000 (18:31 +0000)
It is less confusing without the clobber assignment; and
PublicInbox::MIME exists to workaround bugs in older
Email::MIME (which is in Debian 9 (stretch))

scripts/import_vger_from_mbox

index abc2d37cc967aaba34afb1b195f28867a2d3fa88..1308483599ead8007ad884422ff9a44f6a3a4a5e 100644 (file)
@@ -46,12 +46,12 @@ my $vger = PublicInbox::Filter::Vger->new;
 sub do_add ($$) {
        my ($im, $msg) = @_;
        $$msg =~ s/(\r?\n)+\z/$1/s;
-       $msg = Email::MIME->new($$msg);
-       $msg = $vger->scrub($msg);
+       my $mime = PublicInbox::MIME->new($msg);
+       $mime = $vger->scrub($mime);
        return unless $im;
-       $im->add($msg) or
+       $im->add($mime) or
                warn "duplicate: ",
-                       $msg->header_obj->header_raw('Message-ID'), "\n";
+                       $mime->header_obj->header_raw('Message-ID'), "\n";
 }
 
 # asctime: From example@example.com Fri Jun 23 02:56:55 2000