user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] extsearchidx: ignore Eml warnings across the board
@ 2021-07-07 23:24 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-07-07 23:24 UTC (permalink / raw)
  To: meta

There's nothing we can do about misformatted emails and headers
we get from untrusted sources.  They're too noisy and those
messages already exist in public-inboxes, anyways, so just
keep things quiet so we can spot real problems more easily.
---
 lib/PublicInbox/ExtSearchIdx.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index 495579a2..a421e16b 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -891,10 +891,6 @@ SELECT DISTINCT(mid),id FROM msgid WHERE id IN
 ORDER BY id
 EOS
 	$iter->execute($min_id);
-	local $SIG{__WARN__} = sub {
-		return if PublicInbox::Eml::warn_ignore(@_);
-		warn @_;
-	};
 	while (my ($mid, $id) = $iter->fetchrow_array) {
 		last if $sync->{quit};
 		$self->{current_info} = "dedupe $mid";
@@ -942,6 +938,7 @@ sub eidx_sync { # main entry point
 	my $warn_cb = $SIG{__WARN__} || \&CORE::warn;
 	local $self->{current_info} = '';
 	local $SIG{__WARN__} = sub {
+		return if PublicInbox::Eml::warn_ignore(@_);
 		$warn_cb->($self->{current_info}, ': ', @_);
 	};
 	$self->idx_init($opt); # acquire lock via V2Writable::_idx_init
@@ -1238,7 +1235,10 @@ sub eidx_watch { # public-inbox-extindex --watch main loop
 	my $oldset = PublicInbox::DS::block_signals();
 	local $self->{current_info} = '';
 	my $cb = $SIG{__WARN__} || \&CORE::warn;
-	local $SIG{__WARN__} = sub { $cb->($self->{current_info}, ': ', @_) };
+	local $SIG{__WARN__} = sub {
+		return if PublicInbox::Eml::warn_ignore(@_);
+		$cb->($self->{current_info}, ': ', @_);
+	};
 	my $sig = {
 		HUP => sub { eidx_reload($self, $idler) },
 		USR1 => sub { eidx_resync_start($self) },

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-07 23:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07 23:24 [PATCH] extsearchidx: ignore Eml warnings across the board Eric Wong

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ https://public-inbox.org/meta \
		meta@public-inbox.org
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.mail.public-inbox.meta
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.mail.public-inbox.meta
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git