about summary refs log tree commit homepage
path: root/public-inbox-mda
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-01-10 21:03:37 +0000
committerEric Wong <e@80x24.org>2014-01-10 21:52:13 +0000
commitb62db36dc28ef07ccecd60d27931d18254a1349c (patch)
treed0fdc9c78868a26752b8826c08ee2edc7504b453 /public-inbox-mda
parent657097b189ee4eb683c0c6d5f157e7810f3e9868 (diff)
downloadpublic-inbox-b62db36dc28ef07ccecd60d27931d18254a1349c.tar.gz
Unfortunately we slurp, but expect our MTA to provide its own
limit on message sizes.
Diffstat (limited to 'public-inbox-mda')
-rwxr-xr-xpublic-inbox-mda4
1 files changed, 3 insertions, 1 deletions
diff --git a/public-inbox-mda b/public-inbox-mda
index 4e971d92..177c891e 100755
--- a/public-inbox-mda
+++ b/public-inbox-mda
@@ -10,9 +10,11 @@ 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 (do_spamc($filter->simple, \$filtered)) {
+if (length($filter->simple->as_string) <= $max
+    && 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;