]> Sergey Matveev's repositories - public-inbox.git/commitdiff
public-inbox-mda: preserve SpamAssassin headers in spam
authorEric Wong <e@80x24.org>
Fri, 5 Jun 2015 17:45:26 +0000 (17:45 +0000)
committerEric Wong <e@80x24.org>
Fri, 5 Jun 2015 17:45:26 +0000 (17:45 +0000)
We want to be able to prioritize spam downstream to check for
borderline cases.

public-inbox-mda

index 522eeff7cd1bb2149aeeb3f161cb578a329a11cf..047a4827914184a824b1c1ad8c52d69381f88c59 100755 (executable)
@@ -56,6 +56,14 @@ if (PublicInbox::MDA->precheck($filter, $dst->{address}) &&
                        $filter->pipe(PublicInbox::MDA->cmd, $main_repo);
                }
        }
+} else {
+       # Ensure emergency spam gets spamassassin headers.
+       # This makes it easier to prioritize obvious spam from less obvious
+       if (defined($filtered) && length($filtered)) {
+               my $drop = Email::MIME->new(\$filtered);
+               $filtered = undef;
+               $filter->simple($drop);
+       }
 }
 exit 0; # goes to emergency