commit fa04109: [Minor] Broken CT != missing CT

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Jun 17 13:07:06 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-06-17 14:05:50 +0100
URL: https://github.com/rspamd/rspamd/commit/fa04109d087b2cd31bcd3087fddbd72b3fd87bd8 (HEAD -> master)

[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;


More information about the Commits mailing list