Mailing List Archive

svn commit: r232927 - in /spamassassin/trunk: lib/Mail/SpamAssassin/EvalTests.pm rules/70_testing.cf
Author: felicity
Date: Mon Aug 15 20:41:44 2005
New Revision: 232927

URL: http://svn.apache.org/viewcvs?rev=232927&view=rev
Log:
new test rule from discussion on users list

Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
spamassassin/trunk/rules/70_testing.cf

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm?rev=232927&r1=232926&r2=232927&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm Mon Aug 15 20:41:44 2005
@@ -3092,6 +3092,26 @@
return 0;
}

+sub check_html_uri_only {
+ my ($self) = @_;
+
+ # Find out if there are any multipart/alternative parts in the message
+ my @ma = $self->{msg}->find_parts(qr@^multipart/alternative\b@i);
+
+ # If there are no multipart/alternative sections, skip this test.
+ return if (!@ma);
+
+ # At this point, we're not actually checking the alternates, just the entire
+ # message.
+ my $return = 0;
+ while (my($k,$v) = each %{$self->{html}->{uri_detail}}) {
+ $return = 1; # make sure there's at least 1 URI
+ return 0 if ($v->{types}->{parsed});
+ }
+
+ return $return;
+}
+
sub check_https_ip_mismatch {
my ($self) = @_;


Modified: spamassassin/trunk/rules/70_testing.cf
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/rules/70_testing.cf?rev=232927&r1=232926&r2=232927&view=diff
==============================================================================
--- spamassassin/trunk/rules/70_testing.cf (original)
+++ spamassassin/trunk/rules/70_testing.cf Mon Aug 15 20:41:44 2005
@@ -55,3 +55,6 @@
describe T_URIBL_XS_SURBL Has URI in XS - Testing
tflags T_URIBL_XS_SURBL net

+# From discussion on users@ list
+body T_URI_HTML_ONLY eval:check_html_uri_only()
+describe T_URI_HTML_ONLY URIs only found in HTML part of multipart/alternative message