You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/09/27 20:27:07 UTC

svn commit: rev 47324 - in spamassassin/trunk: lib/Mail/SpamAssassin rules

Author: felicity
Date: Mon Sep 27 11:27:06 2004
New Revision: 47324

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
   spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm
   spamassassin/trunk/rules/20_head_tests.cf
Log:
bug 3801: ala the HEAD_LONG rule, catch when there's a missing blank line between the message header and body

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm	(original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm	Mon Sep 27 11:27:06 2004
@@ -3280,8 +3280,12 @@
 
 sub check_for_long_header {
   my ($self) = @_;
-
   return defined $self->{msg}->{'truncated_header'};
+}
+
+sub check_for_missing_hb_separator {
+  my ($self) = @_;
+  return defined $self->{msg}->{'missing_head_body_separator'};
 }
 
 1;

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm	(original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message.pm	Mon Sep 27 11:27:06 2004
@@ -222,7 +222,10 @@
 
     # Alternately, if a multipart mime boundary is found in the header area,
     # aka it's malformed, exit out as well and treat it as part of the body.
-    last if (defined $boundary && $message[0] =~ /^--\Q$boundary\E(?:--|\s*$)/);
+    if (defined $boundary && $message[0] =~ /^--\Q$boundary\E(?:--|\s*$)/) {
+      $self->{'missing_head_body_separator'} = 1;
+      last;
+    }
   }
 
   # Store the pristine body for later -- store as a copy since @message

Modified: spamassassin/trunk/rules/20_head_tests.cf
==============================================================================
--- spamassassin/trunk/rules/20_head_tests.cf	(original)
+++ spamassassin/trunk/rules/20_head_tests.cf	Mon Sep 27 11:27:06 2004
@@ -27,6 +27,9 @@
 header HEAD_LONG		eval:check_for_long_header()
 describe HEAD_LONG		Message headers are very long
 
+header MISSING_HB_SEP		eval:check_for_missing_hb_separator()
+describe MISSING_HB_SEP		Missing blank line between message header and body
+
 header NO_REAL_NAME		From =~ /^["\s]*\<?\S+\@\S+\>?\s*$/
 describe NO_REAL_NAME		From: does not include a real name