You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2011/05/18 21:16:51 UTC

svn commit: r1124386 - in /spamassassin/trunk: lib/Mail/SpamAssassin/Conf.pm t/data/01_test_rules.cf t/originating_ip_hdr.t t/trust_path.t

Author: mmartinec
Date: Wed May 18 19:16:51 2011
New Revision: 1124386

URL: http://svn.apache.org/viewvc?rev=1124386&view=rev
Log:
Bug 6591: 3.3.2rc1 fails t/trusted_path.t tests 69, 72, 75, 78

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
    spamassassin/trunk/t/data/01_test_rules.cf
    spamassassin/trunk/t/originating_ip_hdr.t
    spamassassin/trunk/t/trust_path.t

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm?rev=1124386&r1=1124385&r2=1124386&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm Wed May 18 19:16:51 2011
@@ -1373,7 +1373,11 @@ but they may be in the future.
       unless (defined $value && $value !~ /^$/) {
 	return $MISSING_REQUIRED_VALUE;
       }
-      push(@{$self->{originating_ip_headers}}, split(/\s+/, $value));
+      foreach my $hfname (split(/\s+/, $value)) {
+        # avoid duplicates, consider header field names case-insensitive
+        push(@{$self->{originating_ip_headers}}, $hfname)
+          if !grep(lc($_) eq lc($hfname), @{$self->{originating_ip_headers}});
+      }
     }
   });
 

Modified: spamassassin/trunk/t/data/01_test_rules.cf
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/data/01_test_rules.cf?rev=1124386&r1=1124385&r2=1124386&view=diff
==============================================================================
--- spamassassin/trunk/t/data/01_test_rules.cf (original)
+++ spamassassin/trunk/t/data/01_test_rules.cf Wed May 18 19:16:51 2011
@@ -48,6 +48,10 @@ add_header spam Flag _YESNOCAPS_
 add_header all Level _STARS(*)_
 add_header all Status "_YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_"
 
+clear_originating_ip_headers
+originating_ip_headers X-Yahoo-Post-IP X-Originating-IP X-Apparently-From
+originating_ip_headers X-SenderIP
+
 required_score           5
 ok_locales              all
 ifplugin Mail::SpamAssassin::Plugin::TextCat

Modified: spamassassin/trunk/t/originating_ip_hdr.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/originating_ip_hdr.t?rev=1124386&r1=1124385&r2=1124386&view=diff
==============================================================================
--- spamassassin/trunk/t/originating_ip_hdr.t (original)
+++ spamassassin/trunk/t/originating_ip_hdr.t Wed May 18 19:16:51 2011
@@ -6,12 +6,7 @@ use Test; BEGIN { plan tests => 9 };
 
 # ---------------------------------------------------------------------------
 
-# the 'originating_ip_headers X-Originating-IP' is normally in a default
-# set of originating_ip_headers, but not when 'make disttest' is run;
-# let's just make it explicit:
-#
 tstlocalrules (q{
-  originating_ip_headers X-Originating-IP
   header TEST_ORIG_IP_H1 X-Spam-Relays-External =~ /\bip=198\.51\.100\.1\b/
   score  TEST_ORIG_IP_H1 0.1
   header TEST_ORIG_IP_H2 X-Spam-Relays-External =~ /\bip=198\.51\.100\.2\b/

Modified: spamassassin/trunk/t/trust_path.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/trust_path.t?rev=1124386&r1=1124385&r2=1124386&view=diff
==============================================================================
--- spamassassin/trunk/t/trust_path.t (original)
+++ spamassassin/trunk/t/trust_path.t Wed May 18 19:16:51 2011
@@ -613,8 +613,7 @@ while (1) {
             "add_header all Trusted _RELAYSTRUSTED_\n".
             "clear_trusted_networks\n".
             "clear_internal_networks\n".
-            "clear_msa_networks\n".
-            "originating_ip_headers X-Originating-IP\n";
+            "clear_msa_networks\n";
 
   if ($hdrs =~ s/^\s*(trusted_networks\s+[^\n]*)//gs) {
     $conf .= $1."\n";
@@ -631,7 +630,7 @@ while (1) {
   my $netset_warn = 0;
   my $fh;
   if ($expected =~ s/^\s*Netset-Warn\s*//) {    
-    # create a file descriptior for logging STDERR
+    # create a file descriptor for logging STDERR
     # (we do not want warnings for regexps we know are invalid)
     $fh = IO::File->new_tmpfile();
     open(STDERR, ">&".fileno($fh)) || die "Cannot create LOGERR temp file";