about summary refs log tree commit homepage
path: root/public-inbox-mda
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-04-09 19:33:06 +0000
committerEric Wong <e@80x24.org>2014-04-09 19:33:06 +0000
commitd2d769298498abe88f3256cf6609097d1ce74d42 (patch)
treebb7aa47c403831e5b99183c7ee977cd68c9a67ba /public-inbox-mda
parent44723a3a3343a6b7a923d33da2bdac0c81bdc5f6 (diff)
downloadpublic-inbox-d2d769298498abe88f3256cf6609097d1ce74d42.tar.gz
This can make it easy to query via "git log --author=..."
without extracting each message.
Diffstat (limited to 'public-inbox-mda')
-rwxr-xr-xpublic-inbox-mda15
1 files changed, 14 insertions, 1 deletions
diff --git a/public-inbox-mda b/public-inbox-mda
index 70fbdf27..14017f68 100755
--- a/public-inbox-mda
+++ b/public-inbox-mda
@@ -41,7 +41,20 @@ 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));
+                        $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_COMMITTER_EMAIL} = $recipient;
+                        local $ENV{GIT_COMMITTER_NAME} = $dst->{listname};
+
                         $filter->pipe(MDA, '-1', $main_repo);
                 }
         }