JMAP OCaml Libraries#
This project implements OCaml libraries for the JMAP protocol, following the specifications in RFC 8620 (Core) and RFC 8621 (Mail).
Project Structure#
The code is organized into three main libraries:
-
jmap- Core JMAP protocol (RFC 8620)- Basic data types
- Error handling
- Wire protocol
- Session handling
- Standard methods (get, set, changes, query)
- Binary data handling
- Push notifications
-
jmap-unix- Unix-specific implementation of JMAP- HTTP connections to JMAP endpoints
- Authentication
- Session discovery
- Request/response handling
- Blob upload/download
- Unix-specific I/O
-
jmap-email- JMAP Mail extension (RFC 8621)- Email specific types
- Mailbox handling
- Thread management
- Search snippet functionality
- Identity management
- Email submission
- Vacation response
Usage#
The libraries are designed to be used together. For example:
(* Using the core JMAP protocol library *)
open Jmap
open Jmap.Types
open Jmap.Wire
(* Using the Unix implementation *)
open Jmap_unix
(* Using the JMAP Email extension library *)
open Jmap_email
open Jmap_email.Types
(* Example: Connecting to a JMAP server *)
let connect_to_server () =
let credentials = Jmap_unix.Basic("username", "password") in
let (ctx, session) = Jmap_unix.quick_connect ~host:"jmap.example.com" ~username:"user" ~password:"pass" in
...
Building#
# Build
opam exec -- dune build @check
# Generate documentation
opam exec -- dune build @doc