AtlatestRepositorysigil-jmap
sigil-jmap / treeREADME.md
1
# sigil-jmap3
A [Sigil](https://codeberg.org/sigil/sigil) library for JMAP email (RFC 8620/8621). Works with Fastmail, Stalwart, Cyrus, Apache James, and other JMAP-compatible servers.5
## Features7
- **Session discovery** -- Bearer token or Basic auth, automatic capability detection8
- **Mailbox operations** -- list, find by role/name, create, update, delete9
- **Email querying** -- filter by mailbox, sort, paginate with back-referenced query+get10
- **Email retrieval** -- single or batch with full body content11
- **Email mutations** -- move between mailboxes, set/remove keywords, delete12
- **Email sending** -- with identity selection, to/cc/bcc, text and HTML bodies13
- **Blob download** -- fetch attachments via template URL expansion14
- **Error handling** -- JMAP-level error type checking16
## Usage18
Add `sigil-jmap` as a dependency in your `package.sgl`:20
```scheme21
(from-git url: "codeberg:sigil/sigil-jmap" package: "sigil-jmap")22
```24
Then connect and query email:26
```scheme27
(import (sigil jmap))29
(define session (jmap-connect30
url: "https://api.fastmail.com/jmap/session"31
token: (getenv "JMAP_TOKEN")))33
;; List mailboxes34
(define mailboxes (jmap-mailboxes session))36
;; Find inbox37
(define inbox (jmap-mailbox-by-role session "inbox"))39
;; Query recent emails40
(define emails (jmap-email-query session41
mailbox-id: (jmap-mailbox-id inbox)42
limit: 10))43
```45
## Modules47
| Module | Description |48
|--------|-------------|49
| `(sigil jmap)` | Top-level re-exports |50
| `(sigil jmap client)` | Session discovery, JMAP request/response handling |51
| `(sigil jmap mailbox)` | Mailbox CRUD operations |52
| `(sigil jmap email)` | Email query, get, update, move, delete |53
| `(sigil jmap send)` | Identity listing and email submission |55
## Dependencies57
- sigil-stdlib58
- sigil-json59
- sigil-http61
## Building63
```bash64
sigil deps install65
sigil build66
sigil test67
```69
## License71
BSD-3-Clause