]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WatchMaildir.pm
watch: allow multiple spam watch directories
[public-inbox.git] / lib / PublicInbox / WatchMaildir.pm
index 4be0b397217d55334fa6575cbe58b77a6cbdbf51..e49fb6c78d91d71edc59b25462f39974525ed019 100644 (file)
@@ -24,7 +24,9 @@ sub new {
        # indefinitely...
        foreach my $pfx (qw(publicinboxwatch publicinboxlearn)) {
                my $k = "$pfx.watchspam";
-               if (my $dir = $config->{$k}) {
+               defined(my $dirs = $config->{$k}) or next;
+               $dirs = [ $dirs ] if !ref($dirs);
+               for my $dir (@$dirs) {
                        if (is_maildir($dir)) {
                                # skip "new", no MUA has seen it, yet.
                                my $cur = "$dir/cur";