From dbbd6c612def879c6c41c584b4be39c9fd3a8013 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 11 Oct 2019 11:25:01 +0100 Subject: [PATCH] [Fix] Fix parent CTE propagation --- src/libmime/mime_parser.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c index 517bc4b8d..dc3ef4b7c 100644 --- a/src/libmime/mime_parser.c +++ b/src/libmime/mime_parser.c @@ -264,6 +264,7 @@ rspamd_mime_part_get_cte (struct rspamd_task *task, { struct rspamd_mime_header *hdr, *cur; enum rspamd_cte cte = RSPAMD_CTE_UNKNOWN; + gboolean parent_propagated = FALSE; hdr = rspamd_message_get_header_from_hash (hdrs, "Content-Transfer-Encoding"); @@ -271,6 +272,7 @@ rspamd_mime_part_get_cte (struct rspamd_task *task, if (part->parent_part && part->parent_part->cte != RSPAMD_CTE_UNKNOWN && !(part->parent_part->flags & RSPAMD_MIME_PART_MISSING_CTE)) { part->cte = part->parent_part->cte; + parent_propagated = TRUE; goto check_cte; } @@ -319,6 +321,11 @@ check_cte: part->cte = cte; part->flags |= RSPAMD_MIME_PART_BAD_CTE; } + else if (cte != part->cte && parent_propagated) { + part->cte = cte; + msg_info_task ("detected missing CTE for part as: %s", + rspamd_cte_to_string (part->cte)); + } } else { msg_debug_mime ("processed cte: %s", -- 2.39.5