]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei import: non-noisy by default, add --noisy switch
authorEric Wong <e@80x24.org>
Fri, 22 Nov 2024 23:05:57 +0000 (23:05 +0000)
committerEric Wong <e@80x24.org>
Mon, 25 Nov 2024 07:46:17 +0000 (07:46 +0000)
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
lib/PublicInbox/LEI.pm
lib/PublicInbox/LeiImport.pm

index 31d6db1329d6a89465f614d665ceda21f83890c9..5ab6d59be4df1c3968977866908f9b366cf19215 100644 (file)
@@ -89,6 +89,11 @@ Use the specified proxy (e.g., C<socks5h://0:9050>).
 Consider L<imap.proxy> and L<nntp.proxy> which can be persistently
 configured on a per-host basis in L<lei-config(1)>.
 
+=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<lei-config(1)> for various C<imap.*> and C<nntp.*> options.
index 6d072b95dffbfc180e18735c1ee0045caa52e31e..fc7d190a48264066f658c6c800229360e3a0c6e3 100644 (file)
@@ -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(@_)
index 5521188c2fe44d9ba015554f3e09981962599e74..64cd4d733fff21ae1b51e276ee9d5c51ca531b64 100644 (file)
@@ -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);
 }