]> git.donarmstrong.com Git - debbugs.git/commitdiff
debugs-spam: output all of folded X-Spam headers
authorDon Armstrong <don@donarmstrong.com>
Sun, 22 Mar 2020 20:14:17 +0000 (13:14 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sun, 22 Mar 2020 20:14:17 +0000 (13:14 -0700)
bin/debbugs-spam

index 09077e0acccac2a0c842caf0df07b6cea79ab520..1c44290543420946f53db6942b0c4de3a50961a6 100755 (executable)
@@ -370,13 +370,17 @@ sub spam_score {
         if ($exit_code) {
             $is_spam = 1;
         }
+        my $in_spam_header = 0;
         while (<$spamc_out>) {
-            if (/^X-Spam/) {
+            if (/^X-Spam/ or (/^\s+/ and $in_spam_header)) {
+                $in_spam_header = 1;
                 $report .= $_;
                 if (/^X-Spam-Status: (Yes|No), score=(-?[\d\.]+) required=(-?[\d\.]+)/) {
                     $threshold = $3;
                     $score = $2;
                 }
+            } else {
+               $in_spam_header = 0;
             }
             if (/^\s*$/) {
                 last;