Skip to main content

Module compose

Module compose 

Source
Expand description

Draft building and finalizing for outgoing mail.

Structs§

Attachment
A file named in an Attach: pseudo-header of the draft.
DraftHeaders
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, so my_hdr From: and my_hdr Reply-To: win over what rmut chose; To, Cc and Bcc instead gain the address, like mutt, so a standing my_hdr Bcc: me@example.com cannot 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. path is where the body lives, so ~b and ~h still 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 ~c sees 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 a User-Agent header when user_agent and 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 2369 NO meaning 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: %a the author’s address, %n their name, %s the subject, %i the message-id, %d the 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 (alternates included) 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=flowed and 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).