]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Rework] Revert missing thing for broken CT
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Nov 2019 13:29:10 +0000 (13:29 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Nov 2019 13:29:10 +0000 (13:29 +0000)
src/libmime/archives.c

index 5b08dd19bcfd513b4ca0aa46621ce0baf888b0c5..32a251c945e91027c2c5980431fc8a8881058a3a 100644 (file)
@@ -1936,6 +1936,17 @@ rspamd_archives_process (struct rspamd_task *task)
                                                gz_magic, sizeof (gz_magic))) {
                                        rspamd_archive_process_gzip (task, part);
                                }
+
+                               if (part->ct && (part->ct->flags & RSPAMD_CONTENT_TYPE_TEXT) &&
+                                               part->part_type == RSPAMD_MIME_PART_ARCHIVE &&
+                                               part->specific.arch) {
+                                       struct rspamd_archive *arch = part->specific.arch;
+
+                                       msg_info_task ("found %s archive with incorrect content-type: %T/%T",
+                                                       rspamd_archive_type_str (arch->type),
+                                                       &part->ct->type, &part->ct->subtype);
+                                       part->ct->flags |= RSPAMD_CONTENT_TYPE_BROKEN;
+                               }
                        }
                }
        }