GNU Mailutils |
|
General-Purpose Mail Package |
Official GNU Software |
The ‘#’ character introduces an end-of-line comment. All characters until and including the end of line are ignored.
The ‘echo’ (‘ec’) command prints its arguments to stdout.
The command ‘source filename’ reads commands from the named file. Its minimal abbreviation is ‘so’.
The mail variables are set using ‘set’ (‘se’) command. The command takes a list of assignments. The syntax of an assignment is
Assign a string value to the variable. If string contains whitespace characters it must be enclosed in a pair of double-quote characters (‘"’)
Assign a numeric value to the variable.
Assign boolean True
value.
Assign boolean False
value.
Example:
? set askcc nocrt indentprefix="> "
This statement sets askcc
to True
, crt
to
False
, and indentprefix
to “> ”.
To unset mail variables use ‘unset’(‘uns’) command. The command takes a list of variable names to unset.
To undo the effect of the previous example, do:
? unset askcc crt indentprefix
When used without arguments, both set
or unset
list all currently defined variables. The form of this listing is
controlled by variable-pretty-print
(varpp
) variable. If
it is set, a description precedes each variable, e.g.:
# prompt user for subject before composing the message ask # prompt user for cc before composing the message askcc # output character set for decoded header fields charset="auto" # number of columns on terminal screen columns=80
If variable-pretty-print
is not set, only the settings are
shown, e.g.:
ask askcc charset="auto" columns=80
A special command is provided to list all internal mail
variables:
variable [names...]
If used without arguments, it prints all known internal variables. If arguments are given, it displays only those internal variables that are listed in command line. For each variable, this command prints its name, data type, current value and a short description. For example:
? variable ask datefield ask, asksub Type: boolean Current value: yes prompt user for subject before composing the message datefield Type: boolean Current value: [not set] get date from the `Date:' header, instead of the envelope
Shell environment may be modified using ‘setenv’ (‘sete’) command. The command takes a list of assignments. The syntax of an assignment is:
If variable name does not already exist in the environment, then it is added to the environment with the value value. If name does exist, then its value in the environment is changed to value.
Delete the variable name from the environment (“unset” it).
The conditional statement allows to execute a set of mail commands
depending on the mode the mail
program is in. The conditional
statement is:
if cond ... else ... endif
where ‘...’ represents the set of commands to be executed in each branch of the statement. cond can be one of the following:
True if mail
is operating in mail sending mode.
True if mail
is operating in mail reading mode.
True if stdout is a terminal device (as opposed to a regular file).
The conditional statements can be nested to arbitrary depth. The minimal abbreviations for ‘if’, ‘else’ and ‘endif’ commands are ‘i’, ‘el’ and ‘en’.
Example:
if t set crt prompt="& " else unset prompt endif if s alt gray@example.com gray@example.org set
This document was generated on January 2, 2022 using makeinfo.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.