Mailing List Archive

svn commit: r483263 - in /spamassassin/rules/trunk/sandbox/felicity: 70_other.cf sandbox-felicity.pm
Author: felicity
Date: Wed Dec 6 14:21:14 2006
New Revision: 483263

URL: http://svn.apache.org/viewvc?view=rev&rev=483263
Log:
work on some test rules

Modified:
spamassassin/rules/trunk/sandbox/felicity/70_other.cf
spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm

Modified: spamassassin/rules/trunk/sandbox/felicity/70_other.cf
URL: http://svn.apache.org/viewvc/spamassassin/rules/trunk/sandbox/felicity/70_other.cf?view=diff&rev=483263&r1=483262&r2=483263
==============================================================================
--- spamassassin/rules/trunk/sandbox/felicity/70_other.cf (original)
+++ spamassassin/rules/trunk/sandbox/felicity/70_other.cf Wed Dec 6 14:21:14 2006
@@ -255,18 +255,14 @@
# 1.627 1.9593 0.0000 1.000 0.90 0.01 T_BASE64_LENGTH_80
# 1.100 1.3246 0.0000 1.000 0.87 0.01 T_BASE64_LENGTH_90

-body BASE64_LENGTH_78 eval:check_base64_length('78')
-body BASE64_LENGTH_79 eval:check_base64_length('79')
-body BASE64_LENGTH_80 eval:check_base64_length('80')
-body BASE64_LENGTH_90 eval:check_base64_length('90')
+body BASE64_LENGTH_78_79 eval:check_base64_length('78','79')
+body BASE64_LENGTH_79_INF eval:check_base64_length('79')


# better results than TVD_STOCK1:
# 19.869 22.6915 0.0000 1.000 1.00 1.00 TVD_STOCK_02
# 12.248 13.9887 0.0000 1.000 0.83 1.00 TVD_STOCK_03
# 9.861 11.2617 0.0000 1.000 0.67 1.00 TVD_STOCK1
-# 20.259 23.0657 0.5047 0.979 0.50 1.00 TVD_STOCK_01
-body TVD_STOCK_01 eval:check_stock_info('1')
body TVD_STOCK_02 eval:check_stock_info('2')
body TVD_STOCK_03 eval:check_stock_info('3')
endif

Modified: spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm
URL: http://svn.apache.org/viewvc/spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm?view=diff&rev=483263&r1=483262&r2=483263
==============================================================================
--- spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm (original)
+++ spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm Wed Dec 6 14:21:14 2006
@@ -47,13 +47,15 @@
my $self = shift;
my $pms = shift;
shift; # body array, unnecessary
- my $len = shift;
+ my $min = shift;
+ my $max = shift;

if (!defined $pms->{base64_length}) {
$pms->{base64_length} = $self->_check_base64_length($pms->{msg});
}

- return $pms->{base64_length} >= $len;
+ return $pms->{base64_length} <= $max if defined $max;
+ return $pms->{base64_length} >= $min;
}

sub _check_base64_length {
@@ -63,6 +65,13 @@
my $result = 0;

foreach my $p ($msg->find_parts(qr@.@, 1)) {
+ my $ctype=
+ Mail::SpamAssassin::Util::parse_content_type($p->get_header('content-type'));
+
+ # FPs from Google Calendar invites, etc.
+ # perhaps just limit to test, and image?
+ next if ($ctype eq 'application/ics');
+
my $cte = lc $p->get_header('content-transfer-encoding') || '';
next if ($cte !~ /^base64$/);
foreach my $l ( @{$p->raw()} ) {