]> Sergey Matveev's repositories - public-inbox.git/commitdiff
scripts/import_vger_from_mbox: filter out same headers as MDA
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Mon, 19 Mar 2018 08:14:57 +0000 (08:14 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Mon, 19 Mar 2018 08:16:34 +0000 (08:16 +0000)
Perhaps we should filter these headers out in Import

scripts/import_vger_from_mbox

index 6a00fae3fa5ff4414d9dbc2007400c09be606d70..1edb987a7eb22a60385ca4a0115e79e59fd63f2a 100644 (file)
@@ -8,6 +8,7 @@ use PublicInbox::MIME;
 use PublicInbox::Inbox;
 use PublicInbox::V2Writable;
 use PublicInbox::Import;
+use PublicInbox::MDA;
 my $usage = "usage: $0 NAME EMAIL DIR <MBOX\n";
 my $dry_run;
 my $version = 2;
@@ -57,6 +58,7 @@ sub do_add ($$) {
        }
        $mime = $vger->scrub($mime);
        return unless $im;
+       $mime->header_set($_) foreach @PublicInbox::MDA::BAD_HEADERS;
        $im->add($mime) or
                warn "duplicate: ",
                        $mime->header_obj->header_raw('Message-ID'), "\n";