.\" Copyright (c) 1980 The Regents of the University of California.
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" @(#)mail5.nr 6.4 (Berkeley) 4/17/91
.sh 1 "Additional features"
This section describes some additional commands useful for
reading your mail, setting options, and handling lists of messages.
commands accept a list of messages as an argument.
command, which prints the message headers associated with the
message list passed to it.
command is particularly useful in conjunction with some of the
message list features described below.
consists of a list of message numbers, ranges, and names,
separated by spaces or tabs. Message numbers may be either
decimal numbers, which directly specify messages, or one of the
to specify the first relevant, current, or last
relevant message, respectively.
here means, for most commands
A range of messages consists of two message numbers (of the form
described in the previous paragraph) separated by a dash.
Thus, to print the first four messages, use
and to print all the messages from the current message to the last
is a user name. The user names given in the message list are
collected together and each message selected by other means
is checked to make sure it was sent by one of the named users.
If the message consists entirely of user names, then every
message sent by one of those users that is
(in the sense described earlier)
is selected. Thus, to print every message sent to you by
As a shorthand notation, you can specify simply
prints all undeleted messages,
deletes all undeleted messages, and
undeletes all deleted messages.
You can search for the presence of a word in subject lines with
For example, to print the headers of all messages that contain the
Note that subject searching ignores upper/lower case differences.
This section describes all the
command goes to the previous message and prints it. The
command may be given a decimal number
as an argument, in which case the
previous message is gone to and printed.
Prints a brief summary of commands.
Used to preface a command to be executed by the shell.
but also print out ignored header fields. See also
\fBprint\fP, \fBignore\fP and \fBretain\fP.
\fBPrint\fP can be abbreviated to \fBP\fP.
.ip "\fBReply\fP or \fBRespond\fP\ \ "
Note the capital \fBR\fP in the name.
Frame a reply to a one or more messages.
The reply (or replies if you are using this on multiple messages)
will be sent ONLY to the person who sent you the message
(respectively, the set of people who sent the messages you are
add people using the \fB~t\fP, \fB~c\fP and \fB~b\fP
tilde escapes. The subject in your reply is formed by prefacing the
subject in the original message with
unless it already began thus.
If the original message included a
header field, the reply will go
to the recipient named by
You type in your message using the same conventions available to you
command is especially useful for replying to messages that were sent
to enormous distribution groups when you really just want to
send a message to the originator. Use it often.
\fBReply\fP (and \fBRespond\fP) can be abbreviated to \fBR\fP.
\fBType\fP can be abbreviated to \fBT\fP.
Define a name to stand for a set of other names.
This is used when you want to send messages to a certain
group of people and want to avoid retyping their names.
alias project john sue willie kathryn
which expands to the four people John, Sue, Willie, and Kathryn.
If no arguments are given, all currently-defined aliases are printed.
If one argument is given, that alias is printed (if it exists).
\fBAlias\fP can be abbreviated to \fBa\fP.
.ip "\fBalternates\fP\ \ "
If you have accounts on several machines, you may find it convenient
to use the /usr/lib/aliases on all the machines except one to direct
your mail to a single account.
command is used to inform
that each of these other addresses is really
takes a list of user names and remembers that they are all actually you.
to messages that were sent to one of these alternate names,
will not bother to send a copy of the message to this other address (which
would simply be directed back to you by the alias mechanism).
is given no argument, it lists the current set of alternate names.
is usually used in the .mailrc file.
\fBAlternates\fP can be abbreviated to \fBalt\fP.
command allows you to change your current directory.
takes a single argument, which is taken to be the pathname of
the directory to change to. If no argument is given,
changes to your home directory.
\fBChdir\fP can be abbreviated to \fBc\fP.
command does the same thing that
does, except that it does not mark the messages it is used on
for deletion when you quit.
\fBCopy\fP can be abbreviated to \fBco\fP.
Deletes a list of messages. Deleted messages can be reclaimed
\fBDelete\fP can be abbreviated to \fBd\fP.
.ip "\fBdp\fP or \fBdt\fP\ \ "
commands delete the current message and print the next message.
They are useful for quickly reading and disposing of mail.
If there is no next message, \fImail\fP says ``at EOF.''
To edit individual messages using the text editor, the
command takes a list of messages as described under the
command and processes each by writing it into the file
is the message number being edited and executing the text editor on it.
When you have edited the message to your satisfaction, write the message
will read the message back and remove the file.
Marks the end of the then-part of an
statement and the beginning of the
part to take effect if the condition of the
.ip "\fBexit\fP or \fBxit\fP\ \ "
without updating the system mailbox or the file your were reading.
Thus, if you accidentally delete several messages, you can use
to avoid scrambling your mailbox.
\fBExit\fP can be abbreviated to \fBex\fP or \fBx\fP.
\fBFile\fP can be abbreviated to \fBfi\fP.
List the names of the folders in your folder directory.
command switches to a new mail file or folder. With no arguments, it
tells you which file you are currently reading. If you give
it an argument, it will write out changes (such as deletions)
you have made in the current file and read the new file.
Some special conventions are recognized for the name:
%name \fIName\fP's system mailbox
+folder A file in your folder directory
\fBFolder\fP can be abbreviated to \fBfo\fP.
command takes a list of messages and prints out the header lines for each one;
is the easy way to display all the message headers from \*(lqjoe.\*(rq
\fBFrom\fP can be abbreviated to \fBf\fP.
to read your mail, it lists the message headers that you have.
These headers tell you who each message is from, when they were
received, how many lines and characters each message is, and the
header field of each message, if present. In addition,
tags the message header of each message that has been the object
messages are not printed at all. If you wish to reprint the current
list of message headers, you can do so with the
command (and thus the initial header listing)
only lists the first so many message headers.
The number of headers listed depends on the speed of your
This can be overridden by specifying the number of headers you
maintains a notion of the current
into your messages for the purposes of printing headers.
command to move forward and back a window.
notion of the current window directly to a particular message by
attention to the messages around message 40.
If a ``+'' argument is given, then the next screenful of message headers is
printed, and if a ``\-'' argument is given, the previous screenful of message
\fBHeaders\fP can be abbreviated to \fBh\fP.
Print a brief and usually out of date help message about the commands
is usually more up-to-date than either the help message or this manual.
It is also a synonym for \fB?\fP.
Arrange to hold a list of messages in the system mailbox, instead
of moving them to the file
in your home directory. If you set the binary option
this will happen by default.
It does not override the \fBdelete\fP command.
\fBHold\fP can be abbreviated to \fBho\fP.
file can be executed conditionally depending on whether you are
sending or receiving mail with the
command. For example, you can do:
Note that the only allowed conditions are
Add the list of header fields named to the
Header fields in the ignore list are not printed on your
terminal when you print a message. This allows you to suppress
printing of certain machine-generated header fields, such as
which are not usually of interest. The
commands can be used to print a message in its entirety, including
is executed with no arguments, it lists the current set of ignored fields.
\fBList\fP can be abbreviated to \fBl\fP.
.. Define a list of local names for this host. This command is useful
.. when the host is known by more than one name. Names in the list
.. may be qualified be the domain of the host. The first name on the local
.. The names on the local list are used by
.. to decide which addresses are local to the host.
.. local ucbarpa.BERKELEY.ARPA arpa.BERKELEY.ARPA \\
.. arpavax.BERKELEY.ARPA r.BERKELEY.ARPA \\
.. From this list we see that
.. .i "fred@ucbarpa.BERKELEY.ARPA",
.. .i "harold@arpa.BERKELEY",
.. are all addresses of users on the local host.
.. command is usually not used be general users since it is designed for
.. local configuration; it is usually found in the file /usr/lib/Mail.rc.
Send mail to one or more people. If you have the
will prompt you for a subject to your message. Then you
can type in your message, using tilde escapes as described in
section 4 to edit, print, or modify your message. To signal your
satisfaction with the message and send it, type control-d at the
beginning of a line, or a . alone on a line if you set the option
To abort the message, type two interrupt characters (\s-2RUBOUT\s0
by default) in a row or use the
The \fBmail\fP command can be abbreviated to \fBm\fP.
Indicate that a list of messages be sent to
in your home directory when you quit. This is the default
action for messages if you do
.ip "\fBnext\fP or \fB+\fP\ \ "
command goes to the next message and types it. If given a message list,
goes to the first such message and types it. Thus,
goes to the next message sent by
command can be abbreviated to simply a newline, which means that one
can go to and type a message by simply giving its message number or
one of the magic characters
prints the current message and
prints message 4, as described previously.
\fBNext\fP can be abbreviated to \fBn\fP.
Cause a list of messages to be held in your system mailbox when you quit.
\fBPreserve\fP can be abbreviated to \fBpre\fP.
Print the specified messages. If the
variable is set, messages longer than the number of lines it indicates
are paged through the command specified by the \fBPAGER\fP variable.
The \fBprint\fP command can be abbreviated to \fBp\fP.
Terminates the session, saving all undeleted, unsaved and unwritten messages
in the user's \fImbox\fP file in their login directory
(messages marked as having been read), preserving all
messages marked with \fBhold\fP or \fBpreserve\fP or never referenced
Any messages that were deleted, saved, written or saved to \fImbox\fP are
removed from their system mailbox.
If new mail has arrived during the session, the message
``You have new mail'' is given. If given while editing a mailbox file
with the \fB\-f\fP flag, then the edit file is rewritten.
A return to the Shell is effected, unless the rewrite of edit file fails,
in which case the user can escape with the \fBexit\fP command.
\fBQuit\fP can be abbreviated to \fBq\fP.
.ip "\fBreply\fP or \fBrespond\fP\ \ "
Frame a reply to a single message.
The reply will be sent to the
person who sent you the message (to which you are replying), plus all
the people who received the original message, except you. You can
add people using the \fB~t\fP, \fB~c\fP and \fB~b\fP
tilde escapes. The subject in your reply is formed by prefacing the
subject in the original message with
unless it already began thus.
If the original message included a
header field, the reply will go
to the recipient named by
You type in your message using the same conventions available to you
The \fBreply\fP (and \fBrespond\fP) command can be abbreviated to \fBr\fP.
Add the list of header fields named to the \fIretained list\fP.
Only the header fields in the retain list
are shown on your terminal when you print a message.
All other header fields are suppressed.
commands can be used to print a message in its entirety.
is executed with no arguments, it lists the current set of
It is often useful to be able to save messages on related topics
command gives you the ability to do this. The
command takes as an argument a list of message numbers, followed by
the name of the file in which to save the messages. The messages
are appended to the named file, thus allowing one to keep several
messages in the file, stored in the order they were put there.
The filename in quotes, followed by the line
count and character count is echoed on the user's terminal.
command relative to our running example is:
messages are not automatically saved in
at quit time, nor are they selected by the
command described above, unless explicitly specified.
\fBSave\fP can be abbreviated to \fBs\fP.
Set an option or give an option a value. Used to customize
Section 5.3 contains a list of the options. Options can be
To give the valued option
There must be no space before or after the ``='' sign.
If no arguments are given, all variable values are printed.
Several options can be specified in a single
\fBSet\fP can be abbreviated to \fBse\fP.
invokes an interactive shell and allows you to type commands to it.
When you leave the shell, you will return to
The shell used is a default assumed by
you can override this default by setting the valued option
\fBShell\fP can be abbreviated to \fBsh\fP.
Takes a message list and prints out the size in characters of each
commands from a file. It is useful when you are trying to fix your
file and you need to re-read it.
\fBSource\fP can be abbreviated to \fBso\fP.
command takes a message list and prints the first five lines
of each addressed message.
If you wish, you can change the number of lines that
prints out by setting the valued option
\fBTop\fP can be abbreviated to \fBto\fP.
Takes a message list and types out each message on the terminal.
The \fBtype\fP command can be abbreviated to \fBt\fP.
Takes a message list and marks each message as \fInot\fP
\fBUndelete\fP can be abbreviated to \fBu\fP.
Takes a message list and marks each message as
\fBUnread\fP can be abbreviated to \fBU\fP.
Takes a list of option names and discards their remembered values;
the inverse of \fBset\fP .
It is often useful to be able to invoke one of two editors,
based on the type of terminal one is using. To invoke
a display oriented editor, you can use the
command. The operation of the
command is otherwise identical to that of the
commands assume some default text editors. These default editors
can be overridden by the valued options
for the standard and screen editors. You might want to do:
set EDITOR=/usr/ucb/ex VISUAL=/usr/ucb/vi
\fBVisual\fP can be abbreviated to \fBv\fP.
command always writes the entire message, including the headers,
into the file. If you want to write just the message itself, you
command has the same syntax as the
command, and can be abbreviated to simply
Thus, we could write the second message by doing:
As suggested by this example, the
command is useful for such tasks as sending and receiving
source program text over the message system.
The filename in quotes, followed by the line
count and character count is echoed on the user's terminal.
presents message headers in windowfuls as described under
attention forward to the next window by giving the
command. Analogously, you can move to the previous window with:
Throughout this manual, we have seen examples of binary and valued options.
This section describes each of the options in alphabetical order, including
some that you have not seen yet.
To avoid confusion, please note that the options are either
all lower case letters or all upper case letters. When I start a sentence
to prompt you for a subject header,
as a courtesy to English.
defines the pathname of the text editor to be used in the
command and ~e. If not defined, a standard editor is used.
Pathname of the program to use for paginating output when
it exceeds \fIcrt\fP lines.
A default paginator is used if this option is not defined.
gives the path name of your shell. This shell is used for the
command and ~! escape. In addition, this shell expands
file names with shell metacharacters like * and ? in them.
defines the pathname of the screen editor to be used in the
and ~v escape. A standard screen editor is used if you do not define one.
to be appended to the end rather than prepended.
Normally, \fIMail\fP will put messages in \fImbox\fP
in the same order that the system puts messages in your system mailbox.
be appended to regardless. It is in any event quicker to append.
to prompt you for the subject of each message you send.
If you respond with simply a newline, no subject field will be sent.
causes you to be prompted for additional carbon copy recipients at the
end of each message. Responding with a newline shows your
satisfaction with the current list.
.ip "\fBautoprint\fP\ \ "
\*- thus, after deleting a message, the next one will be typed
automatically. This is useful when quickly scanning and deleting
messages in your mailbox.
is used as a threshold to determine how long a message must
causes debugging information to be displayed. Use of this
option is the same as using the \fB\-d\fP command line flag.
is a binary option which, if set, causes
to interpret a period alone on a line as the terminator
of the message you are sending.
To allow you to change the escape character used when sending
mail, you can set the valued option
Only the first character of the
option is used, and it must be doubled if it is to appear as
the first character of a line of your message. If you change your escape
character, then ~ loses all its special meaning, and need no longer be doubled
at the beginning of a line.
The name of the directory to use for storing folders of messages.
If this name begins with a `/'
considers it to be an absolute pathname; otherwise, the folder directory
is found relative to your home directory.
causes messages that have been read but not manually dealt with
to be held in the system mailbox. This prevents such messages from
being automatically swept into your \fImbox\fP file.
causes \s-2RUBOUT\s0 characters from your terminal to be ignored and echoed
as @'s while you are sending mail. \s-2RUBOUT\s0 characters retain their
option is equivalent to supplying the
flag on the command line as described in section 6.
.ip "\fBignoreeof\fP\ \ "
refuse to accept a control\-d as the end of a message.
to truncate your system mailbox instead of deleting it when it
is empty. This is useful if you elect to protect your mailbox, which
you would do with the shell command:
chmod 600 /usr/spool/mail/yourname
is your login name. If you do not do this, anyone can probably read
your mail, although people usually don't.
usually discards it when you
To retain all saved messages, set the
When sending mail to an alias,
makes sure that if you are included in the alias, that mail will not
be sent to you. This is useful if a single alias is being used by
all members of the group. If however, you wish to receive a copy of
all the messages you send to the alias, you can set the binary option
suppresses the printing of the version and headers when
is first invoked. Setting this option is the same as using
when you abort a message with two \s-2RUBOUTs\s0,
copies the partial letter to the file
in your home directory. Setting the binary option
suppresses the printing of the version when
as well as printing the for example
If you love to keep records, then the
can be set to the name of a file to save your outgoing mail.
Each new message you send is appended to the end of the file.
initially prints the message headers, it determines the number to
print by looking at the speed of your terminal. The faster your
terminal, the more it prints.
overrides this calculation and
specifies how many message headers you want printed.
This number is also used for scrolling with the
To use an alternate mail delivery system, set the
option to the full pathname of the program to use. Note: this is not
for everyone! Most people should use the default delivery system.
defines the number of lines that the
command will print out instead of the default five lines.
The binary option "verbose" causes
to invoke sendmail with the
flag, which causes it to go into verbose mode and announce expansion
of aliases, etc. Setting the "verbose" option is equivalent to
flag as described in section 6.