Skip to main content

Module compose

Module compose 

Source
Expand description

Writing: Markdown in, mail out.

You write Markdown. The message goes out as multipart/alternative: the Markdown itself as plain text, readable as it is, and its HTML (CommonMark with tables and strikethrough). A reply or a forward appends the message it answers below your text, after your text was converted: in HTML, the original made safe (reading::safe_html) in a blockquote; in plain text, its lines quoted with “> “. In-Reply-To and References keep the thread together in every client (RFC 5322 §3.6.4).

A draft is a small TOML file, saved as you type, so closing the window never loses anything (docs/client.md, “Calm first”).

Structs§

Draft
A message being written.
Outgoing
What goes out, besides the bytes: who it is from and to whom it goes.
Protection
How a message is protected with OpenPGP: signed with your key, encrypted to these keys (the recipients’ and yours, to read it in Sent).
Quote 🔒
The message answered or forwarded, below your text.

Enums§

DraftKind

Constants§

PLAIN_MARKS 🔒
Marks of plain formatting kept from HTML written in Markdown: they fetch nothing.
SIGNATURE_LINE
The line above a signature (RFC 3676 §4.3): readers recognise and fold what follows.

Functions§

address_of
“Jane jane@example.org” or “jane@example.org” → “jane@example.org”.
answer
A reply, a reply to all or a forward, from the message at original: recipients, subject and thread prefilled, the text left to you. own holds your addresses, never answered to.
attachments 🔒
The files attached by hand, then, for a forward, the original’s attachments.
build
The message as it goes out, from a draft: your text, then what it quotes or forwards, the attachments, the thread. from is the account’s name and address.
build_with
The message as it goes out, protected when asked: PGP/MIME (RFC 3156), multipart/signed for a signature alone, multipart/encrypted otherwise, the signature then inside. autocrypt is your Autocrypt header’s value.
entry 🔒
escape 🔒
escape_attribute 🔒
invitation_answer
An answer to an invitation (iMIP, RFC 6047 §2.4): a sentence for people, and the iTIP REPLY for their calendar, as two versions of one message.
is_own_copy
Whether path is one of the files Sioul copied for a draft from another application (handed), which go with their draft.
local_picture 🔒
“…” whose picture is on this computer or in the text itself (local_source); its other attributes are left out.
local_source 🔒
Whether a picture’s address stays on this computer: a path (from the note’s folder, or from the root), a file: address without a host, or the picture itself (data:image/…). Never “//host/…”, “\host\…” nor “file://host/…”, which reach a server (on Windows, with your credentials).
markdown_html
CommonMark with tables and strikethrough, as HTML. A line break typed in a mail is meant, as in a chat or a GitHub comment: it is kept.
mime_of
The media type from a file’s extension; unknown ones go as plain bytes.
name_of 🔒
The name part of “Jane jane@example.org”, else empty; a quoted name (“"Doe, Jane" <…>”) as it reads, without its quotes and escapes.
new_id 🔒
A name unique enough for a draft or a Message-ID: the time, and a little of the process.
new_message_id
A new message’s own name, the left part of its Message-ID: unique to this moment and this program.
own_copy_in 🔒
phrase
A name as an address field writes it (RFC 5322 §3.2.5): as it is when it holds only words, else between quotes, its quotes and backslashes escaped, so that “Doe, Jane” stays one name and never ends the field or the address.
plain_mark 🔒
“”, “”, “
”: a mark of PLAIN_MARKS, without attributes.
prefixed 🔒
“Re: Subject”, once only: “Re: Re: Re:” helps nobody. known: the prefixes your correspondents’ mail programs write (words::Replies: “TR:”, “AW:”…), capitals and accents aside.
quote 🔒
quoted_printable 🔒
Quoted-printable (RFC 2045 §6.7), lines kept, CRLF, soft breaks before 76 characters.
remove_own_copy
One of those copies removed, with its request’s folder once empty; nothing for any other file.
remove_own_copy_in 🔒
split_addresses
Splits what was typed in an address field: commas, semicolons and line breaks separate, but not inside a quoted name or between “<” and “>” (“"Doe, Jane" jane@example.org” is one recipient). A line whose quote or “<” is left open splits at every comma and semicolon, so no one is lost.
tag_attributes 🔒
A tag’s attributes after its name, names lowercase; none when the text is not one tag’s attributes (another tag, a stray quote).
written_html 🔒
One piece of HTML written in Markdown: a mark of plain formatting, or a picture of this computer rebuilt from its address, size and words alone; anything else as text, shown as it was written.