]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix parent CTE propagation
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 11 Oct 2019 10:25:01 +0000 (11:25 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 11 Oct 2019 10:25:01 +0000 (11:25 +0100)
src/libmime/mime_parser.c

index 517bc4b8dbc159279254cc5ab84a6ef887dfd817..dc3ef4b7c035fda56e10babf925f6892aec9bf90 100644 (file)
@@ -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",