about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-04-12 21:10:05 +0000
committerEric Wong <e@80x24.org>2017-04-12 21:10:05 +0000
commit3d6bb5064927764e57758d195db78639f4ec87f3 (patch)
tree93bec3910c76164f105ddcea46a3fcc365f10d1a /script
parent8a3fc4a2f027b36f27225ceee5908c571c8f4f47 (diff)
parentde243560e2caa1d19bcbf518edfaf8b016161245 (diff)
downloadpublic-inbox-3d6bb5064927764e57758d195db78639f4ec87f3.tar.gz
* origin/master:
  search: fix help message for searching within quotes
  learn: scan all inboxes when learning spam
  watchmaildir: do not reject lowercase flags on Maildir files
  searchview: show full (&x=t) messages in ascending chronlogical order
  searchview: add "t" id to link to thread overview
  extmsg: use updated mail-archive.com URL
  view: escape HTML description name
Diffstat (limited to 'script')
-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