aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkorgoth1 <vladislav.stakhov@gmail.com>2020-02-28 20:52:45 +0300
committerkorgoth1 <vladislav.stakhov@gmail.com>2020-02-28 20:52:45 +0300
commitff5476957ac106ac44d73f30c5d13935370b7048 (patch)
tree78604d3a5c1524e3cf7ed8157e297ba562915cd2 /test
parentca991102df9309af17ea0f5b5d1035b9b41230c1 (diff)
downloadrspamd-ff5476957ac106ac44d73f30c5d13935370b7048.tar.gz
rspamd-ff5476957ac106ac44d73f30c5d13935370b7048.zip
[Test] URL compose map
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/340_surbl.robot9
-rw-r--r--test/functional/configs/maps/url_compose_map.list1
-rw-r--r--test/functional/configs/plugins.conf5
-rw-r--r--test/functional/configs/surbl.conf12
-rw-r--r--test/functional/messages/url11.eml3
5 files changed, 27 insertions, 3 deletions
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 &shy
+SURBL html entity&shy
${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