<!--}}}-->
-<sect>Syntax of Initialization Files<label id="muttrc-syntax"> <!--{{{-->
+<sect>Basic Syntax of Initialization Files<label id="muttrc-syntax"> <!--{{{-->
<p>
An initialization file consists of a series of <ref id="commands"
comment which includes line3 and line4. line5 is a new line of its own and
thus is interpreted again.
-It is also possible to substitute the output of a Unix command in an
-initialization file. This is accomplished by enclosing the command in
-backquotes (``). For example,
+The commands understood by mutt are explained in the next paragraphs.
+For a complete list, see the <ref id="commands" name="command reference">.
+
+<!--}}}-->
+
+<sect>Expansion within variables <!--{{{-->
+
+ <p>Besides just assign static content to variables, there's plenty of
+ ways of adding external and more or less dynamic content.
+
+ <sect1>Commands' Output
+
+ <p>It is possible to substitute the output of a Unix command in an
+ initialization file. This is accomplished by enclosing the command
+ in backquotes (``) as in, for example:
+
<tscreen><verb>
my_hdr X-Operating-System: `uname -a`
</verb></tscreen>
-The output of the Unix command ``uname -a'' will be substituted before the
-line is parsed. Note that since initialization files are line oriented, only
-the first line of output from the Unix command will be substituted.
-UNIX environments can be accessed like the way it is done in shells like
-sh and bash: Prepend the name of the environment by a ``$''. For
-example,
+ <p>The output of the Unix command ``uname -a'' will be substituted
+ before the line is parsed. Note that since initialization files are
+ line oriented, only the first line of output from the Unix command
+ will be substituted.
+
+ <sect1>Environment Variables
+
+ <p>UNIX environments can be accessed like the way it is done in
+ shells like sh and bash: Prepend the name of the environment by a
+ ``$'' sign. For example,
+
<tscreen><verb>
set record=+sent_on_$HOSTNAME
</verb></tscreen>
-The commands understood by mutt are explained in the next paragraphs.
-For a complete list, see the <ref id="commands" name="command reference">.
+ <p>sets the <ref id="record" name="$record"> variable to the
+ string <em/+sent_on_/ and appends the value of the evironment
+ variable <tt>$HOSTNAME</tt>.
-<!--}}}-->
+ <p><bf/Note:/ There will be no warning if an environment variable
+ is not defined. The result will of the expansion will then be empty.
+
+ <sect1>Configuration Variables
+
+ <p>As for environment variables, the values of all configuration
+ variables as string can be used in the same way, too. For example,
+
+<tscreen><verb>
+set imap_home_namespace = $folder
+</verb></tscreen>
+
+ <p>would set the value of <ref id="imap_home_namespace"
+ name="$imap_home_namespace"> to the value to
+ which <ref id="folder" name="$folder"> is <em/currently/ set
+ to.
+
+ <p><bf/Note:/ There're no logical links established in such cases so
+ that the the value for <ref id="imap_home_namespace"
+ name="$imap_home_namespace"> won't change even
+ if <ref id="folder" name="$folder"> gets changed.
+
+ <p><bf/Note:/ There will be no warning if a configuration variable
+ is not defined or is empty. The result will of the expansion will
+ then be empty.
+
+ <sect1>Self-Defined Variables
+
+ <p>Mutt-ng flexibly allows users to define their own variables. To
+ avoid conflicts with the standard set and to prevent misleading
+ error messages, there's a reserved namespace for them: all
+ user-defined variables must be prefixed with <tt/user_/ and can be
+ used just like any ordinary configuration or environment
+ variable.
+
+ <p>For example, to view the manual, users can either define two
+ macros like the following
+
+<tscreen><verb>
+macro generic <F1> "!less -r /path/to/manual" "Show manual"
+macro pager <F1> "!less -r /path/to/manual" "Show manual"
+</verb></tscreen>
+
+ <p>for <tt/generic/, <tt/pager/ and <tt/index/. The alternative is to
+ define a custom variable like so:
+
+<tscreen><verb>
+set user_manualcmd = "!less -r /path/to_manual"
+macro generic <F1> "$user_manualcmd<enter>" "Show manual"
+macro pager <F1> "$user_manualcmd<enter>" "Show manual"
+macro index <F1> "$user_manualcmd<enter>" "Show manual"
+</verb></tscreen>
+
+ <p>to re-use the command sequence as in:
+
+<tscreen><verb>
+macro index <F2> "$user_manualcmd | grep '\^[ ]\\+~. '" "Show Patterns"
+</verb></tscreen>
+
+ <p>Using this feature, arbitrary sequences can be defined once and
+ recalled and reused where necessary. More advanced scenarios could
+ include to save a variable's value at the beginning of macro
+ sequence and restore it at end.
+
+ <p>When the variable is first defined, the first value it gets
+ assigned is also the initial value to which it can be reset using
+ the <tt/reset/ command.
+
+ <p>The complete removal is done via the <tt/unset/ keyword.
+
+ <p>After the following sequence:
+
+<tscreen><verb>
+set user_foo = 42
+set user_foo = 666
+</verb></tscreen>
+
+ <p>the variable <tt>$user_foo</tt> has a current value of 666 and an
+ initial of 42. The query
+
+<tscreen><verb>
+set ?user_foo
+</verb></tscreen>
+
+ <p>will show 666. After doing the reset via
+
+<tscreen><verb>
+reset user_foo
+</verb></tscreen>
+
+ <p>a following query will give 42 as the result. After unsetting it
+ via
+
+<tscreen><verb>
+unset user_foo
+</verb></tscreen>
+
+ <p>any query or operation (except the noted expansion within other
+ statements) will lead to an error message.
+
+ <sect1>Pre-Defined Variables
+
+ <p>In order to allow users to share one setup over a number of
+ different machines without having to change its contents, there's a
+ number of pre-defined variables. These are prefixed with
+ <tt/muttng_/ and are read-only, i.e. they cannot be set, unset or
+ reset. The reference chapter lists all available variables.
+
+ <p><em> Please consult the local copy of your manual for their
+ values as they may differ from different manual sources.</em> Where
+ the manual is installed in can be queried (already using such a
+ variable) by running:
+
+<tscreen><verb>
+muttng -Q muttng_docdir
+</verb></tscreen>
+
+ <p>To extend the example for viewing the manual via self-defined
+ variables, it can be made more readable and more portable by
+ changing the real path in:
+
+<tscreen><verb>
+set user_manualcmd = '!less -r /path/to_manual'
+</verb></tscreen>
+
+ <p>to:
+
+<tscreen><verb>
+set user_manualcmd = "!less -r $muttng_docdir/manual.txt"
+</verb></tscreen>
+
+ <p>which works everywhere if a manual is installed.
+
+ <p><em>Note: this is a draft feature and maybe subject to change in
+ the near future.</em>
+
+ <sect1>Type Conversions
+
+ <p>A note about variable's types during conversion: internally
+ values are stored in internal types but for any dump/query or set
+ operation they're converted to and from string. That means that
+ there's no need to worry about types when referencing any variable.
+ As an example, the following can be used without harm (besides
+ makeing muttng very likely behave strange):
+
+<tscreen><verb>
+set read_inc = 100
+set folder = $read_inc
+set read_inc = $folder
+set user_magic_number = 42
+set folder = $user_magic_number
+</verb></tscreen>
+
+<!--}}}-->
<sect>Defining/Using aliases<label id="alias"> <!--{{{-->
<p>
<sect>Format = Flowed <!--{{{-->
-<p>Mutt-ng contains support for so-called <tt/format=flowed/ messages.
-In the beginning of email, each message had a fixed line width, and
-it was enough for displaying them on fixed-size terminals. But times
-changed, and nowadays hardly anybody still uses fixed-size terminals:
-more people nowaydays use graphical user interfaces, with dynamically
-resizable windows. This led to the demand of a new email format that
-makes it possible for the email client to make the email look nice
-in a resizable window without breaking quoting levels and creating
-an incompatible email format that can also be displayed nicely on
-old fixed-size terminals.
-
-<p>For introductory information on <tt/format=flowed/ messages, see
-<htmlurl url="http://www.joeclark.org/ffaq.html"
-name="<http://www.joeclark.org/ffaq.html>">.
-
-<p>When you receive emails that are marked as <tt/format=flowed/
-messages, and is formatted correctly, mutt-ng will try to reformat
-the message to optimally fit on your terminal. If you want a fixed
-margin on the right side of your terminal, you can set the
-following:
+ <sect1>Introduction <!--{{{-->
-<verb>
-set wrapmargin = 10
-</verb>
+ <p>Mutt-ng contains support for so-called <tt/format=flowed/ messages.
+ In the beginning of email, each message had a fixed line width, and
+ it was enough for displaying them on fixed-size terminals. But times
+ changed, and nowadays hardly anybody still uses fixed-size terminals:
+ more people nowaydays use graphical user interfaces, with dynamically
+ resizable windows. This led to the demand of a new email format that
+ makes it possible for the email client to make the email look nice
+ in a resizable window without breaking quoting levels and creating
+ an incompatible email format that can also be displayed nicely on
+ old fixed-size terminals.
-<p>The code above makes the line break 10 columns before the right
-side of the terminal.
+ <p>For introductory information on <tt/format=flowed/ messages, see
+ <htmlurl url="http://www.joeclark.org/ffaq.html"
+ name="<http://www.joeclark.org/ffaq.html>">.
-<p>If your terminal is so wide that the lines are embarrassingly long,
-you can also set a maximum line length:
+ <!--}}}-->
-<verb>
-set max_line_length = 120
-</verb>
+ <sect1>Receiving: Display Setup <!--{{{-->
-<p>The example above will give you lines not longer than 120
-characters.
+ <p>When you receive emails that are marked as <tt/format=flowed/
+ messages, and is formatted correctly, mutt-ng will try to reformat
+ the message to optimally fit on your terminal. If you want a fixed
+ margin on the right side of your terminal, you can set the
+ following:
-<p>When you view at <tt/format=flowed/ messages, you will often see
-the quoting hierarchy like in the following example:
+ <verb>
+ set wrapmargin = 10
+ </verb>
-<verb>
->Bill, can you please send last month's progress report to Mr.
->Morgan? We also urgently need the cost estimation for the new
->production server that we want to set up before our customer's
->project will go live.
-</verb>
+ <p>The code above makes the line break 10 columns before the right
+ side of the terminal.
-<p>This obviously doesn't look very nice, and it makes it very
-hard to differentiate between text and quoting character. The
-solution is to configure mutt-ng to "stuff" the quoting:
+ <p>If your terminal is so wide that the lines are embarrassingly long,
+ you can also set a maximum line length:
-<verb>
-set stuff_quoted
-</verb>
+ <verb>
+ set max_line_length = 120
+ </verb>
-<p>This will lead to a nicer result that is easier to read:
+ <p>The example above will give you lines not longer than 120
+ characters.
-<verb>
-> Bill, can you please send last month's progress report to Mr.
-> Morgan? We also urgently need the cost estimation for the new
-> production server that we want to set up before our customer's
-> project will go live.
-</verb>
+ <p>When you view at <tt/format=flowed/ messages, you will often see
+ the quoting hierarchy like in the following example:
+
+ <verb>
+ >Bill, can you please send last month's progress report to Mr.
+ >Morgan? We also urgently need the cost estimation for the new
+ >production server that we want to set up before our customer's
+ >project will go live.
+ </verb>
-<p>If you want mutt-ng to send emails with <tt/format=flowed/ set, you
-need to explicitly set it:
+ <p>This obviously doesn't look very nice, and it makes it very
+ hard to differentiate between text and quoting character. The
+ solution is to configure mutt-ng to "stuff" the quoting:
-<verb>
-set text_flowed
-</verb>
+ <verb>
+ set stuff_quoted
+ </verb>
+
+ <p>This will lead to a nicer result that is easier to read:
+
+ <verb>
+ > Bill, can you please send last month's progress report to Mr.
+ > Morgan? We also urgently need the cost estimation for the new
+ > production server that we want to set up before our customer's
+ > project will go live.
+ </verb>
+
+ <!--}}}-->
+
+ <sect1>Sending <!--{{{-->
+
+ <p>If you want mutt-ng to send emails with <tt/format=flowed/ set, you
+ need to explicitly set it:
+
+ <verb>
+ set text_flowed
+ </verb>
-<p>Additionally, you have to use an editor which supports writing
-<tt/format=flowed/-conforming emails. For vim, this is done by
-adding <tt/w/ to the formatoptions (see <tt/:h formatoptions/ and
-<tt/:h fo-table/) when writing emails.
+ <p>Additionally, you have to use an editor which supports writing
+ <tt/format=flowed/-conforming emails. For vim, this is done by
+ adding <tt/w/ to the formatoptions (see <tt/:h formatoptions/ and
+ <tt/:h fo-table/) when writing emails.
+
+ <p>Also note that <em/format=flowed/ knows about ``space-stuffing'',
+ that is, when sending messages, some kinds of lines have to be
+ indented with a single space on the sending side. On the receiving
+ side, the first space (if any) is removed. As a consequence and in
+ addition to the above simple setting, please keep this in mind when
+ making manual formattings within the editor. Also note that mutt-ng
+ currently violates the standard (RfC 3676) as it does not
+ space-stuff lines starting with:
+
+ <itemize>
+
+ <item><tt/>/ This is <em/not/ the quote character but a right
+ angle used for other reasons
+
+ <item><tt/From/ with a trailing space.
+
+ <item>just a space for formatting reasons
+
+ </itemize>
+
+ Please make sure that you manually prepend a space to each of them.
+
+ <!--}}}-->
+
+ <sect1>Additional Notes <!--{{{-->
+
+ <p> For completeness, the <ref id="delete_space"
+ name="$delete_space"> variable provides the mechanism
+ to generate a <tt/DelSp=yes/ parameter on <em/outgoing/ messages.
+ According to the standard, clients receiving a <tt/format=flowed/
+ messages should delete the last space of a flowed line but still
+ interpret the line as flowed. Because flowed lines usually contain
+ only one space at the end, this parameter would make the receiving
+ client concatenate the last word of the previous with the first of
+ the current line <em/without/ a space. This makes ordinary text
+ unreadable and is intended for languages rarely using spaces. So
+ please use this setting only if you're sure what you're doing.
+
+ <!--}}}-->
<!--}}}-->
and the <tt>˜n</tt> pattern:
<verb>
-color black yellow "~n 10-"
-color red yellow "~n 100-"</verb>
+color index black yellow "~n 10-"
+color index red yellow "~n 100-"</verb>
<p>The rules above mark all messages with a score between 10 and 99
with black and yellow, and messages with a score greater or equal
1524. Mutt-ng can be set up to <em/automatically/ execute any
given utility as listed in one of the mailcap files (see the
<ref id="mailcap_path" name="$mailcap_path">
- variable for details.) These utilities may have security issues
- like overriding arbitrary files, contain exploitable bugs or just
- leak information which is a bad in combination with running them
- without prompting. When using mutt-ng's autoview mechanism
- involing use of mailcap files, please make sure that
+ variable for details.)
+
+ These utilities may have a variety of security vulnerabilities,
+ including overwriting of arbitrary files, information leaks or
+ other exploitable bugs. These vulnerabilities may go unnoticed by
+ the user, especially when they are called automatically (and
+ without interactive prompting) from the mailcap file(s). When
+ using mutt-ng's autoview mechanism in combination with mailcap
+ files, please be sure to...
<itemize>
- <item>you manually select trustworthy applications with a
- reasonable calling sequence
+ <item>manually select trustworth applications with a reasonable
+ calling sequence
- <item>you check the contents of mailcap files from time to time
- (for example after doing software installations/upgrades)
+ <item>periodically check the contents of mailcap files,
+ especially after software installations or upgrades
- <item>you, if you're the system's operator, always keep the
- software packages involved up-to-date
+ <item>keep the software packages referenced in the mailcap file up to date
- <item>you never ever change the default value of the
- <ref id="mailcap_sanitize"
- name="$mailcap_sanitize"> variable
+ <item>leave the <ref id="mailcap_sanitize"
+ name="$mailcap_sanitize"> variable in its default
+ state to restrict mailcap expandos to a safe set of characters
</itemize>
to send messages from the command line as well.
<tscreen><verb>
--A expand an alias
+-A expand an alias
-a attach a file to a message
-b specify a blind carbon-copy (BCC) address
-c specify a carbon-copy (Cc) address
--D print the value of all variables on stdout
-e specify a config command to be run after initialization files are read
-f specify a mailbox to load
-F specify an alternate file to read initialization commands
-Q query a configuration variable
-R open mailbox in read-only mode
-s specify a subject (enclose in quotes if it contains spaces)
+-t dump the value of all variables to stdout
+-T dump the value of all changed variables to stdout
-v show version number and compile-time definitions
-x simulate the mailx(1) compose mode
-y show a menu containing the files specified by the mailboxes command