From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0DE661F461 for ; Sat, 6 Jul 2019 04:30:49 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] watch: allow multiple spam watch directories Date: Sat, 6 Jul 2019 04:30:48 +0000 Message-Id: <20190706043048.8712-1-e@80x24.org> List-Id: 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"; -- EW