Read-only Maildir backend.
A Maildir is a directory with three subdirectories: cur/, new/
and tmp/. Each message lives in its own file. Messages in cur/
carry flags as a :2,<letters> suffix; messages in new/ have no
flags. We never move files between new/ and cur/ — this library
is strictly read-only.
This namespace intentionally does not touch the filesystem beyond
listing cur/ and new/ and reading individual files as bytes.
Parsing reuses mailseq.parse/message->map via an in-memory
MimeMessage.
Read-only Maildir backend. A Maildir is a directory with three subdirectories: `cur/`, `new/` and `tmp/`. Each message lives in its own file. Messages in `cur/` carry flags as a `:2,<letters>` suffix; messages in `new/` have no flags. We never move files between `new/` and `cur/` — this library is strictly read-only. This namespace intentionally does not touch the filesystem beyond listing `cur/` and `new/` and reading individual files as bytes. Parsing reuses `mailseq.parse/message->map` via an in-memory `MimeMessage`.
(by-id path id opts)Return the single message whose stable id matches id, or nil.
Because Maildir flag changes rewrite the filename suffix, we match
on the stable prefix. Scans new/ and cur/ — this is O(n) in
v1; an index can come later if it proves necessary.
Return the single message whose stable id matches `id`, or nil. Because Maildir flag changes rewrite the filename suffix, we match on the stable prefix. Scans `new/` and `cur/` — this is O(n) in v1; an index can come later if it proves necessary.
(by-ids path ids opts)Return a vector of message maps for every message whose stable id
is in ids (a set of strings). A single scan of cur/ + new/
reads only the matching files, in parallel.
Typical use: call list-ids to get all ids, diff against a set of
already-seen ids, then call by-ids with the remainder.
Return a vector of message maps for every message whose stable id is in `ids` (a set of strings). A single scan of `cur/` + `new/` reads only the matching files, in parallel. Typical use: call `list-ids` to get all ids, diff against a set of already-seen ids, then call `by-ids` with the remainder.
(list-ids path)Return a vector of stable id strings for every message in the
Maildir at path. Only reads filenames — no file content is
touched. Cost: one listFiles per subdirectory.
Return a vector of stable id strings for every message in the Maildir at `path`. Only reads filenames — no file content is touched. Cost: one `listFiles` per subdirectory.
(messages path opts)Read the messages under path (a Maildir directory) selected by
opts; return them as a vector in delivery order, oldest first.
:limit keeps the last N delivered, like IMAP, and only those
files are parsed.
With :since or :before, pass 1 reads only the Date: headers
to filter, then pass 2 parses the survivors. :since also skips,
unread, files whose filename timestamp is more than one day older:
a message with a later Date: but such a filename is not returned.
Read the messages under `path` (a Maildir directory) selected by `opts`; return them as a vector in delivery order, oldest first. `:limit` keeps the last N delivered, like IMAP, and only those files are parsed. With `:since` or `:before`, pass 1 reads only the `Date:` headers to filter, then pass 2 parses the survivors. `:since` also skips, unread, files whose filename timestamp is more than one day older: a message with a later `Date:` but such a filename is not returned.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |