[PATCH] test: overhaul multipart test to test for improved message/rfc822 handling
On Mon, 5 Sep 2011 12:01:46 -0700, Jameson Graef Rollins wrote: > The main goal of this overhaul is to define how message/rfc822 parts > should be handled. message/rfc822 parts should be output in a similar > fashion to the outer message, including some subset of the rfc822 > headers. The following decisions about formatting of message/rfc822 > parts were made: I have pushed the remaining 3 patches in the series. Namely this one, and the last 2 from the previous series. I added a brief note to the commit message about the one test which fails. I think on the whole the approach Jamie took of writing the test as the specification is the correct one. d
Re: [PATCH] test: overhaul multipart test to test for improved message/rfc822 handling
On Mon, 5 Sep 2011 12:01:46 -0700, Jameson Graef Rollins wrote: > The main goal of this overhaul is to define how message/rfc822 parts > should be handled. message/rfc822 parts should be output in a similar > fashion to the outer message, including some subset of the rfc822 > headers. The following decisions about formatting of message/rfc822 > parts were made: I have pushed the remaining 3 patches in the series. Namely this one, and the last 2 from the previous series. I added a brief note to the commit message about the one test which fails. I think on the whole the approach Jamie took of writing the test as the specification is the correct one. d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] test: overhaul multipart test to test for improved message/rfc822 handling
The main goal of this overhaul is to define how message/rfc822 parts should be handled. message/rfc822 parts should be output in a similar fashion to the outer message, including some subset of the rfc822 headers. The following decisions about formatting of message/rfc822 parts were made: The format and content of message/rfc822 parts shall be as similar as possible to that of full messages. In particular, for formatted outputs, the "content" of rfc822 part output should include "headers" and "body" fields). The "body" field shall include the body of the message. The "headers" field shall include the following headers, since these are the ones available from the GMimeMessage: "From" "To" "Cc" "Subject" "Date" However, for the case of --format=raw the raw rfc822 should be output, including all headers. A subset of relevant headers shall be output in reply. The test embedded rfc822 message is also modified to be itself multipart, so we can more fully test how all sub parts of the message part are output. --- This updated patch fixes some conflicts with the current master head. test/multipart | 368 +++- 1 files changed, 283 insertions(+), 85 deletions(-) diff --git a/test/multipart b/test/multipart index ef859d1..0fd1c7e 100755 --- a/test/multipart +++ b/test/multipart @@ -2,6 +2,29 @@ test_description="output of multipart message" . ./test-lib.sh +cat < embedded_message +From: Carl Worth +To: cwo...@cworth.org +Subject: html message +Date: Fri, 05 Jan 2001 15:42:57 + +User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) +Message-ID: <87liy5ap01@yoom.home.cworth.org> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="==-=-==" + +--==-=-== +Content-Type: text/html + +This is an embedded message, with a multipart/alternative part. + +--==-=-== +Content-Type: text/plain + +This is an embedded message, with a multipart/alternative part. + +--==-=-==-- +EOF + cat < ${MAIL_DIR}/multipart From: Carl Worth To: cwo...@cworth.org @@ -20,17 +43,9 @@ Content-Type: multipart/mixed; boundary="=-=-=" Content-Type: message/rfc822 Content-Disposition: inline -From: Carl Worth -To: cwo...@cworth.org -Subject: html message -Date: Fri, 05 Jan 2001 15:42:57 + -User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) -Message-ID: <87liy5ap01@yoom.home.cworth.org> -MIME-Version: 1.0 -Content-Type: text/html - -This is an embedded message, with a single html part. - +EOF +cat embedded_message >> ${MAIL_DIR}/multipart +cat <> ${MAIL_DIR}/multipart --=-=-= Content-Disposition: attachment; filename=attachment @@ -105,20 +120,33 @@ Date: Fri, 05 Jan 2001 15:43:57 + part{ ID: 1, Content-type: multipart/signed part{ ID: 2, Content-type: multipart/mixed part{ ID: 3, Content-type: message/rfc822 -part{ ID: 4, Content-type: text/html +header{ +From: Carl Worth +To: cwo...@cworth.org +Subject: html message +Date: Fri, 05 Jan 2001 15:42:57 + +header} +body{ +part{ ID: 4, Content-type: multipart/alternative +part{ ID: 5, Content-type: text/html Non-text part: text/html part} +part{ ID: 6, Content-type: text/plain +This is an embedded message, with a multipart/alternative part. +part} +part} +body} part} -attachment{ ID: 5, Filename: attachment, Content-type: text/plain +attachment{ ID: 7, Filename: attachment, Content-type: text/plain This is a text attachment. attachment} -part{ ID: 6, Content-type: text/plain +part{ ID: 8, Content-type: text/plain And this message is signed. -Carl part} part} -part{ ID: 7, Content-type: application/pgp-signature +part{ ID: 9, Content-type: application/pgp-signature Non-text part: application/pgp-signature part} part} @@ -133,20 +161,33 @@ cat
[PATCH] test: overhaul multipart test to test for improved message/rfc822 handling
The main goal of this overhaul is to define how message/rfc822 parts should be handled. message/rfc822 parts should be output in a similar fashion to the outer message, including some subset of the rfc822 headers. The following decisions about formatting of message/rfc822 parts were made: The format and content of message/rfc822 parts shall be as similar as possible to that of full messages. In particular, for formatted outputs, the "content" of rfc822 part output should include "headers" and "body" fields). The "body" field shall include the body of the message. The "headers" field shall include the following headers, since these are the ones available from the GMimeMessage: "From" "To" "Cc" "Subject" "Date" However, for the case of --format=raw the raw rfc822 should be output, including all headers. A subset of relevant headers shall be output in reply. The test embedded rfc822 message is also modified to be itself multipart, so we can more fully test how all sub parts of the message part are output. --- This updated patch fixes some conflicts with the current master head. test/multipart | 368 +++- 1 files changed, 283 insertions(+), 85 deletions(-) diff --git a/test/multipart b/test/multipart index ef859d1..0fd1c7e 100755 --- a/test/multipart +++ b/test/multipart @@ -2,6 +2,29 @@ test_description="output of multipart message" . ./test-lib.sh +cat < embedded_message +From: Carl Worth +To: cworth at cworth.org +Subject: html message +Date: Fri, 05 Jan 2001 15:42:57 + +User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) +Message-ID: <87liy5ap01.fsf at yoom.home.cworth.org> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="==-=-==" + +--==-=-== +Content-Type: text/html + +This is an embedded message, with a multipart/alternative part. + +--==-=-== +Content-Type: text/plain + +This is an embedded message, with a multipart/alternative part. + +--==-=-==-- +EOF + cat < ${MAIL_DIR}/multipart From: Carl Worth To: cworth at cworth.org @@ -20,17 +43,9 @@ Content-Type: multipart/mixed; boundary="=-=-=" Content-Type: message/rfc822 Content-Disposition: inline -From: Carl Worth -To: cworth at cworth.org -Subject: html message -Date: Fri, 05 Jan 2001 15:42:57 + -User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) -Message-ID: <87liy5ap01.fsf at yoom.home.cworth.org> -MIME-Version: 1.0 -Content-Type: text/html - -This is an embedded message, with a single html part. - +EOF +cat embedded_message >> ${MAIL_DIR}/multipart +cat <> ${MAIL_DIR}/multipart --=-=-= Content-Disposition: attachment; filename=attachment @@ -105,20 +120,33 @@ Date: Fri, 05 Jan 2001 15:43:57 + part{ ID: 1, Content-type: multipart/signed part{ ID: 2, Content-type: multipart/mixed part{ ID: 3, Content-type: message/rfc822 -part{ ID: 4, Content-type: text/html +header{ +From: Carl Worth +To: cworth at cworth.org +Subject: html message +Date: Fri, 05 Jan 2001 15:42:57 + +header} +body{ +part{ ID: 4, Content-type: multipart/alternative +part{ ID: 5, Content-type: text/html Non-text part: text/html part} +part{ ID: 6, Content-type: text/plain +This is an embedded message, with a multipart/alternative part. +part} +part} +body} part} -attachment{ ID: 5, Filename: attachment, Content-type: text/plain +attachment{ ID: 7, Filename: attachment, Content-type: text/plain This is a text attachment. attachment} -part{ ID: 6, Content-type: text/plain +part{ ID: 8, Content-type: text/plain And this message is signed. -Carl part} part} -part{ ID: 7, Content-type: application/pgp-signature +part{ ID: 9, Content-type: application/pgp-signature Non-text part: application/pgp-signature part} part} @@ -133,20 +161,33 @@ cat