From ff5476957ac106ac44d73f30c5d13935370b7048 Mon Sep 17 00:00:00 2001 From: korgoth1 Date: Fri, 28 Feb 2020 20:52:45 +0300 Subject: [PATCH] [Test] URL compose map --- test/functional/cases/340_surbl.robot | 9 ++++++++- test/functional/configs/maps/url_compose_map.list | 1 + test/functional/configs/plugins.conf | 5 +++++ test/functional/configs/surbl.conf | 12 ++++++++++-- test/functional/messages/url11.eml | 3 +++ 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 test/functional/configs/maps/url_compose_map.list create mode 100644 test/functional/messages/url11.eml diff --git a/test/functional/cases/340_surbl.robot b/test/functional/cases/340_surbl.robot index 8c7fcc3c1..092495d38 100644 --- a/test/functional/cases/340_surbl.robot +++ b/test/functional/cases/340_surbl.robot @@ -147,10 +147,17 @@ SURBL IDN Punycode domain Should Not Contain ${result.stdout} DBL_PHISH Should Not Contain ${result.stdout} URIBL_BLACK -SURBL html entity ­ +SURBL html entity­ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url10.eml Should Contain ${result.stdout} RSPAMD_URIBL +SURBL url compose map + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url11.eml + Should Contain ${result.stdout} RSPAMD_URIBL + Should Contain ${result.stdout} DBL_SPAM + Should Not Contain ${result.stdout} DBL_PHISH + Should Not Contain ${result.stdout} URIBL_BLACK + *** Keywords *** Surbl Setup ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/surbl.conf diff --git a/test/functional/configs/maps/url_compose_map.list b/test/functional/configs/maps/url_compose_map.list new file mode 100644 index 000000000..da65ffb0f --- /dev/null +++ b/test/functional/configs/maps/url_compose_map.list @@ -0,0 +1 @@ +*.dirty.sanchez.com \ No newline at end of file diff --git a/test/functional/configs/plugins.conf b/test/functional/configs/plugins.conf index 025f6c55f..17f004843 100644 --- a/test/functional/configs/plugins.conf +++ b/test/functional/configs/plugins.conf @@ -665,6 +665,11 @@ options = { type = a; replies = ["127.0.0.3"]; }, + { + name = "very.dirty.sanchez.com.test7.uribl"; + type = a; + replies = ["127.0.0.2"]; + }, # TODO: add IPv6 tests ]; } diff --git a/test/functional/configs/surbl.conf b/test/functional/configs/surbl.conf index 1ebf2d97f..764d5edd8 100644 --- a/test/functional/configs/surbl.conf +++ b/test/functional/configs/surbl.conf @@ -1,7 +1,10 @@ surbl { "whitelist" = [ "rspamd-test.com" - ] + ]; + "url_compose_map" = [ + "${TESTDIR}/configs/maps/url_compose_map.list", + ]; rules { "RSPAMD_URIBL" { suffix = "test.uribl"; @@ -64,7 +67,12 @@ EOD; end EOD; } - + "BAD_SUBDOMAIN" { + suffix = "test7.uribl"; + check_dkim = true; + check_emails = false; + images = true; + } } } diff --git a/test/functional/messages/url11.eml b/test/functional/messages/url11.eml new file mode 100644 index 000000000..a757d0177 --- /dev/null +++ b/test/functional/messages/url11.eml @@ -0,0 +1,3 @@ +Content-Type: text/plain + +http://very.dirty.sanchez.com -- 2.39.5