From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id EE76A1F5B1 for ; Mon, 29 Jun 2020 10:34:24 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/5] watch: show path for warnings from spam messages Date: Mon, 29 Jun 2020 10:34:18 +0000 Message-Id: <20200629103421.31016-3-e@yhbt.net> In-Reply-To: <20200629103421.31016-1-e@yhbt.net> References: <20200629103421.31016-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It could be useful to see warnings generated for known problematic messages just as it is for possibly non-problematic ones. --- lib/PublicInbox/WatchMaildir.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index ec28a3034ff..25b87e938e0 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -188,15 +188,14 @@ sub _try_path { warn "unmappable dir: $1\n"; return; } - if (!ref($inboxes) && $inboxes eq 'watchspam') { - return _remove_spam($self, $path); - } - my $warn_cb = $SIG{__WARN__} || sub { print STDERR @_ }; local $SIG{__WARN__} = sub { $warn_cb->("path: $path\n"); $warn_cb->(@_); }; + if (!ref($inboxes) && $inboxes eq 'watchspam') { + return _remove_spam($self, $path); + } foreach my $ibx (@$inboxes) { my $eml = mime_from_path($path) or next; import_eml($self, $ibx, $eml);