.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\" %sccs.include.redist.roff%
.\" @(#)mail.1 8.2 (Berkeley) %G%
.Nd send and receive mail
is an intelligent mail processing system, which has
a command syntax reminiscent of
with lines replaced by messages.
delivery are displayed on the user's terminal.
Ignore tty interrupt signals.
particularly useful when using
Forces mail to run in interactive mode even when
character when sending mail is only active in interactive mode.
.Pa /usr/share/misc/Mail.rc
Inhibits the initial display of message headers
when reading mail or editing a mail folder.
Specify subject on command line
(only the first argument after the
flag is used as a subject; be careful to quote subjects
Send blind carbon copies to
List should be a comma-separated list of names.
Read in the contents of your
writes undeleted messages back to this file.
.Dl mail -f /var/spool/mail/user
To send a message to one or more people,
can be invoked with arguments which are the names of people to
whom the mail will be sent.
You are then expected to type in
at the beginning of a line.
.Ar Replying to or originating mail ,
describes some features of
available to help you compose your letter.
is given no arguments and checks your mail out of the
prints out a one line header of each message found.
The current message is initially the first message (numbered 1)
and can be printed using the
command (which can be abbreviated
You can move among the messages much as you move between lines in
moving backwards and forwards, and
After examining a message you can
program to forget about the message.
This is not irreversible; the message can be
by giving its number, or the
session can be aborted by giving the
Deleted messages will, however, usually disappear never to be seen again.
can be given a list of message numbers as arguments to apply
to a number of messages at once.
deletes messages 1 and 2, while
deletes messages 1 through 5.
addresses all messages, and
the last message; thus the command
which prints the first few lines of a message could be used in
to print the first few lines of all messages.
.Ss Replying to or originating mail.
set up a response to a message, sending it back to the
Text you then type in, up to an end-of-file,
defines the contents of the message.
While you are composing a message,
treats lines beginning with the character
(alone on a line) will place a copy
of the current message into the response right shifting it by a tabstop
Other escapes will set up subject fields, add and delete recipients
to the message and allow you to escape to an editor to revise the
message or to a shell to run some commands.
are given in the summary below.)
.Ss Ending a mail processing session.
Messages which have been examined go to your
file unless they have been deleted in which case they are discarded.
Unexamined messages go back to the post office.
.Ss Personal and systemwide distribution lists.
It is also possible to create a personal distribution lists so that,
for instance, you can send mail to
Such lists can be defined by placing a line like
.Dl alias cohorts bill ozalp jkf mark kridle@ucbcory
The current list of such aliases can be displayed with the
System wide distribution lists can be created by editing
these are kept in a different syntax.
In mail you send, personal aliases will be expanded in mail sent
to others so that they will be able to
are not expanded when the mail is sent,
but any reply returned to the machine will have the system wide
alias expanded as all mail goes through
.Ss Network mail (ARPA, UUCP, Berknet)
for a description of network addresses.
has a number of options which can be set in the
file to alter its behavior; thus
(These options are summarized below.)
(Adapted from the `Mail Reference Manual')
Each command is typed on a line by itself, and may take arguments
following the command word.
The command need not be typed in its
entirety \- the first command which matches the typed prefix is used.
For commands which take message lists as arguments, if no message
list is given, then the next message forward which satisfies the
command's requirements is used.
If there are no messages forward of
the current message, the search proceeds backwards, and if there are no
.Dq Li No applicable messages
Print out the preceding message.
previous message and prints it.
Prints a brief summary of commands.
but also prints out ignored header fields.
recipients of the original message.
With no arguments, prints out all currently-defined aliases.
argument, prints out that alias.
With more than one argument, creates
a new alias or changes an old one.
command is useful if you have accounts on several machines.
that the listed addresses are really you.
will not send a copy of the message to any of the addresses
command is given with no argument, the current set of alternate
Changes the user's working directory to that specified, if given.
no directory is given, then changes to the user's login directory.
command does the same thing that
does, except that it does not mark the messages it
is used on for deletion when you quit.
Takes a list of messages as argument and marks them all as deleted.
Deleted messages will not be saved in
nor will they be available for most other commands.
Deletes the current message and prints the next message.
If there is no next message,
Takes a list of messages and points the text editor at each one in
On return from the editor, the message is read back in.
Effects an immediate return to the Shell without
modifying the user's system mailbox, his
file, or his edit file in
List the names of the folders in your folder directory.
command switches to a new mail file or folder.
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 in
Some special conventions are recognized for
# means the previous file, % means your system
mailbox, %user means user's system mailbox, & means
\&+\&folder means a file in your folder
Takes a list of messages and prints their message headers.
Lists the current range of headers, which is an 18\-message group.
argument is given, then the next 18\-message group is printed, and if
argument is given, the previous 18\-message group is printed.
Takes a message list and marks each
message therein to be saved in the
user's system mailbox instead of in
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.
command is very handy for suppression of certain machine-generated
commands can be used to print a message in its entirety, including
is executed with no arguments, it lists the current set of
Takes as argument login names and distribution group names and sends
Indicate that a list of messages be sent to
in your home directory when you quit.
action for messages if you do
Goes to the next message in sequence and types it.
With an argument list, types the next matching message.
Takes a message list and types out each message on the user's terminal.
Terminates the session, saving all undeleted, unsaved messages in
file in his login directory, preserving all messages marked with
in his system mailbox, and removing all other messages from his system
If new mail has arrived during the session, the message
.Dq Li "You have new mail"
flag, then the edit file is rewritten.
effected, unless the rewrite of edit file fails, in which case the user
Takes a message list and sends mail to the sender and all
recipients of the specified message.
The default message must not be deleted.
Add the list of header fields named to the
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
Takes a message list and a filename and appends each message in
turn to the end of the file.
The filename in quotes, followed by the line
count and character count is echoed on the user's terminal.
With no arguments, prints all variable values.
Arguments are of the form
(no space before or after =) or
Quotation marks may be placed around any part of the assignment statement to
quote blanks or tabs, i.e.
.Dq Li "set indentprefix=\*q->\*q"
Header fields thus marked are filtered out when
or when automatically saving to
Header fields thus marked are the only ones saved
with a message when saving by
or when automatically saving to
Invokes an interactive version of the shell.
Takes a message list and prints out the size in characters of each
Takes a message list and prints the top few lines of each.
lines printed is controlled by the variable
Takes a list of names defined by
commands and discards the remembered groups of users.
no longer have any significance.
Takes a message list and marks each message as
Takes a message list and marks each message as
Takes a list of option names and discards their remembered values;
Takes a message list and invokes the display editor on each message.
Extremely useful for such tasks as sending and receiving source
program text over the message system.
presents message headers in windowfuls as described under the
attention forward to the next window with the
Also, you can move to the previous window by using
Here is a summary of the tilde escapes,
which are used when composing messages to perform
Tilde escapes are only recognized at the beginning
is somewhat of a misnomer since the actual escape character can be set
.It Ic \&~! Ns Ar command
Execute the indicated shell command, then return to the message.
.It Ic \&~b Ns Ar name ...
Add the given names to the list of carbon copy recipients but do not make
the names visible in the Cc: line ("blind" carbon copy).
.It Ic \&~c Ns Ar name ...
Add the given names to the list of carbon copy recipients.
from your home directory into the message.
Invoke the text editor on the message collected so far.
editing session is finished, you may continue appending text to the
.It Ic \&~f Ns Ar messages
Read the named messages into the message being sent.
If no messages are specified, read in the current message.
Message headers currently being ignored (by the
command) are not included.
.It Ic \&~F Ns Ar messages
except all message headers are included.
Edit the message header fields by typing each one in turn and allowing
the user to append text to the end or modify the field by using the
current terminal erase and kill characters.
.It Ic \&~m Ns Ar messages
Read the named messages into the message being sent, indented by a
If no messages are specified,
read the current message.
Message headers currently being ignored (by the
command) are not included.
.It Ic \&~M Ns Ar messages
except all message headers are included.
Print out the message collected so far, prefaced by the message header
Abort the message being sent, copying the message to
in your home directory if
.It Ic \&~r Ns Ar filename
Read the named file into the message.
Cause the named string to become the current subject field.
.It Ic \&~\&t Ns Ar name ...
Add the given names to the direct recipient list.
Invoke an alternate editor (defined by the
message collected so far.
Usually, the alternate editor will be a
After you quit the editor, you may resume appending
text to the end of your message.
.It Ic \&~w Ns Ar filename
Write the message onto the named file.
.It Ic \&~\&| Ns Ar command
Pipe the message through the command as a filter.
no output or terminates abnormally, retain the original text of the
to rejustify the message.
.It Ic \&~: Ns Ar mail-command
Execute the given mail command.
Not all commands, however, are allowed.
Insert the string of text in the message prefaced by a single ~.
you have changed the escape character, then you should double
that character in order to send it.
Options are controlled via
Options may be either binary, in which case it is only
significant to see whether they are set or not; or string, in which
case the actual value is of interest.
The binary options include the following:
to be appended to the end rather than prepended.
This should always be set (perhaps in
.Pa /usr/share/misc/Mail.rc ) .
to prompt you for the subject of each message you send.
you respond with simply a newline, no subject field will be sent.
Causes you to be prompted for additional carbon copy recipients at the
Responding with a newline indicates your
satisfaction with the current list.
\- thus, after deleting a message, the next one will be typed
Setting the binary option
is the same as specifying
on the command line and causes
to output all sorts of information useful for debugging
to interpret a period alone on a line as the terminator
of a message you are sending.
This option is used to hold messages in the system mailbox
Causes interrupt signals from your terminal to be ignored and echoed as
refuse to accept a control-d as the end of a message.
Usually, when a group 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.
is the same as giving the
flag on the command line.
Normally, when you abort a message with two
copies the partial letter to the file
Setting the binary option
Suppresses the printing of the version when first invoked.
If this option is set, then a message-list specifier in the form ``/x:y''
will expand to all messages containing the substring ``y'' in the header
field ``x''. The string search is case insensitive.
flag on the command line.
When mail runs in verbose mode,
the actual delivery of messages is displayed on the user's
Pathname of the text editor to use in the
If not defined, then a default editor is used.
Pathname of the directory lister to use in the
Pathname of the program to use in the
is used if this option is not defined.
Pathname of the shell to use in the
A default shell is used if this option is
Pathname of the text editor to use in the
is used as a threshold to determine how long a message must
then the height of the terminal screen stored in the system
is used to compute the threshold (see
If defined, the first character of this option gives the character to
use in the place of ~ to denote escapes.
The name of the directory to use for storing folders of
If this name begins with a `/',
considers it to be an absolute pathname; otherwise, the
folder directory is found relative to your home directory.
It can be the name of a folder.
in the user's home directory.
If defined, gives the pathname of the file used to record all outgoing
If not defined, then outgoing mail is not so saved.
String used by the ``~m'' tilde escape for indenting messages, in place of
the normal tab character (^I).
Be sure to quote the value if it contains
If defined, gives the number of lines of a message to be printed out
command; normally, the first five lines are printed.
.Bl -tag -width /usr/share/misc/Mail.help* -compact
File giving initial mail commands.
.It Pa /usr/share/misc/Mail.help*
.It Pa /usr/share/misc/Mail.rc
System initialization file.
.%T "The Mail Reference Manual" .
This man page is derived from
.%T "The Mail Reference Manual"
originally written by Kurt Shoens.
There are some flags that are not documented here.
not useful to the general user.