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

svn commit: rev 23123 - in spamassassin/trunk: spamd t t/data/spam

Author: sidney
Date: Wed Jul 21 11:23:45 2004
New Revision: 23123

Modified:
   spamassassin/trunk/spamd/spamd.raw
   spamassassin/trunk/t/bayesdbm.t
   spamassassin/trunk/t/bayesdbm_flock.t
   spamassassin/trunk/t/bayessql.t
   spamassassin/trunk/t/data/spam/001
   spamassassin/trunk/t/spamd.t
   spamassassin/trunk/t/spamd_ssl.t
Log:
fix bug 3624 spamd truncated last line and update regression tests

Modified: spamassassin/trunk/spamd/spamd.raw
==============================================================================
--- spamassassin/trunk/spamd/spamd.raw	(original)
+++ spamassassin/trunk/spamd/spamd.raw	Wed Jul 21 11:23:45 2004
@@ -1041,9 +1041,8 @@
   my $actual_length = 0;
   while ( $_ = $client->getline() ) {
     $actual_length += length($_);
-    last if (defined $expected_length && $actual_length >= $expected_length);
-
     push(@msglines, $_);    
+    last if (defined $expected_length && $actual_length >= $expected_length);
   }
   
   # Now parse *only* the message headers; the MIME tree won't be generated 

Modified: spamassassin/trunk/t/bayesdbm.t
==============================================================================
--- spamassassin/trunk/t/bayesdbm.t	(original)
+++ spamassassin/trunk/t/bayesdbm.t	Wed Jul 21 11:23:45 2004
@@ -63,7 +63,7 @@
 
 # $msgid is the generated hash messageid
 # $msgid_hdr is the Message-Id header
-ok($msgid eq '6e167ac4780e198af9c13b8708ba9e1b767133c7@sa_generated');
+ok($msgid eq 'ce33e4a8bc5798c65428d6018380bae346c7c126@sa_generated');
 ok($msgid_hdr eq '9PS291LhupY');
 
 ok($sa->{bayes_scanner}->{store}->tie_db_writable());

Modified: spamassassin/trunk/t/bayesdbm_flock.t
==============================================================================
--- spamassassin/trunk/t/bayesdbm_flock.t	(original)
+++ spamassassin/trunk/t/bayesdbm_flock.t	Wed Jul 21 11:23:45 2004
@@ -64,7 +64,7 @@
 
 # $msgid is the generated hash messageid
 # $msgid_hdr is the Message-Id header
-ok($msgid eq '6e167ac4780e198af9c13b8708ba9e1b767133c7@sa_generated');
+ok($msgid eq 'ce33e4a8bc5798c65428d6018380bae346c7c126@sa_generated');
 ok($msgid_hdr eq '9PS291LhupY');
 
 ok($sa->{bayes_scanner}->{store}->tie_db_writable());

Modified: spamassassin/trunk/t/bayessql.t
==============================================================================
--- spamassassin/trunk/t/bayessql.t	(original)
+++ spamassassin/trunk/t/bayessql.t	Wed Jul 21 11:23:45 2004
@@ -102,7 +102,7 @@
 
 # $msgid is the generated hash messageid
 # $msgid_hdr is the Message-Id header
-ok($msgid eq '6e167ac4780e198af9c13b8708ba9e1b767133c7@sa_generated');
+ok($msgid eq 'ce33e4a8bc5798c65428d6018380bae346c7c126@sa_generated');
 ok($msgid_hdr eq '9PS291LhupY');
 
 ok($sa->{bayes_scanner}->{store}->tie_db_writable());

Modified: spamassassin/trunk/t/data/spam/001
==============================================================================
--- spamassassin/trunk/t/data/spam/001	(original)
+++ spamassassin/trunk/t/data/spam/001	Wed Jul 21 11:23:45 2004
@@ -16,6 +16,26 @@
 Subject: There yours for FREE!
 To: undisclosed-recipients:;
 
