From 64cc1122d94f87badb4994518eda070d6362991e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 Apr 2017 01:41:28 +0000 Subject: learn: scan all inboxes when learning spam 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 38c83243..71aa50f9 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 -- cgit v1.2.3-24-ge0c7