Re: [Jmap] [JMAP] CalendarEvent/parse proposition for the JMAP Calendar draft

Robert Stepanek <rsto@fastmailteam.com> Wed, 12 April 2023 08:08 UTC

Return-Path: <rsto@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 1B957C15C280 for <jmap@ietfa.amsl.com>; Wed, 12 Apr 2023 01:08:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.095
X-Spam-Level:
X-Spam-Status: No, score=-2.095 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=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="QUfNSmN7"; dkim=pass (2048-bit key) header.d=messagingengine.com header.b="K9a1SiH/"
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 4lHCESd9E-ej for <jmap@ietfa.amsl.com>; Wed, 12 Apr 2023 01:08:16 -0700 (PDT)
Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B818CC14CEE3 for <jmap@ietf.org>; Wed, 12 Apr 2023 01:08:16 -0700 (PDT)
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 0BC9B3200959 for <jmap@ietf.org>; Wed, 12 Apr 2023 04:08:13 -0400 (EDT)
Received: from imap43 ([10.202.2.93]) by compute3.internal (MEProxy); Wed, 12 Apr 2023 04:08:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= fastmailteam.com; h=cc:content-type:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1681286893; x= 1681373293; bh=eypaeoEQ7p+iN1uBkT+F5tLruI3af2Ys/t6hHGARRFc=; b=Q UfNSmN79WHyvMz1sjvwaybZXWJI3iwRGXjhssIEn4b3cBjcCjB+ULJU9PsHiDB7u 3pu1+AHymLFr+x/UbmLVQmp/sXI8Wlniy0Nbu6k8SKp9/Z9KwZR/KbLAQW+TWrH7 GyUJZraisHmlbEFNX+/iltfqW35Z0f2pzeG88BBLeyzfcYLQixGV4O4KIpMBeRX6 yEvSQvDZft5yxlPoW/Y52tFhgwzqKeE5kytA6xtBAtdrRX+7+PBiq1GyEeCP92U1 AXmxtbD7o0CAtvARtO7MhuExNlF01NeC6LT2msICiMelXMMVHtQLX/DxMNyrOZKH EWnW4vkc3jdvd/hZxXNFw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1681286893; x=1681373293; bh=eypaeoEQ7p+iN 1uBkT+F5tLruI3af2Ys/t6hHGARRFc=; b=K9a1SiH/dzX6lRqL+2o2EOZ8joXeO u3i0ecKH5XDCR8bbHfqo+StiKTQ6Qa//gPfVc84hTX6jvKU7H0z85/soHKyzE1ly yUxVu8aVG9vlTPRXY4tgR0a3ejsxG90BottMM4KW/iyW0QpGTr8UnjeH4Wtg+adU aX+EVPi0yWspE8aA+w8NIMYIt21ZPcrU9CXwlwfn6UGFUpr+UTEvcKaI8lrCI1ce YZ3Dqq+QeuAxtiNf6eVG47qF4tZnkrFlO83tAtPKdk7MN3Bj0pLQBTY6oeVot+qL CPdb/Tt9WNyiczs7eMDWEM4lc+nMbVk8tYIMk2URz89lOeQdKGb4hqwNw==
X-ME-Sender: <xms:7WY2ZCXLG6tte7Lv7LZFlZ5TWJKcSnOMovLwT5gLiKQEJmgMdBnv2g> <xme:7WY2ZOnYandHjmDA6C-qYDNfkPU4vhynjndZpBu7x3gCkzMq1jmDOH0fa1LODqoU7 BFzf7FwEHkToQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekiecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesrgdtreerre erjeenucfhrhhomhepfdftohgsvghrthcuufhtvghprghnvghkfdcuoehrshhtohesfhgr shhtmhgrihhlthgvrghmrdgtohhmqeenucggtffrrghtthgvrhhnpeejjedthfekfffgfe eivdfggfelffdvffdtueeftdefkeeugfejhfegleetfeefgfenucffohhmrghinheptgih rhhushhimhgrphdrohhrghdpghhithhhuhgsrdgtohhmpdhivghtfhdrohhrghenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrshhtohesfhgr shhtmhgrihhlthgvrghmrdgtohhm
X-ME-Proxy: <xmx:7WY2ZGYJjNMeEJT93o9xFF0Op7xZrIuY-G0qIxVunYIQAI-lzop5_Q> <xmx:7WY2ZJUQ_UUtqvl13wyof5zaZSerZ8TIG-p4K9CG93WoE2zmP73zfA> <xmx:7WY2ZMmxReUGarVNx1fu5C7daOiymLG23DEPuDHu3CMii8ahSkaa-A> <xmx:7WY2ZIyVajUp2BG0QDO5AnlTbZsVw12zrtaeZ-lZA6LsmPhgEUQZVQ>
Feedback-ID: ia5d944da:Fastmail
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7B75A2D40074; Wed, 12 Apr 2023 04:08:13 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.9.0-alpha0-334-g8c072af647-fm-20230330.001-g8c072af6
Mime-Version: 1.0
Message-Id: <ab348779-6122-495a-b3c8-66f5ff280b32@app.fastmail.com>
In-Reply-To: <Mime4j.6.e7ae1c1fa90e3ca2.187745bb130@linagora.com>
References: <Mime4j.6.e7ae1c1fa90e3ca2.187745bb130@linagora.com>
Date: Wed, 12 Apr 2023 10:07:53 +0200
From: Robert Stepanek <rsto@fastmailteam.com>
To: jmap@ietf.org
Content-Type: multipart/alternative; boundary="7460ba40e01f49429c4130a6e1e921bc"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/flHvSs97AKbggOVW1aCNSSIw6Ro>
Subject: Re: [Jmap] [JMAP] CalendarEvent/parse proposition for the JMAP Calendar draft
X-BeenThere: jmap@ietf.org
X-Mailman-Version: 2.1.39
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, 12 Apr 2023 08:08:22 -0000

