]> Sergey Matveev's repositories - public-inbox.git/blobdiff - public-inbox-mda
INSTALL: add lynx to install requirements
[public-inbox.git] / public-inbox-mda
index aabc37ebf3c4b0a2c6ba3ed090c49c775406551b..411ac15f7f396a35b95b23387cd133f0f1e4deed 100755 (executable)
@@ -41,8 +41,22 @@ if (PublicInbox->precheck($filter, $recipient) &&
        if (PublicInbox::Filter->run($simple)) {
                # run spamc again on the HTML-free message
                if (do_spamc($simple, \$filtered)) {
-                       $filter->simple(Email::Simple->new($filtered));
-                       $filter->pipe(MDA, $main_repo);
+                       $simple = Email::Simple->new($filtered);
+                       $filter->simple($simple);
+
+                       my $from = $filter->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 = "";
+                       local $ENV{GIT_AUTHOR_NAME} = $name;
+                       local $ENV{GIT_AUTHOR_EMAIL} = $email;
+                       local $ENV{GIT_AUTHOR_DATE} = $simple->header("Date");
+                       local $ENV{GIT_COMMITTER_EMAIL} = $recipient;
+                       local $ENV{GIT_COMMITTER_NAME} = $dst->{listname};
+
+                       $filter->pipe(MDA, '-1', $main_repo);
                }
        }
 }