part->detected_type = rspamd_mempool_strdup (task->task_pool,
lua_tostring (L, -1));
}
+
+ lua_pop (L, 1);
+
+ lua_pushstring (L, "no_text");
+ lua_gettable (L, -2);
+
+ if (lua_isboolean (L, -1)) {
+ if (!!lua_toboolean (L, -1)) {
+ part->flags |= RSPAMD_MIME_PART_NO_TEXT_EXTRACTION;
+ }
+ }
+
+ lua_pop (L, 1);
}
}
rspamd_images_process_mime_part_maybe (task, part);
/* Still no content detected, try text heuristic */
- if (part->part_type == RSPAMD_MIME_PART_UNDEFINED) {
+ if (part->part_type == RSPAMD_MIME_PART_UNDEFINED &&
+ !(part->flags & RSPAMD_MIME_PART_NO_TEXT_EXTRACTION)) {
rspamd_message_process_text_part_maybe (task, part);
}
}
struct rspamd_archive;
enum rspamd_mime_part_flags {
- RSPAMD_MIME_PART_ATTACHEMENT = (1 << 1),
- RSPAMD_MIME_PART_BAD_CTE = (1 << 4),
- RSPAMD_MIME_PART_MISSING_CTE = (1 << 5),
+ RSPAMD_MIME_PART_ATTACHEMENT = (1u << 1u),
+ RSPAMD_MIME_PART_BAD_CTE = (1u << 4u),
+ RSPAMD_MIME_PART_MISSING_CTE = (1u << 5u),
+ RSPAMD_MIME_PART_NO_TEXT_EXTRACTION = (1u << 6u),
};
enum rspamd_mime_part_type {