Hi,

I'm much in favor of adding CalendarEvent/parse as an optional method to JMAP Calendars. Just as Email/parse parses MIME messages, CalendarEvent/parse should parse iCalendar data. Should there ever be the need to support other calendar formats, this still could be solved with a `contentType` argument.

On Wed, Apr 12, 2023, at 9:26 AM, René CORDIER wrote:
> At Linagora we have an internal need of showing what we call a blue bar on top of Calendar event emails that you receive. It would allow the client to show the user details of a Calendar event he received in a nice and generic way when reading the corresponding email (because Calendar email sent events are not formatted the same way depending of the calendar).
> 
> We came up with a custom method called CalendarEvent/parse. It would allow to parse a .ics calendar file attached to the mail to extract properties defined in RFC5545 to allow client to show events from different calendars in the same way. 
> 

At Fastmail and in the Cyrus IMAP server we support this use case with a non-standard `calendarEvents` property in the `Email` object. Any MIME body parts of type text/calendar will be rendered as JSCalendar events to this property in Email/get.

The Cyrus IMAP server also already supports `CalendarEvent/parse` if you use the `https://cyrusimap.org/ns/jmap/calendars` capability.

> For more details, we have a document that defines our custom method here: https://github.com/linagora/tmail-backend/blob/master/docs/modules/ROOT/pages/tmail-backend/jmap-extensions/calendarEventParsing.adoc
> 

I guess we will have more discussions about this should this get defined in JMAP Calendars but here are my remarks already (in no particular order):

 • +1 for using the applicable subsets of arguments of Email/parse. But I do think that a standard CalendarEvent/parse also needs to support the `properties` argument, rather than hard-coding in the spec the list of returned properties.
 • Is there a reason why use you use different value type notations than the JMAP spec? e.g. your `blobIds: [Id]` definition would read `blobIds: Id[]` in standard JMAP notation. Similarly, `parsed: Map[BlobId]` notates that the value type of `parsed` is a JSON objects with keys of type `Map` (some subset of String) and values of type `BlobId`. But that's not what your example shows.
 • Your example shows that the parsed property maps a `blobId` to a single `CalendarEvent`. This will not work in the general case, as a blob with iCalendar data may contain multiple VEVENT components which do not parse to a single CalendarEvent. The most common scenario where we see that happening is for iTIP messages that contain two or more VEVENTs with the same UID and all of them having a RECURRENCE-ID. I suggest you change the value of parsed to a map of list of events, such as  `parsed: Id[CalendarEvent[]]`.
 • I see that you document how to convert iCalendar properties to JSCalendar event properties. I guess that's on me, because we still did not manage to publish our RFC draft that standardizes how convert between the two formats: https://www.ietf.org/archive/id/draft-ietf-calext-jscalendar-icalendar-07.html For JMAP Calendars, I definitely would be against different a conversion scheme as part of CalendarEvent/parse and rather refer to the conversion guide RFC.

Thanks!
Robert