

			     MAIL  REFERENCE  MANUAL
			     ----  ---------  ------

	Mail allows you to communicate with other users of the system,
without having to resort to a game of 'telephone tag' or using the US mail.
In order to use mail you simply need to know the users login name.  A simple
method of doing this is to use the 'finger' command.  Once you know the login
name, there are only a few commands you need to know in order to use mail.


			       Finding a Users Name
			       --------------------
	
	To find the login name for 'Bob Johnson' you would type:

		finger Bob
		  or perhaps
		finger Johnson

	The system will response with a message similar to this:

		Login name: bjohnson   	           In real life: Bob Johnson
		Office: AFZF-DE-EPS                Phone: 287-8754
		Directory: /usr/usr/bjohnson       Shell: /bin/sh
		On since Jan 27 12:35:33 on tty0    	
		Plan:
		General Engineer
		Directorate of Engineering & Housing


			       Sending Mail Messages
			       ---------------------

	At the '$' prompt you type:

		mail bjohnson
		(or mail "Bob Johnson", see Mail Alias)

	The system then returns with:

		To: bjohnson
		Subject:

	The system will always return with the true network address of the
person that mail is sent to.

	The user types a brief title about the message and hits the carriage
return.  On the next line, the text of the message is begun.  There is no
prompt character at this time.  The text can be as long or short as you wish.
You must remember several things: to hit a CR (carriage return) at the end
of each line, and once you hit the CR, you cannot go back and change things
in the line.  You can correct on the line you are on, by using the backspace
key and backing up to the error.  If you wish to kill a mail message when you
are in the middle of writing it, you can type a control C (this is performed
by holding down the 'ctrl' key and hitting the letter 'c').

	When you have finished the message, you must hit a carriage return
to a new line, and then type a CTRL D or a '.' (period) and the system will
respond with:

		Cc:

	This is the carbon copy distribution.  This will allow you to send a
copy of the message to someone else or to yourself.  If you do not wish to
send any copies to other people just hit a carriage return at this point,
otherwise, enter the login name of the person.


			      Multiple Readers
			      ----------------

	The mail system is flexible enough so you can send a message to
several people at one time.  To do this, simply  list the login names with
a space between them.  For example:

		mail bjohnson smith jones

	You can also send copies to multiple people in the same way by listing
the logins on the 'Cc:' line.  For example:

		Cc: green franklin


			     Reading Mail Messages
			     ---------------------

	When you login, the system will tell you if you have any mail.  To
read the mail, simply type 'mail' at the '$' prompt.

		mail

	The system will then tell you how may messages you have, and will
print out the headers of the mail similar to this:

	You have 3 messages in /usr/mail/bjohnson

	  NO  LNS  RECEIVED      FROM         SUBJECT
	  1   51  Jan 04 10:24  green         Last weeks staff meeting
	  2   24  Dec 29 15:33  jones         We've got trouble..
	  3   17  Dec 20 02:50  ..!smith      New product

	[unpositioned] ?

	To read one of the messages, simply type in the number of the
message you wish to read.  The prompt '[unpositioned] ?' will change to
show which of the mail messages you are currently acting upon.  For example,
if you have typed '2' to read message number two, then after the message had
been displayed, the prompt would change to:

		[2] ?

	If the mail message is longer than what will normally fit on your
screen, then the message is shown one page at a time.  At the end of the
page you will be prompted by '-- more --'.  To continue to the next page, hit
the space bar.  To advance one line at a time, hit the carriage return key.
Finally, to interrupt the showing of the message, hit the 'q' key.


			       Replying to Mail
                               ----------------

	Often there are times when you'll want to reply to a message.  Rather
than waiting until you are finished reading all of your mail, there is an
'answer' command which can be used while you are reading your mail.  You use
the 'answer' command immediately after reading the message while the command
prompt is "pointing" to the number of the letter you wish to reply to.
The system will send the mail to the sender of the original message.  It will
Also retain the original subject line and will insert a reply chain message.
You type 'a' at the '[2] ?' prompt, the system responds by:

		To: jones
		Subject: We've got trouble..
		In-Reply-To: Your message of Dec 29 15:33

	You would then type in the reply message similar to sending mail.


			         Saving Mail
                                 -----------

	Incoming mail is stored in a mail spool file.  It is the presence
of mail in this file that generates the notice "you have mail" whenever
you log into the system.  There might be situations in which you may wish to
save mail message in you home directory so that you can refer to it later.
There are several ways of doing this.  The first is the 'save' command.
This will save a message in the current directory under a name you designate.
At the the '[2] ?' prompt, you would type:

		 s contract

	 A new file 'contract' is created if one did not exist and the message
is appended to that file.  Those messages that are saved using the 's' command 
without specifying a file name are recorded in a special file called 'mbox'.
Messages in this file cannot be read by other users.  These messages can be
accessed by using the '-f' flag of the mail command.  Those messages that
have been copied into a file with the 's' command will be removed from the
mail spool file.


			     Deleting Mail Messages
			     ----------------------

	If you do not wish to keep mail messages after reading them, you
