From: Eric Wong Date: Fri, 22 Nov 2024 23:05:57 +0000 (+0000) Subject: lei import: non-noisy by default, add --noisy switch X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4180f46eae8b3f08a2e38e7a5e7127844545f50f;p=thirdparty%2Fpublic-inbox.git lei import: non-noisy by default, add --noisy switch 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. --- diff --git a/Documentation/lei-import.pod b/Documentation/lei-import.pod index 31d6db132..5ab6d59be 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 6d072b95d..fc7d190a4 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 5521188c2..64cd4d733 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); }