From 6d3644f5dd7c54fbee33be728f6735e4419cdc0d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 1 Jul 2019 02:18:48 +0000 Subject: watch: allow multiple spam watch directories Given most folks have multiple mail accounts, there's no reason we can't support multiple Maildirs. --- lib/PublicInbox/WatchMaildir.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index 4be0b397..e49fb6c7 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -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"; -- cgit v1.2.3-24-ge0c7