aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-24 15:49:16 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-24 15:49:16 +0100
commitc992064bb2341a021ba5d000e0825d95420ec3b3 (patch)
tree6da1ec40c2693db4e22a998b22eadb9ab0fc19f4 /src
parent99cc1fcb693f0c08f48776bdc8ba76fc91856737 (diff)
downloadrspamd-c992064bb2341a021ba5d000e0825d95420ec3b3.tar.gz
rspamd-c992064bb2341a021ba5d000e0825d95420ec3b3.zip
[Project] Rework images detection
Diffstat (limited to 'src')
-rw-r--r--src/libmime/images.c7
-rw-r--r--src/libmime/message.c3
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libmime/images.c b/src/libmime/images.c
index 073776359..faa7a6b2e 100644
--- a/src/libmime/images.c
+++ b/src/libmime/images.c
@@ -50,14 +50,13 @@ rspamd_images_process (struct rspamd_task *task)
{
guint i;
struct rspamd_mime_part *part;
- rspamd_ftok_t srch;
-
- RSPAMD_FTOK_ASSIGN (&srch, "image");
PTR_ARRAY_FOREACH (MESSAGE_FIELD (task, parts), i, part) {
if (!(part->flags & (RSPAMD_MIME_PART_TEXT|RSPAMD_MIME_PART_ARCHIVE))) {
- if (rspamd_ftok_cmp (&part->ct->type, &srch) == 0 &&
+ if (part->detected_type &&
+ strcmp (part->detected_type, "image") == 0 &&
part->parsed_data.len > 0) {
+
process_image (task, part);
}
}
diff --git a/src/libmime/message.c b/src/libmime/message.c
index cb95945fe..ef725e72c 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -1368,7 +1368,6 @@ rspamd_message_process (struct rspamd_task *task)
L = task->cfg->lua_state;
}
- rspamd_images_process (task);
rspamd_archives_process (task);
if (L && rspamd_lua_require_function (L,
@@ -1570,7 +1569,9 @@ rspamd_message_process (struct rspamd_task *task)
}
}
+ rspamd_images_process (task);
rspamd_images_link (task);
+
rspamd_tokenize_meta_words (task);
}