From: Eric Wong Date: Wed, 5 Apr 2017 01:41:28 +0000 (+0000) Subject: learn: scan all inboxes when learning spam X-Git-Tag: v1.0.0~73 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=64cc1122d94f87badb4994518eda070d6362991e learn: scan all inboxes when learning spam This matches the behavior of the -watch daemon since 6d534038285ddd760709ba76ea007f9108200097 ("watch: watchspam affects all configured inboxes") --- 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