+For tests that use this mesasge to work, it must contain spammy phrases,
+the body must be at least 2048 bytes long, the first 1024 bytes of the
+body must remain unchanged, the last line must remain unchanged and
+the very first line of this file must remain unchanged.
+
+Subject to those constraints you can add spammy stuff at the end of this
+message as long as you add it after the first 1024 bytes of the body and
+before the last line.
+
+Some tests scripts hard code the SHA1 hash of the first 1024 bytes of this
+message which is why you must not alter those first 1024 bytes.
+
+The hash is actually calculated on the minimum of 1024 and half the length
+of the body of the message, which is why the body of this message has to be
+at least 2048 bytes.
+
+Another test script checks for the first line and the last line of this file.
+
+Enough filler, now for the spammy stuff:
+
 Congratulations! You have been selected to receive 2 FREE 2 Day VIP Passes to Universal Studios!
 
 Click here http://209.61.190.180
@@ -36,5 +56,24 @@
 C1a115 is a spammy way to write Cialis.
 V1c0d1n is a spammy way to write Vicodin.
 
-(add any other spammy stuff here)
+Hello, I have a special offer for you...
+
+WANT TO LOSE WEIGHT?
+
+The most powerful weightloss is now available
+without prescription. All natural Spampro720
+100% Money Back Guarantie!
+
+- Lose up to 19% Total Body Weight.
+- Up to 300% more Weight Loss while dieting.
+- Loss of 20-35% abdominal Fat.
+- Reduction of 40-70% overall Fat under skin.
+- Increase metabolic rate by 76.9% without Exercise.
+- Burns calorized fat.
+- Suppresses appetite for sugar.
+- Boost your Confidence level and Self Esteem.
 
+Get the facts about all-natural Spampro720: http://209.61.190.180
+
+(add any other spammy stuff here)
+This must be the very last line

Modified: spamassassin/trunk/t/spamd.t
==============================================================================
--- spamassassin/trunk/t/spamd.t	(original)
+++ spamassassin/trunk/t/spamd.t	Wed Jul 21 11:23:45 2004
@@ -2,7 +2,7 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 7) };
+use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 9) };
 
 exit if $SKIP_SPAMD_TESTS;
 
@@ -10,12 +10,14 @@
 
 %patterns = (
 
+q{ Return-Path: sb55sb55@yahoo.com}, 'firstline',
 q{ Subject: There yours for FREE!}, 'subj',
 q{ X-Spam-Status: Yes, score=}, 'status',
 q{ X-Spam-Flag: YES}, 'flag',
 q{ X-Spam-Level: **********}, 'stars',
 q{ FROM_ENDS_IN_NUMS}, 'endsinnums',
 q{ NO_REAL_NAME}, 'noreal',
+q{ This must be the very last line}, 'lastline',
 
 
 );

Modified: spamassassin/trunk/t/spamd_ssl.t
==============================================================================
--- spamassassin/trunk/t/spamd_ssl.t	(original)
+++ spamassassin/trunk/t/spamd_ssl.t	Wed Jul 21 11:23:45 2004
@@ -2,7 +2,7 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_ssl");
-use Test; plan tests => (($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE) ? 0 : 7);
+use Test; plan tests => (($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE) ? 0 : 9);
 
 exit if ($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE);
 
@@ -10,12 +10,14 @@
 
 %patterns = (
 
+q{ Return-Path: sb55sb55@yahoo.com}, 'firstline',
 q{ Subject: There yours for FREE!}, 'subj',
 q{ X-Spam-Status: Yes, score=}, 'status',
 q{ X-Spam-Flag: YES}, 'flag',
 q{ X-Spam-Level: **********}, 'stars',
 q{ FROM_ENDS_IN_NUMS}, 'endsinnums',
 q{ NO_REAL_NAME}, 'noreal',
+q{ This must be the very last line}, 'lastline',
 
 
 );