]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WatchMaildir.pm
watchmaildir: show the current path on spamcheck failures
[public-inbox.git] / lib / PublicInbox / WatchMaildir.pm
index 2d4c6f4340af5d34b01148be0878743be52fc5eb..a76bf06e629db1c5b5381ee04e038fd48b970790 100644 (file)
@@ -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);