aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-23 16:49:47 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-23 16:49:47 +0000
commitdf20cac59f6a77b67878acbc9f72d9deb93f6161 (patch)
treee0e738c85200de5100d054b2626e9720fc56a926 /src/libmime
parentf7085f21661e4e4c4a9b2470be07a069c32b8a7e (diff)
downloadrspamd-df20cac59f6a77b67878acbc9f72d9deb93f6161.tar.gz
rspamd-df20cac59f6a77b67878acbc9f72d9deb93f6161.zip
[Fix] Disable fuzzy images by default
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/images.c13
-rw-r--r--src/libmime/images.h2
2 files changed, 7 insertions, 8 deletions
diff --git a/src/libmime/images.c b/src/libmime/images.c
index 31b99f022..1f3c891cf 100644
--- a/src/libmime/images.c
+++ b/src/libmime/images.c
@@ -428,7 +428,7 @@ rspamd_image_save_hash (struct rspamd_task *task, struct rspamd_image *img)
#endif
-static void
+void
rspamd_image_normalize (struct rspamd_task *task, struct rspamd_image *img)
{
#ifdef USABLE_GD
@@ -445,6 +445,10 @@ rspamd_image_normalize (struct rspamd_task *task, struct rspamd_image *img)
return;
}
+ if (img->data->len > task->cfg->max_pic_size) {
+ return;
+ }
+
if (rspamd_image_check_hash (task, img)) {
return;
}
@@ -595,13 +599,6 @@ process_image (struct rspamd_task *task, struct rspamd_mime_part *part)
img->parent = part;
- if (img->data->len <= task->cfg->max_pic_size) {
- rspamd_image_normalize (task, img);
- }
- else {
- msg_info_task ("skip normalization for image %s: too large: %z",
- img->filename, img->data->len);
- }
part->flags |= RSPAMD_MIME_PART_IMAGE;
part->specific.img = img;
diff --git a/src/libmime/images.h b/src/libmime/images.h
index e442eaa40..55aa6873f 100644
--- a/src/libmime/images.h
+++ b/src/libmime/images.h
@@ -40,4 +40,6 @@ void rspamd_images_process (struct rspamd_task *task);
*/
const gchar * rspamd_image_type_str (enum rspamd_image_type type);
+void rspamd_image_normalize (struct rspamd_task *task, struct rspamd_image *img);
+
#endif /* IMAGES_H_ */