Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id EE515429E32 for ; Mon, 27 Jun 2011 19:12:31 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HzpNuan7pkXo for ; Mon, 27 Jun 2011 19:12:31 -0700 (PDT) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 2CBB4429E25 for ; Mon, 27 Jun 2011 19:12:31 -0700 (PDT) Received: by qyk9 with SMTP id 9so3408401qyk.5 for ; Mon, 27 Jun 2011 19:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=zBgAsI/iyHZdzMTiCbXmbJmxkff6w1U3pxQQntndgUc=; b=nilv8Jx3eT2ssG9CxEwgek0uychm4fP4BwxZoKTRnhAvKUIFKaCJxUQiXvhgLHjdAU 5hLrUC0AcA3wKc0dmi3adE1XmfbhOEkKTZPZ1enaXQUEoP8re/1LtLVwt/YFL5xjMrIC HpYK7jHyq+nFTWNXogukxSr116VfKx3se5HXA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=LvE4s/MmkBOj6gWDCed3onxcQ1kNVi34expTF/W4DhQ8mkYAI5mx0nlTvspwEMQdwl K7K7DovuFJrq06rN8GK+XO3/WNuKTJvRGLS/wZZAK9duqjFQxJbKF3IPgZS/kpKrTthe 3ZsCod+avv5tkXx6aEZbbjAxMJwChmH9usR+A= MIME-Version: 1.0 Received: by 10.229.2.157 with SMTP id 29mr5269708qcj.62.1309227150232; Mon, 27 Jun 2011 19:12:30 -0700 (PDT) Sender: amdragon@gmail.com Received: by 10.229.32.197 with HTTP; Mon, 27 Jun 2011 19:12:30 -0700 (PDT) In-Reply-To: <4E09072A.7040906@fifthhorseman.net> References: <1307032735-27427-1-git-send-email-jrollins@finestructure.net> <1307120466-4980-1-git-send-email-jrollins@finestructure.net> <87wrgccedd.fsf@yoom.home.cworth.org> <87mxh319un.fsf@servo.factory.finestructure.net> <878vsn0x1i.fsf@servo.factory.finestructure.net> <20110627220741.GA4120@mit.edu> <4E09072A.7040906@fifthhorseman.net> Date: Mon, 27 Jun 2011 22:12:30 -0400 X-Google-Sender-Auth: dwt19CTcg1NN7LbihamhpN5LcMg Message-ID: Subject: Re: interaction between --format=raw and multipart handling [was: Re: Do not attept to output part raw if part is not GMimePart.] From: Austin Clements To: notmuch Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 02:12:32 -0000 On Mon, Jun 27, 2011 at 6:41 PM, Daniel Kahn Gillmor wrote: > On 06/27/2011 06:07 PM, Austin Clements wrote: >> Oh, right, of course. =C2=A0show_message_part will walk into the parts, = so >> format_part_content_raw will still be called on the leafs of a >> requested multipart. =C2=A0Though, this approach results in each leaf be= ing >> transfer decoded and printed individually, so if you ask for a >> multipart, you won't get the "raw" contents of the multipart (unless >> it's part 0), so much as you get the concatenated "raw" contents of >> each part in the multipart. > > > let's take two labeled examples: > > A=E2=94=94=E2=94=AC=E2=95=B4multipart/signed 58292 bytes > B =E2=94=9C=E2=94=AC=E2=95=B4multipart/mixed 56553 bytes > C =E2=94=82=E2=94=9C=E2=95=B4text/plain 1278 bytes > D =E2=94=82=E2=94=9C=E2=95=B4text/plain attachment [grub-install.out] 541= 09 bytes > E =E2=94=82=E2=94=94=E2=95=B4text/x-diff attachment [597538.patch] 496 by= tes > F =E2=94=94=E2=95=B4application/pgp-signature attachment [signature.asc] = 900 bytes > > > X=E2=94=94=E2=94=AC=E2=95=B4multipart/signed 3863 bytes > Y =E2=94=9C=E2=95=B4text/plain 1857 bytes > Z =E2=94=94=E2=95=B4application/pgp-signature attachment [signature.asc] = 900 bytes > > (i know, you won't use "A" or "Z" as part IDs once we have hierarchical > part numbers, but consider them placeholders). > > if parts F or Z are ever going to be useful (e.g. to some external > process that wants to validate the signature by hand), then the tool > needs to provide some way of producing parts B and Y in a pristine form > (that is, including MIME headers and without interpreting/applying any > transfer encodings). > > Perhaps this means there are two flavors of "raw" that we should be > distinguishing, something like: > > =C2=A00) "source" -- the equivalent to viewing the source of the message, > with headers and without attempting to reverse transfer-encodings, etc. > > =C2=A01) "rare" -- (not entirely raw, but still bloody, ha ha) strip head= ers, > reverse transfer encodings, etc. > > I think our current implementation of --format=3Draw emits "source" when > applied to the entire message, but "rare" when applied to one of the part= s. Yes. > I'm suggesting that it might be useful to be able to get "source" of a > part. =C2=A0(and perhaps it might also be useful to get the whole message > "rare" sometimes?) > > My first instinct was: if it's multipart, provide "source", if it's > single-part, provide "rare". =C2=A0But that fails for the XYZ case above = -- > we'd need Y (which is single-part) to be provided as "source" if we were > ever to be able to make use of Z on its own, so i don't think it'll be > that simple. > > OTOH, i'm not sure that "rare" is particularly meaningful for non-leaf > parts. > >> That if you ask for a multipart, you should effectively get a slice >> out of the original message bytes (since multipart/* parts can't have >> non-identity transfer encodings). =C2=A0Are you also saying that should >> extend to transfer encoded leaf parts, too? > > hmm. =C2=A0is it true that multipart/* parts can't have non-identity tran= sfer > encodings? =C2=A0that would simplify some things, but i don't have a > reference handy that says it's the case. RFC 2045, section 6.4: "If an entity is of type "multipart" the Content-Transfer-Encoding is not permitted to have any value other than "7bit", "8bit" or "binary"." (And, for completeness, section 6.2: "The Content-Transfer-Encoding values "7bit", "8bit", and "binary" all mean that the identity (i.e. NO) encoding transformation has been performed.") > At any rate, i'm not sure it affects the need for being able to emit > both "rare" and "source" forms of at least the leaf (non-multipart) parts= . > > i hope this is all at least somewhat clarifying and not just adding to > the confusion, Thanks. That's actually very informative and solidifies some of what's been slowly coagulating in my mind. I was also thinking about the two output variants you describe (though, being less clever, I was thinking "raw" and "decoded"). The fact that multipart/* parts can only have identity encodings makes me wonder if the two could be merged by thinking of the decoded content of a leaf part as a child/body to the original, encoded part. On the other hand, that doesn't make sense for other formats, so perhaps that's not a fruitful approach.