Write a new message

$ himalaya message write [OPTIONS] [BODY]...

Writes a new message by editing a MML template. A template is a pseudo-message following this format:

Header1: val1
Header2: val2
Header3: val3
…

Body

Headers are located at the top of the template, whereas the body is located at the bottom of the template. Headers and body need to be separated by an empty new line.

Headers

Templates accept 8 headers:

  • Message-ID: represents the message identifier (you usually do not need to set up it manually)
  • In-Reply-To: represents the identifier of the replied message
  • Subject: represents the subject of the message
  • From: represents the address of the sender
  • To: represents the addresses of the receivers
  • Reply-To: represents the address the receiver should reply to instead of the From header
  • Cc: represents the addresses of the other receivers (carbon copy)
  • Bcc: represents the addresses of the other hidden receivers (blind carbon copy)

An address can be:

  • a single email address user@domain
  • a named address Name <user@domain>
  • a quoted named address "Name" <user@domain>

Multiple address are separated by a coma ,: user@domain, Name <user@domain>, "Name" <user@domain>.

Body

Templates bodies can be simple strings. During the compilation they are transformed into text/plain parts. So writing a template can be as simple as:

From: alice@localhost
To: Bob <bob@localhost>
Subject: Hello from Himalaya

Hello, world!

Templates bodies can also be written in MIME Meta Language, see the templates section for more information about the syntax.

Edition

Templates are edited using your default editor (the one specified in the $EDITOR environment variable).

Once the editor exited, the following actions will be prompted:

(s)end, (e)dit, (l)ocal/(r)emote draft or (d)iscard?
  • s compiles the template then sends the message
  • e reopens your editor with the template
  • l saves the template locally
  • r saves the template remotely (in the draft folder)
  • d discards the template

Options

-H|--header

Prefill the template with custom headers (can be repeated).

A raw header should follow the pattern KEY:VAL.

--disable-cache

Disable any sort of cache.

The action depends on commands it apply on. For example, when listing envelopes using the IMAP backend, this flag will ensure that envelopes are fetched from the IMAP server rather than the synchronized local Maildir.

-a|--account

Override the default account.

An account name corresponds to an entry in the table at the root level of your TOML configuration file.

Settings

message.write.backend

Override the backend used for writing messages.

# valid backends: maildir, imap, notmuch
message.write.backend = "imap"

message.write.headers

Define visible headers at the top of messages when writing them (new/reply/forward).

message.write.headers = ["Date", "From", "To", "Subject"]