-my ($name, $email, $date);
-
-if ($train eq "ham") {
- require PublicInbox::MDA;
- require PublicInbox::Filter;
- PublicInbox::Filter->run($mime);
- ($name, $email, $date) = PublicInbox::MDA->author_info($mime);
+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, 'spam');
+ $im->done;
+ });