From: Aki Tuomi Date: Tue, 29 Oct 2019 13:11:18 +0000 (+0200) Subject: lib-mail: Treat > as quote for HTML mails too X-Git-Tag: 2.3.9~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=36383e3b10a3e9a70c7e780e77d11d0364d4881f;p=thirdparty%2Fdovecot%2Fcore.git lib-mail: Treat > as quote for HTML mails too --- diff --git a/src/lib-mail/message-snippet.c b/src/lib-mail/message-snippet.c index b33bbae60a..837edd22ef 100644 --- a/src/lib-mail/message-snippet.c +++ b/src/lib-mail/message-snippet.c @@ -94,7 +94,7 @@ static bool snippet_generate(struct snippet_context *ctx, count = 1; switch (ctx->state) { case SNIPPET_STATE_NEWLINE: - if (data[i] == '>' && ctx->html2text == NULL) { + if (data[i] == '>') { ctx->state = SNIPPET_STATE_QUOTED; i++; target = &ctx->quoted_snippet; @@ -160,7 +160,7 @@ int message_snippet_generate(struct istream *input, if (ct == NULL) /* text/plain */ ; else if (mail_html2text_content_type_match(ct)) { - ctx.html2text = mail_html2text_init(MAIL_HTML2TEXT_FLAG_SKIP_QUOTED); + ctx.html2text = mail_html2text_init(0); ctx.plain_output = buffer_create_dynamic(pool, 1024); } else if (strncasecmp(ct, "text/", 5) != 0) break; diff --git a/src/lib-mail/test-message-snippet.c b/src/lib-mail/test-message-snippet.c index 623afabb83..e2b79c7c8c 100644 --- a/src/lib-mail/test-message-snippet.c +++ b/src/lib-mail/test-message-snippet.c @@ -50,7 +50,7 @@ static const struct { "> -foo\n" "
=\n", 100, - "Hi, How is it going? > -foo" }, + "Hi, How is it going?" }, { "Content-Transfer-Encoding: quoted-printable\n" "Content-Type: application/xhtml+xml;\n" @@ -64,7 +64,7 @@ static const struct { "> -foo\n" "
=\n", 100, - "Hi, How is it going? > -foo" }, + "Hi, How is it going?" }, { "Content-Type: text/plain\n" "\n" ">quote1\n>quote2\n", @@ -90,7 +90,7 @@ static const struct { "class=3D\"\">
quoted text is included
\n" "

=\n", 100, - "" }, + ">quoted text is included" }, }; static void test_message_snippet(void)