\documentstyle [12pt]{article}
\parindent=0pt
\parskip=7pt plus 2pt

\def\oneline#1{\par\bigskip\leftline{\tt\hskip.75in#1}}
\def\command#1{\par\bigskip\leftline{\tt\hskip.75in\% #1}}
\def\comarg#1#2{\par\bigskip\leftline{\tt\hskip.75in\% #1 {\it#2}}}
\def\MH/{{\sf MH}}
\def\MM/{{\sc mm}}
\def\unix/{{\sc Unix}}
\newfont{\itt}{cmti10}
\begin{document}

\title{MH for Beginners}
\author{Mary Hegardt \and Tim Morgan}
\maketitle

This document is intended to be an introduction for new users to the
\MH/ mail system. For more detailed information, users will want to
read the document called {\sl The Rand MH Message Handling System:
User's Manual\/} by Marshall~T. Rose and John~L. Romine. It is available
for Xeroxing in suite CS408.

\section{Using Electronic Mail}

Electronic mail (e-mail) is a quick, convenient way to send a message
to another person (or persons).  The message recipient can read and
reply to the message at his convenience. E-mail is much faster than
a paper memo and avoids inconveniences associated with the telephone
such as unwanted interruptions and ``phone tag.''

At UCI, one can send e-mail to people within the ICS department, people
in other units on campus, and to people at some other institutions
off campus (usually other universities).

An electronic mail message consists of two parts: the headers and the
body.  The body comes after the headers and consists of the ``message'':
whatever the sender types in. The headers are the lines at the top
of the message including the subject and addresses of the people
to whom the message is addressed.  It is similar to the top lines
of a memo: {\tt To:}, {\tt From:}, {\tt Subject:}, and so on.  The headers
are separated from the body by a blank line. As in memos, the people
listed in the {\tt Cc:}\ field are not intended to be the primary recipients 
of the message. The message is for their information only, and they
are not expected to reply.


E-mail is also useful for discussions among groups of people.  This
``bboards'' (electronic bulletin boards) facility will be discussed later.

An electronic mail address looks like ``{\it name\/}{\tt@}{\it site\/}''.
The {\it name\/} is
a person's ``mail handle'' --- usually his first initial followed by his
last name.   For example, Mary Hegardt's mail handle is ``mhegardt''.
The {\it site\/} is the system where the addressee receives mail.  Within
the ICS Department, you need only know the person's mail handle;
the mail system will automatically fill in the ``{\tt @}{\it site\/}'' part.

\section{Why MH ?}

The \MH/ system is very different from most mail user agents.  Instead of 
running one large program which handles all mail functions and keeps
messages in one large file, \MH/ is a collection of smaller 
single-purpose programs used to manipulate mail messages
which are kept in individual files.  \MH/ may seem to be more complicated
or harder to use than other mail systems (MM, for example), but  
\MH/ has been designed to allow
you to take full advantage of existing {\sc Unix}\footnote{{\sc Unix} is 
a trademark of AT\&T Bell Laboratories} commands and programs
in connection with mail messages.
For example, you can use your usual text editor, spelling program, and
printer commands on individual messages.  


\section{The Basics}

The first time you use an \MH/ command (probably {\it inc\/}), 
\MH/ will create a directory called ``Mail'' in your home (login) directory. All
your mail will be stored in directories beneath this one.  It will also
create a file in your home directory called \verb|.mh_profile|.  It is
a file that allows you to tailor your \MH/ environment.  We'll discuss
this more later.  


\subsection{Reading Mail}

When someone sends a mail message to you, it is delivered to a file
called your ``mail drop'' file.  When you are ready to read your mail,
you have to incorporate (or ``inc'') your mail messages from the mail
drop area into your account.

Everytime you log in to your {\sc Unix} account, you will be told if you
have new mail messages.  When you are ready to read them, type \verb|inc|.
The {\it inc\/} program will copy your mail into your ``inbox'' and generate
a ``scan'' listing of the new messages. For example,

\begin{scriptsize}
\begin{verbatim}
4.2 BSD UNIX #116: Mon Jul 15 14:03:21 PDT 1985
You have new ZOTnet mail, type "inc" (or mail)

TERM = (dm1520)

% inc

Incorporating new mail into inbox ...
 
   1+ 10/29 1732-PST Tim Morgan        new bboard!  <<Please add us to the uni
   2  11/12 0016-PST ROODE@uci-20b     CP6 from the 20s  <<What is (will be) t
   4  11/15 1909-EDT tts@tts           Hello, got a few questions
   5  11/15 2134-PST Marshall Rose     MH.6 on 750a  <<Mary, I've left the dis
   6  11/16 0808-PST Mail Delivery Su  Returned mail: Host unknown
   7  11/16 1021-PST Tim Morgan        Unix-wizards/info-unix move
   8  11/18 0952-PST freeman@icsd.UCI  Re:New system wide aliases for ICS facu
   9  11/18 1346-EDT tts@tts           Have we got a problem?
\end{verbatim}
\end{scriptsize}

This is what a typical ``inc'' session for the Postmaster looks like.  
{\it Inc\/} copies my mail into my ``inbox'' folder, assigns a unique number to
each message, and scans them for me.  The numbers allow you to refer
to each message individually.  After the message number, you see the
date and time the message was sent, the name of the sender, and the
subject of the message. The ``current'' message is indicated by a 
``{\tt +}'' sign. To read it, type ``{\tt show}'':

\begin{scriptsize}
\begin{verbatim}
% show

   (Message inbox:1)
   Received: from localhost by UCI.EDU id a005369; 29 Oct 85 17:32 PST
   To: postmaster@UCI.EDU
   Subject: new bboard!
   Date: 29 Oct 85 17:32:24 PST (Tue)
   From: Tim Morgan <morgan@UCI.EDU>
   
   Please add us to the unix-sw list.  Also, if RAJ hasn't mentioned it,
   and if it still exists, we should get on the Astronomy bboard.

   Tim
\end{verbatim}
\end{scriptsize}

If the message is
longer than one screenful, you will see the word ``more'' at the bottom
of the screen.  When you are ready to see ``more'' of the message,
press the \fbox{space bar} to see another screenful, or press the 
\fbox{return} key to see just one more line.

To see the next message, you could type a couple of different commands:


\oneline{\% next}
or
\oneline{\% show next}
or
\oneline{\% show 2}

All of these commands would have the same effect: to type out the next message
in the list.  The most efficient thing to do is to type ``{\tt next}''.  When
You do that, message number 2 will be shown and become the ``current message''.

\begin{footnotesize}
\begin{verbatim}
% next

(Message inbox:2)
Received: from UCI-20B by UCI-ICSA id aa01222; 12 Nov 85 0:23 PST
Date: 12 Nov 1985 0016-PST
From: ROODE@uci-20b
Subject: CP6 from the 20s
To: zotnet@uci-20b
cc: dana_roode%ucicp6@UCI.EDU

What is (will be) the prescribed method of addressing for sending
CP6 mail from the 20s?  They dont seem to know about @CF, @UCICP6,
but "Name_Name%UCICP6"@ICSA seems to fly.

	dana
\end{verbatim}
\end{footnotesize}

\subsection{Selecting Messages}

As you have seen, messages can be referred to by their message numbers.
Some \MH/ commands, such as {\it show,} can act upon more than one
message at a time. A range of messages can be specified using the
form ``{\it name1-name2\/}'' where {\it name\/} is a message number or
one of the reserved message names described below:

\bigskip

\def\titem[#1]{\par\noindent\hbox to .5in{\hfil\it #1\/}\qquad}

\titem[cur] The current message (the last one that was handled)
\titem[next] The next message (same as ${\it cur\/} + 1$)
\titem[prev] The previous message (${\it cur\/} - 1$)
\titem[first] The first message in the current folder
\titem[last] The last message in the folder
\titem[all] All messages ($\it first-last$)

\bigskip

If you do not name a specific message, the command will act upon
the ``current message''.

\subsection{Sending Messages}

A mail message consists of two parts: the headers and the body.  The
headers are the lines at the top of the message that say ``{\tt To:}''
and so on.  The body is the actual text of the message (what you
want to say).  To send someone a message, you start with the
{\it comp\/} command.  This will start up an editor called {\it prompter\/}
that will prompt you to fill in the headers. You should type the
requested information for that header or a \fbox{return} to omit it.  
You should end the message by typing control-D (press down the key
marked \fbox{ctrl} and strike the D key) at the beginning of a new
line.  Here's an example:

\begin{verbatim}
	% comp
	To: morgan, raj
	Cc: 
	Subject: Lunch
	---------
	Where are we going for lunch today ?  

	Mary
	<control-D>
	--------
	What now ?  send
\end{verbatim}

At the ``\verb|What now ?|'' prompt you can type a {\tt?} to see 
what commands you can type next.
One of the most useful options at this point is to edit the draft
of the message to correct any mistakes.  To do this you type:

\oneline{What now ?  edit vi}

This will put you in the {\it vi\/} editor to edit the message.  If you use
{\it emacs\/} or any other editor, just type ``edit emacs'' or whatever.
When you have finished editing, just exit the editor as you would 
normally.  You will then get another ``\verb|What now ?|'' prompt. Here are some
of the ``What now'' options:

\bigskip

\begingroup
\def\titem[#1]{\par\hangafter=1\hangindent=1.4in\noindent
	\hbox to\hangindent{\hfil#1\qquad}\ignorespaces}

\titem[\tt edit \it editor\/] Edit the message using the specified
				editor.  When you exit, you will be
				back at \verb|What now|.

\titem[\tt list] Shows the message you just typed

\titem[\tt whom -check] Verifies that the addresses you have
				used are valid as far as our system
				can tell

\titem[\tt send] Sends the message to the recipients

\titem[\tt push] Sends the message in the background

\titem[\tt quit] Quits without sending the message.
				Saves the text of the message as
				a ``draft''. Type \verb|comp -use| to
				get back to that draft later.

\titem[\tt quit -delete] Quit, throwing away the draft
\endgroup

\bigskip

Make sure you are happy with your message before typing \verb|send|.  There
is no way to recall a message once it has been sent.

\subsection{Replying to Messages}

To reply to the current message type {\it repl.}  When you do this, 
the reply headers will be printed out and you will be put in the prompter
editor to type in your reply text. When you are replying  to a message,
the name of the sender of the original message will appear in the
``To:'' field.  Any people on the ``To:'' or ``Cc:'' lists will also
be copied on your reply message. As with {\it comp,} when you have
finished, type control-D and \verb|send| (or whatever) at \verb|What now ?|.

\subsection{Forwarding Messages}

If you receive a particularly interesting message and can't resist
sharing it with others, you can forward it using the {\it forw\/}
command.  You will be prompted to fill in the headers (the address
to which the message is to be forwarded, etc.). When you have done this,
you will see the text of the message which you are forwarding and will be
given the opportunity to add some enlightening text to the message.
Exit with control-D and do whatever feels good at the \verb|What now ?|
prompt.

\subsection{The Advanced Features}

You will probably want to master the beginning \MH/ concepts before you
tackle the following\dots

\subsection{Folders}

Folders are really just directories for storing mail messages in an
organized way.   To store a message in a folder named
``inbox'', type:

\oneline{\% refile 5 +inventory}

If the folder doesn't exist yet, you will be asked if it should be created.
To access messages in another folder, you can change your current
folder from ``inbox'' to something else.  If you want to look at all
the messages pertaining to the inventory, you type:

\oneline{\% folder +inventory}

and now you use {\it scan,} {\it show,} etc., to manipulate the messages
in that folder.
To change back to inbox, type:

\oneline{\% folder +inbox}

Using the {\it inc\/} command will change your current folder to be the
``inbox'' automatically.
	
\section{Mailing files}

Mailing files is usually not a good idea, especially for large files.  
The mail system was never designed for moving big files. You
can use the {\it cp\/} file to move the file to another account much more
efficiently:

\oneline{\% cp \char`\~frated/desired-file \char`\~./newfile}

This will copy the file from frated's account to the current directory and
call it ``newfile''. 

You can also copy files across the network using {\it rcp\/}:

\oneline{\% rcp icsd:frated/desired-file ./newfile}

This copies frated's file on the system icsd to the current directory.

If you {\it really\/} have to mail a file, you use the {\it mhmail\/} program.
To mail a file ``myfile'' to another user ``frated'', with ``MyFile'' as
the subject type:

\oneline{\% mhmail frated -subject MyFile < myfile}


\section{Searching for messages}

The {\it pick\/} program allows you to search your inbox (or any other)
folder to find messages which contain a certain word.  If you want to 
list all messages from Smith you can type:

\oneline{\% pick -from smith -list}

and it will list the numbers of all messages from Smith that are in the
current folder.  You can {\it pick\/} messages according to any of the
headers ({\tt -to -from -subj -cc {\rm or} -date}) or just search all the
messages for a given word ({\tt -search}).

\section{The MH Profile}

Each \MH/ user has a file in his directory called \verb|.mh_profile|.  This
file contains a list of user-specified default options for \MH/ programs.
The only required
entry is the name of your \MH/
directory:

\oneline{Path: Mail}
or
\oneline{Path: mhbox}

To make a change to your \verb|.mh_profile|, you edit the file and add a
line for the applicable program.  For example, if you would like to use {\it
vi\/} instead of {\it prompter\/} as your initial editor when composing
messages, you would add this line to your \verb|.mh_profile|:

\oneline{comp: -editor vi}

or, if you want to have a format file for {\it scan\/} to use, you should
have:

\oneline{scan: -form {\it formatfile}}

Almost all of the \MH/ programs have options that can be set using the
\verb|.mh_profile|. You should consult the {\sl MH User's Manual\/}
for more information about this.

Many people will want to add a signature line to their \verb|.mh_profile|.
This line  will appear as your signature on the From: line in messages
you send. It looks like this:

\oneline{Signature: John Q. Public}


Occasionally people express an interest in getting rid of some of the
header lines in their mail messages.  They don't want to see the
``Received from'', ``Via'' information, or some other header.  It
is possible to prevent these and other annoying headers from being
displayed by changing your {\it show\/} processor to be {\it mhless.}
To do this you must add this line 

\oneline{showproc: mhless}

to your \verb|.mh_profile|. You also must create a file 
called ``.mhlessrc'' containing the words which
appear at the beginning of the lines you don't want to see.
 
The typical ``.mhlessrc'' file will look like this:
\begin{verbatim}
	Received
	Via
	BB-Posted
	Return-Path
\end{verbatim}

The ``.mhlessrc'' file must be in your home directory.


\section{BBoards}

Electronic bulletin boards (BBoards) are a convenient way for a group
of people to discuss a particular topic.  Messages are sent to
an address where they can be read and replied to by all interested
parties. In the ICS department we have some ``local'' BBoards which
involve only people in the department.  We also subscribe to many
nationally distributed BBoards.  BBoards are read using the {\it bbc\/}
program which will allow you to read the messages with
an \MH/-like interface. 

One very important BBoard is ``system''.
It contains vital news about changes in software, system
downtime, new programs, and other information useful to all users.

To read a BBoard, you type ``\verb|bbc| {\it BBoard\_name\/}''. The {\it
bbc\/} program will check to see if there are new messages in the named
BBoard and if there are, it will start up {\it msh\/} so you can read them.
The {\it msh\/} program allows you to use regular \MH/ commands when reading
BBoards. Type ``{\tt show}'' to see the current message, ``{\tt next}'' to
see the next message, and so on.  Type ``{\tt quit}'' to quit reading the
current BBoard. If you have named more than one BBoard on the command line
or in your \verb|.mh_profile|, {\it bbc\/} will continue processing the next
BBoard in the list.

Here is an example of using {\it bbc\/} to read the system BBoard:

\newpage
\begin{footnotesize}
\baselineskip=12pt\parskip=0pt
\leftline{\tt\% bbc \itt system}
\leftline{\tt Reading system, currently at message 1 of 22}
\leftline{\tt(msh) \itt show}
\begin{verbatim}
(Message 1, BBoard-ID: 1360)
BBoard-ID: 1360
BB-Posted: Wed, 29 Jan 86 15:36:39 PST
Received: from localhost by UCI.EDU id a006693; 29 Jan 86 15:20 PST
To: network@UCI.EDU
Subject: Imagen 24300
Date: Wed, 29 Jan 86 15:19:43 -0800
From: Tinh Tang <ttang@UCI.EDU>

The Imagen 24300 is now operating normally.  It was broken down
due to the paper jammed in the drum.  Luckily, it didn't cause
any damage.

/ttang
\end{verbatim}\leftline{\tt(msh) \itt next}\begin{verbatim}
(Message 4, BBoard-ID: 1363)
BBoard-ID: 1363
BB-Posted: Fri, 31 Jan 86 13:33:37 PST
Received: from localhost by UCI.EDU id a001631; 31 Jan 86 13:30 PST
To: msgs@UCI.EDU
Subject: uci.edu down 2/7/86 17:10 - 2/7/86 20:30
Date: Fri, 31 Jan 86 13:30:27 -0800
From: root@UCI.EDU

The uci.edu will be down from
	February  7,1986 17:10 till February  7,1986 20:30.
The reason for the downtime is:
Both, the Computing Facility and the Physical Sciences Dataswitches 
will be unavailable from 5:10pm until 8:30pm on Friday, February 7th. 
Therefore all the Computers attached to those switches and the 
corresponding tandem link will be unavailable to users on 
the specified time.              (RJ).

Downtime Scheduler
\end{verbatim}\leftline{\tt(msh) \itt quit}
\leftline{\tt \%}
\end{footnotesize}
\newpage

You can see a list of all the available BBoards by typing:

\command{bbc -topics}

You can also put a line in your ``\verb|.mh_profile|'' listing all
the BBoards you want to read on a regular basis:

\oneline{bboards: system movies mh-users events}

Then you only need to type ``\verb|bbc|'' to read all your BBoards. 


\section{Checking for Mail}

Under \unix/, there are many different ways to check for new mail. The
easiest way to do it is to set the {\it csh\/} variable named ``mail''
to tell {\it csh\/} to check for new mail for you periodically. To
do this, add the line

	\oneline{set mail=(60 /usr/spool/mail/\$USER)}

to the {\tt .login} file in your home directory.  This command says
to check for mail if {\it csh\/} is about to prompt you with a
{\tt \%} sign, and if it has been at least 60 seconds since it last
checked for mail.  The advantage of this method of mail notification,
besides simplicity, is that you will never be interrupted by a mail
notification.  You will only be notified about new mail when you
are between commands.

If you want asynchronous mail notification, which will print to your
terminal regardless  of what you are currently doing, you may make
use of a ``receive mail hook'' called ``rcvtty''.  To do this, 
create a file in your home directory called ``{\tt .maildelivery}''.
In this file, put the line

	\oneline{* - pipe R /usr/uci/lib/mh/rcvtty}

Then, each time mail arrives, you will receive a one--line ``scan''
listing of the mail if your terminal is world-writable.  For more
information on mail delivery files, type:

	\command{man 5 maildelivery}

This will tell you about all the options available to you if you
use maildelivery files.


\section{Aliases}

Using \MH/, you may specify your own private mail aliases.  This feature
allows you to store lists of addresses or long internet addresses of people
with whom you frequently correspond in one file, and then to address them
using short mnemonic names.  Typically, you will call your alias file ``{\tt
aliases}''; it must be stored in your \MH/ directory.  The format of this
file is simple. The alias is given, followed by a colon, followed by one or
more legal mail addresses separated by commas.  For example, you might for
some reason have an alias for all the users named ``Rose'' in the ICS
department:

	\oneline{roses: prose, srose, mrose, drose}

In addition to your ``{\tt aliases}'' file, you will need to modify your\break
\verb|.mh_profile| in order to use aliases.  You should add the flag
``{\tt -alias aliases}'' to the entries for the commands {\it ali, whom,
send,} and {\it push,} creating entries for these programs if they aren't
already in your \verb|.mh_profile|.
Now, messages addressed to ``{\tt roses}'' will be distributed to all
the people listed in the alias.

The {\it ali\/} command is used to show you what an alias expands to.
You just type

	\comarg{ali}{alias}

and {\it ali\/} will respond with the expansion of the {\it alias.}  {\it
Ali\/} searches the system aliases file in addition to your private ones.

\section{Blind Lists}

There are two different types of so-called ``blind addressing'' of messages.
The {\tt BCC:} field allows you to add recipients to your message just
like those who are CC'd, but the normal recipients will not see that the
BCC recipients were copied on the message, their replies will not go to the
blind recipients, and the blind recipients cannot (easily) reply to the
message.

The second type of blind mailing is actually called a ``group address list'',
although it is commonly referred to as a ``blind list''.
The format of this type of address is

	\oneline{{\it phrase\/}: {\it address\_list\/};}

where the ``{\it phrase\/}'' is any English phrase of one or more words,
and the {\it address\_list\/} consists of one or more addresses separated by
commas.  The recipients of a message addressed in this fashion will
see simply

	\oneline{{\it phrase\/}: ;}

so when they reply to the message, their reply will come only to the sender
(or the {\tt Reply-To:} field, if one was specified), rather than going to
all the recipients of the original list. For example, to use a group
address list for the ``{\tt roses}'' alias you would type:

	\oneline{To: People Named Rose: roses;}

This type of group address is very
useful for making up lists of related people, such as all the people working
on a particular research project.


\end{document}
