Expand description
rmut’s mail session: an open mailbox and the operations over it.
Everything here works without a screen. A front end owns the menus,
the keys and the drawing, and drives a Session for the rest:
what is in the mailbox, what is selected, what a mark or a sync
did. Outcomes leave as Notices through the sink the front end
installs, so an operation never has to know how it will be shown.
Structs§
- Command
Run - What a command line did, for the front end to finish and report.
- Compose
- A draft file going through editor → send/postpone/discard.
- Compose
Base - Snapshot of the message being replied to / forwarded, taken when the compose flow starts.
- Compose
Setup - Facts
- What the session knows about the open folder without asking the connection. Cheap, and unchanged while a job is in flight.
- Held
- A message that has been sent but is waiting out $undo_send before it goes anywhere. The finalized text is ready to transmit; the draft it came from is kept whole, so cancelling puts the compose menu back exactly as it was.
- Hook
- A compiled hook: the pattern its message must match, and what the hook carries (an enter-command line, or an Fcc mailbox).
- Imap
- A handle on the connection: the facts, and the thread doing the talking.
- Msg
- MsgMark
- One message’s state before a step touched it. The path is the identity: it only changes when the mailbox is written, and a write drops the whole stack.
- Session
- One open mailbox and everything rmut knows about it.
- Undo
Step - One undoable step: what it was, the messages as they stood before it, and where the cursor was.
Enums§
- Answer
- An answer on its way back in.
- Ask
- A question waiting on an answer.
- AskKind
- Which question is being answered, and everything the operation was holding when it stopped to ask. The front end carries it back untouched, so nothing about a half-done operation lives in the front end.
- Compose
Kind - Done
- What a job left behind.
- FrontOp
- The functions a session cannot carry out, because they are about the display rather than the mail: a menu to open, a screen to repaint, an editor to hand the terminal to. The session has done whatever checking it can (a mailbox with unsaved changes will not be left, an unconfigured query will not be prompted for) before handing one of these back, so a front end can act on it directly.
- Function
- One thing the index can be told to do, under the name mutt gives
it. A front end binds keys or menu items to these;
bindand:execname them straight out. - Job
- What the session asks the connection to do.
- Key
- The keystroke answering a
Ask::Key.Otheris anything the question does not recognise, which usually calls it off. - Manage
- One folder-management action, its folder names already stripped of
the
imap:account/prefix. - Outcome
- What came of running a function.
- Page
Spot - Where on the visible page the cursor should land.
- Pattern
Op - The pattern operations, mutt’s D/U/T/Ctrl+T.
- Request
- Something only the front end can do, handed back for it to honour or refuse.
- Security
- PGP treatment for an outgoing draft, chosen at the send prompt.
- Sidebar
Op - What to do with the mailbox pane.
- SortKey
- Thread
Op - Wants
- What a line answer is, so a front end can help the user give one.
Functions§
- account_
password - Run the account’s password command once per session. OAuth tokens expire, so those are fetched fresh for every connection instead.
- default_
from - default_
quote_ re - mutt’s $quote_regexp default.
- draft_
full - The draft as a full message: the file as edited, with any withheld header block put back in front.
- expand_
tilde - A path with a leading
~expanded, as mutt does everywhere it takes one. - header_
value - First value of a (single-line) header in a draft head block.
- parse_
sort - “[reverse-]date|from|subject|size|threads” from the config.
- pipe_to
- Run a shell command with
byteson its stdin. - run_
sendmail - With
rcptsthe addresses go on the command line (a bounce keeps its Resent-To out of -t’s reach); otherwise -t reads To/Cc/Bcc. - send_
via_ smtp - wrap_
order - Visit order for a wrapping scan over
nentries starting after (before, when backwards)sel: each index paired with a flag set once the walk passed the end (start). The starting index comes last, so a lone match under the cursor still counts as a wrap. - write_
draft