From: Vsevolod Stakhov Date: Fri, 6 Feb 2026 18:16:03 +0000 (+0000) Subject: [Test] Add MIME_HTML_ONLY test for multipart/mixed with html and non-text attachment X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=229aa9ba73ffa9cee1f2f494aa8ed27bdde96737;p=thirdparty%2Frspamd.git [Test] Add MIME_HTML_ONLY test for multipart/mixed with html and non-text attachment Add test case for multipart/mixed containing text/html + application/zip to ensure MIME_HTML_ONLY fires when HTML is the only text part alongside a non-text attachment. --- diff --git a/test/functional/cases/001_merged/100_general.robot b/test/functional/cases/001_merged/100_general.robot index 6b5dbd0b55..4552f41674 100644 --- a/test/functional/cases/001_merged/100_general.robot +++ b/test/functional/cases/001_merged/100_general.robot @@ -9,6 +9,7 @@ ${ALT_RELATED} ${RSPAMD_TESTDIR}/messages/alternative-related.eml ${MIXED_RELATED_HTML} ${RSPAMD_TESTDIR}/messages/mixed-related-html-only.eml ${ALT_NESTED_RFC822} ${RSPAMD_TESTDIR}/messages/alternative-nested-rfc822.eml ${ALT_EMPTY_RELATED} ${RSPAMD_TESTDIR}/messages/alternative-empty-related.eml +${MIXED_HTML_ZIP} ${RSPAMD_TESTDIR}/messages/mixed-html-zip.eml ${SETTINGS_NOSYMBOLS} {symbols_enabled = []} *** Test Cases *** @@ -88,3 +89,8 @@ HTML ONLY - malformed related with no children Scan File ${ALT_EMPTY_RELATED} ... Settings={symbols_enabled = [MIME_HTML_ONLY]} Expect Symbol MIME_HTML_ONLY + +HTML ONLY - multipart/mixed with html and non-text attachment + Scan File ${MIXED_HTML_ZIP} + ... Settings={symbols_enabled = [MIME_HTML_ONLY]} + Expect Symbol MIME_HTML_ONLY diff --git a/test/functional/messages/mixed-html-zip.eml b/test/functional/messages/mixed-html-zip.eml new file mode 100644 index 0000000000..7d137367bb --- /dev/null +++ b/test/functional/messages/mixed-html-zip.eml @@ -0,0 +1,24 @@ +Return-Path: test@test.com +From: TEST +To: Me +Subject: multipart/mixed with html and zip attachment +MIME-Version: 1.0 +Date: Mon, 01 Jan 2024 00:00:00 +0000 +Message-ID: +Content-Type: multipart/mixed; boundary="a3f1e7d94b2c80569e1f3a7d6c4b2e8f" + +--a3f1e7d94b2c80569e1f3a7d6c4b2e8f +Content-Type: text/html + + + +

This is an HTML-only message with a zip attachment.

+Click here + + + +--a3f1e7d94b2c80569e1f3a7d6c4b2e8f +Content-Type: application/zip; name="ComplaintLetter_1508658544.zip" + +UEsDBBQAAAAIAGRlZmF1bHQAAAAAAAAAAAAAAAALABAAZHVtbXkudHh0VVgMAGR1bW15 +--a3f1e7d94b2c80569e1f3a7d6c4b2e8f--