diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-11-27 15:29:17 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-11-27 15:29:17 +0000 |
commit | dda2df85a29ebf8db1836ecc8f31c5143d827c0d (patch) | |
tree | 3705b0ceec4a695b3c8ddc0aa1e973dc238e702a | |
parent | 6f0693ceaebf44f80127e041bd4fbff48045c93c (diff) | |
download | rspamd-dda2df85a29ebf8db1836ecc8f31c5143d827c0d.tar.gz rspamd-dda2df85a29ebf8db1836ecc8f31c5143d827c0d.zip |
[Test] Add tests for broken richtext case
-rw-r--r-- | test/functional/cases/280_rules.robot | 5 | ||||
-rw-r--r-- | test/functional/messages/broken_richtext.eml | 27 |
2 files changed, 32 insertions, 0 deletions
diff --git a/test/functional/cases/280_rules.robot b/test/functional/cases/280_rules.robot index 36dc4d63d..bb2012237 100644 --- a/test/functional/cases/280_rules.robot +++ b/test/functional/cases/280_rules.robot @@ -10,6 +10,7 @@ ${CONFIG} ${TESTDIR}/configs/plugins.conf ${MESSAGE1} ${TESTDIR}/messages/fws_fn.eml ${MESSAGE2} ${TESTDIR}/messages/fws_fp.eml ${MESSAGE3} ${TESTDIR}/messages/fws_tp.eml +${MESSAGE4} ${TESTDIR}/messages/broken_richtext.eml ${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat ${RSPAMD_SCOPE} Test @@ -29,6 +30,10 @@ Issue 2349 ${result} = Scan Message With Rspamc ${MESSAGE2} Check Rspamc ${result} MULTIPLE_UNIQUE_HEADERS inverse=1 +Broken Rich Text + ${result} = Scan Message With Rspamc ${MESSAGE4} + Check Rspamc ${result} BROKEN_CONTENT_TYPE + *** Keywords *** Rules Setup ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/regexp.conf diff --git a/test/functional/messages/broken_richtext.eml b/test/functional/messages/broken_richtext.eml new file mode 100644 index 000000000..e4786c104 --- /dev/null +++ b/test/functional/messages/broken_richtext.eml @@ -0,0 +1,27 @@ +From: user@example.com
+Message-ID: <XXX@yyy>
+MIME-Version: 1.0
+To: user@example.com
+Subject: Hi
+Content-Type: multipart/mixed; boundary=
+ "xxx"
+
+
+--xxx
+Content-Type: text/plain
+Content-Transfer-Encoding: 7bit
+
+Hi
+
+--xxx
+Content-Type: text/richtext
+Content-Description: eicar.zip
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment; filename="eicar.zip"
+
+UEsDBAoAAAAAAOCYuCg8z1FoRAAAAEQAAAAJAAAAZWljYXIuY29tWDVPIVAlQEFQ
+WzRcUFpYNTQoUF4pN0NDKTd9JEVJQ0FSLVNUQU5EQVJELUFOVElWSVJVUy1URVNU
+LUZJTEUhJEgrSCpQSwECFAAKAAAAAADgmLgoPM9RaEQAAABEAAAACQAAAAAAAAAB
+ACAA/4EAAAAAZWljYXIuY29tUEsFBgAAAAABAAEANwAAAGsAAAAAAA==
+
+--xxx--
|