]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Use attachments filenames as bayes tokens
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Sep 2016 10:57:34 +0000 (11:57 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Sep 2016 10:57:34 +0000 (11:57 +0100)
src/libstat/stat_process.c

index 388d6b4e3392fe6efe3437f46037ed0ba9007be0..1bc92727081316cd274c0e10dc0f3c30469ca59b 100644 (file)
@@ -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 */