return true
end
+ local parent = part:get_parent()
+
+ if parent then
+ local parent_type,parent_subtype = parent:get_type()
+
+ if parent_type == 'multipart' and parent_subtype == 'encrypted' then
+ -- Skip text heuristics for encrypted parts
+ lua_util.debugm(N, log_obj, "text part check: parent is encrypted, not a text part")
+
+ return false
+ end
+ end
+
local content = part:get_content()
local clen = #content
local is_text
if (rspamd_ftok_casecmp (&res->type, &srch) == 0) {
res->flags |= RSPAMD_CONTENT_TYPE_MULTIPART;
+
+ RSPAMD_FTOK_ASSIGN (&srch, "encrypted");
+ if (rspamd_ftok_casecmp (&res->subtype, &srch) == 0) {
+ res->flags |= RSPAMD_CONTENT_TYPE_ENCRYPTED;
+ }
}
else {
RSPAMD_FTOK_ASSIGN (&srch, "text");
RSPAMD_CONTENT_TYPE_MESSAGE = 1 << 3,
RSPAMD_CONTENT_TYPE_DSN = 1 << 4,
RSPAMD_CONTENT_TYPE_MISSING = 1 << 5,
+ RSPAMD_CONTENT_TYPE_ENCRYPTED = 1 << 1,
};
enum rspamd_content_param_flags {