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 D065320964 for ; Wed, 5 Apr 2017 01:44:14 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] learn: scan all inboxes when learning spam Date: Wed, 5 Apr 2017 01:44:14 +0000 Message-Id: <20170405014414.12128-1-e@80x24.org> List-Id: This matches the behavior of the -watch daemon since 6d534038285ddd760709ba76ea007f9108200097 ("watch: watchspam affects all configured inboxes") --- script/public-inbox-learn | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/script/public-inbox-learn b/script/public-inbox-learn index 38c8324..71aa50f 100755 --- a/script/public-inbox-learn +++ b/script/public-inbox-learn @@ -51,6 +51,18 @@ foreach my $h (qw(Cc To)) { } } +if ($train eq 'spam') { + $pi_config->each_inbox(sub { + my ($ibx) = @_; + my $git = $ibx->git; + my $name = $ibx->{name}; + my $addr = $ibx->{-primary_address}; + my $im = PublicInbox::Import->new($git, $name, $addr, $ibx); + $im->remove($mime); + $im->done; + }); +} + require PublicInbox::MDA if $train eq "ham"; # n.b. message may be cross-posted to multiple public-inboxes -- EW