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/10/27 09:56:04 UTC
svn commit: rev 55677 - in spamassassin/trunk: lib/Mail/SpamAssassin rules
Author: quinlan
Date: Wed Oct 27 00:56:04 2004
New Revision: 55677
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
spamassassin/trunk/rules/70_testing.cf
Log:
bug 3680: empty anchor
URIBL test for Jeff
some other anchor rules
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm Wed Oct 27 00:56:04 2004
@@ -559,6 +559,11 @@
$self->examine_text_style($1, $2);
}
}
+ # image inside of an anchor
+ # XXX - test code
+ if ($tag eq "img" && exists $self->{inside}{a} && $self->{inside}{a} > 0) {
+ $self->{anchor}->[$self->{anchor_index}] .= " <img> ";
+ }
if ($tag eq "img" && exists $attr->{width} && exists $attr->{height}) {
my $width = 0;
my $height = 0;
@@ -598,6 +603,10 @@
if ($tag eq "a") {
$self->{anchor_index}++;
$self->{anchor}->[$self->{anchor_index}] = "";
+ # XXX - test code
+ if (!exists $attr->{href} || $attr->{href} !~ /\S/) {
+ $self->put_results(t_anchor_empty_href => 1);
+ }
}
if ($tag eq "title") {
$self->{title_index}++;
Modified: spamassassin/trunk/rules/70_testing.cf
==============================================================================
--- spamassassin/trunk/rules/70_testing.cf (original)
+++ spamassassin/trunk/rules/70_testing.cf Wed Oct 27 00:56:04 2004
@@ -181,3 +181,20 @@
# try \b around a rule deleted at some point
body T_OPTING_IN_CAPS /\b(?-i:O)pt.?(?-i:I)n\b/i
+# testing for Jeff, do not use!!!
+ifplugin Mail::SpamAssassin::Plugin::URIDNSBL
+urirhsbl URIBL_MP fraud.rhs.mailpolice.com. A
+body URIBL_MP eval:check_uridnsbl('URIBL_MP')
+describe URIBL_MP URI's domain appears in MailPolice fraud list
+tflags URIBL_MP net
+score URIBL_MP 2.0
+endif # Mail::SpamAssassin::Plugin::URIDNSBL
+
+# bug 3680: empty anchor, some others
+body T_HTML_LINK_EMPTY_1 eval:html_text_match('anchor', '^$')
+body T_HTML_LINK_EMPTY_2 eval:html_text_match('anchor', '^\s*$')
+body T_HTML_LINK_PUSH_HERE eval:html_text_match('anchor', '(?i)(?:push|go|cl[1l]ck)\s*(?:here|this)')
+body T_HTML_LINK_OPT eval:html_text_match('anchor', '(?i)opt.?(?:out|in)')
+body T_HTML_LINK_OPT_OUT eval:html_text_match('anchor', '(?i)opt.?out')
+body T_HTML_LINK_EMPTY_HREF eval:html_test('t_anchor_empty_href')
+describe T_HTML_LINK_EMPTY_HREF HTML anchor has empty or missing HREF value