about summary refs log tree commit homepage
path: root/lib/PublicInbox/WatchMaildir.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-29 10:34:18 +0000
committerEric Wong <e@yhbt.net>2020-06-30 03:05:24 +0000
commit901305dfe6837f5c1e9ae185f4cb536b92124049 (patch)
treeac70bdef478bef22f4637479ea66c62cc612ad34 /lib/PublicInbox/WatchMaildir.pm
parent1b356e8d587a9c1bb92a11ffce255a3d3c25747c (diff)
downloadpublic-inbox-901305dfe6837f5c1e9ae185f4cb536b92124049.tar.gz
It could be useful to see warnings generated for known problematic
messages just as it is for possibly non-problematic ones.
Diffstat (limited to 'lib/PublicInbox/WatchMaildir.pm')
-rw-r--r--lib/PublicInbox/WatchMaildir.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm
index ec28a303..25b87e93 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);