diff options
author | Carl Worth <cworth@cworth.org> | 2011-05-16 22:28:36 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2011-05-17 14:51:06 -0700 |
commit | c51d5b3cdb5ca0816816e88ca6f7136a24e74eee (patch) | |
tree | be75427f07bc5c6b16a8467bf3ed6c47ccfc15c3 /test/multipart | |
parent | d67f75549785117a8e0c3bc4f0bd71352a29974c (diff) |
notmuch show: Include output for the enclosing multipart part of a MIME mail
Previously, the outer multipart part of any multipart/mixed,
multipart/signed, etc. MIME message was silently omitted from the
"notmuch show" output. This prevented any client from correctly
determining to which parts a signature applies, for example.
Now, we actually emit these parts as their own parts. The output is
still flattened---the contained parts are not yet included "within"
the multipart part---so it's still not possible to determine to which
parts a signature applies, but this is one step along the path.
The test suite is updated to reflect this change, (though we'll
eventually want to fix the emacs interface to not display buttons for
the multipart enclosure parts as there's nothing useful for the user
to actually do with them).
Diffstat (limited to 'test/multipart')
-rwxr-xr-x | test/multipart | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/multipart b/test/multipart index dde25abc..ef9a8a2e 100755 --- a/test/multipart +++ b/test/multipart @@ -58,19 +58,23 @@ To: cworth@cworth.org Date: Tue, 05 Jan 2001 15:43:57 -0000 header} body{ -part{ ID: 1, Content-type: text/plain +part{ ID: 1, Content-type: multipart/signed +part} +part{ ID: 2, Content-type: multipart/mixed +part} +part{ ID: 3, Content-type: text/plain This is an inline text part. part} -attachment{ ID: 2, Content-type: text/plain +attachment{ ID: 4, Content-type: text/plain Attachment: attachment (text/plain) This is a text attachment. attachment} -part{ ID: 3, Content-type: text/plain +part{ ID: 5, Content-type: text/plain And this message is signed. -Carl part} -part{ ID: 4, Content-type: application/pgp-signature +part{ ID: 6, Content-type: application/pgp-signature Non-text part: application/pgp-signature part} body} @@ -78,7 +82,7 @@ Non-text part: application/pgp-signature test_begin_subtest "Show multipart MIME message (--format=json)" output=$(notmuch show --format=json 'id:87liy5ap00.fsf@yoom.home.cworth.org') -test_expect_equal "$output" '[[[{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "filename": "/home/cworth/src/notmuch/test/tmp.multipart/mail/multipart", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Cc": "", "Bcc": "", "Date": "Tue, 05 Jan 2001 15:43:57 -0000"}, "body": [{"id": 1, "content-type": "text/plain", "content": "This is an inline text part.\n"}, {"id": 2, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"}, {"id": 3, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}, {"id": 4, "content-type": "application/pgp-signature"}]}, []]]]' +test_expect_equal "$output" '[[[{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "filename": "/home/cworth/src/notmuch/test/tmp.multipart/mail/multipart", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Cc": "", "Bcc": "", "Date": "Tue, 05 Jan 2001 15:43:57 -0000"}, "body": [{"id": 1, "content-type": "multipart/signed"}, {"id": 2, "content-type": "multipart/mixed"}, {"id": 3, "content-type": "text/plain", "content": "This is an inline text part.\n"}, {"id": 4, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"}, {"id": 5, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}, {"id": 6, "content-type": "application/pgp-signature"}]}, []]]]' test_done |