Skip to main content

Crate rmut_core

Crate rmut_core 

Source

Modules§

alias
Mutt-style address aliases: lines of alias nick expansion... read from $RMUT_ALIASES or ~/.config/rmut/aliases.
command
mutt’s enter-command (:): config commands typed at runtime.
compose
Draft building and finalizing for outgoing mail.
config
TOML configuration from $RMUT_CONFIG or ~/.config/rmut/config.toml.
flowed
RFC 3676 text/plain; format=flowed.
format
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.
hdrcache
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.
html
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.
imap
Minimal IMAP4rev1 client: exactly the commands rmut needs (LOGIN, LIST, SELECT, UID FETCH/STORE, EXPUNGE, APPEND, NOOP, LOGOUT), over plain TCP or TLS. Responses are read as logical lines with RFC 3501 {N} literals collected alongside the text.
mailcap
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.
maildir
mailto
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
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.
message
muttrc
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.
net
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.
notice
What an operation has to say for itself.
pattern
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
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.
remote
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.
rfc2047
Header values decoded the way mutt decodes them: mutt’s rfc2047_decode rather than mailparse’s get_value.
smtp
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).
thread
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.