should delete them.  This is done by typing a 'd' at the '[number] ?' prompt.
It is always a good idea to 'delete' or 'save' all messages from the mail spool
file because messages that are left will generate the false notification
"you have mail" when you next login.


			         Exiting Mail
				 ------------

	Those messages that have been 'saved' and those that have been
'deleted' actually don't disappear from the mail spool until you have exited
mail.  To do so, you type 'q' at the '[number] ?' prompt.  If you wish to
exit mail but leave your mail the same as it was before you got into mail,
use 'x' instead of 'q'.


			 Fate of Messages Saved - mbox
			 -----------------------------

	Those messages that have been saved by using the 's' command, are
accessed by the following command:

		mail -f

	The format of 'mbox' is identical to your system mailbox.  You will
receive a 'index' page showing the headers of the messages saved.  If there
are more that 18 messages, the index is displayed one page at a time, pausing
at the end of the page with the prompt '-- more --'.

	Periodically 'mbox' should be cleaned out.  This is done by deleting
messages as described previously.


			       ADVANCED TOPICS
			       ---------------

	The following discussions describe mail features for users who are
familiar to Unix and mail.


			     Command Line Arguments
			     ----------------------

	The following optional arguments alter the printing or the sending
of mail when used on the command line while entering mail.

	-p      causes all mail to be printed without prompting for disposition.

	-q      causes mail to terminate after interrupts.  Normally an
		interrupt only causes the termination of the letter being
		printed.

	-f file
		causes mail to use 'file' instead of the default mailfile.
		If no file is specified, $HOME/mbox is assumed.

	-g group
		causes mail to be sent to members of group that are designated
		in the file /etc/group.


        -s "subject"
                causes the Subject: field to be filled in when sending mail.
                Useful for sending mail from a shell script. Added by erc.

	-u user
		Imitates "user" if his mailbox can be read.  Useful for
		system-wide read-only mailboxes.  Added by erc.



		      Additional Commands While Reading Mail
		      --------------------------------------

	Any one of the following commands can be entered while reading mail
to indicate the disposition of the current letter pointed to by the
'[number] ?' prompt:

	RETURN  Go on to next letter.

	+       Same as RETURN.

	dq      Delete letter, put undeleted mail back in mailfile, and stop.

	u       Undelete letter and remain positioned on the letter.

	p       Print current letter.

	p|command
		Like the p command, but the letter is printed by passing it as
		standard input to the specified shell command.  If the | is
		doubled, as in p||, the previous shell command is substituted.
		This procedure can be used to get a hard copy of a letter by
		typing p|lpr.

	-       Go back to previous letter.

	<       Go back to previous undeleted letter.

	>       Advance to next undeleted letter.

	r       (reply) Same as answer.

	w [ file ]
		Save letter, similar to 'save' but without a header, in the
		named file ($HOME/mbox is default).  The letter is *not*
		deleted from mailfile.

	m [ -g groups ] [ persons ]
		Mail (forward) the current letter to the named persons.  A
		"forwarded by ..." message is inserted after the header.

	M [ -g groups ] [ persons ]
		Mail the current letter and a prepended comment to the named
		persons.  The standard input is read through end-of-file for
		text or commands to prepend to the letter.  The body of the
		original letter is indented by '>'.  A "forwarded by..."
		annotation is inserted after the header.

	l       List a table of contents of letters in the mailfile.  The
		table of contents is ordered from newest to oldest, unless the
		-r option was specified, in which case the sort is reversed.
		A one-character disposition code is suffixed to the letter
		number if it has been deleted, forwarded, saved or answered.

	h       (header) Same as l.

	EOT     (control-d) Same as q.

	f       Put undeleted mail back in the mailfile and reopen the
		resulting mailfile.  A new table of contents will be listed.
		This command is a handy response to the new mail arrived
		prompt.  It avoids having to exit and reexecute mail.

	!command
		Escape to the shell to do command.

	cd [directory]
		Change current working directory to directory.  Standard shell
		syntax is allowed in directory names (e.g., $HOME/mail).  If
		no directory is specified, $HOME is assumed by default.  The
		directory remains the current working directory only for the
		duration of mail.  If the -f option was used to specify an
		alternate mailfile that does not begin with /, the command is
		disallowed (because the wrong mailfile may be updated at exit).

	cd! directory
		Same as cd, but the constraint on alternate mailfiles is
		lifted. (User beware!)

	?       Print a command summary.


	If a number is typed before the command, then that number is taken as
the letter number.  For example, the command "4d" typed at the prompt will
delete letter number four no matter what number was being pointed to in the
prompt string.  This shortcut will work on the following commands: 'p', 'r',
'a', 'w', 's', 'm', 'M', 'd', and 'u'.


			Additional Commands While Writing Mail
			--------------------------------------

	The following commands can be used while inputing mail for interacting
