interaction between --format=raw and multipart handling [was: Re: Do not attept to...
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 27 Jun 2011 22:41:46 +0000 (18:41 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:44 +0000 (09:38 -0800)
cd/1a692eadf16dcc19febbc759d988b29350ed2f [new file with mode: 0644]

diff --git a/cd/1a692eadf16dcc19febbc759d988b29350ed2f b/cd/1a692eadf16dcc19febbc759d988b29350ed2f
new file mode 100644 (file)
index 0000000..79e9430
--- /dev/null
@@ -0,0 +1,180 @@
+Return-Path: <dkg@fifthhorseman.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 814AD429E25\r
+       for <notmuch@notmuchmail.org>; Mon, 27 Jun 2011 15:41:57 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id s7VOAtf4caE5 for <notmuch@notmuchmail.org>;\r
+       Mon, 27 Jun 2011 15:41:56 -0700 (PDT)\r
+Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
+       by olra.theworths.org (Postfix) with ESMTP id B80F9431FD0\r
+       for <notmuch@notmuchmail.org>; Mon, 27 Jun 2011 15:41:56 -0700 (PDT)\r
+Received: from [192.168.23.207] (dsl254-070-154.nyc1.dsl.speakeasy.net\r
+       [216.254.70.154])\r
+       by che.mayfirst.org (Postfix) with ESMTPSA id CAA10F970\r
+       for <notmuch@notmuchmail.org>; Mon, 27 Jun 2011 18:41:54 -0400 (EDT)\r
+Message-ID: <4E09072A.7040906@fifthhorseman.net>\r
+Date: Mon, 27 Jun 2011 18:41:46 -0400\r
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
+User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;\r
+       rv:1.9.2.17) Gecko/20110516 Icedove/3.1.10\r
+MIME-Version: 1.0\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: interaction between --format=raw and multipart handling [was: Re:\r
+       Do not attept to output part raw if part is not GMimePart.]\r
+References: <1307032735-27427-1-git-send-email-jrollins@finestructure.net>\r
+       <1307120466-4980-1-git-send-email-jrollins@finestructure.net>\r
+       <87wrgccedd.fsf@yoom.home.cworth.org>\r
+       <87mxh319un.fsf@servo.factory.finestructure.net>\r
+       <BANLkTik8v7uZDcO4wV1Ve1Lymd03Z-WWdw@mail.gmail.com>\r
+       <878vsn0x1i.fsf@servo.factory.finestructure.net>\r
+       <20110627220741.GA4120@mit.edu>\r
+In-Reply-To: <20110627220741.GA4120@mit.edu>\r
+X-Enigmail-Version: 1.1.2\r
+Content-Type: multipart/signed; micalg=pgp-sha512;\r
+       protocol="application/pgp-signature";\r
+       boundary="------------enig016CC7533040F7A4A5342619"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+Reply-To: notmuch <notmuch@notmuchmail.org>\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 27 Jun 2011 22:41:57 -0000\r
+\r
+This is an OpenPGP/MIME signed message (RFC 2440 and 3156)\r
+--------------enig016CC7533040F7A4A5342619\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On 06/27/2011 06:07 PM, Austin Clements wrote:\r
+> Oh, right, of course.  show_message_part will walk into the parts, so\r
+> format_part_content_raw will still be called on the leafs of a\r
+> requested multipart.  Though, this approach results in each leaf being\r
+> transfer decoded and printed individually, so if you ask for a\r
+> multipart, you won't get the "raw" contents of the multipart (unless\r
+> it's part 0), so much as you get the concatenated "raw" contents of\r
+> each part in the multipart.\r
+\r
+\r
+let's take two labeled examples:\r
+\r
+A=E2=94=94=E2=94=AC=E2=95=B4multipart/signed 58292 bytes\r
+B =E2=94=9C=E2=94=AC=E2=95=B4multipart/mixed 56553 bytes\r
+C =E2=94=82=E2=94=9C=E2=95=B4text/plain 1278 bytes\r
+D =E2=94=82=E2=94=9C=E2=95=B4text/plain attachment [grub-install.out] 541=\r
+09 bytes\r
+E =E2=94=82=E2=94=94=E2=95=B4text/x-diff attachment [597538.patch] 496 by=\r
+tes\r
+F =E2=94=94=E2=95=B4application/pgp-signature attachment [signature.asc] =\r
+900 bytes\r
+\r
+\r
+X=E2=94=94=E2=94=AC=E2=95=B4multipart/signed 3863 bytes\r
+Y =E2=94=9C=E2=95=B4text/plain 1857 bytes\r
+Z =E2=94=94=E2=95=B4application/pgp-signature attachment [signature.asc] =\r
+900 bytes\r
+\r
+(i know, you won't use "A" or "Z" as part IDs once we have hierarchical\r
+part numbers, but consider them placeholders).\r
+\r
+if parts F or Z are ever going to be useful (e.g. to some external\r
+process that wants to validate the signature by hand), then the tool\r
+needs to provide some way of producing parts B and Y in a pristine form\r
+(that is, including MIME headers and without interpreting/applying any\r
+transfer encodings).\r
+\r
+Perhaps this means there are two flavors of "raw" that we should be\r
+distinguishing, something like:\r
+\r
+ 0) "source" -- the equivalent to viewing the source of the message,\r
+with headers and without attempting to reverse transfer-encodings, etc.\r
+\r
+ 1) "rare" -- (not entirely raw, but still bloody, ha ha) strip headers,\r
+reverse transfer encodings, etc.\r
+\r
+I think our current implementation of --format=3Draw emits "source" when\r
+applied to the entire message, but "rare" when applied to one of the part=\r
+s.\r
+\r
+I'm suggesting that it might be useful to be able to get "source" of a\r
+part.  (and perhaps it might also be useful to get the whole message\r
+"rare" sometimes?)\r
+\r
+My first instinct was: if it's multipart, provide "source", if it's\r
+single-part, provide "rare".  But that fails for the XYZ case above --\r
+we'd need Y (which is single-part) to be provided as "source" if we were\r
+ever to be able to make use of Z on its own, so i don't think it'll be\r
+that simple.\r
+\r
+OTOH, i'm not sure that "rare" is particularly meaningful for non-leaf\r
+parts.\r
+\r
+> Daniel, is this the problem that you're getting at with "opacity"?\r
+\r
+the origin of the term "opaque" used in this context can be found in the\r
+definition of multipart/signed:\r
+\r
+ https://tools.ietf.org/html/rfc1847#section-2.1\r
+\r
+> That if you ask for a multipart, you should effectively get a slice\r
+> out of the original message bytes (since multipart/* parts can't have\r
+> non-identity transfer encodings).  Are you also saying that should\r
+> extend to transfer encoded leaf parts, too?\r
+\r
+hmm.  is it true that multipart/* parts can't have non-identity transfer\r
+encodings?  that would simplify some things, but i don't have a\r
+reference handy that says it's the case.\r
+\r
+At any rate, i'm not sure it affects the need for being able to emit\r
+both "rare" and "source" forms of at least the leaf (non-multipart) parts=\r
+=2E\r
+\r
+i hope this is all at least somewhat clarifying and not just adding to\r
+the confusion,\r
+\r
+       --dkg\r
+\r
+\r
+--------------enig016CC7533040F7A4A5342619\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+Content-Description: OpenPGP digital signature\r
+Content-Disposition: attachment; filename="signature.asc"\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.11 (GNU/Linux)\r
+Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\r
+\r
+iQJ8BAEBCgBmBQJOCQcqXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w\r
+ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwRUU1QkU5NzkyODJEODBCOUY3NTQwRjFD\r
+Q0QyRUQ5NEQyMTczOUU5AAoJEMzS7ZTSFznpgVoQAIg+UCSpzFilQc2QLNUfDRmK\r
+WGqVYHaeNvWl6muvCzW+1oX3TM3kq1MaVrEkIgtLY3b1BPIdZ/0szKCRSvJcUzlW\r
+qCqfFwNYs3iwu8tIbS9hB7YnKf30Xq8zt0ACuNFzk67KHPu8eaVV7Eu4AeH++xoN\r
+PrO2cIc4ACiKBRrre2P1fJZRb9c+BftlU9lsWeqp1hVJD2udidf4rVM7AJ/QbjJH\r
+FvH2aWhE0fa1Suy9twcWhgV2ZhVIx1iTck271aTRJw/4ItVSOIpW0vaaM0bTjcn4\r
+SO1v16DBOu6S0rVtiOgxrztBYoT0EDL8Bn5fXq542vQRgKZoKnO2LDy1Dg1ffMLY\r
+WE2CiHKhw9YzETrmlUR4+Kzct+XRQwuPAAzYgtmj0sSgwIZSfN94evBcYol1YcDZ\r
+MaW0UyFNrwciJ1lZwm/njnLRdXYDYpDzxiFX5Eou62EdZxYDQPwM3oVTb6xZPlQV\r
+WK04w8MjpWYh0wf92+wO71+B36XYB43amxhxP9xldX1Itn301PK2YOiwWg+09LT2\r
+wS0KmdHMu32elWIvrp8xafhpkUgoMyr/idBglFmh723e7YTrIy8B1/O24lIfBuzi\r
+/bdWMVHJU2QTT8q6J7vyiudinnIJo/secQA9tLvnajwu0eaRRQ8IYjVIefx+MvJF\r
+o3A2YF+2b50sYJ+cKhbK\r
+=bVBl\r
+-----END PGP SIGNATURE-----\r
+\r
+--------------enig016CC7533040F7A4A5342619--\r