]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Add a simple multimap utf test
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 31 Jul 2016 11:44:58 +0000 (12:44 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 31 Jul 2016 11:44:58 +0000 (12:44 +0100)
test/functional/cases/102_maps.robot
test/functional/configs/maps.conf
test/functional/configs/maps/utf.list [new file with mode: 0644]
test/functional/messages/utf.eml [new file with mode: 0644]

index e391af99cb91b845c27fda9713d75bbdc37248b6..4744335f8af05aa6d85892ed8d9961995abbb4ba 100644 (file)
@@ -8,6 +8,7 @@ Variables       ${TESTDIR}/lib/vars.py
 *** Variables ***
 ${CONFIG}       ${TESTDIR}/configs/maps.conf
 ${MESSAGE}      ${TESTDIR}/messages/spam_message.eml
+${UTF_MESSAGE}      ${TESTDIR}/messages/utf.eml
 ${RSPAMD_SCOPE}  Suite
 
 *** Test Cases ***
@@ -88,3 +89,11 @@ MAP - MULSYM SYMBOL MISS
 MAP - MULSYM SYMBOL + SCORE
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --rcpt  user5@example.com
   Check Rspamc  ${result}  SYM1 (-10.0
+
+MAP - UTF
+  ${result} =  Scan Message With Rspamc  ${UTF_MESSAGE}
+  Check Rspamc  ${result}  HEADER_MAP
+
+MAP - UTF MISS
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}
+  Check Rspamc  ${result}  HEADER_MAP  inverse=1  rc_nocheck=1
\ No newline at end of file
index 63c195c5da4c99823465f150f113f43070278ad7..0817dd7cfcba80befed02fc05dcb13fdc5cc6714 100644 (file)
@@ -62,4 +62,11 @@ multimap {
     symbols = ["SYM1"];
     map = "${TESTDIR}/configs/maps/multiple.list";
   }
+  HEADER_MAP {
+    type = "header";
+    header = "To";
+    filter = "email:name";
+    map = "${TESTDIR}/configs/maps/utf.list";
+    regexp = true;
+  }
 }
diff --git a/test/functional/configs/maps/utf.list b/test/functional/configs/maps/utf.list
new file mode 100644 (file)
index 0000000..5c345cb
--- /dev/null
@@ -0,0 +1 @@
+/Васисуал/iU
diff --git a/test/functional/messages/utf.eml b/test/functional/messages/utf.eml
new file mode 100644 (file)
index 0000000..93513cc
--- /dev/null
@@ -0,0 +1,15 @@
+To: =?UTF-8?B?0JLQsNGB0LjRgdGD0LDQu9C40Lkg0JXQstC70LDQvNC/0LjQtdCy0LjRhw==?=
+ <xxx@example.com>
+From: ZZZ <yy@example.com>
+Subject: Hello
+Message-ID: <f13bcdad-273b-9a44-6209-cb1631c01dca@example.com>
+Date: Sun, 31 Jul 2016 11:40:08 +0100
+User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0)
+ Gecko/20100101 Thunderbird/45.2.0
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 7bit
+
+
+--
+ZZZ