]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Process headers only once
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 25 Oct 2016 13:07:39 +0000 (15:07 +0200)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 25 Oct 2016 13:42:08 +0000 (15:42 +0200)
src/libmime/message.c

index 5028e7cc26b144f76ab8fb8f05383e66d75a1cf7..ca05dc4c8a1a79980a346b96357bc1a4cdf99f31 100644 (file)
@@ -86,6 +86,7 @@ process_raw_headers (struct rspamd_task *task, GHashTable *target,
        end = p + len;
        c = p;
        memset (nlines_count, 0, sizeof (nlines_count));
+       msg_debug_task ("start processing headers");
 
        while (p < end) {
                /* FSM for processing headers */
@@ -1169,7 +1170,13 @@ mime_foreach_callback (GMimeObject * part, gpointer user_data)
                mime_part = rspamd_mempool_alloc0 (task->task_pool,
                                sizeof (struct rspamd_mime_part));
 
-               hdrs = g_mime_object_get_headers (GMIME_OBJECT (part));
+               if (md->parent != NULL) {
+                       hdrs = g_mime_object_get_headers (GMIME_OBJECT (part));
+               }
+               else {
+                       hdrs = NULL;
+               }
+
                mime_part->raw_headers = g_hash_table_new_full (rspamd_strcase_hash,
                                rspamd_strcase_equal, NULL, rspamd_ptr_array_free_hard);