diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-23 00:38:55 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-23 00:38:55 +0000 |
commit | c10a012a44a1c40df0e90511f745af0b7377a665 (patch) | |
tree | 767c8c2395d28ac044466fde97110caee359dc2d /src/libmime | |
parent | c065374f689cd970392530b25b213ad0692a93f9 (diff) | |
download | rspamd-c10a012a44a1c40df0e90511f745af0b7377a665.tar.gz rspamd-c10a012a44a1c40df0e90511f745af0b7377a665.zip |
[Minor] Add condition to parse special mime headers
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/mime_headers.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index eaee0a5ae..282579548 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -95,12 +95,11 @@ rspamd_mime_header_check_special (struct rspamd_task *task, static void rspamd_mime_header_add (struct rspamd_task *task, - GHashTable *target, struct rspamd_mime_header *rh) + GHashTable *target, struct rspamd_mime_header *rh, + gboolean check_special) { GPtrArray *ar; - rspamd_mime_header_check_special (task, rh); - if ((ar = g_hash_table_lookup (target, rh->name)) != NULL) { g_ptr_array_add (ar, rh); msg_debug_task ("append raw header %s: %s", rh->name, rh->value); @@ -112,7 +111,9 @@ rspamd_mime_header_add (struct rspamd_task *task, msg_debug_task ("add new raw header %s: %s", rh->name, rh->value); } - rspamd_mime_header_check_special (task, rh); + if (check_special) { + rspamd_mime_header_check_special (task, rh); + } } /* Convert raw headers to a list of struct raw_header * */ @@ -306,14 +307,14 @@ rspamd_mime_headers_process (struct rspamd_task *task, GHashTable *target, /* We also validate utf8 and replace all non-valid utf8 chars */ rspamd_mime_charset_utf_enforce (new->decoded, strlen (new->decoded)); - rspamd_mime_header_add (task, target, new); + rspamd_mime_header_add (task, target, new, check_newlines); state = 0; break; case 5: /* Header has only name, no value */ new->value = ""; new->decoded = ""; - rspamd_mime_header_add (task, target, new); + rspamd_mime_header_add (task, target, new, check_newlines); state = 0; break; case 99: |