You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/06/28 04:27:01 UTC

svn commit: r202115 - in /spamassassin/trunk: lib/Mail/SpamAssassin/Conf.pm lib/Mail/SpamAssassin/EvalTests.pm t/SATest.pm t/dnsbl.t

Author: jm
Date: Mon Jun 27 19:27:00 2005
New Revision: 202115

URL: http://svn.apache.org/viewcvs?rev=202115&view=rev
Log:
bug 4433: revert incorrect 'fix' for untrusted behaviour; add test to dnsbl.t; add code to SATest.pm to support redirecting stderr; add clarification to Conf doco regarding the untrusted behaviour, and link to new explanatory wiki page

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
    spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
    spamassassin/trunk/t/SATest.pm
    spamassassin/trunk/t/dnsbl.t

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm?rev=202115&r1=202114&r2=202115&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm Mon Jun 27 19:27:00 2005
@@ -1816,12 +1816,18 @@
 end of the set name.  That should test the IP address of the relay that
 connected to the most remote trusted relay.
 
-In addition, you can test all untrusted IP addresses by placing '-untrusted'
-at the end of the set name.
-
 Note that this requires that SpamAssassin know which relays are trusted.  For
 simple cases, SpamAssassin can make a good estimate.  For complex cases, you
 may get better results by setting C<trusted_networks> manually.
+
+In addition, you can test all untrusted IP addresses by placing '-untrusted'
+at the end of the set name.   Important note -- this does NOT include the 
+IP address from the most recent 'untrusted line', as used in '-firsttrusted'
+above.  That's because we're talking about the trustworthiness of the
+IP address data, not the source header line, here; and in the case of 
+the most recent header (the 'firsttrusted'), that data can be trusted.
+See the Wiki page at http://wiki.apache.org/spamassassin/TrustedRelays
+for more information on this.
 
 =back
 

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm?rev=202115&r1=202114&r2=202115&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm Mon Jun 27 19:27:00 2005
@@ -1267,6 +1267,8 @@
       @ips = $self->ip_list_uniq_and_strip_private (@ips, @tips);
       if ($1 eq "first") {
         @ips = (defined $ips[0]) ? ($ips[0]) : ();
+      } else {
+        shift @ips;
       }
     }
     else

Modified: spamassassin/trunk/t/SATest.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/t/SATest.pm?rev=202115&r1=202114&r2=202115&view=diff
==============================================================================
--- spamassassin/trunk/t/SATest.pm (original)
+++ spamassassin/trunk/t/SATest.pm Mon Jun 27 19:27:00 2005
@@ -223,6 +223,9 @@
   my $args = shift;
   my $read_sub = shift;
 
+  my $post_redir = '';
+  $args =~ s/ 2\>\&1$// and $post_redir = ' 2>&1';
+
   rmtree ("log/outputdir.tmp"); # some tests use this
   mkdir ("log/outputdir.tmp", 0755);
 
@@ -238,7 +241,7 @@
   my $scrargs = "$scr $args";
   $scrargs =~ s!/!\\!g if ($^O =~ /^MS(DOS|Win)/i);
   print ("\t$scrargs\n");
-  system ("$scrargs > log/$testname.${Test::ntest}");
+  system ("$scrargs > log/$testname.${Test::ntest} $post_redir");
   $sa_exitcode = ($?>>8);
   if ($sa_exitcode != 0) { return undef; }
   &checkfile ("$testname.${Test::ntest}", $read_sub) if (defined $read_sub);

Modified: spamassassin/trunk/t/dnsbl.t
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/t/dnsbl.t?rev=202115&r1=202114&r2=202115&view=diff
==============================================================================
--- spamassassin/trunk/t/dnsbl.t (original)
+++ spamassassin/trunk/t/dnsbl.t Mon Jun 27 19:27:00 2005
@@ -19,7 +19,7 @@
 use Test;
 
 BEGIN {
-  plan tests => (DO_RUN ? 22 : 0),
+  plan tests => (DO_RUN ? 23 : 0),
 };
 
 exit unless (DO_RUN);
@@ -88,6 +88,7 @@
  q{ DNSBL_TXT_MISS } => 'P_20',
  q{ DNSBL_SB_UNDEF } => 'P_21',
  q{ DNSBL_SB_MISS } => 'P_22',
+ q{ launching DNS A query for 14.35.17.212.untrusted.dnsbltest.spamassassin.org. } => 'untrusted',
 );
 
 tstprefs("
@@ -108,6 +109,10 @@
 describe DNSBL_TEST_WHITELIST	DNSBL whitelist match
 tflags DNSBL_TEST_WHITELIST	net nice
 
+header DNSBL_TEST_UNTRUSTED	eval:check_rbl('white-untrusted', 'untrusted.dnsbltest.spamassassin.org.', '127.0.0.1')
+describe DNSBL_TEST_UNTRUSTED	DNSBL untrusted match
+tflags DNSBL_TEST_UNTRUSTED	net nice
+
 header DNSBL_TEST_DYNAMIC	eval:check_rbl_sub('test', '2')
 describe DNSBL_TEST_DYNAMIC	DNSBL dynamic match
 tflags DNSBL_TEST_DYNAMIC	net
@@ -164,5 +169,5 @@
 tflags DNSBL_SB_MISS	net
 ");
 
-sarun ("-t < data/spam/dnsbl.eml", \&patterns_run_cb);
+sarun ("-D -t < data/spam/dnsbl.eml 2>&1", \&patterns_run_cb);
 ok_all_patterns();