diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-07 20:49:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-07 20:49:44 +0000 |
commit | ba501e250fe5002b3d0c3831aafb438ee3687cdf (patch) | |
tree | 88233be0e6962d4edc4dd37fa732f03700007afe | |
parent | f6f3c2dea862e0a503130a668f44152b77619a8e (diff) | |
parent | 1d0c3ae0ace2f6f4313e05cf4297e81e09df9cd2 (diff) | |
download | rspamd-ba501e250fe5002b3d0c3831aafb438ee3687cdf.tar.gz rspamd-ba501e250fe5002b3d0c3831aafb438ee3687cdf.zip |
Merge pull request #3179 from korgoth1/master
[Test] SPF for external relay
-rw-r--r-- | test/functional/cases/117_spf.robot | 4 | ||||
-rw-r--r-- | test/functional/cases/340_surbl.robot | 4 | ||||
-rw-r--r-- | test/functional/configs/dmarc.conf | 4 | ||||
-rw-r--r-- | test/functional/configs/plugins.conf | 10 | ||||
-rw-r--r-- | test/functional/configs/spf.conf | 1 | ||||
-rw-r--r-- | test/functional/messages/external_relay.eml | 16 | ||||
-rw-r--r-- | test/functional/messages/url10.eml | 4 |
7 files changed, 41 insertions, 2 deletions
diff --git a/test/functional/cases/117_spf.robot b/test/functional/cases/117_spf.robot index bfb56065f..ca4309fcb 100644 --- a/test/functional/cases/117_spf.robot +++ b/test/functional/cases/117_spf.robot @@ -127,6 +127,10 @@ SPF PERMFAIL REDIRECT WITHOUT SPF ... -i 192.0.2.1 -F a@fail1.org.org.za Check Rspamc ${result} R_SPF_DNSFAIL +SPF EXTERNAL RELAY + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/external_relay.eml + Should contain ${result.stdout} R_SPF_ALLOW (1.00)[+ip4:37.48.67.26] + *** Keywords *** SPF Setup ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dmarc.conf diff --git a/test/functional/cases/340_surbl.robot b/test/functional/cases/340_surbl.robot index 5137223bf..8d62c1698 100644 --- a/test/functional/cases/340_surbl.robot +++ b/test/functional/cases/340_surbl.robot @@ -141,6 +141,10 @@ SURBL IDN Punycode domain Should Not Contain ${result.stdout} DBL_PHISH Should Not Contain ${result.stdout} URIBL_BLACK +SURBL html entity ­ + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url10.eml + Should Contain ${result.stdout} RSPAMD_URIBL + Should Contain ${result.stdout} DBL_SPAM *** Keywords *** Surbl Setup diff --git a/test/functional/configs/dmarc.conf b/test/functional/configs/dmarc.conf index 0d931b7d3..08a542c70 100644 --- a/test/functional/configs/dmarc.conf +++ b/test/functional/configs/dmarc.conf @@ -1,2 +1,4 @@ dmarc { } -spf { } +spf { + external_relay = 192.168.1.1; +}
\ No newline at end of file diff --git a/test/functional/configs/plugins.conf b/test/functional/configs/plugins.conf index 851f280d9..098209788 100644 --- a/test/functional/configs/plugins.conf +++ b/test/functional/configs/plugins.conf @@ -219,6 +219,16 @@ options = { replies = ["v=spf1 ip4:8.8.8.8 a -all"]; }, { + name = "trusted.com", + type = "txt"; + replies = ["v=spf1 ip4:192.168.1.1"]; + }, + { + name = "external.com", + type = "txt"; + replies = ["v=spf1 ip4:37.48.67.26"]; + }, + { name = "co.za", type = "txt"; rcode = 'norec'; diff --git a/test/functional/configs/spf.conf b/test/functional/configs/spf.conf deleted file mode 100644 index 37028b1a7..000000000 --- a/test/functional/configs/spf.conf +++ /dev/null @@ -1 +0,0 @@ -spf { } diff --git a/test/functional/messages/external_relay.eml b/test/functional/messages/external_relay.eml new file mode 100644 index 000000000..14ac8ae2c --- /dev/null +++ b/test/functional/messages/external_relay.eml @@ -0,0 +1,16 @@ +Return-path: root@external.com +Received: from trusted.com (trusted.com [192.168.1.1]) by + example.com with LMTP id MJX+NoRd5F2caAAAzslS3g for <test@example.com>; + Thu, 5 Dec 2019 18:22:18 +0300 +Received: from external.com (external.com [37.48.67.26]) by + trusted.com (Postfix) with ESMTP id C018DA00021; + Thu, 5 Dec 2019 18:22:18 +0300 +To: test@example.com +From: root@external.com +Subject: test Sat, 26 Jan 2019 12:04:58 +0100 +Message-Id: <20190126120458.015328@srv.example.com> +Date: Sat, 26 Jan 2019 12:04:58 +0100 +MIME-Version: 1.0 +Content-Type: multipart/mixed + +dsadas diff --git a/test/functional/messages/url10.eml b/test/functional/messages/url10.eml new file mode 100644 index 000000000..3b43e9e08 --- /dev/null +++ b/test/functional/messages/url10.eml @@ -0,0 +1,4 @@ +Content-Type: text/html +Content-Transfer-Encoding: quoted-printable + +<a href="https:/\test­test.­com/redirect?url=https%3A%2F%2Fexample%2Ecom&urlhash=rH0t#100xp@example.com">
\ No newline at end of file |