Expand description
Draft building and finalizing for outgoing mail.
Structs§
- Attachment
- A file named in an
Attach:pseudo-header of the draft. - Draft
Headers - Quoted
- The message an attribution or a forward subject is about, for the format strings that describe it.
Constants§
- DEFAULT_
ATTRIBUTION - mutt’s $attribution: the line a quoted reply opens with.
- DEFAULT_
FORWARD_ FORMAT - mutt’s $forward_format: the subject a forward carries.
- DEFAULT_
INDENT - mutt’s $indent_string: what a quoted line is prefixed with.
- MARKDOWN_
HEADER - The draft header that says whether this draft is markdown: rmut’s own, written by the compose menu’s toggle, kept through postpone, and taken off before the message goes anywhere.
- REPLY_
REGEXP - mutt’s $reply_regexp default: “Re:” with an optional bracketed count, as Re[2]: has it.
Functions§
- addresses
- Every bare address in an RFC 5322 address field.
- apply_
my_ hdr - mutt’s
my_hdr: extra header lines that go on every draft. An entry naming a header the draft already carries replaces it, somy_hdr From:andmy_hdr Reply-To:win over what rmut chose; To, Cc and Bcc instead gain the address, like mutt, so a standingmy_hdr Bcc: me@example.comcannot erase a reply’s recipients. Malformed entries (no colon, no name) are ignored. - attach_
line - One Attach: line back from its parts (quotes around a path with spaces, then the optional type and description).
- attribution
- mutt’s $attribution over the message being replied to.
- bare_
address - body_
entity - The draft’s text as a MIME entity: text/plain, or with markdown compose a multipart/alternative of that text/plain and the text/html rendered from it. The plain half comes first, so a reader that shows the last part it can (every graphical one) shows the html, and a plain one loses nothing.
- bounce_
text - Message text for a bounce: the original with a fresh Resent-* block prepended, per RFC 5322 (the newest resend goes first).
- content_
type - Content type guessed from the filename extension.
- default_
reply_ regexp - draft_
envelope - A draft seen as a message, so hook patterns (
~t,~c,~s,~f, …) can be matched against outgoing mail the way mutt matches fcc-hook.pathis where the body lives, so~band~hstill have something to read; the date is now, since the draft has no Date header yet. Bcc joins the Cc addresses, so a hook on~csees a blind recipient too. - draft_
text - The text the user edits in $EDITOR: header block, blank line, body.
- extract_
attachments - Pull mutt-style
Attach: <path> [type/subtype] [description]pseudo-headers out of a draft’s header block; quotes allow a path with spaces,~/means $HOME. Returns the draft without those lines. - finalize
- From/Date/Message-ID when the user didn’t write them.
- finalize_
with - Like
finalize, adding aUser-Agentheader whenuser_agentand the draft has none of its own. - flow_
plain - mutt’s $text_flowed for a message that goes out with no MIME wrapper at all: declare the body and space-stuff it, in place, on a finalized draft. One that already carries a Content-Type (the user wrote their own) is left alone.
- followup_
to - mutt’s $followup_to: the Mail-Followup-To for a message going to a mailing list. Every recipient goes in; your own address is left out when you are subscribed (the list copy is the one you will get) and kept when you are not.
- forward_
body - The forwarded original between mutt’s markers. With mutt’s $forward_quote the message itself is prefixed with $indent_string, the way a reply is quoted; the markers stay flush, since they are rmut’s words and not the original’s.
- forward_
subject - mutt’s $forward_format over the message being forwarded.
- from_
address - The SMTP envelope sender: the bare address of the From header.
- group_
recipients - The Cc a group reply gets: everyone the original named in To and
Cc, written the way they were written, minus anyone already in
to(the sender, normally) and, unless mutt’s $metoo is set, minus me. Duplicates collapse on the bare address, so a person listed in both To and Cc appears once. - list_
post_ address - First address in an RFC 5322 address field, without display name,
e.g. the SMTP envelope sender from a From line.
The posting address from a List-Post header value:
<mailto:dev@example.com>, with the RFC 2369NOmeaning the list takes no posts. Extra mailto parameters are dropped. - make_
message_ id - mixed_
entity - The MIME entity (Content-Type header + body, CRLF endings) for a draft body with attachments: multipart/mixed with the text first, files base64-encoded, and optionally the forwarded original as message/rfc822 (mutt’s mime_forward). The caller puts it under the draft’s top-level headers, or inside a PGP layer.
- quote
- Quote a body mutt-style under an attribution line, each line prefixed with $indent_string.
- quoted_
printable - Quoted-printable (RFC 2045), CRLF line ends: the html half’s paragraphs are single lines, often past the 998 bytes SMTP allows.
- render_
quoted - Expand one of mutt’s message format strings:
%athe author’s address,%ntheir name,%sthe subject,%ithe message-id,%dthe date,%{...}the date through strftime,%%a percent. Padding and conditionals work as they do in the index format. - reply_
regexp - Compile a $reply_regexp the way mutt does: case-insensitively unless the pattern itself has an uppercase letter (mutt’s mutt_which_case).
- reply_
subject - The subject of a reply, as mutt makes it: “Re: “ over the original with whatever $reply_regexp matched at its start taken off, so an “RE: x” or “Re[2]: x” answers as “Re: x” rather than piling up.
- reverse_
from - mutt’s reverse_name: the first of my addresses (
alternatesincluded) the original was addressed to, in the form it appeared: the display name from the To/Cc header is kept. - rfc2822_
now - signature_
text - mutt’s $signature: the text a draft ends with. A name ending in
|is a command whose standard output is the signature (mutt’s rule); anything else is a file. A signature that cannot be read is no signature: a draft is worth more than the ornament on it. - smtp_
envelope - SMTP envelope for a finalized draft: every To/Cc/Bcc address, and the text with Bcc headers removed (they must not go on the wire).
- take_
markdown - The draft without its markdown header, and what the header said (None when it has none, and the config decides).
- text_
entity - The text/plain entity of an outgoing message: its Content-Type
header and the body in canonical CRLF form. With mutt’s
$text_flowed the part is declared
format=flowedand the body is space-stuffed, so a reader may rewrap it (RFC 3676). The paragraphs are the editor’s doing: rmut adds no trailing spaces. - user_
agent_ header - Finalize an edited draft for sending: require a recipient, add mutt’s $user_agent header, when the caller asks for it.
- with_
signature - The body with the signature under it, mutt’s way: a blank line, then $sig_dashes’ “– “ line when it is on, then the signature.
- with_
signature_ at - The signature added to a draft. mutt’s $sig_on_top puts it above the quoted original instead of below (with a blank line between, so the reply is written between the signature and the quote).