with a letter being entered:

	~e      causes the text editor 'ed' to be invoked on the letter.

	~v      causes the visual editor 'vi' to be invoked.

	~p      causes the letter to be printed from the beginning to the
		current location.

	~r file reads the named file into the letter.

	~t [ -g groups ] [ persons ]
		Change the route list to the logins named by group and
		persons.  If a % appears anywhere in the argument string, it
		is replaced by the previous list of addressees, as determined
		by the most recent specification.  If no arguments are given,
		the current route list is printed.

	~x      exits from the letter without changing anything.  The letter
		is discarded and not sent.

	~!      command causes the shell command line command to be executed.

	~?      Print a command summary.


				   Mail Alias
				   ----------

	A person is usually a user name recognized by login.  However, mail
will look first in the current user's $HOME/.alias file and finally in
/etc/aliaslist for the named person.  If the person is found, the translation
found in the second column of the alias file will be used as the actual
address.  The alias file consists of two column entries separated by a tab.
The first is the tag and the second is a space-separated list of translations.
There is no rescan of the alias file for further (recursive) translations.
This translation is also performed if a name (in quotes) is typed in on the
command line.

When receiving mail, the alias file is scanned for system!user constructs
(addresses) that match the "From" field.  If a matching address is found,
the name in the first column is substituted.  This is useful for "hiding"
actual addresses from the user, making it simpler to reply to, for example,
Joe User that it is to reply to mach1!mach2!mach3!joeuser.  Added by erc.


				  Dead Letters
				  ------------

	If a person being sent mail is not recognized, or if mail is
interrupted during input, the 'dead.letter' will be saved to allow editing and
resending.  If a person is answering a letter, an interrupt saves the contents
in a dead.answer file.


				  Remote Mail
				  -----------

	To denote a recipient on a remote system, prefix 'person' by the system
name and exclamation mark '!' (see uucp(1C)).  Everything after the first
exclamation mark in persons is interpreted by the remote system.  In
particular, if 'persons' contains additional exclamation marks, it can denote
a sequence of machines through which the letter is to be sent on the way to
its ultimate destination.  For example, specifying 'sys1!sys2!login' as a
recipient's name causes the letter to be sent to user 'sys2!login' on system
'sys1'.  System 'sys1' will interpret that destination as a request to send the
letter to user login on system 'sys2'.  This might be useful, for instance,
if the sending system can access system 'sys1' but not system 'sys2', and
system 'sys1' has access to system 'sys2'.

If the variable MAILDEFER is defined in the environment and is set to "yes",
mail is queued for the remote system, but is not actually sent.  Mail is then
sent by executing a "uucico" command or a "uusched" command via cron(1).


			    Logging of Outgoing Mail
			    ------------------------

	If the variable MAILLOG is defined in the environment and has a non-null
value, it is assumed to be the name of a log file into which copies of all
letters being sent by mail are kept.  This includes letters being answered
('a' command) and forwarded ('m' and 'M' commands).


			    Automatic Mail Forwarding
			    -------------------------

	If the mailfile (usually in the /usr/mail/ directory) has has its
first line 'Forward to person' then all mail sent to the owner of the mailfile
will be forwarded automatically to 'person'.  This is especially useful to
forward all of a person's mail to one machine in a multiple machine environment.

                        Pathalias Database Support
                        --------------------------

	If a $PATHALIAS file is present (defaults to /usr/lib/uucp/paths)
and readable. it will be used to resolve Internet-style addresses.  If a
line of the form "smart-host<TAB><SYSTEM>" is present in the paths file,
mail will be forwarded to <SYSTEM> if the destination system isn't in the
paths file.  For example, if /usr/lib/uucp/paths contained the following:

	smart-host	apple
	akasha	syst1!akasha!%s
	rhiannon	%s

"mail erc@akasha" would be translated to "mail syst1!akasha!erc".
"mail linux-activists@joker.cs.hut.fi" would translate to
"mail apple!joker.cs.hut.fi!linux-activists". "mail root@rhiannon" would
be forwarded to root on the current host (this is a good way to alias
hostnames).

                        Pathalias Database Support
                        --------------------------

	If a $PATHALIAS file is present (defaults to /usr/lib/uucp/paths)
and readable. it will be used to resolve Internet-style addresses.  If a
line of the form "smart-host<TAB><SYSTEM>" is present in the paths file,
mail will be forwarded to <SYSTEM> if the destination system isn't in the
paths file.  For example, if /usr/lib/uucp/paths contained the following:

	smart-host	apple
	akasha	syst1!akasha!%s
	rhiannon	%s

"mail erc@akasha" would be translated to "mail syst1!akasha!erc".
"mail linux-activists@joker.cs.hut.fi" would translate to
"mail apple!joker.cs.hut.fi!linux-activists". "mail root@rhiannon" would
be forwarded to root on the current host (this is a good way to alias
hostnames).

If mail starts doing odd things like not delivering mail, dumping
core, looping, etc.  Make sure that /usr/lib/uucp/paths is there, that
you have a smart-host defined, and tht it is world readable.
