aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-29 20:04:22 +0100
committerGitHub <noreply@github.com>2019-09-29 20:04:22 +0100
commiteeedd37dc3190c79ce00f46c972173fafe32da2d (patch)
tree0bb266305c504c2a8031dc82f3442bb9371ff0fd
parent916a45c6f97ae530a856143390abc602ad9b4d5e (diff)
parentefce7305fe145c2d7de7857cbe9e45c49d4bc4d7 (diff)
downloadrspamd-eeedd37dc3190c79ce00f46c972173fafe32da2d.tar.gz
rspamd-eeedd37dc3190c79ce00f46c972173fafe32da2d.zip
Merge pull request #3059 from korgoth1/master
[Test] Bad boundary+FreemailCC
-rw-r--r--test/functional/cases/102_multimap.robot5
-rw-r--r--test/functional/cases/280_rules.robot5
-rw-r--r--test/functional/configs/maps/domains.list.214
-rw-r--r--test/functional/configs/multimap.conf6
-rw-r--r--test/functional/messages/badboundary.eml17
-rw-r--r--test/functional/messages/freemailcc.eml10
6 files changed, 57 insertions, 0 deletions
diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot
index 594faf0b6..b495b5394 100644
--- a/test/functional/cases/102_multimap.robot
+++ b/test/functional/cases/102_multimap.robot
@@ -21,6 +21,7 @@ ${URL3} ${TESTDIR}/messages/url3.eml
${URL4} ${TESTDIR}/messages/url4.eml
${URL5} ${TESTDIR}/messages/url5.eml
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${FREEMAIL_CC} ${TESTDIR}/messages/freemailcc.eml
*** Test Cases ***
MAP - DNSBL HIT
@@ -321,6 +322,10 @@ RCVD_AUTHED_TWO HIT / RCVD_AUTHED_ONE MISS
Check Rspamc ${result} RCVD_AUTHED_TWO
Should Not Contain ${result.stdout} RCVD_AUTHED_ONE
+FREEMAIL_CC
+ ${result} = Scan Message With Rspamc ${FREEMAIL_CC}
+ Check Rspamc ${result} FREEMAIL_CC (19.00)[test.com, test1.com, test2.com, test3.com, test4.com, test5.com, test6.com, test7.com, test8.com, test9.com, test10.com, test11.com, test12.com, test13.com, test14.com]
+
*** Keywords ***
Multimap Setup
${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/multimap.conf
diff --git a/test/functional/cases/280_rules.robot b/test/functional/cases/280_rules.robot
index d66ecf5d4..882fc7275 100644
--- a/test/functional/cases/280_rules.robot
+++ b/test/functional/cases/280_rules.robot
@@ -12,6 +12,7 @@ ${MESSAGE1} ${TESTDIR}/messages/fws_fn.eml
${MESSAGE2} ${TESTDIR}/messages/fws_fp.eml
${MESSAGE3} ${TESTDIR}/messages/fws_tp.eml
${MESSAGE4} ${TESTDIR}/messages/broken_richtext.eml
+${MESSAGE5} ${TESTDIR}/messages/badboundary.eml
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
${RSPAMD_SCOPE} Test
@@ -40,6 +41,10 @@ Dynamic Config
Check Rspamc ${result} SA_BODY_WORD (10
Check Rspamc ${result} \/ 20
+Broken boundary
+ ${result} = Scan Message With Rspamc ${MESSAGE4}
+ Check Rspamc ${result} BROKEN_CONTENT_TYPE
+
*** Keywords ***
Rules Setup
${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/regexp.conf
diff --git a/test/functional/configs/maps/domains.list.2 b/test/functional/configs/maps/domains.list.2
index 45cd0b2ec..15fb90830 100644
--- a/test/functional/configs/maps/domains.list.2
+++ b/test/functional/configs/maps/domains.list.2
@@ -1,2 +1,16 @@
rspamd-test.com
+test.com
+test2.com
+test3.com
+test4.com
+test5.com
+test6.com
+test7.com
+test8.com
+test9.com
+test10.com
+test11.com
+test12.com
+test13.com
+test14.com
#other.com
diff --git a/test/functional/configs/multimap.conf b/test/functional/configs/multimap.conf
index f003ec96e..804284b11 100644
--- a/test/functional/configs/multimap.conf
+++ b/test/functional/configs/multimap.conf
@@ -18,6 +18,12 @@ multimap {
filter = "email:domain";
map = "${TESTDIR}/configs/maps/domains.list";
}
+ FREEMAIL_CC {
+ type = "header";
+ header = "Cc";
+ filter = "email:domain";
+ map = "${TESTDIR}/configs/maps/domains.list.2";
+ }
REGEXP_MAP {
type = "from";
filter = "email:addr";
diff --git a/test/functional/messages/badboundary.eml b/test/functional/messages/badboundary.eml
new file mode 100644
index 000000000..a298ee9d6
--- /dev/null
+++ b/test/functional/messages/badboundary.eml
@@ -0,0 +1,17 @@
+Content-Type: multipart/mixed; boundary="===============3209040583106423479=="
+MIME-Version: 1.0
+From: test@example.org
+To: test@example.org
+Date: Thu, 26 Sep 2019 15:52:32 -0000
+Subject: Test message
+Message-ID: <156951315267.43830.14912869070271436609@example.org>
+
+--===============3209040583106423479==
+Content-Type: image/gif
+MIME-Version: 1.0
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment; filename="Transparent.gif"
+
+R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
+
+--===============3209040583106423479== \ No newline at end of file
diff --git a/test/functional/messages/freemailcc.eml b/test/functional/messages/freemailcc.eml
new file mode 100644
index 000000000..6926c6e2f
--- /dev/null
+++ b/test/functional/messages/freemailcc.eml
@@ -0,0 +1,10 @@
+Content-Type: multipart/mixed; boundary="===============3209040583106423479=="
+MIME-Version: 1.0
+From: test@example.org
+To: test@example.org
+CC: <testp@test.com>, <testp1@test1.com>, <testp2@test2.com>,<testp3@test3.com>,<testp4@test4.com>,<testp5@test5.com>,<testp6@test6.com>,<testp7@test7.com>,<testp8@test8.com>,<testp9@test9.com>,<testp10@test10.com>,<testp11@test11.com>,<testp12@test12.com>,<testp13@test13.com>,<testp14@test14.com>,<testp15@test.com>,<testp16@test.com>,<testp17@test.com>,<testp18@test.com>,<test19@test.com>
+Date: Thu, 26 Sep 2019 15:52:32 -0000
+Subject: Test message
+Message-ID: <156951315267.43830.14912869070271436609@example.org>
+
+skdjaskdjasd \ No newline at end of file