From 7788d8eb1d85d33e478af3cdd0249116481e69f9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 31 Jul 2016 12:44:58 +0100 Subject: [PATCH] [Test] Add a simple multimap utf test --- test/functional/cases/102_maps.robot | 9 +++++++++ test/functional/configs/maps.conf | 7 +++++++ test/functional/configs/maps/utf.list | 1 + test/functional/messages/utf.eml | 15 +++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 test/functional/configs/maps/utf.list create mode 100644 test/functional/messages/utf.eml 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==?= + +From: ZZZ +Subject: Hello +Message-ID: +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 -- 2.39.5