diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-03-11 19:50:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 19:50:21 +0000 |
commit | 12d5f4a6ec4798d5e91cc81ef2db605d8a0ab855 (patch) | |
tree | f2616fb3b70898c85a920d829ad45b0eb063180c | |
parent | 716642909eb6cb263d9559f1f744192ac3b94af9 (diff) | |
parent | c8e7d65b3970f106152bbcfbc8d5a2cf56a97f5e (diff) | |
download | rspamd-12d5f4a6ec4798d5e91cc81ef2db605d8a0ab855.tar.gz rspamd-12d5f4a6ec4798d5e91cc81ef2db605d8a0ab855.zip |
Merge pull request #3298 from korgoth1/master
[Test] URL compose map
-rw-r--r-- | test/functional/cases/300_rbl.robot | 13 | ||||
-rw-r--r-- | test/functional/cases/340_surbl.robot | 12 | ||||
-rw-r--r-- | test/functional/configs/maps/url_compose_map.list | 3 | ||||
-rw-r--r-- | test/functional/configs/maps/url_compose_map_for_mails.list | 4 | ||||
-rw-r--r-- | test/functional/configs/plugins.conf | 30 | ||||
-rw-r--r-- | test/functional/configs/rbl.conf | 9 | ||||
-rw-r--r-- | test/functional/configs/surbl.conf | 6 | ||||
-rw-r--r-- | test/functional/messages/url11.eml | 3 | ||||
-rw-r--r-- | test/functional/messages/url12.eml | 1 | ||||
-rw-r--r-- | test/functional/messages/url13.eml | 4 | ||||
-rw-r--r-- | test/functional/messages/url14.eml | 4 | ||||
-rw-r--r-- | test/functional/messages/url15.eml | 3 | ||||
-rw-r--r-- | test/functional/messages/url16.eml | 5 |
13 files changed, 85 insertions, 12 deletions
diff --git a/test/functional/cases/300_rbl.robot b/test/functional/cases/300_rbl.robot index 8ac96915e..ef858558c 100644 --- a/test/functional/cases/300_rbl.robot +++ b/test/functional/cases/300_rbl.robot @@ -36,6 +36,19 @@ RBL FROM HIT WL ${result} = Scan Message With Rspamc ${MESSAGE} -i 4.3.2.4 Check Rspamc ${result} FAKE_RBL_CODE_2 inverse=True +EMAILBL Compose Map 1 + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url14.eml + Should Contain ${result.stdout} RSPAMD_EMAILBL (0.00)[dirty.sanchez.com:email] + +EMAILBL Compose Map 2 + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url15.eml + Should Contain ${result.stdout} RSPAMD_EMAILBL (0.00)[very.dirty.sanchez.com:email] + +EMAILBL Compose Map 3 + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url16.eml + Should Contain ${result.stdout} RSPAMD_EMAILBL (0.00)[41.black.sanchez.com:email] + + *** Keywords *** Rbl Setup ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/rbl.conf diff --git a/test/functional/cases/340_surbl.robot b/test/functional/cases/340_surbl.robot index 68088ed45..ab89b9def 100644 --- a/test/functional/cases/340_surbl.robot +++ b/test/functional/cases/340_surbl.robot @@ -151,9 +151,17 @@ SURBL html entity­ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url10.eml Should Contain ${result.stdout} RSPAMD_URIBL -SURBL url compose map +SURBL url compose map 1 ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url11.eml - Should Contain ${result.stdout} BAD_SUBDOMAIN (0.00)[4.very.dirty.sanchez.com:url, clean.dirty.sanchez.com:url] + Should Contain ${result.stdout} BAD_SUBDOMAIN (0.00)[clean.dirty.sanchez.com:url] + +SURBL url compose map 2 + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url12.eml + Should Contain ${result.stdout} BAD_SUBDOMAIN (0.00)[4.very.dirty.sanchez.com:url] + +SURBL url compose map 3 + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url13.eml + Should Contain ${result.stdout} BAD_SUBDOMAIN (0.00)[41.black.sanchez.com:url] *** Keywords *** Surbl Setup diff --git a/test/functional/configs/maps/url_compose_map.list b/test/functional/configs/maps/url_compose_map.list index 06868b288..808c455ca 100644 --- a/test/functional/configs/maps/url_compose_map.list +++ b/test/functional/configs/maps/url_compose_map.list @@ -1,2 +1,3 @@ *.dirty.sanchez.com -!not.dirty.sanchez.com
\ No newline at end of file +!not.dirty.sanchez.com +41.black.sanchez.com
\ No newline at end of file diff --git a/test/functional/configs/maps/url_compose_map_for_mails.list b/test/functional/configs/maps/url_compose_map_for_mails.list index 2abdc5e32..1d54a3e2a 100644 --- a/test/functional/configs/maps/url_compose_map_for_mails.list +++ b/test/functional/configs/maps/url_compose_map_for_mails.list @@ -1 +1,3 @@ -!very.clean.exclude.com
\ No newline at end of file +*.dirty.sanchez.com +!admin.dirty.sanchez.com +41.black.sanchez.com
\ No newline at end of file diff --git a/test/functional/configs/plugins.conf b/test/functional/configs/plugins.conf index 47f2c9918..e74ddd73d 100644 --- a/test/functional/configs/plugins.conf +++ b/test/functional/configs/plugins.conf @@ -680,6 +680,36 @@ options = { type = a; replies = ["127.0.0.2"]; }, + { + name = "41.black.sanchez.com.test7.uribl"; + type = a; + replies = ["127.0.0.2"]; + }, + { + name = "black.sanchez.com.test7.uribl"; + type = a; + replies = ["127.0.0.2"]; + }, + { + name = "dirty.sanchez.com.test8.uribl"; + type = a; + replies = ["127.0.0.2"]; + }, + { + name = "very.dirty.sanchez.com.test8.uribl"; + type = a; + replies = ["127.0.0.2"]; + }, + { + name = "41.black.sanchez.com.test8.uribl"; + type = a; + replies = ["127.0.0.2"]; + }, + { + name = "black.sanchez.com.test8.uribl"; + type = a; + replies = ["127.0.0.2"]; + }, # TODO: add IPv6 tests ]; } diff --git a/test/functional/configs/rbl.conf b/test/functional/configs/rbl.conf index 4a9318a0a..da5c59b53 100644 --- a/test/functional/configs/rbl.conf +++ b/test/functional/configs/rbl.conf @@ -31,5 +31,14 @@ rbl { "FAKE_WL_RBL_CODE_3" = "127.0.0.3"; } } + RSPAMD_EMAILBL { + rbl = "test8.uribl"; + url_compose_map = "${TESTDIR}/configs/maps/url_compose_map_for_mails.list"; + emails = true; + emails_domainonly = true + returncodes = { + RSPAMD_EMAILBL = "127.0.0.2"; + } + } } }
\ No newline at end of file diff --git a/test/functional/configs/surbl.conf b/test/functional/configs/surbl.conf index a2565784e..6e3a40e18 100644 --- a/test/functional/configs/surbl.conf +++ b/test/functional/configs/surbl.conf @@ -70,12 +70,6 @@ EOD; check_dkim = true; check_emails = false; } - "BAD_SUBDOMAIN_IN_MAIL" { - suffix = "test8.uribl"; - url_compose_map = "${TESTDIR}/configs/maps/url_compose_map_for_mails.list"; - check_dkim = true; - check_emails = true; - } } } diff --git a/test/functional/messages/url11.eml b/test/functional/messages/url11.eml index 0b19c5eee..82ddbf77d 100644 --- a/test/functional/messages/url11.eml +++ b/test/functional/messages/url11.eml @@ -1,5 +1,4 @@ Content-Type: text/plain http://clean.dirty.sanchez.com -http://not.dirty.sanchez.com -http://4.very.dirty.sanchez.com
\ No newline at end of file +http://not.dirty.sanchez.com
\ No newline at end of file diff --git a/test/functional/messages/url12.eml b/test/functional/messages/url12.eml index b8467f680..75e8ecc51 100644 --- a/test/functional/messages/url12.eml +++ b/test/functional/messages/url12.eml @@ -1,3 +1,4 @@ Content-Type: text/plain +http://4.very.dirty.sanchez.com http://not.dirty.sanchez.com
\ No newline at end of file diff --git a/test/functional/messages/url13.eml b/test/functional/messages/url13.eml new file mode 100644 index 000000000..f73c9651f --- /dev/null +++ b/test/functional/messages/url13.eml @@ -0,0 +1,4 @@ +Content-Type: text/plain + +http://41.black.sanchez.com +http://black.sanchez.com
\ No newline at end of file diff --git a/test/functional/messages/url14.eml b/test/functional/messages/url14.eml new file mode 100644 index 000000000..32632da4a --- /dev/null +++ b/test/functional/messages/url14.eml @@ -0,0 +1,4 @@ +Content-Type: text/plain + +user@dirty.sanchez.com +user@admin.dirty.sanchez.com
\ No newline at end of file diff --git a/test/functional/messages/url15.eml b/test/functional/messages/url15.eml new file mode 100644 index 000000000..1240979af --- /dev/null +++ b/test/functional/messages/url15.eml @@ -0,0 +1,3 @@ +Content-Type: text/plain + +4@very.dirty.sanchez.com
\ No newline at end of file diff --git a/test/functional/messages/url16.eml b/test/functional/messages/url16.eml new file mode 100644 index 000000000..0dbe8079a --- /dev/null +++ b/test/functional/messages/url16.eml @@ -0,0 +1,5 @@ +Content-Type: text/plain + +test@admin.dirty.sanchez.com +admin@41.black.sanchez.com +admin@black.sanchez.com
\ No newline at end of file |