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/03/17 18:42:39 UTC

svn commit: rev 9572 - in incubator/spamassassin/trunk: lib/Mail/SpamAssassin rules t t/data/nice t/data/spam

Author: sidney
Date: Wed Mar 17 09:42:36 2004
New Revision: 9572

Added:
   incubator/spamassassin/trunk/t/data/nice/008
   incubator/spamassassin/trunk/t/data/nice/009
   incubator/spamassassin/trunk/t/data/nice/010
   incubator/spamassassin/trunk/t/data/nice/011
   incubator/spamassassin/trunk/t/data/nice/012
   incubator/spamassassin/trunk/t/data/nice/013
   incubator/spamassassin/trunk/t/data/nice/014
   incubator/spamassassin/trunk/t/data/nice/015
   incubator/spamassassin/trunk/t/data/spam/012
   incubator/spamassassin/trunk/t/data/spam/013
   incubator/spamassassin/trunk/t/whitelist_from.t
Modified:
   incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
   incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
   incubator/spamassassin/trunk/rules/50_scores.cf
   incubator/spamassassin/trunk/rules/60_whitelist.cf
Log:
Bug 3021: Use whitelist_from_rcvd for a new forgery rule


Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm	(original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm	Wed Mar 17 09:42:36 2004
@@ -255,6 +255,7 @@
   $self->{bayes_sql_override_username} = '';
 
   $self->{whitelist_from} = { };
+  $self->{whitelist_allows_relays} = { };
   $self->{blacklist_from} = { };
 
   $self->{blacklist_to} = { };
@@ -574,7 +575,7 @@
 C<sendinghost.spamassassin.org> or just C<spamassassin.org> here.
 
 Note that this requires that C<internal_networks> be correct.  For simple cases,
-it will be, but for a complex network, or if you're running with DNS checks off
+it will be, but for a complex network, or running with DNS checks off
 or with C<-L>, you may get better results by setting that parameter.
 
 e.g.
@@ -599,6 +600,37 @@
       next;
     }
 
+=item whitelist_allows_relays add@ress.com
+
+Specify addresses which are in C<whitelist_from_rcvd> that sometimes
+send through a mail relay other than the listed ones. By default mail
+with a From address that is in C<whitelist_from_rcvd> that does not match
+the relay will trigger a forgery rule. Including the address in
+C<whitelist_allows_relay> prevents that.
+
+Whitelist and blacklist addresses are now file-glob-style patterns, so
+C<fr...@somewhere.com>, C<*...@isp.com>, or C<*.domain.net> will all work.
+Specifically, C<*> and C<?> are allowed, but all other metacharacters are not.
+Regular expressions are not used for security reasons.
+
+Multiple addresses per line, separated by spaces, is OK.  Multiple
+C<whitelist_allows_relays> lines is also OK.
+
+The specified email address does not have to match exactly the address
+previously used in a whitelist_from_rcvd line as it is compared to the
+address in the header.
+
+e.g.
+
+  whitelist_allows_relays joe@example.com fred@example.com
+  whitelist_allows_relays *@example.com
+
+=cut
+
+    if ( $key eq 'whitelist_allows_relays' ) {
+      $self->add_to_addrlist ('whitelist_allows_relays', split (/\s+/, $value)); next;
+    }
+
 =item unwhitelist_from_rcvd add@ress.com
 
 Used to override a default whitelist_from_rcvd entry, so for example a
@@ -3012,13 +3044,18 @@
   my ($self, $listname, $addr, $domain) = @_;
 
   $addr = lc $addr;
