.\" 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
.\" @(#)mail4.nr 6.4 (Berkeley) 4/17/91
.sh 1 "More about sending mail"
While typing in a message to be sent to others, it is often
useful to be able to invoke the text editor on the partial message,
print the message, execute a shell command, or do some other
provides these capabilities through
which consist of a tilde (~) at the beginning of a line, followed by
a single character which indicates the function to be performed. For
example, to print the text of the message so far, use:
which will print a line of dashes, the recipients of your message, and
the text of the message so far.
requires two consecutive \s-2RUBOUT\s0's to abort a letter, you
can use a single \s-2RUBOUT\s0 to abort the output of ~p or any other
~ escape without killing your letter.
If you are dissatisfied with the message as
it stands, you can invoke the text editor on it using the escape
which causes the message to be copied into a temporary file and an
instance of the editor to be spawned. After modifying the message to
your satisfaction, write it out and quit the editor.
after which you may continue typing text which will be appended to your
message, or type <control-d> to end the message.
A standard text editor is provided by
You can override this default by setting the valued option
to something else. For example, you might prefer:
Many systems offer a screen editor as an alternative to the standard
editor, on your current message, you can use the escape,
~v works like ~e, except that the screen editor is invoked instead.
A default screen editor is defined by
If it does not suit you, you can set the valued option
to the path name of a different editor.
It is often useful to be able to include the contents of some
file in your message; the escape
is provided for this purpose, and causes the named file to be appended
complains if the file doesn't exist
or can't be read. If the read is successful, the number of lines and
characters appended to your message is printed, after which you may continue
appending text. The filename may contain shell metacharacters like * and ?
which are expanded according to the conventions of your shell.
As a special case of ~r, the escape
in your home directory. This is often useful since
of your message there when you abort a message with \s-2RUBOUT\s0.
To save the current text of your message on a file you may use the
will print out the number of lines and characters written
to the file, after which you may continue appending text to your message.
Shell metacharacters may be used in the filename, as in ~r and are expanded
with the conventions of your shell.
If you are sending mail from within
you can read a message sent to you into the message
you are constructing with the escape:
which will read message 4 into the current message, shifted right by
one tab stop. You can name any non-deleted message, or list of messages.
Messages can also be forwarded without shifting by a tab stop with ~f.
This is the usual way to forward a message.
If, in the process of composing a message, you decide to add additional
people to the list of message recipients, you can do so with the escape
You may name as few or many additional recipients as you wish. Note
that the users originally on the recipient list will still receive
the message; you cannot remove someone from the recipient
If you wish, you can associate a subject with your message by using the
~s Arbitrary string of text
which replaces any previous subject with
.q "Arbitrary string of text."
The subject, if given, is sent near the
top of the message prefixed with
You can see what the message will look like by using ~p.
For political reasons, one occasionally prefers to list certain
people as recipients of carbon copies of a message rather than
direct recipients. The escape
adds the named people to the
Again, you can execute ~p to see what the message will look like.
adds the named people to the
list, but does not make the names visible in the
line ("blind" carbon copy).
The recipients of the message together constitute the
field, and the carbon copies the
field. If you wish to edit these in ways impossible with the ~t, ~s, ~c
and ~b escapes, you can use the escape
followed by the current list of recipients and leaves the cursor
(or printhead) at the end of the line. If you type in ordinary
characters, they are appended to the end of the current list of
recipients. You can also use your erase character to erase back into
the list of recipients, or your kill character to erase them altogether.
Thus, for example, if your erase and kill characters are the standard
(on printing terminals) # and @ symbols,
would change the initial recipients
field, where the same rules apply. Another newline brings you to
field, which may be edited in the same fashion. Another newline
("blind" carbon copy) field, which follows the same rules as the "Cc:"
leaves you appending text to the end of your message. You can use
~p to print the current text of the header fields and the body
To effect a temporary escape to the shell, the escape
and returns you to mailing mode without altering the text of
your message. If you wish, instead, to filter the body of your
message through a shell command, then you can use
which pipes your message through the command and uses the output
as the new text of your message. If the command produces no output,
assumes that something is amiss and retains the old version
of your message. A frequently-used filter is the command
designed to format outgoing mail.
To effect a temporary escape to
command mode instead, you can use the
escape. This is especially useful for retyping the message you are
replying to, using, for example:
It is also useful for setting options and modifying aliases.
If you wish abort the current message, you can use the escape
This will terminate the current message and return you to the
shell (or \fIMail\fP if you were using the \fBmail\fP command).
If the \fBsave\fP option is set, the message will be copied
If you wish (for some reason) to send a message that contains
a line beginning with a tilde, you must double it. Thus, for example,
~~This line begins with a tilde.
~This line begins with a tilde.
prints out a brief summary of the available tilde escapes.
On some terminals (particularly ones with no lower case)
tilde's are difficult to type.
allows you to change the escape character with the
option. For example, I set
and use a right bracket instead of a tilde. If I ever need to
send a line beginning with right bracket, I double it, just as for ~.
Changing the escape character removes the special meaning of ~.
This section describes how to send mail to people on other machines.
Recall that sending to a plain login name sends mail to that person
on your machine. If your machine is directly (or sometimes, even,
indirectly) connected to the Arpanet, you can send messages to people
on the Arpanet using a name of the form
is the login name of the person you're trying to reach,
is the name of the machine on the Arpanet,
is the higher-level scope within which the hostname is known, e.g. EDU (for educational
institutions), COM (for commercial entities), GOV (for governmental agencies),
ARPA for many other things, BITNET or CSNET for those networks.
If your recipient logs in on a machine connected to yours by
UUCP (the Bell Laboratories supplied network that communicates
over telephone lines), sending mail can be a bit more complicated.
You must know the list of machines through which your message must
travel to arrive at his site. So, if his machine is directly connected
to yours, you can send mail to him using the syntax:
is the name of the machine and
If your message must go through an intermediary machine first, you
and so on. It is actually a feature of UUCP that the map of all
the systems in the network is not known anywhere (except where people
decide to write it down for convenience). Talk to your system administrator
about good ways to get places; the
command will tell you systems whose names are recognized, but not which
ones are frequently called or well-connected.
command to respond to a letter, there is a problem of figuring out the
names of the users in the
.i "relative to the current machine" .
If the original letter was sent to you by someone on the local machine,
then this problem does not exist, but if the message came from a remote
machine, the problem must be dealt with.
uses a heuristic to build the correct name for each user relative
to the local machine. So, when you
to remote mail, the names in the
lists may change somewhat.
.sh 2 "Special recipients"
As described previously, you can send mail to either user names or
names. It is also possible to send messages directly to files or to
programs, using special conventions. If a recipient name has a
`/' in it or begins with a `+', it is assumed to be the
path name of a file into which
to send the message. If the file already exists, the message is
appended to the end of the file. If you want to name a file in
your current directory (ie, one for which a `/' would not usually
be needed) you can precede the name with `./'
So, to send mail to the file
in the current directory, you can give the command:
If the name begins with a `+,' it is expanded into the full path name
of the folder name in your folder directory.
This ability to send mail to files can be used for a variety of
purposes, such as maintaining a journal and keeping a record of
mail sent to a certain group of users. The second example can be
done automatically by including the full pathname of the record
command for the group. Using our previous
example, you might give the command:
alias project sam sally steve susan /usr/project/mail_record
Then, all mail sent to "project" would be saved on the file
.q /usr/project/mail_record
as well as being sent to the members of the project. This file
It is sometimes useful to send mail directly to a program, for
example one might write a project billboard program and want to access
To send messages to the billboard program, one can send mail
to the special name `|billboard' for example.
treats recipient names that begin with a `|' as a program to send
can be set up to reference a `|' prefaced name if desired.
the shell treats `|' specially, so it must be quoted on the command
line. Also, the `| program' must be presented as a single argument to
mail. The safest course is to surround the entire name with double
quotes. This also applies to usage in the
command. For example, if we wanted to alias `rmsgs' to `rmsgs \-s'