From: Eric Wong <e@80x24.org>
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 [thread overview]
Message-ID: <20241122230557.534344-1-e@80x24.org> (raw)
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<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.
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);
}
reply other threads:[~2024-11-22 23:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241122230557.534344-1-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).