From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 006961F4C1 for ; Fri, 22 Nov 2024 23:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1732316758; bh=T7EbZMPlpOkRR0FYvrwwzcrSZuimXX4WRTX1M6gCvkk=; h=From:To:Subject:Date:From; b=EPNo2hnHUA9wedr3tgiPZyl90qHdqYsQZNlC79DlPUuyPum9PxBX+P4XcV5HqWmcU vHSth236s8MvQAShbXEuI5LVyCi5i0Oki8hYXw+lIQqeYOnZ/AUzFbBLcvj3kcQv57 nu1s+uAjIotGLLUN3P4yLLV3V5EXSaBnHx+99YZ0= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] lei import: non-noisy by default, add --noisy switch Date: Fri, 22 Nov 2024 23:05:57 +0000 Message-ID: <20241122230557.534344-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Email::Address::XS is too noisy by default to be useful given the poorly formatted messages which exist in history. Quiet it down by default since users often don't have the means to fix such historical messages anyways. --- Documentation/lei-import.pod | 5 +++++ lib/PublicInbox/LEI.pm | 4 ++-- lib/PublicInbox/LeiImport.pm | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Documentation/lei-import.pod b/Documentation/lei-import.pod index 31d6db13..5ab6d59b 100644 --- a/Documentation/lei-import.pod +++ b/Documentation/lei-import.pod @@ -89,6 +89,11 @@ Use the specified proxy (e.g., C). Consider L and L which can be persistently configured on a per-host basis in L. +=item --noisy + +Warn on misformatted email headers. Not particularly useful but this was +the default prior to public-inbox 2.0.0. New in public-inbox 2.0.0. + =back See L for various C and C options. diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 6d072b95..fc7d190a 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -271,7 +271,7 @@ import => [ 'LOCATION...|--stdin [LABELS...]', 'one-time import/update from URL or filesystem', qw(stdin| offset=i recursive|r exclude=s include|I=s new-only lock=s@ in-format|F=s kw! verbose|v+ incremental! mail-sync! - commit-delay=i sort|s:s@), + commit-delay=i sort|s:s@ noisy), @net_opt, @c_opt ], 'forget-mail-sync' => [ 'LOCATION...', 'forget sync information for a mail folder', @c_opt ], @@ -623,7 +623,7 @@ sub _lei_atfork_child { eval 'no warnings; undef $PublicInbox::LeiNoteEvent::to_flush'; undef $errors_log; $quit = \&CORE::exit; - if (!$self->{-eml_noisy}) { # only "lei import" sets this atm + if (!$self->{opt}->{noisy}) { # only "lei import" sets this atm my $cb = $SIG{__WARN__} // \&CORE::warn; $SIG{__WARN__} = sub { $cb->(@_) unless PublicInbox::Eml::warn_ignore(@_) diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm index 5521188c..64cd4d73 100644 --- a/lib/PublicInbox/LeiImport.pm +++ b/lib/PublicInbox/LeiImport.pm @@ -123,7 +123,6 @@ sub do_import_index ($$@) { } ($lei->{opt}->{'new-only'} && (!$net || !$net->{imap_order})) and warn "# --new-only is only for IMAP\n"; - $lei->{-eml_noisy} = 1; $lei->{-err_type} = 'non-fatal'; $lei->wq1_start($self, $j); }