this repo has no description
README.md

JMAP Unix Implementation#

This library provides Unix-specific implementation for the core JMAP protocol.

Overview#

Jmap_unix provides the implementation needed to make actual connections to JMAP servers using OCaml's Unix module. It handles:

  • HTTP connections to JMAP endpoints
  • Authentication
  • Session discovery
  • Request/response handling
  • Blob upload/download
  • High-level email operations (Jmap_unix.Email)

Usage#

open Jmap
open Jmap_unix

(* Create a connection to a JMAP server *)
let credentials = Basic("username", "password") in
let (ctx, session) = Jmap_unix.connect ~host:"jmap.example.com" ~credentials in

(* Use the connection for JMAP requests *)
let response = Jmap_unix.request ctx request in

(* Close the connection when done *)
Jmap_unix.close ctx

Email Operations#

The Email module provides high-level operations for working with emails:

open Jmap
open Jmap.Unix

(* Get an email *)
let email = Email.get_email ctx ~account_id ~email_id ()

(* Search for unread emails *)
let filter = Jmap_email.Email_filter.unread ()
let (ids, emails) = Email.search_emails ctx ~account_id ~filter ()

(* Mark emails as read *)
Email.mark_as_seen ctx ~account_id ~email_ids:["email1"; "email2"] ()

(* Move emails to another mailbox *)
Email.move_emails ctx ~account_id ~email_ids ~mailbox_id ()

Dependencies#

  • jmap (core library)
  • jmap-email (email types and helpers)
  • yojson
  • uri
  • unix