diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-16 15:06:16 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-16 15:06:16 +0000 |
commit | 1f426dddc9ca736b0a1efecf6cad3552069d7a34 (patch) | |
tree | fa77d8e48e063332c2dd1a2eed3a5d20b2badbad /src/libmime | |
parent | ed07010638f56e6118c0aea5bfd8ce3739f00e3a (diff) | |
download | rspamd-1f426dddc9ca736b0a1efecf6cad3552069d7a34.tar.gz rspamd-1f426dddc9ca736b0a1efecf6cad3552069d7a34.zip |
Try to load mime from properly
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/message.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index 18ddfbc34..fe97183e4 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -1542,6 +1542,7 @@ rspamd_message_parse (struct rspamd_task *task) GList *first, *cur; GMimeObject *parent; const GMimeContentType *ct; + struct raw_header *rh; struct mime_text_part *p1, *p2; struct mime_foreach_data md; struct received_header *recv; @@ -1703,18 +1704,22 @@ rspamd_message_parse (struct rspamd_task *task) task->rcpt_mime); #endif } - task->from_mime = internet_address_list_parse_string( - g_mime_message_get_sender (task->message)); - if (task->from_mime) { + first = rspamd_message_get_header (task, "From", FALSE); + + if (first) { + rh = first->data; + task->from_mime = internet_address_list_parse_string (rh->value); + if (task->from_mime) { #ifdef GMIME24 - rspamd_mempool_add_destructor (task->task_pool, - (rspamd_mempool_destruct_t) g_object_unref, - task->from_mime); + rspamd_mempool_add_destructor (task->task_pool, + (rspamd_mempool_destruct_t) g_object_unref, + task->from_mime); #else - rspamd_mempool_add_destructor (task->task_pool, - (rspamd_mempool_destruct_t) internet_address_list_destroy, - task->from_mime); + rspamd_mempool_add_destructor (task->task_pool, + (rspamd_mempool_destruct_t) internet_address_list_destroy, + task->from_mime); #endif + } } /* Parse urls inside Subject header */ |