aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-11 11:25:01 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-11 11:25:01 +0100
commitdbbd6c612def879c6c41c584b4be39c9fd3a8013 (patch)
tree0cd4ab59d7c2ef6202ca87dd979ea2d62407f929
parent8b74294ece38dae6e2a05d79fceab80c8795513a (diff)
downloadrspamd-dbbd6c612def879c6c41c584b4be39c9fd3a8013.tar.gz
rspamd-dbbd6c612def879c6c41c584b4be39c9fd3a8013.zip
[Fix] Fix parent CTE propagation
-rw-r--r--src/libmime/mime_parser.c7
1 files changed, 7 insertions, 0 deletions
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",