commit b374f22: [Fix] Fix headers propagation logic

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Aug 13 10:35:08 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-08-13 11:32:43 +0100
URL: https://github.com/rspamd/rspamd/commit/b374f222fe50e1c957e9398b40de9e780f23addf (HEAD -> master)

[Fix] Fix headers propagation logic

---
 src/libmime/mime_parser.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c
index 5d1ff1b77..b40353dca 100644
--- a/src/libmime/mime_parser.c
+++ b/src/libmime/mime_parser.c
@@ -1155,6 +1155,8 @@ rspamd_mime_parse_message (struct rspamd_task *task,
 						MESSAGE_FIELD (task, raw_headers_content).begin,
 						MESSAGE_FIELD (task, raw_headers_content).len,
 						TRUE);
+				npart->raw_headers = rspamd_message_headers_ref (
+						MESSAGE_FIELD (task, raw_headers));
 			}
 
 			hdr = rspamd_message_get_header_from_hash (
@@ -1178,6 +1180,8 @@ rspamd_mime_parse_message (struct rspamd_task *task,
 							MESSAGE_FIELD (task, raw_headers_content).begin,
 							MESSAGE_FIELD (task, raw_headers_content).len,
 							TRUE);
+					npart->raw_headers = rspamd_message_headers_ref (
+							MESSAGE_FIELD (task, raw_headers));
 				}
 
 				hdr = rspamd_message_get_header_from_hash (
@@ -1192,8 +1196,6 @@ rspamd_mime_parse_message (struct rspamd_task *task,
 
 		pbegin = st->start + body_pos;
 		plen = st->end - pbegin;
-		/* TODO: check if it is correct */
-		npart->raw_headers = NULL;
 		npart->headers_order = NULL;
 	}
 	else {


More information about the Commits mailing list