]> source.dussan.org Git - rspamd.git/commitdiff
[Test] URL compose map
authorkorgoth1 <vladislav.stakhov@gmail.com>
Sat, 29 Feb 2020 19:17:34 +0000 (22:17 +0300)
committerkorgoth1 <vladislav.stakhov@gmail.com>
Sat, 29 Feb 2020 19:17:34 +0000 (22:17 +0300)
13 files changed:
test/functional/cases/300_rbl.robot
test/functional/cases/340_surbl.robot
test/functional/configs/maps/url_compose_map.list
test/functional/configs/maps/url_compose_map_for_mails.list
test/functional/configs/plugins.conf
test/functional/configs/rbl.conf
test/functional/configs/surbl.conf
test/functional/messages/url11.eml
test/functional/messages/url12.eml
test/functional/messages/url13.eml [new file with mode: 0644]
test/functional/messages/url14.eml [new file with mode: 0644]
test/functional/messages/url15.eml [new file with mode: 0644]
test/functional/messages/url16.eml [new file with mode: 0644]

index 8ac96915e34698b5d7dee356d8caa1950c2e4ba3..525786eb74a3309a8fd878b199c689f24733f52b 100644 (file)
@@ -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)[user.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)[4.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
index 68088ed45bc139d2feee7b8e05f98a323abc3def..ab89b9def0cb7ccb96a450acc789bed9c339e097 100644 (file)
@@ -151,9 +151,17 @@ SURBL html entity&shy
   ${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
index 06868b288c6b79f496b2e9cb052ef73284029796..808c455ca9fd39d721eedd44fd40be60b63e17c9 100644 (file)
@@ -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
index 2abdc5e326e7cb29e533632ebc3197c3782ea764..1d54a3e2af450519bbe7e5fa952007e44d15c989 100644 (file)
@@ -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
index 47f2c99182013371cacd1a8350016069173046ab..861b865451df5b68034d61383ec31977bc141240 100644 (file)
@@ -680,6 +680,41 @@ 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 = "user.dirty.sanchez.com.test8.uribl";
+          type = a;
+          replies = ["127.0.0.2"];
+        },
+        {
+          name = "admin.dirty.sanchez.com.test8.uribl";
+          type = a;
+          replies = ["127.0.0.2"];
+        },
+        {
+          name = "4.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
         ];
   }
index 4a9318a0a2322c40a786040a3fadf2ad8e1ad376..e4a57576ecbe5480447353dc35f84d14a0550021 100644 (file)
@@ -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_delimiter = ".";
+      returncodes = {
+        RSPAMD_EMAILBL = "127.0.0.2";
+      }
+    }
   }
 }
\ No newline at end of file
index a2565784e8a3ad55515ebedbb50acb63267a990c..6e3a40e1801123e5afc852233937ed303ee6dad0 100644 (file)
@@ -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;
-    }
   }
 }
 
index 0b19c5eee53e686e9654b4446140cc7c7aff1254..82ddbf77d6de1b2e2d0f6ece7a41a3f62a46030e 100644 (file)
@@ -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
index b8467f6809fef095ce4b7f555f9bebe51c2c146c..75e8ecc515ce319640207d5c33b678e7a33818cf 100644 (file)
@@ -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 (file)
index 0000000..f73c965
--- /dev/null
@@ -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 (file)
index 0000000..42653a6
--- /dev/null
@@ -0,0 +1,4 @@
+Content-Type: text/plain
+
+user@dirty.sanchez.com
+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 (file)
index 0000000..a55521e
--- /dev/null
@@ -0,0 +1,4 @@
+Content-Type: text/plain
+
+4@very.dirty.sanchez.com
+admin@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 (file)
index 0000000..49bd398
--- /dev/null
@@ -0,0 +1,4 @@
+Content-Type: text/plain
+
+41@black.sanchez.com
+black@sanchez.com
\ No newline at end of file