commit dbbd6c6: [Fix] Fix parent CTE propagation
Vsevolod Stakhov
vsevolod at highsecure.ru
Fri Oct 11 10:28:06 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-10-11 11:25:01 +0100
URL: https://github.com/rspamd/rspamd/commit/dbbd6c612def879c6c41c584b4be39c9fd3a8013 (HEAD -> master)
[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",
More information about the Commits
mailing list