From fa04109d087b2cd31bcd3087fddbd72b3fd87bd8 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 17 Jun 2021 14:05:50 +0100 Subject: [PATCH] [Minor] Broken CT != missing CT --- src/libmime/archives.c | 5 ++++- src/lua/lua_mimepart.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libmime/archives.c b/src/libmime/archives.c index c6e2066f5..4d7867f67 100644 --- a/src/libmime/archives.c +++ b/src/libmime/archives.c @@ -1951,7 +1951,10 @@ rspamd_archives_process (struct rspamd_task *task) 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; + + if (!(part->ct->flags & RSPAMD_CONTENT_TYPE_MISSING)) { + part->ct->flags |= RSPAMD_CONTENT_TYPE_BROKEN; + } } } } diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c index b6e5b157d..971aa18eb 100644 --- a/src/lua/lua_mimepart.c +++ b/src/lua/lua_mimepart.c @@ -1831,7 +1831,7 @@ lua_mimepart_is_broken (lua_State * L) true : false); } else { - lua_pushboolean (L, true); + lua_pushboolean (L, false); } return 1; -- 2.39.5