Blame SOURCES/dovecot-2.3.8-CVE_2020_12100ph.patch

b62b43
diff -up dovecot-2.3.8/dovecot-2.3-pigeonhole-0.5.8/src/lib-sieve/plugins/notify/ext-notify-common.c.CVE_2020_12100ph dovecot-2.3.8/dovecot-2.3-pigeonhole-0.5.8/src/lib-sieve/plugins/notify/ext-notify-common.c
b62b43
--- dovecot-2.3.8/dovecot-2.3-pigeonhole-0.5.8/src/lib-sieve/plugins/notify/ext-notify-common.c.CVE_2020_12100ph	2019-10-08 10:48:14.000000000 +0200
b62b43
+++ dovecot-2.3.8/dovecot-2.3-pigeonhole-0.5.8/src/lib-sieve/plugins/notify/ext-notify-common.c	2020-08-07 16:42:56.515389867 +0200
b62b43
@@ -148,6 +148,7 @@ static int cmd_notify_extract_body_text
b62b43
 	const char **body_text_r, size_t *body_size_r)
b62b43
 {
b62b43
 	const struct sieve_extension *this_ext = renv->oprtn->ext;
b62b43
+	const struct message_parser_settings parser_set = { .flags = 0 };
b62b43
 	struct ext_notify_message_context *mctx;
b62b43
 	struct mail *mail = renv->msgdata->mail;
b62b43
 	struct message_parser_ctx *parser;
b62b43
@@ -181,7 +182,7 @@ static int cmd_notify_extract_body_text
b62b43
 	/* Initialize body decoder */
b62b43
 	decoder = message_decoder_init(NULL, 0);
b62b43
 
b62b43
-	parser = message_parser_init(mctx->pool, input, 0, 0);
b62b43
+	parser = message_parser_init(mctx->pool, input, &parser_set);
b62b43
 	is_text = TRUE;
b62b43
 	save_body = FALSE;
b62b43
 	while ( (ret=message_parser_parse_next_block(parser, &block)) > 0 ) {
b62b43
diff -up dovecot-2.3.8/dovecot-2.3-pigeonhole-0.5.8/src/lib-sieve/sieve-message.c.CVE_2020_12100ph dovecot-2.3.8/dovecot-2.3-pigeonhole-0.5.8/src/lib-sieve/sieve-message.c
b62b43
--- dovecot-2.3.8/dovecot-2.3-pigeonhole-0.5.8/src/lib-sieve/sieve-message.c.CVE_2020_12100ph	2019-10-08 10:48:14.000000000 +0200
b62b43
+++ dovecot-2.3.8/dovecot-2.3-pigeonhole-0.5.8/src/lib-sieve/sieve-message.c	2020-08-07 16:42:56.516389854 +0200
b62b43
@@ -1077,10 +1077,10 @@ static int sieve_message_parts_add_missi
b62b43
 	struct sieve_message_context *msgctx = renv->msgctx;
b62b43
 	pool_t pool = msgctx->context_pool;
b62b43
 	struct mail *mail = sieve_message_get_mail(renv->msgctx);
b62b43
-	enum message_parser_flags mparser_flags =
b62b43
-		MESSAGE_PARSER_FLAG_INCLUDE_MULTIPART_BLOCKS;
b62b43
-	enum message_header_parser_flags hparser_flags =
b62b43
-		MESSAGE_HEADER_PARSER_FLAG_SKIP_INITIAL_LWSP;
b62b43
+	struct message_parser_settings parser_set = {
b62b43
+		.hdr_flags = MESSAGE_HEADER_PARSER_FLAG_SKIP_INITIAL_LWSP,
b62b43
+		.flags = MESSAGE_PARSER_FLAG_INCLUDE_MULTIPART_BLOCKS,
b62b43
+	};
b62b43
 	ARRAY(struct sieve_message_header) headers;
b62b43
 	struct sieve_message_part *body_part, *header_part, *last_part;
b62b43
 	struct message_parser_ctx *parser;
b62b43
@@ -1117,7 +1117,7 @@ static int sieve_message_parts_add_missi
b62b43
 	if (iter_all) {
b62b43
 		t_array_init(&headers, 64);
b62b43
 		hdr_content = t_str_new(512);
b62b43
-		hparser_flags |= MESSAGE_HEADER_PARSER_FLAG_CLEAN_ONELINE;
b62b43
+		parser_set.hdr_flags |= MESSAGE_HEADER_PARSER_FLAG_CLEAN_ONELINE;
b62b43
 	} else {
b62b43
 		i_zero(&headers);
b62b43
 	}
b62b43
@@ -1129,7 +1129,7 @@ static int sieve_message_parts_add_missi
b62b43
 		//parser = message_parser_init_from_parts(parts, input,
b62b43
 		// hparser_flags, mparser_flags);
b62b43
 	parser = message_parser_init(pool_datastack_create(),
b62b43
-		input, hparser_flags, mparser_flags);
b62b43
+		input, &parser_set);
b62b43
 	while ( (ret=message_parser_parse_next_block
b62b43
 		(parser, &block)) > 0 ) {
b62b43
 		struct sieve_message_part **body_part_idx;