diff options
author | Andrew Lewis <nerf@judo.za.org> | 2023-08-02 16:35:16 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2023-08-02 16:35:16 +0200 |
commit | 8a1e1ec63cf33e03bc164a7b782dbca33f97d6ab (patch) | |
tree | 10f1a2ba9fff6d227aec37b75d27436bf17dc0ff | |
parent | 8972626aa15dfb41b6bfd98efcde7bbbcddc20e2 (diff) | |
download | rspamd-8a1e1ec63cf33e03bc164a7b782dbca33f97d6ab.tar.gz rspamd-8a1e1ec63cf33e03bc164a7b782dbca33f97d6ab.zip |
[Minor] Test & fix has_only_html_part regression
-rw-r--r-- | src/libmime/mime_expressions.c | 2 | ||||
-rw-r--r-- | test/functional/cases/001_merged/100_general.robot | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c index 88e9e16a1..60cfe7b02 100644 --- a/src/libmime/mime_expressions.c +++ b/src/libmime/mime_expressions.c @@ -1470,8 +1470,6 @@ rspamd_has_only_html_part(struct rspamd_task *task, GArray *args, PTR_ARRAY_FOREACH(MESSAGE_FIELD(task, text_parts), i, p) { - p = g_ptr_array_index(MESSAGE_FIELD(task, text_parts), 0); - if (!IS_TEXT_PART_ATTACHMENT(p)) { if (IS_TEXT_PART_HTML(p)) { cnt_html++; diff --git a/test/functional/cases/001_merged/100_general.robot b/test/functional/cases/001_merged/100_general.robot index b06dd1492..16b9b5f5a 100644 --- a/test/functional/cases/001_merged/100_general.robot +++ b/test/functional/cases/001_merged/100_general.robot @@ -49,3 +49,13 @@ EMAILS DETECTION ZEROFONT ... Settings={symbols_enabled = [MANY_INVISIBLE_PARTS, ZERO_FONT]} Expect Symbol MANY_INVISIBLE_PARTS Expect Symbol ZERO_FONT + +HTML ONLY - TRUE POSITIVE + Scan File ${RSPAMD_TESTDIR}/messages/zerofont.eml + ... Settings={symbols_enabled = [MIME_HTML_ONLY]} + Expect Symbol MIME_HTML_ONLY + +HTML ONLY - TRUE NEGATIVE + Scan File ${RSPAMD_TESTDIR}/messages/btc.eml + ... Settings={symbols_enabled = [MIME_HTML_ONLY]} + Do Not Expect Symbol MIME_HTML_ONLY |