- if (PublicInbox::Filter->run($msg, $filter_arg)) {
- # run spamc again on the HTML-free message
- if (do_spamc($msg, \$filtered)) {
- $msg = Email::MIME->new(\$filtered);
- PublicInbox::MDA->set_list_headers($msg, $dst);
- $filter->simple($msg);
-
- my ($name, $email, $date) =
- PublicInbox::MDA->author_info($msg);
-
- END {
- index_sync($main_repo) if ($? == 0);
- };
-
- local $ENV{GIT_AUTHOR_NAME} = $name;
- local $ENV{GIT_AUTHOR_EMAIL} = $email;
- local $ENV{GIT_AUTHOR_DATE} = $date;
- local $ENV{GIT_COMMITTER_EMAIL} = $recipient;
- local $ENV{GIT_COMMITTER_NAME} = $dst->{listname};
-
- $filter->pipe(PublicInbox::MDA->cmd, $main_repo);
- }
+my $err;
+@$dests = grep {
+ my $ibx = PublicInbox::InboxWritable->new($_);
+ eval { $ibx->assert_usable_dir };
+ if ($@) {
+ warn $@;
+ $err = 1;
+ 0;
+ # pre-check, MDA has stricter rules than an importer might;
+ } elsif ($precheck) {
+ !!PublicInbox::MDA->precheck($eml, $ibx->{address});
+ } else {
+ 1;