From: Eric Wong (Contractor, The Linux Foundation) Date: Thu, 22 Feb 2018 17:55:36 +0000 (+0000) Subject: import_vger_from_mbox: use PublicInbox::MIME and avoid clobbering X-Git-Tag: v1.1.0-pre1~229 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=a81ad9c4b1b5d8c2ae8444b6dcb8710bd361f628 import_vger_from_mbox: use PublicInbox::MIME and avoid clobbering 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)) --- diff --git a/scripts/import_vger_from_mbox b/scripts/import_vger_from_mbox index abc2d37c..13084835 100644 --- a/scripts/import_vger_from_mbox +++ b/scripts/import_vger_from_mbox @@ -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