-  my $re = $addr;
-  $re =~ s/[\000\\\(]/_/gs;			# paranoia
-  $re =~ s/([^\*\?_a-zA-Z0-9])/\\$1/g;		# escape any possible metachars
-  $re =~ tr/?/./;				# "?" -> "."
-  $re =~ s/\*/\.\*/g;				# "*" -> "any string"
-  $self->{$listname}->{$addr}{re} = qr/^${re}$/;
-  $self->{$listname}->{$addr}{domain} = $domain;
+  if ($self->{$listname}->{$addr}) {
+    push @{$self->{$listname}->{$addr}{domain}}, $domain;
+  }
+  else {
+    my $re = $addr;
+    $re =~ s/[\000\\\(]/_/gs;			# paranoia
+    $re =~ s/([^\*\?_a-zA-Z0-9])/\\$1/g;		# escape any possible metachars
+    $re =~ tr/?/./;				# "?" -> "."
+    $re =~ s/\*/\.\*/g;				# "*" -> "any string"
+    $self->{$listname}->{$addr}{re} = qr/^${re}$/;
+    $self->{$listname}->{$addr}{domain} = [ $domain ];
+  }
 }
 
 sub remove_from_addrlist {

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm	(original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm	Wed Mar 17 09:42:36 2004
@@ -925,31 +925,74 @@
 
 sub check_from_in_whitelist {
   my ($self) = @_;
+  $self->_check_from_in_whitelist unless exists $self->{from_in_whitelist};
+  return ($self->{from_in_whitelist} > 0);
+}
+
+sub check_forged_in_whitelist {
+  my ($self) = @_;
+  $self->_check_from_in_whitelist unless exists $self->{from_in_whitelist};
+  $self->_check_from_in_default_whitelist unless exists $self->{from_in_default_whitelist};
+  return ($self->{from_in_whitelist} < 0) && ($self->{from_in_default_whitelist} == 0);
+}
+
+sub check_from_in_default_whitelist {
+  my ($self) = @_;
+  $self->_check_from_in_default_whitelist unless exists $self->{from_in_default_whitelist};
+  return ($self->{from_in_default_whitelist} > 0);
+}
+
+sub check_forged_in_default_whitelist {
+  my ($self) = @_;
+  $self->_check_from_in_default_whitelist unless exists $self->{from_in_default_whitelist};
+  $self->_check_from_in_whitelist unless exists $self->{from_in_whitelist};
+  return ($self->{from_in_default_whitelist} < 0) && ($self->{from_in_whitelist} == 0);
+}
+
+###########################################################################
+
+sub _check_from_in_whitelist {
+  my ($self) = @_;
+  my $found_match = 0;
   local ($_);
   foreach $_ ($self->all_from_addrs()) {
     if ($self->_check_whitelist ($self->{conf}->{whitelist_from}, $_)) {
-      return 1;
+      $self->{from_in_whitelist} = 1;
+      return;
     }
-    if ($self->_check_whitelist_rcvd ($self->{conf}->{whitelist_from_rcvd}, $_)) {
-      return 1;
+    my $wh = $self->_check_whitelist_rcvd ($self->{conf}->{whitelist_from_rcvd}, $_);
+    if ($wh == 1) {
+      $self->{from_in_whitelist} = 1;
+      return;
+    }
+    elsif ($wh == -1) {
+      $found_match = -1;
     }
   }
 
-  return 0;
+  $self->{from_in_whitelist} = $found_match;
+  return;
 }
 
 ###########################################################################
 
-sub check_from_in_default_whitelist {
+sub _check_from_in_default_whitelist {
   my ($self) = @_;
+  my $found_match = 0;
   local ($_);
   foreach $_ ($self->all_from_addrs()) {
-    if ($self->_check_whitelist_rcvd ($self->{conf}->{def_whitelist_from_rcvd}, $_)) {
-      return 1;
+    my $wh = $self->_check_whitelist_rcvd ($self->{conf}->{def_whitelist_from_rcvd}, $_);
+    if ($wh == 1) {
+      $self->{from_in_default_whitelist} = 1;
+      return;
+    }
+    elsif ($wh == -1) {
+      $found_match = -1;
     }
   }
 
-  return 0;
+  $self->{from_in_default_whitelist} = $found_match;
+  return;
 }
 
 ###########################################################################
@@ -1027,11 +1070,13 @@
 
 ###########################################################################
 
+# look up $addr and trusted relays in a whitelist with rcvd
+# note if it appears to be a forgery and $addr is not in any-relay list
 sub _check_whitelist_rcvd {
   my ($self, $list, $addr) = @_;
 
   # we can only match this if we have at least 1 trusted or untrusted header
-  return unless ($self->{num_relays_untrusted}+$self->{num_relays_trusted} > 0);
+  return 0 unless ($self->{num_relays_untrusted}+$self->{num_relays_trusted} > 0);
 
   my @relays = ();
   # try the untrusted one first
@@ -1045,19 +1090,31 @@
   }
 
   $addr = lc $addr;
+  my $found_forged = 0;
   foreach my $white_addr (keys %{$list}) {
     my $regexp = $list->{$white_addr}{re};
-    my $domain = $list->{$white_addr}{domain};
-
-    if ($addr =~ /${regexp}/i) {
-      foreach my $lastunt (@relays) {
-	my $rdns = $lastunt->{lc_rdns};
-	if ($rdns =~ /(?:^|\.)\Q${domain}\E$/) { return 1; }
+    foreach my $domain (@{$list->{$white_addr}{domain}}) {
+      
+      if ($addr =~ /${regexp}/i) {
+        foreach my $lastunt (@relays) {
+          my $rdns = $lastunt->{lc_rdns};
+          if ($rdns =~ /(?:^|\.)\Q${domain}\E$/) { return 1; }
+        }
+        # found address match but no relay match. note as possible forgery
+        $found_forged = -1;
       }
     }
   }
-
-  return 0;
+  if ($found_forged) { # might be forgery. check if in list of exempted
+    my $wlist = $self->{conf}->{whitelist_allows_relays};
+    foreach my $fuzzy_addr (values %{$wlist}) {
+      if ($addr =~ /$fuzzy_addr/i) {
+        $found_forged = 0;
+        last;
+      }
+    }
+  }
+  return $found_forged;
 }
 
 ###########################################################################

Modified: incubator/spamassassin/trunk/rules/50_scores.cf
==============================================================================
--- incubator/spamassassin/trunk/rules/50_scores.cf	(original)
+++ incubator/spamassassin/trunk/rules/50_scores.cf	Wed Mar 17 09:42:36 2004
@@ -890,6 +890,10 @@
 score USER_IN_DEF_WHITELIST -15.000
 score USER_IN_BLACKLIST_TO 10.000
 
+# if we have a relay specified for a whitelist entry penalize a forgery
+score FORGED_IN_WHITELIST 3.000
+score FORGED_DEF_WHITELIST 10.000
+
 # Not really false positives but the user wants spam!
 
 score USER_IN_WHITELIST_TO -6.000

Modified: incubator/spamassassin/trunk/rules/60_whitelist.cf
==============================================================================
--- incubator/spamassassin/trunk/rules/60_whitelist.cf	(original)
+++ incubator/spamassassin/trunk/rules/60_whitelist.cf	Wed Mar 17 09:42:36 2004
@@ -48,6 +48,14 @@
 describe USER_IN_DEF_WHITELIST	From: address is in the default white-list
 tflags USER_IN_DEF_WHITELIST	userconf nice noautolearn
 
+header FORGED_IN_WHITELIST	eval:check_forged_in_whitelist()
+describe FORGED_IN_WHITELIST	Forged From: is in user's white-list
+tflags FORGED_IN_WHITELIST	userconf
+
+header FORGED_DEF_WHITELIST	eval:check_forged_in_default_whitelist()
+describe FORGED_DEF_WHITELIST	Forged From: is in default white-list
+tflags FORGED_DEF_WHITELIST	userconf
+
 header USER_IN_BLACKLIST_TO     eval:check_to_in_blacklist()
 describe USER_IN_BLACKLIST_TO   User is listed in 'blacklist_to'
 tflags USER_IN_BLACKLIST_TO     userconf nice noautolearn

Added: incubator/spamassassin/trunk/t/data/nice/008
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/data/nice/008	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,14 @@
+Return-Path: <ba...@example.com>
+Received: from example.com (mail1.example.com [80.8.136.186])
+          by b.mx.sonic.net (8.12.10/8.12.7) with SMTP id i19FLtmt026870
+          for <us...@example.com>; Mon, 9 Feb 2004 07:21:57 -0800
+Received: from [8.141.200.111] by mail1.example.com with SMTP; Mon, 09 Feb 2004 23:17:44 -0600
+Message-ID: <ut...@y1uuyl.v.18>
+From: "Baz Test" <ba...@example.com>
+To: user@example.com
+Subject: whitelist test case
+Date: Mon, 09 Feb 04 23:17:44 GMT
+MIME-Version: 1.0
+Content-Type: test/plain
+
+Test whitelist_from baz@example.com

Added: incubator/spamassassin/trunk/t/data/nice/009
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/data/nice/009	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,14 @@
+Return-Path: <fo...@example.com>
+Received: from example.com (mail1.example.com [80.8.136.186])
+          by b.mx.sonic.net (8.12.10/8.12.7) with SMTP id i19FLtmt026870
+          for <us...@example.com>; Mon, 9 Feb 2004 07:21:57 -0800
+Received: from [8.141.200.111] by mail1.example.com with SMTP; Mon, 09 Feb 2004 23:17:44 -0600
+Message-ID: <ut...@y1uuyl.v.18>
+From: "Foo Test" <fo...@example.com>
+To: user@example.com
+Subject: whitelist test case
+Date: Mon, 09 Feb 04 23:17:44 GMT
+MIME-Version: 1.0
+Content-Type: test/plain
+
+Test whitelist_from_rcvd foo@example.com

Added: incubator/spamassassin/trunk/t/data/nice/010
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/data/nice/010	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,14 @@
+Return-Path: <fo...@example.com>
+Received: from spamassassin.org (mail1.spamassassin.org [80.8.136.186])
+          by b.mx.sonic.net (8.12.10/8.12.7) with SMTP id i19FLtmt026870
+          for <us...@example.com>; Mon, 9 Feb 2004 07:21:57 -0800
+Received: from [8.141.200.111] by mail1.spamassassin.org with SMTP; Mon, 09 Feb 2004 23:17:44 -0600
+Message-ID: <ut...@y1uuyl.v.18>
+From: "Foo Test" <fo...@example.com>
+To: user@example.com
+Subject: whitelist test case
+Date: Mon, 09 Feb 04 23:17:44 GMT
+MIME-Version: 1.0
+Content-Type: test/plain
+
+Test whitelist_from_rcvd foo@example.com

Added: incubator/spamassassin/trunk/t/data/nice/011
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/data/nice/011	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,14 @@
+Return-Path: <in...@paypal.com>
+Received: from paypal.com (mail1.paypal.com [80.8.136.186])
+          by b.mx.sonic.net (8.12.10/8.12.7) with SMTP id i19FLtmt026870
+          for <us...@example.com>; Mon, 9 Feb 2004 07:21:57 -0800
+Received: from [8.141.200.111] by mail1.paypal.com with SMTP; Mon, 09 Feb 2004 23:17:44 -0600
+Message-ID: <ut...@y1uuyl.v.18>
+From: "PayPal Info" <in...@paypal.com>
+To: user@example.com
+Subject: whitelist test case
+Date: Mon, 09 Feb 04 23:17:44 GMT
+MIME-Version: 1.0
+Content-Type: test/plain
+
+Test def_whitelist_from_rcvd with a paypal.com address and paypal.com relay

Added: incubator/spamassassin/trunk/t/data/nice/012
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/data/nice/012	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,14 @@
+Return-Path: <in...@paypal.com>
+Received: from ebay.com (mail1.ebay.com [80.8.136.186])
+          by b.mx.sonic.net (8.12.10/8.12.7) with SMTP id i19FLtmt026870
+          for <us...@example.com>; Mon, 9 Feb 2004 07:21:57 -0800
+Received: from [8.141.200.111] by mail1.ebay.com with SMTP; Mon, 09 Feb 2004 23:17:44 -0600
+Message-ID: <ut...@y1uuyl.v.18>
+From: "PayPal Info" <in...@paypal.com>
+To: user@example.com
+Subject: whitelist test case
+Date: Mon, 09 Feb 04 23:17:44 GMT
+MIME-Version: 1.0
+Content-Type: test/plain
+
+Test def_whitelist_from_rcvd with a paypal.com address and ebay.com relay

Added: incubator/spamassassin/trunk/t/data/nice/013
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/data/nice/013	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,14 @@
+Return-Path: <ba...@example.com>
+Received: from paypal.com (mail1.paypal.com [80.8.136.186])
+          by b.mx.sonic.net (8.12.10/8.12.7) with SMTP id i19FLtmt026870
+          for <us...@example.com>; Mon, 9 Feb 2004 07:21:57 -0800
+Received: from [8.141.200.111] by mail1.paypal.com with SMTP; Mon, 09 Feb 2004 23:17:44 -0600
+Message-ID: <ut...@y1uuyl.v.18>
+From: "Bar Test" <ba...@example.com>
+To: user@example.com
+Subject: whitelist test case
+Date: Mon, 09 Feb 04 23:17:44 GMT
+MIME-Version: 1.0
+Content-Type: test/plain
+
+Test whitelist_from_rcvd bar@example.com when relay is forged

Added: incubator/spamassassin/trunk/t/data/nice/014
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/data/nice/014	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,14 @@
+Return-Path: <mu...@example.com>
+Received: from example.com (mail1.example.com [80.8.136.186])
+          by b.mx.sonic.net (8.12.10/8.12.7) with SMTP id i19FLtmt026870
+          for <us...@example.com>; Mon, 9 Feb 2004 07:21:57 -0800
+Received: from [8.141.200.111] by mail1.example.com with SMTP; Mon, 09 Feb 2004 23:17:44 -0600
+Message-ID: <ut...@y1uuyl.v.18>
+From: "Bam Test" <ba...@example.com>
+To: user@example.com
+Subject: whitelist test case
+Date: Mon, 09 Feb 04 23:17:44 GMT
+MIME-Version: 1.0
+Content-Type: test/plain
+
+Test unwhitelist_from mumble@example.com

Added: incubator/spamassassin/trunk/t/data/nice/015
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/data/nice/015	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,14 @@
+Return-Path: <mu...@example.com>
+Received: from example.com (mail1.example.com [80.8.136.186])
+          by b.mx.sonic.net (8.12.10/8.12.7) with SMTP id i19FLtmt026870
+          for <us...@example.com>; Mon, 9 Feb 2004 07:21:57 -0800
+Received: from [8.141.200.111] by mail1.example.com with SMTP; Mon, 09 Feb 2004 23:17:44 -0600
+Message-ID: <ut...@y1uuyl.v.18>
+From: "Mumble Test" <mu...@example.com>
+To: user@example.com
+Subject: whitelist test case
+Date: Mon, 09 Feb 04 23:17:44 GMT
+MIME-Version: 1.0
+Content-Type: test/plain
+
+Test unwhitelist_from_rcvd mumble@example.com

Added: incubator/spamassassin/trunk/t/data/spam/012
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/data/spam/012	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,14 @@
+Return-Path: <fo...@example.com>
+Received: from paypal.com (mail1.paypal.com [80.8.136.186])
+          by b.mx.sonic.net (8.12.10/8.12.7) with SMTP id i19FLtmt026870
+          for <us...@example.com>; Mon, 9 Feb 2004 07:21:57 -0800
+Received: from [8.141.200.111] by mail1.paypal.com with SMTP; Mon, 09 Feb 2004 23:17:44 -0600
+Message-ID: <ut...@y1uuyl.v.18>
+From: "Foo Test" <fo...@example.com>
+To: user@example.com
+Subject: whitelist test case
+Date: Mon, 09 Feb 04 23:17:44 GMT
+MIME-Version: 1.0
+Content-Type: test/plain
+
+Test whitelist_from_rcvd foo@example.com when relay is forged

Added: incubator/spamassassin/trunk/t/data/spam/013
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/data/spam/013	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,14 @@
+Return-Path: <in...@paypal.com>
+Received: from example.com (mail1.example.com [80.8.136.186])
+          by b.mx.sonic.net (8.12.10/8.12.7) with SMTP id i19FLtmt026870
+          for <us...@example.com>; Mon, 9 Feb 2004 07:21:57 -0800
+Received: from [8.141.200.111] by mail1.example.com with SMTP; Mon, 09 Feb 2004 23:17:44 -0600
+Message-ID: <ut...@y1uuyl.v.18>
+From: "Paypal Info" <in...@paypal.com>
+To: user@example.com
+Subject: whitelist test case
+Date: Mon, 09 Feb 04 23:17:44 GMT
+MIME-Version: 1.0
+Content-Type: test/plain
+
+Test def_whitelist_from_rcvd info@paypal.com when relay is forged

Added: incubator/spamassassin/trunk/t/whitelist_from.t
==============================================================================
--- (empty file)
+++ incubator/spamassassin/trunk/t/whitelist_from.t	Wed Mar 17 09:42:36 2004
@@ -0,0 +1,106 @@
+#!/usr/bin/perl
+
+use lib '.'; use lib 't';
+use SATest; sa_t_init("whitelist_from");
+use Test; BEGIN { plan tests => 40 };
+
+# ---------------------------------------------------------------------------
+
+tstprefs ("
+        def_whitelist_from_rcvd *\@paypal.com paypal.com
+        def_whitelist_from_rcvd *\@paypal.com ebay.com
+        def_whitelist_from_rcvd mumble\@example.com example.com
+        whitelist_from_rcvd foo\@example.com spamassassin.org
+        whitelist_from_rcvd foo\@example.com example.com
+        whitelist_from_rcvd bar\@example.com example.com
+        whitelist_allows_relays bar\@example.com
+        whitelist_from baz\@example.com
+        whitelist_from bam\@example.com
+        unwhitelist_from bam\@example.com
+        unwhitelist_from_rcvd mumble\@example.com
+	");
+
+# tests 1 - 4 does whitelist_from work?
+%patterns = (
+             q{ USER_IN_WHITELIST }, 'w1'
+             );
+
+%anti_patterns = (
+             q{ FORGED_IN_WHITELIST }, 'a2',
+             q{ USER_IN_DEF_WHITELIST }, 'a3',
+             q{ FORGED_IN_DEF_WHITELIST }, 'a4'
+             );
+sarun ("-L -t < data/nice/008", \&patterns_run_cb);
+ok_all_patterns();
+
+# tests 5 - 8 does whitelist_from_rcvd work?
+sarun ("-L -t < data/nice/009", \&patterns_run_cb);
+ok_all_patterns();
+
+# tests 9 - 12 second relay specified for same addr in whitelist_from_rcvd
+sarun ("-L -t < data/nice/010", \&patterns_run_cb);
+ok_all_patterns();
+
+%patterns = (
+             q{ USER_IN_DEF_WHITELIST }, 'w5'
+             );
+
+%anti_patterns = (
+             q{ USER_IN_WHITELIST }, 'a6',
+             q{ FORGED_IN_WHITELIST }, 'a7',
+             q{ FORGED_IN_DEF_WHITELIST }, 'a8'
+             );
+
+# tests 13 - 16 does def_whitelist_from_rcvd work?
+sarun ("-L -t < data/nice/011", \&patterns_run_cb);
+ok_all_patterns();
+
+# tests 17 - 20 second relay specified for same addr in def_whitelist_from_rcvd
+sarun ("-L -t < data/nice/012", \&patterns_run_cb);
+ok_all_patterns();
+
+%patterns = ();
+
+%anti_patterns = (
+             q{ USER_IN_WHITELIST }, 'a9',
+             q{ FORGED_IN_WHITELIST }, 'a10',
+             q{ USER_IN_DEF_WHITELIST }, 'a11',
+             q{ FORGED_IN_DEF_WHITELIST }, 'a12'
+             );
+# tests 21 - 24 does whitelist_allows_relays suppress the forged rule without
+#  putting the address on the whitelist?
+sarun ("-L -t < data/nice/013", \&patterns_run_cb);
+ok_all_patterns();
+
+# tests 25 - 28 does unwhitelist_from work?
+sarun ("-L -t < data/nice/014", \&patterns_run_cb);
+ok_all_patterns();
+
+# tests 29 - 32 does unwhitelist_from_rcvd work?
+sarun ("-L -t < data/nice/015", \&patterns_run_cb);
+ok_all_patterns();
+
+%patterns = (
+             q{ FORGED_IN_WHITELIST }, 'w13'
+);
+%anti_patterns = (
+             q{ USER_IN_WHITELIST }, 'a14',
+             q{ USER_IN_DEF_WHITELIST }, 'a15',
+             q{ FORGED_IN_DEF_WHITELIST }, 'a16'
+             );
+# tests 33 - 36 does forgery detection work for whitelist_from_rcvd?
+sarun ("-L -t < data/spam/012", \&patterns_run_cb);
+ok_all_patterns();
+
+%patterns = (
+             q{ FORGED_DEF_WHITELIST }, 'w17'
+);
+%anti_patterns = (
+             q{ USER_IN_WHITELIST }, 'a18',
+             q{ FORGED_IN_WHITELIST }, 'a19',
+             q{ USER_IN_DEF_WHITELIST }, 'a20'
+             );
+
+# tests 37 - 40 does forgery detection work for def_whitelist_from_rcvd?
+sarun ("-L -t < data/spam/013", \&patterns_run_cb);
+ok_all_patterns();

Re: svn commit: rev 9572 - in incubator/spamassassin/trunk: lib/Mail/SpamAssassin rules t t/data/nice t/data/spam

Posted by Michael Parker <pa...@pobox.com>.
On Thu, Mar 18, 2004 at 07:06:05AM +1300, Sidney Markowitz wrote:
> I committed a change in revision 9570 but did not receive the commit 
> notice. But this commit went through to the cvs-commit mailing list. Is 
> something flaky in svn or do only commits that specify a bug number in 
> the log get mailed to the list?
> 
> The change in rev 9570 was the addition of a warn note to rule_names.t 
> in case of failure to let people know not to file a bug report every 
> time they see it.

Probably got sent to the moderator, same thing happened to me.

Looks like they are coming through now.

Michael

Re: svn commit: rev 9572 - in incubator/spamassassin/trunk: lib/Mail/SpamAssassin rules t t/data/nice t/data/spam

Posted by Sidney Markowitz <si...@sidney.com>.
I committed a change in revision 9570 but did not receive the commit 
notice. But this commit went through to the cvs-commit mailing list. Is 
something flaky in svn or do only commits that specify a bug number in 
the log get mailed to the list?

The change in rev 9570 was the addition of a warn note to rule_names.t 
in case of failure to let people know not to file a bug report every 
time they see it.

  -- sidney