From 5eee09843993f42cb8de30116968ac175600976c Mon Sep 17 00:00:00 2001 From: korgoth1 Date: Fri, 6 Dec 2019 22:55:00 +0300 Subject: [Test] SPF PERMFAIL REDIRECT WITHOUT SPF --- test/functional/cases/117_spf.robot | 5 +++++ test/functional/configs/dmarc.conf | 4 +++- test/functional/configs/plugins.conf | 10 ++++++++++ test/functional/messages/external_relay.eml | 18 ++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 test/functional/messages/external_relay.eml diff --git a/test/functional/cases/117_spf.robot b/test/functional/cases/117_spf.robot index 309a0aaef..99e50075b 100644 --- a/test/functional/cases/117_spf.robot +++ b/test/functional/cases/117_spf.robot @@ -127,6 +127,11 @@ SPF PERMFAIL REDIRECT WITHOUT SPF ... -i 192.0.2.1 -F a@fail1.org.org.za Check Rspamc ${result} R_SPF_PERMFAIL +SPF EXTERNAL RELAY + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/external_relay.eml + ... -F root@trusted.client + Check Rspamc ${result} R_SPF_PERMFAIL + *** Keywords *** SPF Setup ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dmarc.conf diff --git a/test/functional/configs/dmarc.conf b/test/functional/configs/dmarc.conf index 0d931b7d3..903e28a71 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..2ac6e7a2c 100644 --- a/test/functional/configs/plugins.conf +++ b/test/functional/configs/plugins.conf @@ -218,6 +218,16 @@ options = { type = "txt"; replies = ["v=spf1 ip4:8.8.8.8 a -all"]; }, + { + name = "trusted.relay", + type = "txt"; + replies = ["v=spf1 -all"]; + }, + { + name = "external.client", + type = "txt"; + replies = ["v=spf1 ip4:37.98.67.26"]; + }, { name = "co.za", type = "txt"; diff --git a/test/functional/messages/external_relay.eml b/test/functional/messages/external_relay.eml new file mode 100644 index 000000000..ab52479d1 --- /dev/null +++ b/test/functional/messages/external_relay.eml @@ -0,0 +1,18 @@ +Received: from trusted.relay (192.168.1.1) by + example.com (37.98.67.26) with Microsoft SMTP + Server id for + 15.1.1847.3; Thu, 5 Dec 2019 18:22:18 +0300 +Received: from external.client (37.48.67.26) by + trusted.relay (192.168.1.1) with Microsoft SMTP + Server id 15.1.1847.3 via Frontend Transport; Thu, 5 Dec 2019 18:22:18 +0300 +To: test@example.com +From: root@external.client +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 + +fail6.org.org.za \ No newline at end of file -- cgit v1.2.3 From d6a1a0f31fa4e8d72faef0f9536cc179b42c37a9 Mon Sep 17 00:00:00 2001 From: korgoth1 Date: Sat, 7 Dec 2019 21:47:51 +0300 Subject: [Test] SPF for relay --- test/functional/cases/117_spf.robot | 3 +-- test/functional/configs/dmarc.conf | 2 +- test/functional/configs/plugins.conf | 8 ++++---- test/functional/configs/spf.conf | 1 - test/functional/messages/external_relay.eml | 18 ++++++++---------- 5 files changed, 14 insertions(+), 18 deletions(-) delete mode 100644 test/functional/configs/spf.conf diff --git a/test/functional/cases/117_spf.robot b/test/functional/cases/117_spf.robot index 7e1f80f24..ca4309fcb 100644 --- a/test/functional/cases/117_spf.robot +++ b/test/functional/cases/117_spf.robot @@ -129,8 +129,7 @@ SPF PERMFAIL REDIRECT WITHOUT SPF SPF EXTERNAL RELAY ${result} = Scan Message With Rspamc ${TESTDIR}/messages/external_relay.eml - ... -F root@trusted.client - Check Rspamc ${result} R_SPF_PERMFAIL + Should contain ${result.stdout} R_SPF_ALLOW (1.00)[+ip4:37.48.67.26] *** Keywords *** SPF Setup diff --git a/test/functional/configs/dmarc.conf b/test/functional/configs/dmarc.conf index 903e28a71..08a542c70 100644 --- a/test/functional/configs/dmarc.conf +++ b/test/functional/configs/dmarc.conf @@ -1,4 +1,4 @@ dmarc { } spf { - external_relay = 192.168.1.1 + 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 2ac6e7a2c..098209788 100644 --- a/test/functional/configs/plugins.conf +++ b/test/functional/configs/plugins.conf @@ -219,14 +219,14 @@ options = { replies = ["v=spf1 ip4:8.8.8.8 a -all"]; }, { - name = "trusted.relay", + name = "trusted.com", type = "txt"; - replies = ["v=spf1 -all"]; + replies = ["v=spf1 ip4:192.168.1.1"]; }, { - name = "external.client", + name = "external.com", type = "txt"; - replies = ["v=spf1 ip4:37.98.67.26"]; + replies = ["v=spf1 ip4:37.48.67.26"]; }, { name = "co.za", 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 index ab52479d1..14ac8ae2c 100644 --- a/test/functional/messages/external_relay.eml +++ b/test/functional/messages/external_relay.eml @@ -1,12 +1,12 @@ -Received: from trusted.relay (192.168.1.1) by - example.com (37.98.67.26) with Microsoft SMTP - Server id for - 15.1.1847.3; Thu, 5 Dec 2019 18:22:18 +0300 -Received: from external.client (37.48.67.26) by - trusted.relay (192.168.1.1) with Microsoft SMTP - Server id 15.1.1847.3 via Frontend Transport; Thu, 5 Dec 2019 18:22:18 +0300 +Return-path: root@external.com +Received: from trusted.com (trusted.com [192.168.1.1]) by + example.com with LMTP id MJX+NoRd5F2caAAAzslS3g for ; + 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.client +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 @@ -14,5 +14,3 @@ MIME-Version: 1.0 Content-Type: multipart/mixed dsadas - -fail6.org.org.za \ No newline at end of file -- cgit v1.2.3 From 1e38f5941625b4b45bd56169e4741471817a881a Mon Sep 17 00:00:00 2001 From: korgoth1 Date: Sat, 7 Dec 2019 23:46:50 +0300 Subject: [Test] SPF for relay --- test/functional/cases/340_surbl.robot | 3 +++ test/functional/messages/url10.eml | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 test/functional/messages/url10.eml diff --git a/test/functional/cases/340_surbl.robot b/test/functional/cases/340_surbl.robot index 5137223bf..71bd4285a 100644 --- a/test/functional/cases/340_surbl.robot +++ b/test/functional/cases/340_surbl.robot @@ -141,6 +141,9 @@ 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 *** Keywords *** Surbl Setup 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 + + \ No newline at end of file -- cgit v1.2.3 From 1d0c3ae0ace2f6f4313e05cf4297e81e09df9cd2 Mon Sep 17 00:00:00 2001 From: korgoth1 Date: Sat, 7 Dec 2019 23:48:27 +0300 Subject: [Test] SURBL html entity­ --- test/functional/cases/340_surbl.robot | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/cases/340_surbl.robot b/test/functional/cases/340_surbl.robot index 71bd4285a..8d62c1698 100644 --- a/test/functional/cases/340_surbl.robot +++ b/test/functional/cases/340_surbl.robot @@ -144,6 +144,7 @@ SURBL IDN Punycode domain 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 -- cgit v1.2.3