From c5b8b0cbc72b8133c70d68668047219342e886d1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 27 Sep 2021 04:59:30 +0000 Subject: lei rediff: quiet warnings from Import and Eml lei rediff is expected to see partial patch fragments and such, so silence warnings when something isn't exactly a valid email message. --- lib/PublicInbox/LeiRediff.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/LeiRediff.pm') diff --git a/lib/PublicInbox/LeiRediff.pm b/lib/PublicInbox/LeiRediff.pm index ea9b2a64..f6960560 100644 --- a/lib/PublicInbox/LeiRediff.pm +++ b/lib/PublicInbox/LeiRediff.pm @@ -193,8 +193,15 @@ sub extract_oids { # Eml each_part callback sub input_eml_cb { # callback for all emails my ($self, $eml) = @_; - $self->{tmp_sto}->add_eml($eml); - $self->{tmp_sto}->done; + { + local $SIG{__WARN__} = sub { + return if "@_" =~ /^no email in From: .*? or Sender:/; + return if PublicInbox::Eml::warn_ignore(@_); + warn @_; + }; + $self->{tmp_sto}->add_eml($eml); + $self->{tmp_sto}->done; + } $eml->each_part(\&extract_oids, $self, 1); } -- cgit v1.2.3-24-ge0c7