From dc51bf0ad4ce84414e79d2f30752502f7c0d46c0 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 16 Aug 2013 11:35:43 -0400 Subject: reply: Use RFC 2822/MIME wholly for text format template Previously, reply's default text format used an odd mix of RFC 2045 MIME encoding for the reply template's body and some made-up RFC 2822-like UTF-8 format for the headers. The intent was to present the headers to the user in a nice, un-encoded format, but this assumed that whatever ultimately sent the email would RFC 2047-encode the headers, while at the same time the body was already RFC 2045 encoded, so it assumed that whatever sent the email would *not* re-encode the body. This can be fixed by either producing a fully decoded UTF-8 reply template, or a fully encoded MIME-compliant RFC 2822 message. This patch does the latter because it is a) Well-defined by RFC 2822 and MIME (while any UTF-8 format would be ad hoc). b) Ready to be piped to sendmail. The point of the text format is to be minimal, so a user should be able to pop up the template in whatever editor they want, edit it, and push it to sendmail. c) Consistent with frontend capabilities. If a frontend has the smarts to RFC 2047 encode the headers before sending the mail, it probably has the smarts to RFC 2047 decode them before presenting the template to a user for editing. Also, as far as I know, nothing automated consumes the reply text format, so changing this should not cause serious problems. (And if anything does still consume this format, it probably gets these encoding issues wrong anyway.) --- test/reply | 9 ++++++--- test/reply-to-sender | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/reply b/test/reply index a85ebe56..d4389cf5 100755 --- a/test/reply +++ b/test/reply @@ -132,7 +132,9 @@ add_message '[subject]="This subject is exactly 200 bytes in length. Other than '[body]="200-byte header"' output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces +Subject: Re: This subject is exactly 200 bytes in length. Other than its + length there is not much of note here. Note that the length of 200 bytes + includes the Subject: and Re: prefixes with two spaces In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> @@ -200,10 +202,11 @@ add_message '[subject]="=?iso-8859-1?q?=e0=df=e7?="' \ '[body]="Encoding"' output=$(notmuch reply id:${gen_msg_id}) +# Note that GMime changes from Q- to B-encoding test_expect_equal "$output" "\ From: Notmuch Test Suite -Subject: Re: àßç -To: ☃ +Subject: Re: =?iso-8859-1?b?4N/n?= +To: =?UTF-8?b?4piD?= In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> diff --git a/test/reply-to-sender b/test/reply-to-sender index c7d15bbe..30e5e385 100755 --- a/test/reply-to-sender +++ b/test/reply-to-sender @@ -200,7 +200,9 @@ add_message '[subject]="This subject is exactly 200 bytes in length. Other than '[body]="200-byte header"' output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces +Subject: Re: This subject is exactly 200 bytes in length. Other than its + length there is not much of note here. Note that the length of 200 bytes + includes the Subject: and Re: prefixes with two spaces In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> -- cgit v1.2.3