Next: , Previous: Scripting, Up: mail


2.4.6 How to Alter the Behavior of mail

Following variables control the behavior of gnu mail:

appenddeadletter

Type: Boolean.
Default: False. If this variable is True, the contents of canceled letter is appended to the user's dead.letter file. Otherwise it overwrites its contents.
askbcc

Type: Boolean.
Default: False. When set to True the user will be prompted to enter Bcc field before composing the message.
askcc

Type: Boolean.
Default: True. When set to True the user will be prompted to enter Cc field before composing the message.
asksub

Type: Boolean.
Default: True in interactive mode, False otherwise. When set to True the user will be prompted to enter Subject field before composing the message.
autoinc

Type: Boolean.
Default: True. Automatically incorporate newly arrived messages.
autoprint

Type: Boolean.
Default: False. Causes the delete command to behave like dp - thus, after deleting a message, the next one will be typed automatically.
bang

Type: Boolean.
Default: False. When set, every occurrence of ! in arguments to ! command is replaced with the last executed command.
datefield

Type: Boolean.
Default: False. By default the date in a header summary is taken from the SMTP envelope of the message. Setting this variable tells mail to use the date from Date: header field, converted to localtime. Notice, that for messages lacking this field mail will fall back to using SMTP envelope.
charset

Type: string
Default: ‘auto The value of this variable controls the output character set for the header fields encoding using RFC 2047. If the variable is unset, no decoding is performed and the fields are printed as they are. If the variable is set to ‘auto’, mail tries to deduce the name of the character set from the value of LC_ALL environment variable. Otherwise, its value is taken as the name of the charset.
cmd

Type: String.
Default: Unset. Contains default shell command for pipe.
columns

Type: Numeric.
Default: Detected at startup by querying the terminal device. If this fails, the value of environment variable COLUMNS is used. This variable contains the number of columns on terminal screen.
crt

Type: Boolean or Numeric
Default: True in interactive mode, False otherwise. The variable crt determines the minimum number of lines the body of the message must contain in order to be piped through pager command specified by environment variable PAGER. If crt is set to a numeric value, this value is taken as the threshold. Otherwise, if crt is set without a value, then the height of the terminal screen is used to compute the threshold. The number of lines on screen is controlled by screen variable.
decode-fallback

Type: String.
Default: ‘none’. This variable controls the way to represent characters that cannot be rendered using current character set. It can have three values:
none
Such characters are not printed at all. The conversion process stops at the first character that cannot be rendered.
copy-pass
The characters are displayed ‘as is’. Notice, that depending on your setup, this may screw-up your terminal settings.
copy-octal
Unprintable characters are represented by their octal codes. Printable ones are printed ‘as is’.

dot

Type: Boolean.
Default: False. If True, causes mail to interpret a period alone on a line as the terminator of a message you are sending.
emptystart

Type: Boolean.
Default: False. If the mailbox is empty, mail normally prints ‘No mail for user’ and exits immediately. If this option is set, mail will start no matter is the mailbox empty or not.
editheaders

Type: Boolean.
Default: False. When set, mail will include message headers in the text to be the ~e and ~v escapes, thus allowing you to customize the headers.
escape

Type: String.
Default: ~ If defined, the first character of this option gives the character to denoting escapes.
flipr

Type: Boolean
Default: Unset The variable flipr if set swaps the meanings of reply and Reply commands (see Replying).
folder

Type: String.
Default: Unset. The name of the directory to use for storing folders of messages. If unset, $HOME is assumed.
header

Type: Boolean.
Default: True, unless started with --nosum (-N) option. Whether to run headers command automatically after entering interactive mode.
hold

Type: Boolean.
Default: False. When set to True, the read or saved messages will be stored in user's mailbox ($HOME/mbox). Otherwise, they will be held in system mailbox also. This option is in effect only when operating upon user's system mailbox.
ignore

Type: Boolean.
Default: False. When set to True, mail will ignore keyboard interrupts when composing messages. Otherwise an interrupt will be taken as a signal to abort composing.
ignoreeof

Type: Boolean.
Default: False. Controls whether typing EOF character terminates the letter being composed.
indentprefix

Type: String.
Default: "\t" (a tab character). String used by the ~m tilde escape for indenting quoted messages.
inplacealiases

Type: Boolean
Default: False

If set, mail will expand aliases in the address header field before entering send mode (see Composing Mail). By default, the address header fields are left intact while composing, the alias expansion takes place immediately before sending message.

