[Jmap] Update Email/query filters to select e-mails from contact and contact groups

Mildred <mildred-ml@mildred.fr> Wed, 01 June 2022 06:56 UTC

Return-Path: <mildred-ml@mildred.fr>
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 B151AC15C60C for <jmap@ietfa.amsl.com>; Tue, 31 May 2022 23:56:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 2.926
X-Spam-Level: **
X-Spam-Status: No, score=2.926 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=no autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id elfEb5HHPiSL for <jmap@ietfa.amsl.com>; Tue, 31 May 2022 23:56:09 -0700 (PDT)
Received: from strasbourg-1.webmsg.me (vps-ce17f477.vps.ovh.net [IPv6:2001:41d0:404:300::166]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C14DAC15AACD for <jmap@ietf.org>; Tue, 31 May 2022 23:56:08 -0700 (PDT)
Received: from vps-e7887199.vps.ovh.net ([2001:41d0:304:200::dae7]:42652 helo=os-gravelines-1.webmsg.me) by strasbourg-1.webmsg.me with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <mildred-ml@mildred.fr>) id 1nwIGy-000W1F-Hu for jmap@ietf.org; Wed, 01 Jun 2022 06:56:04 +0000
Received: from leygaz.mildred.fr ([193.33.57.69]:44946 helo=[192.168.5.225]) by os-gravelines-1.webmsg.me with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from <mildred-ml@mildred.fr>) id 1nwIGx-00BnuS-RL for jmap@ietf.org; Wed, 01 Jun 2022 06:56:03 +0000
Message-ID: <a3e1df4b-9cd8-478e-c132-8fd0b0ebaf56@mildred.fr>
Date: Wed, 01 Jun 2022 08:56:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0
Content-Language: fr
To: IETF JMAP Mailing List <jmap@ietf.org>
From: Mildred <mildred-ml@mildred.fr>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/2oxw3dg3REpxOWDglMG4f6XnzoQ>
Subject: [Jmap] Update Email/query filters to select e-mails from contact and contact groups
X-BeenThere: jmap@ietf.org
X-Mailman-Version: 2.1.34
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, 01 Jun 2022 06:56:11 -0000

Hi,

Working with JMAP on a Cyrus server, I experience a couple of missing 
features in JMAP around the contact spec, and perhaps it might be good 
to improve it while it is not yet finished.

It seems logical to be able to query e-mails related to a contact or a 
contact group, yet there is nothing in the specificationfor that. 
Fortunately, Cyrus did it, but perhaps it might be good to include it.

Cyrus did the following:

- match a contact group in a header: fromContactGroupId, 
toContactGroupId, ccContactGroupId, bccContactGroupId which accepts a 
single contact group only. Use case : show e-mails from a roupe of 
people only (coworkers, friends) or via the NOT operator from other 
people (generally commercial or automated e-mail).

- match any contact in a header: fromAnyContact, toAnyContact, 
ccAnyContact, bccAnyContactwhich is a boolean that is set to true to 
signify we want to query e-mails in which a contact appears in those 
headers. Use case : show e-mails only from people we know, and show 
separately (with a NOT operator) e-mails from people we don't know yet.

There are more than that that coule be useful, and in particular I can 
find other use cases:

- There is nothing to query e-mails related to a single contact, fields 
like fromContactId, toContactId, ccContactId, bccContactId might be 
useful. Use case : get all e-mails from a given contact and shoy your 
correspondance with that person.

- To avoid constructing complex OR queries if we want to query e-mails 
where a contact or a contact group appears in any of these four fields, 
it might be useful to have a field anyContactGroupId / anyContactId

- To exclude some contacts or some contact groups (if we have a people 
blacklist for example) in the same way there is a filter 
inMailboxOtherThan it might be useful to have 
|{from,to,cc,bcc,any}ContactGroupOtherThan or 
||{from,to,cc,bcc,any}ContactOtherThan. This can be constructed with a 
NOT operator though, but a shorthand might come handy (and there is a 
query complexity limit in Cyrus).
|

|- To work with threads, there is already for keywords query fields like 
||allInThreadHaveKeyword|, |someInThreadHaveKeyword| and 
|noneInThreadHaveKeyword. It could be useful to have similar queries for 
contacts: ||allInThreadAnyInContact(Group|), 
|someInThreadAnyInContact(Group|) and |noneInThreadAnyContact(Group)|

|I voiced this in the Cyrus bug repository (#4111), but probably this 
needs some thinking for the spec.|

|I realize this adds a great number of query keywords, but perhaps only 
the most useful could be selected for the spec while some keywords can 
still have their effect with AND/OR/NOT queries. Perhaps it might be 
useful to express boolean conditions for other things than whole 
e-mails. Conditionals might apply to threads or header fields that have 
more than one item (To, Cc, Bcc).|

|And this is for contacts, but maybe for calendars and tasks there are 
similar queries that could be made.
|

|Mildred|