about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-04-05 01:41:28 +0000
committerEric Wong <e@80x24.org>2017-04-05 01:42:33 +0000
commit64cc1122d94f87badb4994518eda070d6362991e (patch)
tree0a5e0991476adb21d4f0b7439013c81294c5c672
parent5d39caaf83799ba3a94b73463a3597c181816425 (diff)
downloadpublic-inbox-64cc1122d94f87badb4994518eda070d6362991e.tar.gz
This matches the behavior of the -watch daemon since
6d534038285ddd760709ba76ea007f9108200097
("watch: watchspam affects all configured inboxes")
-rwxr-xr-xscript/public-inbox-learn12
1 files changed, 12 insertions, 0 deletions
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