Re: [Jmap] Attachments and composing more complex MIME structures

Neil Jenkins <neilj@fastmailteam.com> Tue, 08 August 2017 10:28 UTC

Return-Path: <neilj@fastmailteam.com>
X-Original-To: jmap@ietfa.amsl.com
Delivered-To: jmap@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 95BDF1321A4 for <jmap@ietfa.amsl.com>; Tue, 8 Aug 2017 03:28:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.72
X-Spam-Level:
X-Spam-Status: No, score=-2.72 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fastmailteam.com header.b=l7RoY/rf; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=nSaTfv3V
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id buta0oTUtj7H for <jmap@ietfa.amsl.com>; Tue, 8 Aug 2017 03:28:38 -0700 (PDT)
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8F2F713218C for <jmap@ietf.org>; Tue, 8 Aug 2017 03:28:38 -0700 (PDT)
Received: from betaweb1.internal (betaweb1.nyi.internal [10.202.2.10]) by mailout.nyi.internal (Postfix) with ESMTP id 0825720B17 for <jmap@ietf.org>; Tue, 8 Aug 2017 06:28:38 -0400 (EDT)
Received: from betaweb1 ([::ffff:10.202.2.10]) by betaweb1.internal (MEProxy); Tue, 08 Aug 2017 06:28:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= fastmailteam.com; h=content-transfer-encoding:content-type:date :from:in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=ZrCHDFFi974Hq6N9O atdHxckfWZw3z3Ye4qgY/BH/pE=; b=l7RoY/rfPr8cVHQBPZLiPK6OqKzhs/U/1 4K3vmgi6QLZ0UoLGWPB43ISxRAk4OsyZ6jgoHe4e/5//Y4DNfy+DcCWwWxOcYsSz jyqPj/C1yeiF7/D+W4JZQq9cGQOYfCq0322EsVnu8vBQ3Hq92SPwo141u39glRMe 9T0f0vg/RH+PhCNnG7GiQlYkZJSWCkL/nrLE08WxrBHsYPBxB6gRQyBflHdI+sb6 4vZGY0yJiONktIJU9dgJS0bSPcaNSkewhrtppnSFrOED5ZP7VAHacQ5kZ2ld/w1T VuGyzoslSZ66CkY7cCJp0Wd6Wv4AaMitaqn2j3atQPK+K4sN7dHaw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=ZrCHDF Fi974Hq6N9OatdHxckfWZw3z3Ye4qgY/BH/pE=; b=nSaTfv3VqXlkyBgOzpgqYn jW0S5QgqOfMG23sy4FmLAOSayoR9tajvxLAWCe9/FjfpViZu6BmGb85JS7DKfpYs unhQLAu99h+ODYBypsLFKZqvNh7AaaSNjrqCVzkahALTuzikI4CZcauZ0/06WJ+M Et9XLKaxjrD2JiKJ7RerwmgZIFLwR3ER27L2m8ouSBpdv7KEg+c5a/dEhJ7mUWyA ERuXMpuR2iCqgL6D1pT9a9dlFvyJs4T/H1J1V9LvrDephbinVuzyFdJ5jq7689cD 02DKNdJQ1Ir4r1BAFSWDFRLCYLA8orvsfOORwbwuQVy6PBV4S2Q8rzZyqodvRBgQ ==
X-ME-Sender: <xms:VZKJWQeEeGq_jDt4a6AnsoOkIRsV8eSYE1ymHCQko_yJPA1yBZeDxw>
Received: by mailuser.nyi.internal (Postfix, from userid 99) id B941BE2383; Tue, 8 Aug 2017 06:28:37 -0400 (EDT)
Message-Id: <1502188117.322839.1066636392.362BFD31@webmail.messagingengine.com>
From: Neil Jenkins <neilj@fastmailteam.com>
To: jmap@ietf.org
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: multipart/alternative; boundary="_----------=_15021881173228390"
X-Mailer: MessagingEngine.com Webmail Interface - ajax-f209590a
References: <20170808092341.GB1457@meili>
Date: Tue, 08 Aug 2017 20:28:37 +1000
In-Reply-To: <20170808092341.GB1457@meili>
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/FhbyIvrkVygv4CpY4Iz_J45Kv5I>
Subject: Re: [Jmap] Attachments and composing more complex MIME structures
X-BeenThere: jmap@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: JSON Message Access Protocol <jmap.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jmap>, <mailto:jmap-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jmap/>
List-Post: <mailto:jmap@ietf.org>
List-Help: <mailto:jmap-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jmap>, <mailto:jmap-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 08 Aug 2017 10:28:41 -0000

On Tue, 8 Aug 2017, at 07:23 PM, Josef 'Jeff' Sipek wrote:
> Some clients (most notably iOS Mail app) often produce multipart/mixed> emails with inline text and images.

Although not clear yet (this bit of the spec needs a lot more details),
the intention is that a JMAP server would convert this to an htmlBody in
the Message object that combined the text and images (with cids).
> However, I don't think the attachment API can be used to draft one of> these inline-mime-image mails since setMessages:

No, but you could produce an HTML part that's going to render the same
(and be more compatible).
> Did I miss something, or does this really mean that a client like this> must save drafts that are pre-composed RFC 5322 messages with all the
> inserted> images already embedded?

If the client absolutely MUST create a multipart/mixed email like this,
then yes. The intention with the Message object format is to hide the
complexities of MIME, and try to remove alternative ways of representing
the same things. This makes it easier for client authors, at the expense
of some more complexity for server developers.
> P.S. For what it is worth, the iOS mail app produces a totally
>      different> structure if any of the text has formatting.:
> 1.   text/plain with the whole text without any images
> 2.   multipart/related
> 2.1. text/html with the whole text with <img> tags using cids to
>      refer to>     the images
> 2.2. image/png with the first inserted image
> 2.3. image/png with the second inserted image

Doesn't sound like it would be difficult for it just to always generate
this even when no text formatting is applied then…
Neil.