]> Sergey Matveev's repositories - public-inbox.git/commitdiff
watch: show path for warnings from spam messages
authorEric Wong <e@yhbt.net>
Mon, 29 Jun 2020 10:34:18 +0000 (10:34 +0000)
committerEric Wong <e@yhbt.net>
Tue, 30 Jun 2020 03:05:24 +0000 (03:05 +0000)
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

index ec28a3034ff84962b034ea53fa27ede943e251a9..25b87e938e051dd82877066ec1d7e676ed8427d4 100644 (file)
@@ -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);