You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by qu...@apache.org on 2004/04/30 23:59:08 UTC
svn commit: rev 10456 - in incubator/spamassassin/trunk: lib/Mail/SpamAssassin rules
Author: quinlan
Date: Fri Apr 30 14:59:07 2004
New Revision: 10456
Modified:
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
incubator/spamassassin/trunk/rules/70_testing.cf
Log:
T_HTML_TEXT_AFTER_HTML and T_HTML_TEXT_AFTER_HTML test rules, remove
code and rules later if it doesn't hit enough spam to matter
Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm Fri Apr 30 14:59:07 2004
@@ -120,6 +120,8 @@
$self->{html_visible_text} = [];
$self->{html_invisible_text} = [];
$self->{html_last_tag} = 0;
+ $self->{html}{closed_html} = 0;
+ $self->{html}{closed_body} = 0;
$self->{html}{length} += $1 if (length($text) =~ m/^(\d+)$/); # untaint
@@ -217,6 +219,10 @@
$self->html_tests($tag, $attr, $num);
$self->{html_last_tag} = $tag;
}
+ elsif ($num == -1) {
+ $self->{html}{closed_html} = 1 if $tag eq "html";
+ $self->{html}{closed_body} = 1 if $tag eq "body";
+ }
# shouting
if ($tag =~ /^(?:b|i|u|strong|em|big|center|h\d)$/) {
@@ -921,6 +927,8 @@
my $visible_for_bayes = 1;
if ($text =~ /[^ \t\n\r\f\x0b\xa0]/) {
$visible_for_bayes = $self->html_font_invisible($text);
+ $self->{html}{text_after_body} = 1 if $self->{html}{closed_body};
+ $self->{html}{text_after_html} = 1 if $self->{html}{closed_html};
}
$text =~ s/^\n//s if $self->{html_last_tag} eq "br";
Modified: incubator/spamassassin/trunk/rules/70_testing.cf
==============================================================================
--- incubator/spamassassin/trunk/rules/70_testing.cf (original)
+++ incubator/spamassassin/trunk/rules/70_testing.cf Fri Apr 30 14:59:07 2004
@@ -936,3 +936,6 @@
tflags T_S3_86_S41_56 net
tflags T_S3_86_S41_58 net
tflags T_S3_86_S41_60 net
+
+body T_HTML_TEXT_AFTER_HTML eval:html_test('text_after_html')
+body T_HTML_TEXT_AFTER_BODY eval:html_test('text_after_body')