From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6C30E1F6BF for ; Thu, 1 Sep 2016 19:33:23 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] watch: use "publicinboxwatch" namespace Date: Thu, 1 Sep 2016 19:33:23 +0000 Message-Id: <20160901193323.14191-1-e@80x24.org> List-Id: We'll keep supporting "publicinboxlearn" indefinitely, but "publicinboxwatch" is probably more appropriate at the moment. Noticed while writing documentation. --- lib/PublicInbox/WatchMaildir.pm | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index f34419a..c8ea3ed 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -18,21 +18,25 @@ sub new { my ($class, $config) = @_; my (%mdmap, @mdir, $spamc); - # XXX is "publicinboxlearn" really a good namespace for this? - my $k = 'publicinboxlearn.watchspam'; - if (my $spamdir = $config->{$k}) { - if ($spamdir =~ s/\Amaildir://) { - $spamdir =~ s!/+\z!!; - # skip "new", no MUA has seen it, yet. - my $cur = "$spamdir/cur"; - push @mdir, $cur; - $mdmap{$cur} = 'watchspam'; - } else { - warn "unsupported $k=$spamdir\n"; + # "publicinboxwatch" is the documented namespace + # "publicinboxlearn" is legacy but may be supported + # indefinitely... + foreach my $pfx (qw(publicinboxwatch publicinboxlearn)) { + my $k = "$pfx.watchspam"; + if (my $spamdir = $config->{$k}) { + if ($spamdir =~ s/\Amaildir://) { + $spamdir =~ s!/+\z!!; + # skip "new", no MUA has seen it, yet. + my $cur = "$spamdir/cur"; + push @mdir, $cur; + $mdmap{$cur} = 'watchspam'; + } else { + warn "unsupported $k=$spamdir\n"; + } } } - $k = 'publicinboxwatch.spamcheck'; + my $k = 'publicinboxwatch.spamcheck'; my $spamcheck = $config->{$k}; if ($spamcheck) { if ($spamcheck eq 'spamc') { -- EW