commit ff54769: [Test] URL compose map

korgoth1 vladislav.stakhov at gmail.com
Tue Mar 3 22:15:12 UTC 2020


Author: korgoth1
Date: 2020-02-28 20:52:45 +0300
URL: https://github.com/rspamd/rspamd/commit/ff5476957ac106ac44d73f30c5d13935370b7048

[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(-)

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


More information about the Commits mailing list