about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-06-26 09:00:43 +0000
committerEric Wong <e@80x24.org>2019-06-27 22:52:19 +0000
commit2b2a247c6cec99784e3e92bb025555c93f5701f3 (patch)
tree6ba559efa846bcf7cd0f1e191cfb1fe18f7493cb
parent36c3b27458e722e3e9e1cb378cee16d40469b1d0 (diff)
downloadpublic-inbox-2b2a247c6cec99784e3e92bb025555c93f5701f3.tar.gz
Knowing which message failed a spam check is tough when I have
many Maildirs and don't have a search indexing tool setup for
spam mail.
-rw-r--r--lib/PublicInbox/WatchMaildir.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm
index 2d4c6f43..a76bf06e 100644
--- a/lib/PublicInbox/WatchMaildir.pm
+++ b/lib/PublicInbox/WatchMaildir.pm
@@ -150,6 +150,12 @@ sub _try_path {
         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->(@_);
+        };
         foreach my $ibx (@$inboxes) {
                 my $mime = _path_to_mime($path) or next;
                 my $im = _importer_for($self, $ibx);