aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/message.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-16 11:19:40 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-16 11:24:20 +0100
commit229cf1c94b1879d92028735d46da3a9021f97c29 (patch)
tree5f4290e0603f817c25633d29ce0237b20b373437 /src/libmime/message.c
parentef16ff4ddd6f12dc2d6bc0bd5cc2dae5b219d592 (diff)
downloadrspamd-229cf1c94b1879d92028735d46da3a9021f97c29.tar.gz
rspamd-229cf1c94b1879d92028735d46da3a9021f97c29.zip
[Fix] Add a special logic for text part with no text extraction
Diffstat (limited to 'src/libmime/message.c')
-rw-r--r--src/libmime/message.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index d788844a3..e6fc5be94 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -1446,6 +1446,19 @@ rspamd_message_process (struct rspamd_task *task)
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);
}
}
@@ -1479,7 +1492,8 @@ rspamd_message_process (struct rspamd_task *task)
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);
}
}