sigildocs

(sigil jmap email)

(sigil jmap email) - JMAP Email Operations

Provides email querying, retrieval, and modification via JMAP Email/query, Email/get, and Email/set methods (RFC 8621).

Exports

Query and fetch emails in a single round-trip.

Combines Email/query and Email/get using a JMAP back-reference so the server resolves the query and returns the email objects in one request.

Keywords: mailbox: - Mailbox ID to query within filter: - Custom filter dict (overrides mailbox:) sort: - Sort criteria (default: receivedAt descending) limit: - Max results (default: 50) position: - Offset into results (default: 0) properties: - Properties to fetch (default: standard list)

Returns a list of email dicts.

(jmap-email-query client mailbox: inbox-id limit: 10)

Get a single email by ID with full body content.

Returns the email dict with body values, or #f if not found.

(define email (jmap-email-get client email-id))
(dict-ref email subject:)

Get multiple emails by their IDs.

Returns a list of email dicts.

(jmap-email-get-many client '("id1" "id2" "id3"))

Update an email's properties.

The updates dict contains JMAP patch operations.

(jmap-email-update! client email-id
  #{ (string->keyword "keywords/$seen"): #t })

Move an email to a different mailbox.

Replaces all current mailbox assignments with the target mailbox.

(jmap-email-move! client email-id trash-id)

Delete an email permanently.

(jmap-email-destroy! client email-id)

Set a keyword on an email.

Common keywords: "$seen", "$flagged", "$draft", "$answered", "$forwarded".

(jmap-email-set-keyword! client email-id "$seen")
(jmap-email-set-keyword! client email-id "$flagged")

Remove a keyword from an email.

(jmap-email-remove-keyword! client email-id "$seen")