You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by gb...@apache.org on 2018/07/19 14:19:49 UTC
svn commit: r1836275 - in /spamassassin: branches/3.4/ branches/3.4/t/
branches/3.4/t/data/spam/ trunk/ trunk/t/ trunk/t/data/spam/
Author: gbechis
Date: Thu Jul 19 14:19:48 2018
New Revision: 1836275
URL: http://svn.apache.org/viewvc?rev=1836275&view=rev
Log:
Mail::SpamAssassin::Plugin::RelayCountry regression tests
Added:
spamassassin/branches/3.4/t/data/spam/relayUS.eml
spamassassin/branches/3.4/t/relaycountry_fast.t (with props)
spamassassin/branches/3.4/t/relaycountry_geoip.t (with props)
spamassassin/trunk/t/data/spam/relayUS.eml
spamassassin/trunk/t/relaycountry_fast.t (with props)
spamassassin/trunk/t/relaycountry_geoip.t (with props)
Modified:
spamassassin/branches/3.4/MANIFEST
spamassassin/trunk/MANIFEST
Modified: spamassassin/branches/3.4/MANIFEST
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/MANIFEST?rev=1836275&r1=1836274&r2=1836275&view=diff
==============================================================================
--- spamassassin/branches/3.4/MANIFEST (original)
+++ spamassassin/branches/3.4/MANIFEST Thu Jul 19 14:19:48 2018
@@ -370,6 +370,7 @@ t/data/spam/bsmtpnull
t/data/spam/dnsbl.eml
t/data/spam/gtube.eml
t/data/spam/gtubedcc.eml
+t/data/spam/relayUS.eml
t/data/spam/spf1
t/data/spam/spf2
t/data/spam/spf3
@@ -451,6 +452,8 @@ t/recips.t
t/recreate.t
t/recursion.t
t/regexp_valid.t
+t/relaycountry_fast.t
+t/relaycountry_geoip.t
t/relative_scores.t
t/report_safe.t
t/reportheader.t
Added: spamassassin/branches/3.4/t/data/spam/relayUS.eml
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/data/spam/relayUS.eml?rev=1836275&view=auto
==============================================================================
--- spamassassin/branches/3.4/t/data/spam/relayUS.eml (added)
+++ spamassassin/branches/3.4/t/data/spam/relayUS.eml Thu Jul 19 14:19:48 2018
@@ -0,0 +1,13 @@
+Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66])
+ by in.example.com (Postfix) with ESMTPS
+ for <te...@example.com>; Wed, 18 Jul 2018 21:12:22 +0200 (CEST)
+Received: by mail-wm0-f66.google.com with SMTP id f21-v6so3811271wmc.5
+ for <te...@example.com>; Wed, 18 Jul 2018 12:12:22 -0700 (PDT)
+From: <te...@gmail.com>
+To: test@example.com
+Subject: Relay Country Test
+Date: Wed, 18 Jul 2018 12:12:00 -0700 (PDT)
+MIME-Version: 1.0
+Message-Id: <20...@gmail.com>
+Content-Type: text/plain; charset="us-ascii"
+
Added: spamassassin/branches/3.4/t/relaycountry_fast.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/relaycountry_fast.t?rev=1836275&view=auto
==============================================================================
--- spamassassin/branches/3.4/t/relaycountry_fast.t (added)
+++ spamassassin/branches/3.4/t/relaycountry_fast.t Thu Jul 19 14:19:48 2018
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+BEGIN {
+ if (-e 't/test_dir') { # if we are running "t/rule_tests.t", kluge around ...
+ chdir 't';
+ }
+
+ if (-e 'test_dir') { # running from test directory, not ..
+ unshift(@INC, '../blib/lib');
+ unshift(@INC, '../lib');
+ }
+}
+
+use lib '.'; use lib 't';
+use SATest; sa_t_init("relaycountry");
+
+use constant HAS_COUNTRY_FAST => eval { require IP::Country::Fast; };
+
+use Test::More;
+
+plan skip_all => "IP::Country::Fast not installed" unless HAS_COUNTRY_FAST;
+plan tests => 1;
+
+# ---------------------------------------------------------------------------
+
+tstpre ("
+loadplugin Mail::SpamAssassin::Plugin::RelayCountry
+");
+
+tstprefs ("
+ $default_cf_lines
+ country_db_type Fast
+ add_header all Relay-Country _RELAYCOUNTRY_
+ ");
+
+# Check for country of gmail.com mail server
+%patterns = (
+ q{ X-Spam-Relay-Country: US },
+ );
+
+ok sarun ("-t < data/spam/relayUS.eml", \&patterns_run_cb);
Propchange: spamassassin/branches/3.4/t/relaycountry_fast.t
------------------------------------------------------------------------------
svn:executable = *
Added: spamassassin/branches/3.4/t/relaycountry_geoip.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/relaycountry_geoip.t?rev=1836275&view=auto
==============================================================================
--- spamassassin/branches/3.4/t/relaycountry_geoip.t (added)
+++ spamassassin/branches/3.4/t/relaycountry_geoip.t Thu Jul 19 14:19:48 2018
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+BEGIN {
+ if (-e 't/test_dir') { # if we are running "t/rule_tests.t", kluge around ...
+ chdir 't';
+ }
+
+ if (-e 'test_dir') { # running from test directory, not ..
+ unshift(@INC, '../blib/lib');
+ unshift(@INC, '../lib');
+ }
+}
+
+use lib '.'; use lib 't';
+use SATest; sa_t_init("relaycountry");
+
+use constant HAS_GEOIP => eval { require Geo::IP; };
+
+use Test::More;
+
+plan skip_all => "Geo::IP not installed" unless HAS_GEOIP;
+plan tests => 1;
+
+# ---------------------------------------------------------------------------
+
+tstpre ("
+loadplugin Mail::SpamAssassin::Plugin::RelayCountry
+");
+
+tstprefs ("
+ $default_cf_lines
+ country_db_type GeoIP
+ add_header all Relay-Country _RELAYCOUNTRY_
+ ");
+
+# Check for country of gmail.com mail server
+%patterns = (
+ q{ X-Spam-Relay-Country: US },
+ );
+
+ok sarun ("-t < data/spam/relayUS.eml", \&patterns_run_cb);
Propchange: spamassassin/branches/3.4/t/relaycountry_geoip.t
------------------------------------------------------------------------------
svn:executable = *
Modified: spamassassin/trunk/MANIFEST
URL: http://svn.apache.org/viewvc/spamassassin/trunk/MANIFEST?rev=1836275&r1=1836274&r2=1836275&view=diff
==============================================================================
--- spamassassin/trunk/MANIFEST (original)
+++ spamassassin/trunk/MANIFEST Thu Jul 19 14:19:48 2018
@@ -372,6 +372,7 @@ t/data/spam/bsmtpnull
t/data/spam/dnsbl.eml
t/data/spam/gtube.eml
t/data/spam/gtubedcc.eml
+t/data/spam/relayUS.eml
t/data/spam/spf1
t/data/spam/spf2
t/data/spam/spf3
@@ -454,6 +455,8 @@ t/recips.t
t/recreate.t
t/recursion.t
t/regexp_valid.t
+t/relaycountry_fast.t
+t/relaycountry_geoip.t
t/relative_scores.t
t/report_safe.t
t/reportheader.t
Added: spamassassin/trunk/t/data/spam/relayUS.eml
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/data/spam/relayUS.eml?rev=1836275&view=auto
==============================================================================
--- spamassassin/trunk/t/data/spam/relayUS.eml (added)
+++ spamassassin/trunk/t/data/spam/relayUS.eml Thu Jul 19 14:19:48 2018
@@ -0,0 +1,13 @@
+Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66])
+ by in.example.com (Postfix) with ESMTPS
+ for <te...@example.com>; Wed, 18 Jul 2018 21:12:22 +0200 (CEST)
+Received: by mail-wm0-f66.google.com with SMTP id f21-v6so3811271wmc.5
+ for <te...@example.com>; Wed, 18 Jul 2018 12:12:22 -0700 (PDT)
+From: <te...@gmail.com>
+To: test@example.com
+Subject: Relay Country Test
+Date: Wed, 18 Jul 2018 12:12:00 -0700 (PDT)
+MIME-Version: 1.0
+Message-Id: <20...@gmail.com>
+Content-Type: text/plain; charset="us-ascii"
+
Added: spamassassin/trunk/t/relaycountry_fast.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/relaycountry_fast.t?rev=1836275&view=auto
==============================================================================
--- spamassassin/trunk/t/relaycountry_fast.t (added)
+++ spamassassin/trunk/t/relaycountry_fast.t Thu Jul 19 14:19:48 2018
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+BEGIN {
+ if (-e 't/test_dir') { # if we are running "t/rule_tests.t", kluge around ...
+ chdir 't';
+ }
+
+ if (-e 'test_dir') { # running from test directory, not ..
+ unshift(@INC, '../blib/lib');
+ unshift(@INC, '../lib');
+ }
+}
+
+use lib '.'; use lib 't';
+use SATest; sa_t_init("relaycountry");
+
+use constant HAS_COUNTRY_FAST => eval { require IP::Country::Fast; };
+
+use Test::More;
+
+plan skip_all => "IP::Country::Fast not installed" unless HAS_COUNTRY_FAST;
+plan tests => 1;
+
+# ---------------------------------------------------------------------------
+
+tstpre ("
+loadplugin Mail::SpamAssassin::Plugin::RelayCountry
+");
+
+tstprefs ("
+ $default_cf_lines
+ country_db_type Fast
+ add_header all Relay-Country _RELAYCOUNTRY_
+ ");
+
+# Check for country of gmail.com mail server
+%patterns = (
+ q{ X-Spam-Relay-Country: US },
+ );
+
+ok sarun ("-t < data/spam/relayUS.eml", \&patterns_run_cb);
Propchange: spamassassin/trunk/t/relaycountry_fast.t
------------------------------------------------------------------------------
svn:executable = *
Added: spamassassin/trunk/t/relaycountry_geoip.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/relaycountry_geoip.t?rev=1836275&view=auto
==============================================================================
--- spamassassin/trunk/t/relaycountry_geoip.t (added)
+++ spamassassin/trunk/t/relaycountry_geoip.t Thu Jul 19 14:19:48 2018
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+BEGIN {
+ if (-e 't/test_dir') { # if we are running "t/rule_tests.t", kluge around ...
+ chdir 't';
+ }
+
+ if (-e 'test_dir') { # running from test directory, not ..
+ unshift(@INC, '../blib/lib');
+ unshift(@INC, '../lib');
+ }
+}
+
+use lib '.'; use lib 't';
+use SATest; sa_t_init("relaycountry");
+
+use constant HAS_GEOIP => eval { require Geo::IP; };
+
+use Test::More;
+
+plan skip_all => "Geo::IP not installed" unless HAS_GEOIP;
+plan tests => 1;
+
+# ---------------------------------------------------------------------------
+
+tstpre ("
+loadplugin Mail::SpamAssassin::Plugin::RelayCountry
+");
+
+tstprefs ("
+ $default_cf_lines
+ country_db_type GeoIP
+ add_header all Relay-Country _RELAYCOUNTRY_
+ ");
+
+# Check for country of gmail.com mail server
+%patterns = (
+ q{ X-Spam-Relay-Country: US },
+ );
+
+ok sarun ("-t < data/spam/relayUS.eml", \&patterns_run_cb);
Propchange: spamassassin/trunk/t/relaycountry_geoip.t
------------------------------------------------------------------------------
svn:executable = *