about summary refs log tree commit homepage
path: root/public-inbox-mda
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2014-02-11 00:36:06 +0000
committerEric Wong <normalperson@yhbt.net>2014-02-11 00:36:06 +0000
commit858f0a2960123d6d2cbced1bb18e4e5e524df21e (patch)
treefae844af890e158f116f6369935cdecf4812fe41 /public-inbox-mda
parentb5b6e0f45c5ee171d71b549146432a68d6707531 (diff)
downloadpublic-inbox-858f0a2960123d6d2cbced1bb18e4e5e524df21e.tar.gz
move pre-spamc checks to PublicInbox->precheck
We may add more checks before we go to spamc.
Diffstat (limited to 'public-inbox-mda')
-rwxr-xr-xpublic-inbox-mda6
1 files changed, 1 insertions, 5 deletions
diff --git a/public-inbox-mda b/public-inbox-mda
index 62d5b7fc..291b5574 100755
--- a/public-inbox-mda
+++ b/public-inbox-mda
@@ -11,13 +11,9 @@ my $usage = "public-inbox-mda main_repo fail_repo < rfc2822_message";
 my $filter = Email::Filter->new(emergency => "~/emergency.mbox");
 my $main_repo = shift @ARGV or die "Usage: $usage\n";
 my $fail_repo = shift @ARGV or die "Usage: $usage\n";
-my $max = 1024 * 500; # same as spamc
 
 my $filtered;
-if ($filter->simple->header("From")
-    && length($filter->simple->as_string) <= $max
-    && PublicInbox->recipient_specified($filter)
-    && do_spamc($filter->simple, \$filtered)) {
+if (PublicInbox->precheck($filter) && do_spamc($filter->simple, \$filtered)) {
         # update our message with SA headers (in case our filter rejects it)
         my $simple = Email::Simple->new($filtered);
         $filtered = undef;