Expand description
An IMAP folder mirrored into a local cache maildir, so the whole
index/pager stack works on it unchanged. Filenames carry the UID
and server size (<uid>.rmut,S=<size>); new messages start as
header-only files (marked with a leading X-Rmut-Partial header) and
get their full body on first view. Local flag changes and deletes
are pushed with UID STORE / EXPUNGE on sync.
Structs§
- Backfill
- Background header mirror for the tail of a huge folder: a
dedicated session fetches
uidsinto the cache chunk by chunk; the caller’s poll rescan picks the files up as they land. Dropped (mailbox switch, quit) it stops at the next chunk boundary; best-effort; anything missed comes in with the next reconcile. - Idle
Watch - Handle to a background IDLE watcher. Dropping it sets the stop flag; the thread notices within the socket’s 60 s read timeout and logs out.
- Remote
Functions§
- backfill
- cache_
base $XDG_CACHE_HOME/rmut(or~/.cache/rmut), shared by the IMAP, mbox, and notmuch mirrors.- cache_
dir - Where a folder’s cache maildir lives:
$XDG_CACHE_HOME/rmut/imap/<account>/<mailbox>(percent-encoded). - clean_
mailbox - Tidy a mailbox name: collapse
//runs and trim/from the ends (servers reject “adjacent hierarchy separators”); empty → INBOX. A mutt-style imap[s]:// URL (from an unconverted config) means the mailbox in its path. - idle_
watch - Watch
mailboxwith IDLE on a dedicated connection, setting the handle’s flag whenever the server announces changes. Best-effort: when the server lacks IDLE (or anything fails) the thread just ends and the caller’s NOOP polling carries on as before. - is_
partial - True for cached files that hold only the message headers so far.
- parse_
spec imap:account[/mailbox]→ (account, mailbox); INBOX when omitted.- uid_of
- UID encoded in a cache filename (
<uid>.rmut[,S=n][:2,flags]).
Type Aliases§
- Progress
- Sink for transient “what am I doing” lines during blocking IMAP work (connecting, fetching flags/headers); the UI decides how to show them.