keepsave

Type: Boolean.
Default: False. Controls whether saved messages should be kept in system mailbox too. This variable is in effect only when operating upon a user's system mailbox.
mailx

Type: Boolean.
Default: False. When set, enables mailx compatibility mode. This mode has the following effects:
metamail

Type: Boolean or String.
Default: True. This variable controls operation of decode command. If it is unset, decode will not attempt any interpretation of the content of message parts. Otherwise, if metamail is set to true, decode will use internal metamail support to interpret message parts. Finally, if metamail is assigned a string, this string is treated as command line of the external metamail command which will be used to display parts of a multipart message. For example:
          # Disable MIME interpretation:
          set nometamail
          # Enable built-in MIME support:
          set metamail
          # Use external program to display MIME parts:
          set metamail="metamail -m mail -p"
     

mimenoask

Type: String
Default: Empty By default mail asks for comnfirmation before running interpreter to view a part of the multi-part message. If this variable is set, its value is treated as a comma-separated list of MIME types for which no confirmation is needed. Elements of this list may include shell-style globbing patterns, e.g. setting
          set mimenoask=text/*,image/jpeg
     

will disable prompting before displaying any textual files, no matter what their subtype is, and before displaying files with type ‘image/jpeg’.

metoo

Type: Boolean.
Default: False. Usually, when an alias is expanded that contains the sender, the sender is removed from the expansion. Setting this option causes the sender to be included in the group.
mode

Type: String.
Default: The name of current operation mode. Setting this variable does not affect the operation mode of the program.
outfolder

Type: String.
Default: Unset. Contains the directory in which files created by save, write, etc. commands will be stored. When unset, current directory is assumed.
page

Type: Boolean.
Default: False. If set to True, the pipe command will emit a linefeed character after printing each message.
prompt

Type: String.
Default: "? " Contains the command prompt sequence.
quit

Type: Boolean.
Default: False, unless started with --quit (-q) option. When set, causes keyboard interrupts to terminate the program.
rc

Type: Boolean.
Default: True, unless started with --norc (-N) option. When this variable is set, mail will read the system-wide configuration file upon startup. See Mail Configuration Files.
record

Type: String.
Default: Unset. When set, any outgoing message will be saved to the named file.
recursivealiases

Type: Boolean
Default: True

When set, mail will expand aliases recursively.

regex

Type: Boolean.
Default: True. Setting this to True enables use of regular expressions in ‘/.../’ message specifications.
replyprefix

Type: String
Default: ‘Re: Sets the prefix that will be used when constructing the subject line of a reply message.
replyregex

Type: String
Default: ‘^re: * Sets the regular expression used to recognize subjects of reply messages. If the Subject header of the message matches this expression, the value of replyprefix will not be prepended to it before replying. The expression should be a POSIX extended regular expression. The comparison is case-insensitive.

For example, to recognize usual English, Polish, Norwegian and German reply subject styles, use:

          set replyregex="^(re|odp|aw|ang)(\\[[0-9]+\\])?:[[:blank:]]"
     

(Notice the quoting of backslash characters).

save

Type: Boolean.
Default: True. When set, the aborted messages will be stored in the user's dead.file. See also appenddeadletter.
screen

Type: Numeric.
Default: Detected at startup by querying the terminal device. If this fails, the value of environment variable LINES is used. This variable contains the number of lines on terminal screen.
sendmail

Type: String.
Default: sendmail:/usr/lib/sendmail Contains the URL of mail transport agent.
Sign

Type: String.
Default: Unset. Contains the filename holding users signature. The contents of this file is appended to the end of a message being composed by ~A escape.
sign

Type: String.
Default: Unset. Contains the user's signature. The contents of this variable is appended to the end of a message being composed by ~a escape. Use Sign variable, if your signature occupies more than one line.
showto

Type: Boolean
Default: unset If this variable is set, mail will show To: addresses instead of From: for all messages that come from the user that invoked the program.
subject

Type: String.
Default: Unset. Contains default subject line. This will be used when asksub is off.
toplines

Type: Numeric.
Default: 5 Number of lines to be displayed by top and Top commands.
verbose

Type: Boolean.
Default: False. When set, the actual delivery of messages is displayed on the user's terminal.
xmailer

Type: Boolean.
Default: Set. Controls whether the header ‘X-Mailer’ should be added to outgoing messages. The default value of this header is
          X-Mailer: mail (GNU Mailutils 1.0)