https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7729

--- Comment #3 from Henrik Krohns <apa...@hege.li> ---
Ok vetoing my vote. Tested which rules hit subject, and there are maaaany.
Thinking further, some people will probably stick with 3.4 for years and years,
it would be nightmare to just remove Subject and try to maintain compatibility
for all..

Instead here is the extremely simple code required to implement a "nosubject"
tflag. Just add a small documentation blurt, and it can be committed to 3.4.3
very safely, please vote, +1 me.

--- lib/Mail/SpamAssassin/Plugin/Check.pm (revision 1864688)
+++ lib/Mail/SpamAssassin/Plugin/Check.pm (working copy)
@@ -827,6 +827,9 @@
       $loopid++;
       my ($max) = $conf->{tflags}->{$rulename} =~ /\bmaxhits=(\d+)\b/;
       $max = untaint_var($max);
+      if ($conf->{tflags}->{$rulename} =~ /\bnosubject\b/) {
+        $sub .= "\n".'shift @_;'; # remove subject line
+      }
       $sub .= '
       $hits = 0;
       body_'.$loopid.': foreach my $l (@_) {
@@ -844,6 +847,9 @@
     else {
       # omitting the "pos" call, "body_loopid" label, use of while()
       # instead of if() etc., shaves off 8 perl OPs.
+      if (($conf->{tflags}->{$rulename}||'') =~ /\bnosubject\b/) {
+        $sub .= "\n".'shift @_;'; # remove subject line
+      }
       $sub .= '
       foreach my $l (@_) {
         '.$self->hash_line_for_rule($pms, $rulename).'

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to