this repo has no description
OCaml 94.5%
HTML 2.2%
Dune 0.1%
Other 3.2%
60 2 1

Clone this repository

https://tangled.org/anil.recoil.org/ocaml-jmap
git@git.recoil.org:anil.recoil.org/ocaml-jmap

For self-hosted knots, clone URLs may differ based on your setup.

README.md

ocaml-jmap - JMAP Protocol Implementation for OCaml#

A complete implementation of the JSON Meta Application Protocol (JMAP) as specified in RFC 8620 (core) and RFC 8621 (mail).

Libraries#

The jmap package provides:

  • jmap - Core JMAP protocol types and serialization
  • jmap.eio - JMAP client using Eio for async I/O
  • jmap.brr - JMAP client for browsers using js_of_ocaml

Key Features#

  • Full RFC 8620 (JMAP Core) support: sessions, accounts, method calls, and error handling
  • Full RFC 8621 (JMAP Mail) support: mailboxes, emails, threads, identities, and submissions
  • Type-safe request chaining with result references
  • Multiple backends: Eio for native async, Brr for browser-based clients
  • JSON serialization via jsont

Usage#

(* Query emails from a mailbox using the Chain API *)
open Jmap

let query_and_fetch ~account_id ~mailbox_id =
  let open Chain in
  let filter = Email.Filter_condition.(Condition { ... }) in
  let* query_handle = email_query ~account_id ~filter () in
  let* get_handle = email_get ~account_id ~ids:(Some (from_query query_handle)) () in
  return (query_handle, get_handle)

Installation#

opam install jmap

To use the Eio client, ensure eio and requests are installed:

opam install eio requests

For browser-based applications with js_of_ocaml:

opam install brr

Documentation#

API documentation is available via:

opam install jmap odoc
dune build @doc

License#

ISC