A brief introduction to the unix mail utility

receiving | sending | hints

Here are some very crude instructions for how to get started with e-mail on a Unix system. There are several other types of mail utilities other than the one discussed here [e.g., pine, emacs-mail/Rmail), but the information here will get you started with some basics.

Getting started.

Receiving mail

The mail facility in unix is invoked with the mail command. Just typing this opens your "primary mailbox", a system file (e.g., /var/mail/username) with incoming messages, for example,
mailx version 5.0 Tue Jul 15 21:29:48 PDT 1997 Type ? for help.
"/var/mail/myusername": 2 messages 1 new 1 unread
  U 1 someuser@top.physics. Tue Sep 1 15:57 88/3491 Library Announcement
> N 2 root@top.physics.utah. Tue Sep 22 16:10 16/689 print job
(the layout may be a little different). The first letter to the left in the message-header list denotes a message status (New or Unread); the number in the next column is used for refering to a particular message. The other columns give info such as the sender's email address, date of message, size (#-of-lines/total-bytes), and the subject of message (unless not specified by sender). The > symbol to the left of message #2 indicates that it is the "default" or "current" message. The mail prompt is the ?, indicating that the mailer is waiting instructions. You can take action on the default message (read, save, delete, etc) by typing one of
?     help/command summary
t     type the message to stdout
r     reply to sender (also R)
w filename     write message contents to a file
d     delete message from the primary mailbox
q     quit, saving changes (see below)
x     quit without making changes to mailboxes
This is just a selection of commands; there are quite a few more possibilities.

Some comments:

Sending mail

By typing
mail username@host.domain.edu
you trigger the mail utility to get set for sending a message. You will be asked to specify a subject for the message, then you will be put into a line-edit mode (you can type one line at a time, and can't edit previous lines). As above (when replying to an incoming message), to get out without sending the message, type ^C^C (control-C, twice). To send the message, type a "." (a period) at the beginning of a line, then hit the ENTER key.

To send a file to more than one person,

mail user1 user2 ...
Some people keep track of their outgoing mail by adding themselves to the recipient list.

The man pages for mail list some other features you may use.


None, for now....
bcb 11-Sep-98.