Commitfa230a4cRecorded29 Mar 2026Repositorysigil-jmap

Add README

Changed
 README.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)
Diff
README.mdadded
@@ -0,0 +1,70 @@
+1
# sigil-jmap
+2
+3
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.
+4
+5
## Features
+6
+7
- **Session discovery** -- Bearer token or Basic auth, automatic capability detection
+8
- **Mailbox operations** -- list, find by role/name, create, update, delete
+9
- **Email querying** -- filter by mailbox, sort, paginate with back-referenced query+get
+10
- **Email retrieval** -- single or batch with full body content
+11
- **Email mutations** -- move between mailboxes, set/remove keywords, delete
+12
- **Email sending** -- with identity selection, to/cc/bcc, text and HTML bodies
+13
- **Blob download** -- fetch attachments via template URL expansion
+14
- **Error handling** -- JMAP-level error type checking
+15
+16
## Usage
+17
+18
Add `sigil-jmap` as a dependency in your `package.sgl`:
+19
+20
```scheme
+21
(from-git url: "codeberg:sigil/sigil-jmap" package: "sigil-jmap")
+22
```
+23
+24
Then connect and query email:
+25
+26
```scheme
+27
(import (sigil jmap))
+28
+29
(define session (jmap-connect
+30
url: "https://api.fastmail.com/jmap/session"
+31
token: (getenv "JMAP_TOKEN")))
+32
+33
;; List mailboxes
+34
(define mailboxes (jmap-mailboxes session))
+35
+36
;; Find inbox
+37
(define inbox (jmap-mailbox-by-role session "inbox"))
+38
+39
;; Query recent emails
+40
(define emails (jmap-email-query session
+41
mailbox-id: (jmap-mailbox-id inbox)
+42
limit: 10))
+43
```
+44
+45
## Modules
+46
+47
| 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 |
+54
+55
## Dependencies
+56
+57
- sigil-stdlib
+58
- sigil-json
+59
- sigil-http
+60
+61
## Building
+62
+63
```bash
+64
sigil build --redirects dev-redirects.sgl
+65
sigil test
+66
```
+67
+68
## License
+69
+70
BSD-3-Clause