
Unix mail is an example of electronic mail, which is usually
referred to as e-mail. E-mail is becoming an increasingly
important way to exchange information as computers are accepted
and integreted into the workplace
Because computers have not yet achieved the ubiquitous status
of telephones and mailbboxes, e-mail is not a universal solution
to your commuinications problems, but it can be a real benefit in
many office and personal settings
Avoiding ``telephone tag'' is one good use of e-mail. We can
view telephone calls as synchronous communicaions-both
participants must be abailable and willing to communicate at the
same time. In a typical office setting, this requirement is met
less than 30 percent of the time. E-mail is a form of
asynchronous communication, which permits individuals to
communicate when time is available.
Although the elapsed time for a comple e-mail communication
may seem long compared to an equivalent telephone call, it really
is more efficient. The benefits of e-mail are numerous. Here are
a few:
* You don't waste time making repeated attempts to get through
on the telephone.
*You don't interrupt someone else's meetings or work
sessions.
*You can send a message at any time of the day and night.
*You can call in from anywhere to read your mail or send mail
or send mail to other users if your system has remote acess by
phone.
* You can call in from anywhere to read your mail or send mail
to other users if your system has remote access by phone.
*You can communicate with users on other systems if your
system is tied in to a network.
The primary disadvantage of e-mail is that all users must make
a conscious effort to check for received mail. If they are
logged in full time, the UNIX system can alert them of the
arrival of new mail. If they are not operating full time, they
must log in periodicaally to check for mail.
Sending and Receiving Mail
I'lllustrate the use of e-mail by using several examples
derived from my daily work. Listing 1A shows a sample e-mail
message sent to me by an associate. The fact tht some mail is
waiting for me is announced when I log in. To read the mail. I
type the mail command and carry on a mildly interactive
session.
After displaying a message on-screen, mail
prompts me by showing a questionm mark on-screen and waits for a
command. mail recognizes single-character commands.
By pressing d, I tell mail to delete the
message. Because it was the only message waiting to be read,
mail quits and returns control to the shell. Had there
been other messages, they would have been displayed one at a
time.
If you are using mail and you forget the
commands or haven't learned them yet, you can type the
? command to display a summary of the
mail commands (see Listing 1B).
You can delete or save mail messages, send mail to other
users, and move forward and backward through your received mail
by using these commands. For example, to save a mail item, type
s followed by by a file name from the file name with
a space or tab. This command appends the current message to the
named file (or creates the file if it doesn't exist). If you
don't provide a file name, mail uses the name
mbox in your system by typing the mail
command with an argument that is the log-in name of the recipient.
Listing 1C shows my reply to the previously received mail item. I
used the log-in name dab because that is the name in
the ``From...'' line in the message I received. This name is the
equivalent of a return address on a mailed envelope.
The commanmd lets yuou prepare mail messages
by thaking your input from the keyboard. You nsimmply type the
text of your message. If you make a mistake on a line, use a
combination of backspaces and retyping to correct the mistake
before presing ther Enter orReturn key. You cannot go back once
you have moved to new line. End your input by typing a dot(.) on a
line by itself followed by Return. (Note: some UNIX mail programs
don't recognize the dot to end input. If you press dot and Return
and find that mail is waiting for more input, type
Control-D to terminate input).
If your mail session is interrupted, or if you attempt to send
mail to a non-existent log-in name, the text of your message may be
preserved in a file called dead.letter in your home
directory. You can edit the file and then send it using the
method described next.
You can also prepare mail messages ``off-line'' by using your
favorite editor. (If your editor is a word processor, be sure to
create a plain ASCII text file.) This method gives you more
control over the message appearance because you can go back and
edit the message as much as you want before sending it. After
preparing the message and saving it in a file, you send it by
using themail command with command-line redirection.
Listing 1D shows how I might send a prepared message that is
contained in the file new_procs. The input
redirection symbol (<)tells the UNIX system to obtain input for
mail from a source othe than the keyboard, which is
the default input device. In this case, the source is the file
new_procs.
The mail command in Listing 1D also shows a new
wrinkle: mailing to a list of recipients rather than just one. The
new_procsfile might contain new operating procedures
for a project that involves several users. By giving
mail a list of log-in names, I need to issue only a
single command to send the message to all users in the list
instead of having to send mail to each user individually.
E-Mail to Remote Systems
So far we have dealt with sending mail to users on the same
system. If your system can communicate with other UNIX systems,
you may also be able to exchange mail messages with users at
remote locations.
The key to exchanging mail with remote systems is the
availability of UNIX-to-UNIX Copy Programs. UUCP is a set of
programs that allow UNIX systems to communicate with each other.
If your system is able to call other systems or receive calls
from them, you can probably exchange e-mail with users outside
your system.
To see whether your system is connected via UUCP to other
sites, type the . It will print a list of
system names, one per line, that your system can caall. If you are
lucky, one or more of these systems might be a backbone
site in the UNIX network thqat spans much of the world. Or at
least you might have access to another system that connects to a
backbone site eihter directly or throught a short seriesof
intermediate sites. You may need to enlist the aid of a
knowledgeable user or system administrator at your site to find
out about your system's connections.
If your system is connected to others, it makes calls on your
behalf. You don't need to know any telephone numbers, because the
sytem has them in a file that is read by UUCP when it is asked to
send mail.
Figure 1A depicts a fictional UNIX network with six sites and
shows their connections. The backbone sites have connections (not
shown) to many other sites in a larger network. Figure 1B shows some
sample mail paths that would be used to addes mail to some users
in the example.
The exclamation point (usually caled a ``bang'' separates
entries in the path specification. The initial series of entries
is a sequence of system names of sites that relay the message to
the user. The user's log-inname is the last entry in the path and
is preceded by the name of the user's system. You may have to do
some digging to find the information you need to form correct
mail paths. If UNIX users send you mail, the message will contain
the path by which it came. You can usually reverse the sequence
of names to reply to the sender.
The standard UNIX mail program is functional and
reliable, but it lacks many convenience features that users of
Berkeley UNIX have come to expect. The Berkeley Mail
command has many helpful features to enhance all aspects of
receiving, preparing, and sending mail.
A recent AT&T UNIX program called mailx is very
similar to Mailand is available on some AT&TUNIX
systems. On some UNIX and XENIX systems, the command name
mail is a link (another name) to either
Mail or mailx. In the folllowing
descriptions, I will use the command name mailx, but
the material applies to Mail with little or no
change.
One of the features of mailx is the use of a file
called .mailrc to customize the program to your
preferenmces. When you start mailx, it reads
commands and other information from the .mailrc file
(in your home directory) and configures itself to your
specifications.
You have control over various options by using
set (and unse) commands. For example,
to select the emacs editor for use in creating
mail messages, add the command set
VISUAL=/usr/lbin/emacs to your vi unless your system
administrator overrides this choice in a system-wide
configuration file. (Note: use a correct path name for the editor
of your choice in the set VISUAL command.)
You can also create aliases, which are alternatte names thjat
mailx translates into full mail addresses. Adding the
command alias snowman site2!backa!alaska!gus to your
file lets you use the name ``snowman'' in
place of the full mail path in mailx commands. This
saves you some time and reduices the risk of typing errors.
Another nice feature of mailx is the reply
function. After you read a message, you may want to send a reply
to the sender of the message. Type the R command to reply only to
the sender or r to reply to the sender and anyone
else (except yourself) who received the message. The
mailx command puts you in the input mode and waits
for you to type the reply message. If you want to use a visual
editor to create your input, type `v and press the
Return key. When you have finished creaating your reply, quit the
editor and type dot (or Control-D) to send the reply.
The mailx program has far too many commands and
options to cover here. When you decide that you need to know more
about mailx (and you will), check the documentation
provided with you system. You might also want to get the book
UNIX Communications, by Bart Anderson et al., publiched
by Howard W. Sams, 1987. It offers in-depth coverage of e-mail,
UUCP, and other UNIX communications topics.
|