- if (do_spamc($simple, \$filtered)) {
- $simple = Email::Simple->new($filtered);
- set_list_headers($simple, $dst);
- $filter->simple($simple);
-
- my $from = decode('MIME-Header', $filter->from);
- $from = encode("utf8", $from);
- my @from = Email::Address->parse($from);
- my $name = $from[0]->name;
- defined $name or $name = "";
- my $email = $from[0]->address;
- defined $email or $email = "";
+ 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);
+ };
+