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/05 17:36:46 UTC

svn commit: r1099844 - in /spamassassin/branches/3.3/t: data/nice/orig_ip_hdr.eml originating_ip_hdr.t

Author: mmartinec
Date: Thu May  5 15:36:46 2011
New Revision: 1099844

URL: http://svn.apache.org/viewvc?rev=1099844&view=rev
Log:
Bug 6500: clear_originating_ip_headers seems to be broken - added a test

Added:
    spamassassin/branches/3.3/t/data/nice/orig_ip_hdr.eml
    spamassassin/branches/3.3/t/originating_ip_hdr.t   (with props)

Added: spamassassin/branches/3.3/t/data/nice/orig_ip_hdr.eml
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.3/t/data/nice/orig_ip_hdr.eml?rev=1099844&view=auto
==============================================================================
--- spamassassin/branches/3.3/t/data/nice/orig_ip_hdr.eml (added)
+++ spamassassin/branches/3.3/t/data/nice/orig_ip_hdr.eml Thu May  5 15:36:46 2011
@@ -0,0 +1,12 @@
+Received: from 1.2.3.4 by probeer.bokxing.nl
+  (probeer.alt001.com [87.253.148.98]) with ESMTP id YN8t6r6y41Ly
+  for <ro...@example.nl>; Mon, 11 Oct 2010 14:21:26 +0200 (CEST)
+X-Originating-Ip: [198.51.100.1]
+X-Testing-Ip: [198.51.100.2]
+Subject: test
+From: Roel <ro...@example.nl>
+To: Roel <ro...@example.nl>
+Date: Mon, 11 Oct 2010 14:21:30 +0200
+Message-Id: <AA...@mail.gmail.com>
+
+test

Added: spamassassin/branches/3.3/t/originating_ip_hdr.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.3/t/originating_ip_hdr.t?rev=1099844&view=auto
==============================================================================
--- spamassassin/branches/3.3/t/originating_ip_hdr.t (added)
+++ spamassassin/branches/3.3/t/originating_ip_hdr.t Thu May  5 15:36:46 2011
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+
+use lib '.'; use lib 't';
+use SATest; sa_t_init("if_can");
+use Test; BEGIN { plan tests => 9 };
+
+# ---------------------------------------------------------------------------
+
+tstlocalrules (q{
+  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/
+  score  TEST_ORIG_IP_H2 0.1
+});
+
+%patterns      = ( q{ TEST_ORIG_IP_H1 }, 'test_orig_ip_h1' );
+%anti_patterns = ( q{ TEST_ORIG_IP_H2 }, 'test_orig_ip_h2' );
+
+ok(sarun("-L -t < data/nice/orig_ip_hdr.eml", \&patterns_run_cb));
+ok_all_patterns();
+
+# ---------------------------------------------------------------------------
+
+tstlocalrules (q{
+  clear_originating_ip_headers
+  originating_ip_headers X-Yahoo-Post-IP X-Apparently-From
+  originating_ip_headers X-Originating-IP X-SenderIP
+  originating_ip_headers X-Testing-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/
+  score  TEST_ORIG_IP_H2 0.1
+});
+
+%patterns      = ( q{ TEST_ORIG_IP_H1 }, 'test_orig_ip_h1',
+                   q{ TEST_ORIG_IP_H2 }, 'test_orig_ip_h2' );
+%anti_patterns = ();
+
+ok(sarun("-L -t < data/nice/orig_ip_hdr.eml", \&patterns_run_cb));
+ok_all_patterns();
+
+# ---------------------------------------------------------------------------
+
+tstlocalrules (q{
+  clear_originating_ip_headers
+  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/
+  score  TEST_ORIG_IP_H2 0.1
+});
+
+%patterns = ();
+%anti_patterns = ( q{ TEST_ORIG_IP_H1 }, 'test_orig_ip_h1',
+                   q{ TEST_ORIG_IP_H2 }, 'test_orig_ip_h2' );
+
+ok(sarun("-L -t < data/nice/orig_ip_hdr.eml", \&patterns_run_cb));
+ok_all_patterns();
+

Propchange: spamassassin/branches/3.3/t/originating_ip_hdr.t
------------------------------------------------------------------------------
    svn:eol-style = native