From: Vsevolod Stakhov Date: Thu, 15 Sep 2016 10:57:34 +0000 (+0100) Subject: [Minor] Use attachments filenames as bayes tokens X-Git-Tag: 1.4.0~424 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cb22681cd8f5ef4d4be31eb38d26f699a3e54409;p=rspamd.git [Minor] Use attachments filenames as bayes tokens --- diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index 388d6b4e3..1bc927270 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -77,7 +77,7 @@ rspamd_stat_tokenize_parts_metadata (struct rspamd_stat_ctx *st_ctx, guint i; gchar tmpbuf[128]; - ar = g_array_sized_new (FALSE, FALSE, sizeof (elt), 4); + ar = g_array_sized_new (FALSE, FALSE, sizeof (elt), 16); /* Insert images */ for (i = 0; i < task->parts->len; i ++) { @@ -110,6 +110,11 @@ rspamd_stat_tokenize_parts_metadata (struct rspamd_stat_ctx *st_ctx, msg_debug_task ("added stat tokens for image '%s'", img->html_image->src); } } + else if (part->filename) { + elt.begin = (gchar *)part->filename; + elt.len = strlen (elt->begin); + g_array_append_val (ar, elt); + } } /* Process mime parts */