From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 09B0B1FAF3 for ; Thu, 15 Feb 2018 11:08:46 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [WIP 16/17] scripts/import_vger_from_mbox: use v2 layout for import Date: Thu, 15 Feb 2018 11:08:39 +0000 Message-Id: <20180215110840.30413-17-e@80x24.org> In-Reply-To: <20180215110840.30413-1-e@80x24.org> References: <20180215105509.GA22409@dcvr> <20180215110840.30413-1-e@80x24.org> List-Id: Big lists are orders of magnitude more efficient with v2. --- scripts/import_vger_from_mbox | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/scripts/import_vger_from_mbox b/scripts/import_vger_from_mbox index 3fa5c77..6ea2ca5 100644 --- a/scripts/import_vger_from_mbox +++ b/scripts/import_vger_from_mbox @@ -22,32 +22,20 @@ binmode STDIN; my $msg = ''; use PublicInbox::Filter::Vger; my $vger = PublicInbox::Filter::Vger->new; +if ($im) { + $im->{ssoma_lock} = 0; + $im->{path_type} = 'v2'; +} + sub do_add ($$) { my ($im, $msg) = @_; $$msg =~ s/(\r?\n)+\z/$1/s; $msg = Email::MIME->new($$msg); $msg = $vger->scrub($msg); - my $hdr = $msg->header_obj; - my $date = $hdr->header_raw('Date'); - if ($date) { - eval { str2time($date) }; - if ($@) { - warn "bad Date: $date in ", - $hdr->header_raw('Message-ID'), ": $@\n"; - } - } else { - warn "missing Date: $date in ", - $hdr->header_raw('Message-ID'), ": $@\n"; - my $n = 0; - foreach my $r ($hdr->header_raw('Received')) { - warn "$n Received: $r\n"; - } - warn(('-' x 72), "\n"); - } return unless $im; $im->add($msg) or warn "duplicate: ", - $hdr->header_raw('Message-ID'), "\n"; + $msg->header_obj->header_raw('Message-ID'), "\n"; } # asctime: From example@example.com Fri Jun 23 02:56:55 2000 -- EW