Re: [Jmap] Adding the Message::isForwarded property

Alexey Melnikov <alexey.melnikov@isode.com> Wed, 05 April 2017 15:16 UTC

Return-Path: <alexey.melnikov@isode.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 721E012949A for <jmap@ietfa.amsl.com>; Wed, 5 Apr 2017 08:16:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 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, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=isode.com
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 Cw3i-T_wULWu for <jmap@ietfa.amsl.com>; Wed, 5 Apr 2017 08:16:47 -0700 (PDT)
Received: from statler.isode.com (Statler.isode.com [62.232.206.189]) by ietfa.amsl.com (Postfix) with ESMTP id E627E12945C for <jmap@ietf.org>; Wed, 5 Apr 2017 08:16:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1491405404; d=isode.com; s=june2016; i=@isode.com; bh=FurI2WiZegH7PGuHjyJJYAov6LIvJGIdx2cCd/f3m4c=; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version: In-Reply-To:References:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description; b=J8wZGVrf1a2r12mubKf35Gq0Ebqv/rffL/gzDft0Hv8GPIw9TtPJediaxH2BbeWyWZpug5 713pfgzflA/k+FOLQeUSC9jPBUi3P5uzAY7BfftGmyyCZc3MuozMdLptqpkvuZR4b8vHuf /QyJqYGAF81jCGELB1piMUKmL48BHsM=;
Received: from [172.20.1.215] (dhcp-215.isode.net [172.20.1.215]) by statler.isode.com (submission channel) via TCP with ESMTPSA id <WOUKWwBO-0oD@statler.isode.com>; Wed, 5 Apr 2017 16:16:44 +0100
To: Neil Jenkins <neilj@fastmail.com>, jmap@ietf.org
References: <148716911729.17277.15371202023742081890.idtracker@ietfa.amsl.com> <b7ec34d3-3aaf-82af-3663-5b0966c83ff0@dcrocker.net> <b5753f7f-92f9-50dd-42f0-ce0de7360e08@linagora.com> <A9EDBE7D-4E3D-45C2-BB97-F74AC9DB9486@oracle.com> <9eb1fd3c-8868-9d24-6c30-46d333b69fef@isode.com> <3c1711a2-46dd-db1c-506e-5e1ad89ce56d@linagora.com> <92769755-62c6-7257-ce3d-7d0b5699735d@isode.com> <59771DE7-35FB-49E3-BFC9-9EBD1268E88A@oracle.com> <1491370605.1381724.934621536.30B3055A@webmail.messagingengine.com>
From: Alexey Melnikov <alexey.melnikov@isode.com>
Message-ID: <1d07de41-b115-ccdc-1f12-0eb339c4be0e@isode.com>
Date: Wed, 05 Apr 2017 16:16:27 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
In-Reply-To: <1491370605.1381724.934621536.30B3055A@webmail.messagingengine.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="------------9C270B214CB2526CDC424F6F"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/428DV08PLXgEkByUeEFzLyGrd0k>
Subject: Re: [Jmap] Adding the Message::isForwarded property
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: Wed, 05 Apr 2017 15:16:49 -0000

Hi Neil,


On 05/04/2017 06:36, Neil Jenkins wrote:
> The existing /isFoo/ properties on the Message object correspond to 
> IMAP system flags, so I think they are OK to be special, but since we 
> know we need generic access to IMAP user flags I agree we should just 
> do that and use the IANA registry rather than adding a special 
> /isForwarded/ flag.
>
> My suggestion would be to add a /keywords/ property to the Message 
> object, which corresponds to the list of IMAP user flags. There is a 
> question of what type this should be. An array is one option, but this 
> has two downsides:
>
>  1. The server must sort it to ensure a consistent representation is
>     returned (probably just by ASCII code point, and for compatibility
>     with IMAP the flags /will/ have to be ASCII). This then leads to
>     the question of whether the server accepts an unsorted array from
>     the client when updating it (probably yes, but then it's returning
>     something that's semantically different at the JSON layer to what
>     was set, to represent something semantically the same at the
>     application layer).
>  2. It's much harder to define patch semantics for an array. In
>     CalConnect <https://www.calconnect.org/>, we've been working on a
>     new JSON representation for event data, and there are often many
>     "complex" properties on the event (e.g. set of alarms). Over time
>     we've moved to having everything as a map with an id as the key,
>     rather than an array, so that we can more easily patch event objects.
>

Sorting seems sensible to me.
> So I would advocate for making the /keywords/ property type Object, 
> with the keywords as the keys, each mapping to a Boolean true as the 
> value. This avoids the above two issues, although at the expense of 
> having an irrelevant "value" in the map for each keyword.
That would be fine.

> To enable searching I would add the following properties to the 
> MessageList FilterCondition:
>
>   * hasKeyword: `String|null`
>   * notKeyword: `String|null`
>
Ok.

> With regards to the special server behaviour for the $Forwarded 
> keyword, I think we can define this without adding a 
> /forwardingMessageId/ property. We can just define that the server 
> should look for the X-Forwarded-Message-Id header on the message, and 
> then search for message(s) with this RFC5322 message id, and add the 
> $Forwarded keyword to any it finds.
Is X-Forwarded-Message-Id registered and which implementations are known 
to add it?

> The current /inReplyToMessageId/ property on the Message object is 
> actually problematic, because it's meant to be the JMAP message id, 
> which can change if the original message is delivered and/or deleted 
> after the reply is fetched, but the property is /meant/ to be immutable.
>
> I think we can actually just drop the /inReplyToMessageId/ property 
> altogether. Instead, clients can simply set the In-Reply-To and 
> References headers directly, and the server can use the In-Reply-To 
> header to search for the message(s) to set as replied, just like with 
> $Forwarded.
>
> Neil.
>
>
> _______________________________________________
> Jmap mailing list
> Jmap@ietf.org
> https://www.ietf.org/mailman/listinfo/jmap