Mutt-like index format strings: %[-][min][.max]X where X is
C number, Z status/flag/mark chars, d date, F from, L
its list-aware variant (“To ” for List-Id mail), c size,
l body lines, y X-Label, s subject, % a literal percent. -
left-aligns, min pads, .max truncates (all in characters).
Mutt conditionals work too: %?X?then&else? renders then when
field X is set and non-zero.
Header cache for maildirs: opening a mailbox used to read and
parse every message; now the parsed envelopes are persisted (under
$XDG_CACHE_HOME/rmut/headers/) keyed by the file’s invariant base
name plus its byte length, so only new or changed files are parsed.
Flag renames keep the key; a partial IMAP cache file gaining its
body changes length and re-parses.
text/html into readable text, rmut’s own few hundred lines: mutt
shows html-only mail as raw source unless a mailcap filter is
configured, and machines without lynx/w3m deserve better. This is
the fallback the pager uses by default ([pager] html = "raw"
restores mutt’s literal behavior); a [filters]/mailcap
auto_view entry still wins, since it is consulted first.
URLs in running text: where the pager draws its links, what the
link list offers, and what markdown compose turns into anchors all
agree on what a URL is.
RFC 1524 mailcap, read the way mutt reads it for auto_view: a
[filters] entry with an empty command means “the command is in
my mailcap”, and only a copiousoutput entry can answer, since
that is the one promising plain text on stdout rather than a
window of its own.
RFC 6068 mailto: URLs, for rmut mailto:... as a desktop mail
handler. Only the headers a compose window can honor are read
(to, cc, bcc, subject, body); anything else is ignored rather than
smuggled into the draft, since a URL is untrusted input.
mbox support (system spools like /var/mail/$USER): the file is
mirrored into a cache maildir so the whole index/pager stack works
on it unchanged, and $ sync writes the changes back, rewriting
Status:/X-Status: headers and dropping purged messages, with the
file flock()ed and rewritten in place (mboxrd >From quoting).
Messages are keyed by a content hash, so flags survive re-mirrors
when the spool grows.
Muttrc importer: translate the common muttrc directives into rmut’s
TOML config. Meant for a one-time rmut --import-muttrc run whose
output the user reviews and saves; everything that does not map is
kept visible as # not imported: comments, never dropped silently.
Shared plumbing for the IMAP and SMTP clients: a stream that is
either plain TCP or TLS (rustls), plus a buffered line reader whose
writes go straight through to the socket.
Mutt-style search/limit patterns. Terms: ~f from, ~s subject,
~b body, ~t to, ~c cc, ~C to-or-cc, ~e sender, ~h any
header, ~i Message-ID, ~x References, ~d date, ~r received
date, ~m index range, ~z size range, ~= duplicate,
~N new, ~F flagged, ~D deleted, ~U unread, ~T tagged,
~l addressed to a known mailing list,
~p addressed to me, ~P sent by me, ~A every message;
a bare word matches subject or from (mutt’s
$simple_search). Adjacent terms AND, | ORs, ! negates, ()
groups; string arguments are case-insensitive regexes (quote them
to include spaces), ~d/~r take DD/MM/YYYY ranges or </>/=
offsets like <1w.
PGP support by shelling out to gpg(1): decrypt and verify messages
for the pager, sign and encrypt outgoing drafts. Handles PGP/MIME
(RFC 3156) and inline (“armor in the body”) messages. Passphrases
are between gpg and its agent; rmut never sees or stores them.
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.
Private temporary files: a part for a mailcap %s command, a
signature for gpg, a draft for the editor. They live in the shared
temp dir, so each is created fresh (O_EXCL: never through a link or
over a file someone else put there) and readable by us alone.
Minimal SMTP submission client: EHLO, STARTTLS or implicit TLS,
AUTH PLAIN, then MAIL/RCPT/DATA with dot-stuffing. An alternative
to handing mail to sendmail(1).
Message threading after JWZ’s algorithm
(https://www.jwz.org/doc/threading.html): containers per message-id,
reference chains linked parent→child with loop protection, empty
containers pruned by promoting their children. Threads and siblings
are ordered by date. JWZ step 5, grouping what is left by subject,
is mutt’s pseudo_threads here: see SubjectFallback.