summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-31 12:44:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-31 12:44:58 +0100
commit7788d8eb1d85d33e478af3cdd0249116481e69f9 (patch)
treeeef05fcee9aa0841777e399140e8ea714e037ea5 /test
parent355f5390ab93fa40edf8df0aacc679348d42e9ba (diff)
downloadrspamd-7788d8eb1d85d33e478af3cdd0249116481e69f9.tar.gz
rspamd-7788d8eb1d85d33e478af3cdd0249116481e69f9.zip
[Test] Add a simple multimap utf test
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/102_maps.robot9
-rw-r--r--test/functional/configs/maps.conf7
-rw-r--r--test/functional/configs/maps/utf.list1
-rw-r--r--test/functional/messages/utf.eml15
4 files changed, 32 insertions, 0 deletions
diff --git a/test/functional/cases/102_maps.robot b/test/functional/cases/102_maps.robot
index e391af99c..4744335f8 100644
--- a/test/functional/cases/102_maps.robot
+++ b/test/functional/cases/102_maps.robot
@@ -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
diff --git a/test/functional/configs/maps.conf b/test/functional/configs/maps.conf
index 63c195c5d..0817dd7cf 100644
--- a/test/functional/configs/maps.conf
+++ b/test/functional/configs/maps.conf
@@ -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
index 000000000..5c345cb21
--- /dev/null
+++ b/test/functional/configs/maps/utf.list
@@ -0,0 +1 @@
+/Васисуал/iU
diff --git a/test/functional/messages/utf.eml b/test/functional/messages/utf.eml
new file mode 100644
index 000000000..93513cc4c
--- /dev/null
+++ b/test/functional/messages/utf.eml
@@ -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