X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bin%2Fdebbugs-spam;h=1c44290543420946f53db6942b0c4de3a50961a6;hb=refs%2Fheads%2Fmaster;hp=da5e4577852855152d0f046fc8db757cd3ab2f74;hpb=6c25cd47914e56919d5ad1529b88f1a958d0c84a;p=debbugs.git diff --git a/bin/debbugs-spam b/bin/debbugs-spam index da5e457..1c44290 100755 --- a/bin/debbugs-spam +++ b/bin/debbugs-spam @@ -202,10 +202,10 @@ sub mark_it { my $body = $rec->{text}; my ($subject) = $body =~ /^Subject: *(.+)$/mi; my $is_match = 0; - if ($subject =~ /\Q$regex\E/) { + if ($subject =~ /$regex/) { $is_match = 1; } - if ($mid =~ /\Q$regex\E/) { + if ($mid =~ /$regex/) { $is_match = 1; } if ($is_match) { @@ -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;