]> Sergey Matveev's repositories - public-inbox.git/commitdiff
mda: skip MIME parsing if spam
authorEric Wong <e@80x24.org>
Mon, 28 Oct 2019 10:45:23 +0000 (10:45 +0000)
committerEric Wong <e@80x24.org>
Wed, 30 Oct 2019 08:48:18 +0000 (08:48 +0000)
We don't want to waste cycles parsing the message for MIME bits
if it's spam.

script/public-inbox-mda

index 71c5d93714de0b77802b4f00cba8410f7c33e01f..6935461662e6e900adddfa569d427272df097a24 100755 (executable)
@@ -71,9 +71,9 @@ if ($spamc) {
        my $fh = $emm->fh;
        read($fh, $str, -s $fh);
 }
+do_exit(0) unless $spam_ok;
 
 my $mime = PublicInbox::MIME->new(\$str);
-do_exit(0) unless $spam_ok;
 
 # -mda defaults to the strict base filter which we won't use anywhere else
 sub mda_filter_adjust ($) {