Skip to content

Commit

Permalink
Merge pull request #3179 from korgoth1/master
Browse files Browse the repository at this point in the history
[Test] SPF for external relay
  • Loading branch information
vstakhov committed Dec 7, 2019
2 parents f6f3c2d + 1d0c3ae commit ba501e2
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 2 deletions.
4 changes: 4 additions & 0 deletions test/functional/cases/117_spf.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/functional/cases/340_surbl.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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 &shy
${result} = Scan Message With Rspamc ${TESTDIR}/messages/url10.eml
Should Contain ${result.stdout} RSPAMD_URIBL
Should Contain ${result.stdout} DBL_SPAM

*** Keywords ***
Surbl Setup
Expand Down
4 changes: 3 additions & 1 deletion test/functional/configs/dmarc.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
dmarc { }
spf { }
spf {
external_relay = 192.168.1.1;
}
10 changes: 10 additions & 0 deletions test/functional/configs/plugins.conf
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@ options = {
type = "txt";
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";
Expand Down
1 change: 0 additions & 1 deletion test/functional/configs/spf.conf

This file was deleted.

16 changes: 16 additions & 0 deletions test/functional/messages/external_relay.eml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions test/functional/messages/url10.eml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<a href="https:/\test&shy;test.&shy;com/redirect?url=https%3A%2F%2Fexample%2Ecom&amp;urlhash=rH0t#100xp@example.com">

0 comments on commit ba501e2

Please sign in to comment.