]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Do not tolerate archives with `text` content type
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 3 Dec 2018 12:31:37 +0000 (12:31 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 3 Dec 2018 12:31:37 +0000 (12:31 +0000)
src/libmime/archives.c

index 129863264d276ecc4bf48dfdecaf24e85a35afe2..9cfce6968fc1be82dfb29f8114f64bcf11535e70 100644 (file)
@@ -1543,6 +1543,13 @@ rspamd_archives_process (struct rspamd_task *task)
                                                sz_magic, sizeof (sz_magic))) {
                                        rspamd_archive_process_7zip (task, part);
                                }
+
+                               if (IS_CT_TEXT (part->ct) &&
+                                               (part->flags & RSPAMD_MIME_PART_ARCHIVE)) {
+                                       msg_info_task ("found archive with incorrect content-type: %T/%T",
+                                                       &part->ct->type, &part->ct->subtype);
+                                       part->ct->flags |= RSPAMD_CONTENT_TYPE_BROKEN;
+                               }
                        }
                }
        }