Re: [Jmap] I made a tool to convert email to JMAP compatible JSON

Seph Gentle <me@josephg.com> Sat, 13 June 2020 11:49 UTC

Return-Path: <me@josephg.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 CF6813A081C for <jmap@ietfa.amsl.com>; Sat, 13 Jun 2020 04:49:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=josephg.com header.b=bzt5+Tes; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=cCqHR3xE
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 Vo4JNBbY4YgJ for <jmap@ietfa.amsl.com>; Sat, 13 Jun 2020 04:49:28 -0700 (PDT)
Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0C4C23A081B for <jmap@ietf.org>; Sat, 13 Jun 2020 04:49:28 -0700 (PDT)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 63202333; Sat, 13 Jun 2020 07:49:26 -0400 (EDT)
Received: from imap35 ([10.202.2.85]) by compute1.internal (MEProxy); Sat, 13 Jun 2020 07:49:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=josephg.com; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=mesmtp; bh=85oWV0wVmBqFfvbCjh2nukpzy3Ep NVy+cVroLoF7xDE=; b=bzt5+TessChSNylRPhAKR/hpjOyrQuwT4CpouSmz1yi7 xDZxpY34oXM6Og2x1aPkmnigfqaC087ZY1YSrE/mfqIX90Szq41auEpJICJVoPva h4kbvqiQ/7EEZfHurLsBMLqnUtp56LYxe+Kk+BSo60Z/tOgM2SYPUZ/LXPMcDkQ=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=85oWV0 wVmBqFfvbCjh2nukpzy3EpNVy+cVroLoF7xDE=; b=cCqHR3xE03xwVVaSpLOSdJ 0ViekP3vkS4o3LIVjpBoxb3s8d5G7qwjoaQKx0G4lVUTuE0gDAWzl5mDHkJnKJG0 NSOTCZPrx9ZPyX0pcMv8gpFIHJVvSZYopCMv7g0Ll1Jf+6eWeTof5o1WU04ZQKCb 7kowRvdldCrti9mVA+SvGpulI+SnMIvO69svi2P9snnOIEjEr29DKyXmxvCQDzTi Ern/Ps2hEeoN09j53xtoO5sCuVy5FNr38dGl4/lPOzYvfrQlOzj1zFKDso4rQYxA Cc3SsDk5HdLqz8RppK5pxY7sSoC3HMGzuYZjx5p4ErLMJkHrQTSuyjDwbIM61i6w ==
X-ME-Sender: <xms:Rb3kXuc-mi0UlLLUVNe-HhYoO0p7xdCaykN7Nl_j8uC4ChZdUhLilQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeifedggeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsehttd ertderredtnecuhfhrohhmpedfufgvphhhucfivghnthhlvgdfuceomhgvsehjohhsvghp hhhgrdgtohhmqeenucggtffrrghtthgvrhhnpeetueeivddujeevjeelteekleejledvfe efkedvheetjeetudejhfeigfeggeevvdenucffohhmrghinhepjhhmrghprdhiohdpjhho shgvphhhghdrtghomhdpghhithhhuhgsrdgtohhmpdhnphhmjhhsrdgtohhmpdhivghtfh drohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehmvgesjhhoshgvphhhghdrtghomh
X-ME-Proxy: <xmx:Rb3kXoNuGpZelPsejlneKnkLWLyTNOv_4nJZe531-Z_qKL5vHxE9DA> <xmx:Rb3kXvgXrxoR0RE6Plk2z4MbW9T5qGCO1RYkBqGMr4Kh48MapPWW_A> <xmx:Rb3kXr9wmRkC3cc8lthuEs_LPPh5h6UJN_W6K0PrJZd-A7qwjRWPhA> <xmx:Rr3kXj6X8Zf5SKBBx7qgkfhdf9PZ_icshuM_5jWppSCRzpNqR-Ey5Q>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 76F5C14C00B1; Sat, 13 Jun 2020 07:49:25 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.3.0-dev0-525-ge8fa799-fm-20200609.001-ge8fa7990
Mime-Version: 1.0
Message-Id: <1a8f9067-6630-4304-90c5-db601f213d52@www.fastmail.com>
In-Reply-To: <3af39b224ce9ed212ee53271d5abc17a@avan.tech>
References: <3af39b224ce9ed212ee53271d5abc17a@avan.tech>
Date: Sat, 13 Jun 2020 11:49:05 +0000
From: Seph Gentle <me@josephg.com>
To: marc@marclaporte.com
Cc: jmap@ietf.org
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/FlllKZN1hXDeVLkrh9le8iEMtso>
Subject: Re: [Jmap] I made a tool to convert email to JMAP compatible JSON
X-BeenThere: jmap@ietf.org
X-Mailman-Version: 2.1.29
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: Sat, 13 Jun 2020 11:49:30 -0000

Thanks; and absolutely!

Its a bit difficult to build and use from C at the moment - I haven't set up a shim / API / CLI tool to make that easy. Let me know if thats something folks are interested in.

-Seph


On Sat, Jun 13, 2020, at 11:37 AM, marc@marclaporte.com wrote:
> Dear Seth,
> 
> Thank you very much for your contribution! Interesting use of WASM.
> 
> Can you add here?
> https://jmap.io/software.html
> 
> Best regards,
> 
> Marc
> 
> 
> On Sat, 13 Jun 2020 06:23:06 +0000 Seph Gentle me@josephg.com said
> 
> > Hi everyone!
> > 
> > At the hackathon in Singapore last year Neil Jenkins and I tried to make a
> > JMAP wrapper around gmail's API. But we ran into a problem converting RFC822
> > message envelopes into JMAP objects.
> > 
> > So with a bit of help from Bron (brong) I extracted the email-to-JMAP
> > codepath out of cyrus-imapd. (Cyrus underpins Fastmail). Anyway the end
> > result is now we have a spec compliant, standalone C library / tool to
> > convert email objects to JMAP-compatible json. It gives nice, clean, usable
> > HTML from any email, extracts attachments, and all the other good stuff.
> > 
> > I'd love to see some alternate implementations in other languages. The
> > extracted C code isn't particularly maintainable, but I figure this would
> > provide a great basis for spec conformance testing. And its definitely usable
> > on its own.
> > 
> > I also compiled the code to WASM and wrapped it in a nodejs library so you
> > can convert emails to jmap json from nodejs or directly from the browser.
> > 
> > If you have some emails kicking around, have a play! This is a browser-only
> > email viewer which internally loads and displays emails via jmap's format:
> > 
> > https://josephg.com/mail-viewer/
> > 
> > Code:
> > https://github.com/josephg/mime-to-jmap
> > 
> > NPM package (containing pre-compiled wasm bundle. Building it yourself is a
> > huge pain because of libicu):
> > https://www.npmjs.com/package/mime-to-jmap
> > 
> > Hope someone finds it useful!
> > -Seph
> > 
> > _______________________________________________
> > Jmap mailing list
> > Jmap@ietf.org
> > https://www.ietf.org/mailman/listinfo/jmap
> 
> 
>