D    Customizing Your mailx Session

You can customize your mailx session permanently by including in your .mailrc file any of the settings described in Table D-1. See the unset command in Appendix F for information about temporary settings.

Table D-1:  Variables for Customizing Your mailx Session

Variable Type Description

allnet

Binary

Treats all network names with the same login name the same.

append

Binary

Saves messages in your mbox file in the order of arrival; the earliest message is the first message in the file. When this variable is unset, messages are saved in reverse order; the first message in the file is the most recent. The mailx program runs faster if append is set.

ask

Binary

Prompts you for a subject line when you send a message. Enter a blank line to send a message with no subject.

askcc

Binary

Prompts you for carbon-copy recipients for each message you send.

autoprint

Binary

Automatically displays the next message when you delete the current message. When autoprint is unset, mailx does not display the next message when you delete a message. In either case, the next message becomes your new current message.

bang

String

Enables the special-case treatment of the exclamation point ( ! ) in escape command lines as in vi.

cmd

String

Lets the user specify the default command to be used when using the vertical bar or pipe ( | ) command.

conv

String

Lets the user specify how to convert UUCP style addresses for sendmail.

crt

Numeric

For use with a video display (CRT) terminal. Reads your mail one screenful at a time using the more program. The value tells mailx how many lines of the message to display before invoking the pager.

For example: set crt=20

DEAD

String

Lets the user specify a different location for dead.letter. A dead letter will be written to $HOME/dead.letter by default.

debug

Binary

Displays debugging information.

dot

Binary

Interprets a period on a line by itself to be the end of a message. Do not unset dot and also set ignoreeof.

EDITOR

String

Specifies the pathname for the text editor to be used when you use the edit command or the ~e escape. For example:

set EDITOR=/usr/ucb/ex

If your terminal is a CRT terminal, you can specify a screen editor for this variable. See the VISUAL variable later in this table.

escape

String

Lets you specify the escape character (the character that starts an escape command when you are in the middle of writing a message). The default is the tilde ( ~ ). You must specify a single character.

excode

String

Lets the user specify the locale to be used when doing character conversion on outgoing mail messages.

folder

String

Specifies the directory for storing mail folders. A name beginning with a slash, such as /usr/users/hale, is an absolute pathname. A name without an initial slash is a pathname relative to your home directory.

For example, the command set folder=folder indicates the directory /usr/users/hale/folder.

gonext

Binary

If set, entering a [Return] by itself causes the next mail message to be displayed. If not set, the current message is displayed again.

header

Binary

Prints the message header of messages when mailx is invoked.

hold

Binary

Prevents messages from being moved to your mbox file after you read them. Messages you have read are held in your system mailbox.

ignore

Binary

Ignores Ctrl/C interrupts, echoing them as "at" signs (@). This variable is different from the ignore command described in Appendix F.

ignoreeof

Binary

Ignores Ctrl/D as the end of an outgoing message. Do not set ignoreeof and also unset dot.

indentprefix

String

Lets the user specify a string to be inserted at the beginning of each line of text of a mail message that was included using the ~m command.

keep

Binary

Lets mailx truncate your system mailbox instead of deleting it when it is empty. This is useful if you have set special permissions on your system mailbox for security reasons. If keep is unset, your system mailbox is deleted when it becomes empty; the next time it is created, you must reestablish your desired permissions.

keepsave

Binary

Prevents deletion of saved messages when you quit mail. Usually, the mailx program marks messages when you save them in other files or folders, and then deletes them from your system mailbox when you leave mailx. Setting keepsave makes mailx leave these messages in your system mailbox.

lang

String

Lets the user specify the locale to be used for displaying the mail message.

LISTER

String

Lets the user specify the command used by the folders command.

MBOX

String

Lets the user specify the location for the mbox folder. The mbox folder will usually be located in $HOME/mbox.

metoo

Binary

Includes you in the list of recipients when you send mail to an alias of which you are a member. If metoo is unset, you will not receive copies of messages sent to aliases of which you are a member.

noheader

Binary

Inhibits display of the header and version identification when you invoke mailx.

nosave

Binary

