* [PATCH] lei import: non-noisy by default, add --noisy switch
@ 2024-11-22 23:05 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2024-11-22 23:05 UTC (permalink / raw)
To: meta
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);
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-22 23:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-22 23:05 [PATCH] lei import: non-noisy by default, add --noisy switch Eric Wong
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).