]> source.dussan.org Git - rspamd.git/commitdiff
test uribll in image
authorkorgoth1 <vladislav.stakhov@gmail.com>
Fri, 30 Aug 2019 13:34:49 +0000 (16:34 +0300)
committerkorgoth1 <vladislav.stakhov@gmail.com>
Fri, 30 Aug 2019 13:34:49 +0000 (16:34 +0300)
test/functional/cases/210_clickhouse/clickhouse.pyc [new file with mode: 0644]
test/functional/cases/340_surbl.robot
test/functional/configs/surbl.conf
test/functional/messages/urlimage.eml [new file with mode: 0644]
test/functional/util/dummy_killer.pyc [new file with mode: 0644]

diff --git a/test/functional/cases/210_clickhouse/clickhouse.pyc b/test/functional/cases/210_clickhouse/clickhouse.pyc
new file mode 100644 (file)
index 0000000..e2b7d5f
Binary files /dev/null and b/test/functional/cases/210_clickhouse/clickhouse.pyc differ
index d5391af07dd53d44783646004fc8eb12f11a4e66..a533afdf50a4d7a482c7f0188bb8aa20db8e5578 100644 (file)
@@ -52,6 +52,14 @@ SURBL Example.ru ZEN domain
   Should Not Contain  ${result.stdout}  DBL_PHISH (
   Should Not Contain  ${result.stdout}  URIBL_BLACK (
 
+SURBL Example.com domain image false
+  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/urlimage.eml
+  Should Contain  ${result.stdout}  RSPAMD_URIBL_IMAGES
+  Should Not Contain  ${result.stdout}  DBL_SPAM (
+  Should Not Contain  ${result.stdout}  RSPAMD_URIBL (
+  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
index 85074955c409bee524e8431342b8650b898d19ab..967c170ae2727930a1fa43122c86baa1ecc63a1c 100644 (file)
@@ -5,6 +5,7 @@ surbl {
       suffix = "test.uribl";
       check_dkim = true;
       check_emails = true;
+      images = false;
       process_script =<<EOD
 function(url, suffix)
   local cr = require "rspamd_cryptobox_hash"
@@ -50,5 +51,18 @@ EOD;
         URIBL_DROP = "127.0.0.9";
       }
     }
+    "RSPAMD_URIBL_IMAGES" {
+      suffix = "test.uribl";
+      check_dkim = true;
+      check_emails = true;
+      images = true;
+      process_script =<<EOD
+  function(url, suffix)
+    local cr = require "rspamd_cryptobox_hash"
+    local h = cr.create(url):base32():sub(1, 32)
+    return string.format("%s.%s", h, suffix)
+end
+EOD;
+    }
   }
 }
\ No newline at end of file
diff --git a/test/functional/messages/urlimage.eml b/test/functional/messages/urlimage.eml
new file mode 100644 (file)
index 0000000..6ae7088
--- /dev/null
@@ -0,0 +1,5 @@
+Content-Type: text/html
+
+helo
+<body text="#000000" bgcolor="#FFFFFF">
+    <p><img src="https://example.com" alt=""moz-do-not-send="false" width="326" height="326" border="0"></a></p>
diff --git a/test/functional/util/dummy_killer.pyc b/test/functional/util/dummy_killer.pyc
new file mode 100644 (file)
index 0000000..55e7bac
Binary files /dev/null and b/test/functional/util/dummy_killer.pyc differ