Prevents mailx from saving aborted messages as dead.letter in your home directory.

onehop

Binary

When responding to a message which contains other recipients, sometimes the addresses of the recipients are relative to the originator's address. The onehop option forces the delivery to not follow the path by which the message arrived and deliver it directly, thereby improving performance.

outfolder

Binary

Causes mailx to save outgoing mail messages in the directory specified in folder.

page

Binary

Causes a form feed to be inserted between messages that are processed by the pipe ( | ) command.

PAGER

String

Lets the user specify the paging program to be used when displaying messages.

For example:

PAGER=/usr/bin/more
or
PAGER=/usr/bin/pg

prompt

String

Lets the user change the mailx prompt when mailx is invoked. For example: prompt=>>>

quiet

Binary

Suppresses printing the version when first invoked and the message number when you use the type command.

record

String

Specifies the name of a file into which mailx will save copies of all outgoing messages.

Replayall

Binary

Reverses the function of the reply and Reply commands.

save

Binary

Lets the user save mail messages into dead.letter.

sendwait

Binary

Causes mailx to wait until the message has been processed by the mailer. This option can cause some performance degradation from the users point of view since the user will have to wait until the message has been delivered.

SHELL

String

Lets the user specify the shell to use when invoking the ~ or ~! commands.

screen

Numeric

Specifies the number of messages to be displayed in one screenful when you enter the headers command.

sendmail

String

Specifies the pathname of the program to use to send mail messages. If this variable is not specified, mailx uses the default delivery system. See your system administrator for information about alternate delivery systems.

showto

Binary

Displays the recipient's name instead of the author's name in message headers.

sign

String

Lets the user specify a string to be inserted in the mail message when using the ~a command.

Sign

String

Lets the user specify a string to be inserted in the mail message when using the ~A command.

toplines

Numeric

Specifies the number of lines the top command prints; the default is 5.

verbose

Binary

Invokes mailx in verbose mode. The actual delivery of messages is displayed on the terminal. This is the same as using the -v flag on the command line. This variable is used mainly for debugging purposes. Example D-1 shows the use of the verbose variable.

VISUAL

String

Specifies the pathname for the screen editor that will be used when you use the visual command or the ~v escape. For example:

set VISUAL=/usr/ucb/vi

If your only terminal is a CRT, you can specify a screen editor for the EDITOR variable, too; then either edit (~e) or visual (~v) will invoke the same editor.

The following example shows the use of the verbose variable, discussed in the previous table, that causes mailx to display expansion of aliases as message are sent:

Example D-1:  The mailx verbose Mode

? set verbose            [1]
? alias                  [2]
smith       csug@solo.my.company.com smith@my.company.com smith
? mailx tg [3]
Subject: Conference Room
Starting tomorrow, our weekly meeting will be
moved to Meeting Room 4.

DAL
. [3]
EOT
csug@solo.my.company.com... Connecting to  (local)...
about to exec
csug@solo.my.company.com... Sent
smith,smith@my.company.com... Connecting to
             your.company.com (smtpr)...
220 your.company.com ESMTP Sendmail 8.7.6/UNX 1.7
 (1.1.10.5/28Jun99-0151PM) Tue, 25 Nov 1999 
09:52:10 -0500 (EST)
>>> HELO solo.my.company.com
250 your.company.com Hello solo.my.company.com
             [255.255.255.0],
 pleased to meet you
>>> MAIL From:250 ... Sender ok
>>> RCPT To:250 Recipient ok
>>> RCPT To:250 Recipient ok
>>> DATA
354 Enter mail, end with "." on a line by itself
>>> .
250 JAA0000022475 Message accepted for delivery
>>> QUIT
221 your.company.com closing connection
smith@my.company.com,smith... Sent [4]
? q [5]

The following list items correspond to the numbers in the example.

  1. The verbose variable is set. [Return to example]

  2. The alias command is executed with no parameters to show the contents of the alias. [Return to example]

  3. A message is then sent, addressed to the alias tg. [Return to example]

  4. The expansion of aliases as messages are sent is displayed. [Return to example]

  5. The q command is executed to end the mailx session. [Return to example]