]> source.dussan.org Git - rspamd.git/commitdiff
[Test] URL compose map 3281/head
authorkorgoth1 <vladislav.stakhov@gmail.com>
Sat, 29 Feb 2020 11:52:27 +0000 (14:52 +0300)
committerkorgoth1 <vladislav.stakhov@gmail.com>
Sat, 29 Feb 2020 11:52:27 +0000 (14:52 +0300)
test/functional/cases/340_surbl.robot
test/functional/configs/maps/url_compose_map.list
test/functional/configs/maps/url_compose_map_for_mails.list [new file with mode: 0644]
test/functional/configs/plugins.conf
test/functional/configs/surbl.conf
test/functional/messages/url11.eml
test/functional/messages/url12.eml [new file with mode: 0644]

index 092495d38c21f98e04ebbacad095ad73c0bc0c58..81e30de1dff97b8ae6462b93e8d9038232cf86e9 100644 (file)
@@ -104,21 +104,21 @@ WHITELIST
   Should Not Contain  ${result.stdout}  DBL_SPAM (
   Should Not Contain  ${result.stdout}  RSPAMD_URIBL_IMAGES (
 
-EMAILBL full adress & domain only
+EMAILBL full address & domain only
   ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/emailbltext.eml
   Should Contain  ${result.stdout}  RSPAMD_EMAILBL_FULL (
   Should Contain  ${result.stdout}  RSPAMD_EMAILBL_DOMAINONLY (
 
-EMAILBL full subdomain adress
+EMAILBL full subdomain address
   ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/emailbltext2.eml
   Should Contain  ${result.stdout}  RSPAMD_EMAILBL_FULL (
 
-EMAILBL full subdomain adress & domain only
+EMAILBL full subdomain address & domain only
   ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/emailbltext3.eml
   Should Contain  ${result.stdout}  RSPAMD_EMAILBL_DOMAINONLY (0.00)[baddomain.com:email]
   Should Contain  ${result.stdout}  RSPAMD_EMAILBL_FULL (0.00)[user.subdomain.baddomain.com:email]
 
-EMAILBL REPLY TO full adress
+EMAILBL REPLY TO full address
   ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/replyto.eml
   Should Contain  ${result.stdout}  RSPAMD_EMAILBL_FULL (
   Should Not Contain  ${result.stdout}  RSPAMD_EMAILBL_DOMAINONLY (
@@ -128,7 +128,7 @@ EMAILBL REPLY TO domain only
   Should Contain  ${result.stdout}  RSPAMD_EMAILBL_DOMAINONLY (
   Should Not Contain  ${result.stdout}  RSPAMD_EMAILBL_FULL (
 
-EMAILBL REPLY TO full subdomain adress
+EMAILBL REPLY TO full subdomain address
   ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/replytosubdomain.eml
   Should Contain  ${result.stdout}  RSPAMD_EMAILBL_FULL (
   Should Not Contain  ${result.stdout}  RSPAMD_EMAILBL_DOMAINONLY (
@@ -153,10 +153,8 @@ SURBL html entity&shy
 
 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
+  Should Contain  ${result.stdout}  BAD_SUBDOMAIN (0.00)[very.dirty.sanchez.com:url]
+  Should Not Contain  ${result.stdout}  not.dirty.sanchez.com
 
 *** Keywords ***
 Surbl Setup
index da65ffb0f46b059a2175a0043d6f7040eeaeec4e..06868b288c6b79f496b2e9cb052ef73284029796 100644 (file)
@@ -1 +1,2 @@
-*.dirty.sanchez.com
\ No newline at end of file
+*.dirty.sanchez.com
+!not.dirty.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
new file mode 100644 (file)
index 0000000..2abdc5e
--- /dev/null
@@ -0,0 +1 @@
+!very.clean.exclude.com
\ No newline at end of file
index 17f0048434d5d3156f345a7e38d664ba2660f8a3..817b5e4db49e3fba5aa039d891e6a9dc316058bc 100644 (file)
@@ -670,6 +670,16 @@ options = {
           type = a;
           replies = ["127.0.0.2"];
         },
+        {
+          name = "clean.dirty.sanchez.com.test7.uribl";
+          type = a;
+          replies = ["127.0.0.2"];
+        },
+        {
+          name = "not.dirty.sanchez.com.test7.uribl";
+          type = a;
+          replies = ["127.0.0.2"];
+        },
         # TODO: add IPv6 tests
         ];
   }
index 764d5edd87f199465d0f19703fd6335ee2a5f6f0..a2565784e8a3ad55515ebedbb50acb63267a990c 100644 (file)
@@ -2,9 +2,6 @@ surbl {
     "whitelist" = [
     "rspamd-test.com"
   ];
-    "url_compose_map" = [
-    "${TESTDIR}/configs/maps/url_compose_map.list",
-    ];
   rules {
     "RSPAMD_URIBL" {
       suffix = "test.uribl";
@@ -69,9 +66,15 @@ EOD;
     }
     "BAD_SUBDOMAIN" {
       suffix = "test7.uribl";
+      url_compose_map = "${TESTDIR}/configs/maps/url_compose_map.list";
       check_dkim = true;
       check_emails = false;
-      images = true;
+    }
+    "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;
     }
   }
 }
index a757d01776d7776e49c157d8d0fffed87e36c75b..82ddbf77d6de1b2e2d0f6ece7a41a3f62a46030e 100644 (file)
@@ -1,3 +1,4 @@
 Content-Type: text/plain
 
-http://very.dirty.sanchez.com
+http://clean.dirty.sanchez.com
+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
new file mode 100644 (file)
index 0000000..b8467f6
--- /dev/null
@@ -0,0 +1,3 @@
+Content-Type: text/plain
+
+http://not.dirty.sanchez.com
\ No newline at end of file