]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WatchMaildir.pm
watchmaildir: show $@ in warning message
[public-inbox.git] / lib / PublicInbox / WatchMaildir.pm
index 1823c24862e6e6da36112ce86f123692f1b82e1d..c436742cfa6244a191ea62503ac6771cb2a57edb 100644 (file)
@@ -97,7 +97,8 @@ sub _try_fsn_paths {
 
 sub _remove_spam {
        my ($self, $path) = @_;
-       $path =~ /:2,[A-R]*S[T-Z]*\z/i or return;
+       # path must be marked as (S)een
+       $path =~ /:2,[A-R]*S[T-Za-z]*\z/ or return;
        my $mime = _path_to_mime($path) or return;
        _force_mid($mime);
        $self->{config}->each_inbox(sub {
@@ -110,7 +111,10 @@ sub _remove_spam {
                                $im->remove($scrubbed);
                        }
                };
-               warn "error removing spam at $path from $ibx->{name}\n" if $@;
+               if ($@) {
+                       warn "error removing spam at: ", $path,
+                               " from ", $ibx->{name}, ': ', $@, "\n";
+               }
        })
 }