MH for Beginners
Mary Hegardt - Tim Morgan
Contents
- Using Electronic Mail
- Why MH ?
- The Basics
- Mailing files
- Searching for messages
- The MH Profile
- News
- Checking for Mail
- Aliases
- Blind Lists
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 The Rand MH Message Handling System: User's Manual by Marshall T. Rose and John L. Romine. It is available on-line using the man command (e.g. man mh).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 any other Internet site in the world.
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: To:, From:, Subject:, and so on. The headers are separated from the body by a blank line. As in memos, the people listed in the 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 news (electronic bulletin boards) facility will be discussed later.
An electronic mail address looks like name@site. The name is a person's login name --- usually the first initial followed by the last name. For example, Frances Tong's login name is ftong. The site is the system where the addressee receives mail. Within the ICS Department, you need only know the person's login name; the mail system will automatically fill in the @ site part.
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 (Pine, for example), but MH has been designed to allow you to take full advantage of existing UNIX 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.
The Basics
The first time you use an MH command (probably 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 .mh_profile. It is a file that allows you to tailor your MH environment. We'll discuss this more later.
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 UNIX account, you will be told if you have new mail messages. When you are ready to read them, type inc. The inc program will copy your mail into your inbox and generate a scan listing of the new messages. For example,
4.2 BSD \unix[] #116: Mon Jul 15 14:03:21 PDT 1985 You have new mail. TERM = (xterm) % 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?This is what a typical inc session for the Postmaster looks like. 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 + sign. To read it, type show:
% 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. TimIf 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 [space bar] to see another screenful, or press the [return] key to see just one more line.
To see the next message, you could type a couple of different commands:
% next or
% show next or
% 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 next. When you do that, message number 2 will be shown and become the current message.
% 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. danaSelecting Messages
As you have seen, messages can be referred to by their message numbers. Some MH commands, such as show, can act upon more than one message at a time. A range of messages can be specified using the form name1-name2 where name is a message number or one of the reserved message names described below:
- cur
- The current message (the last one that was handled)
- next
- The next message (same as cur + 1)
- prev
- The previous message ( cur - 1)
- first
- The first message in the current folder
- last
- The last message in the folder
- all
- All messages ( first-last)
If you do not name a specific message, the command will act upon the current message.
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 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 comp command. This will start up an editor called prompter that will prompt you to fill in the headers. You should type the requested information for that header or a [return] to omit it. You should end the message by typing control-D (press down the key marked [ctrl] and strike the D key) at the beginning of a new line. Here's an example:
% comp To: morgan, raj Cc: Subject: Lunch --------- Where are we going for lunch today ? Mary <control-D> -------- What now ? sendAt the What now ? prompt you can type a ? 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:
What now ? edit vi
This will put you in the vi editor to edit the message. If you use 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 What now ? prompt. Here are some of the What now options:
- edit - Edit the message using the specified editor. When you exit, you will be back at What now.
- list - Shows the message you just typed
- whom -check - Verifies that the addresses you have used are valid as far as our system can tell
- send - Sends the message to the recipients
- quit - Quits without sending the message. Saves the text of the message as a draft. Type comp -use to get back to that draft later.
- quit -delete - Quit, throwing away the draft
Make sure you are happy with your message before typing send. There is no way to recall a message once it has been sent.
Replying to Messages
To reply to the current message type 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 comp, when you have finished, type control-D and send (or whatever) at What now ?.
Forwarding Messages
If you receive a particularly interesting message and can't resist sharing it with others, you can forward it using the 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 What now ? prompt.
Removing Messages
You should remove your mail messages when you no longer need them. Use thermmcommand to remove the current message. The message will not be deleted immediately, but instead will be renamed with a preceding comma. These comma files will be deleted by the system after a few days.See Rmm - Removing Mail Messages for additional information.
The Advanced Features
You will probably want to master the beginning MH concepts before you tackle the following...
Folders
Folders are really just directories for storing mail messages in an organized way. To store a message in a folder named inbox, type:
% 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:
% folder +inventory
and now you use scan, show, etc., to manipulate the messages in that folder. To change back to inbox, type:
% folder +inbox
Using the inc command will change your current folder to be the inbox automatically.
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 cp file to move the file to another account much more efficiently:
% cp frated/desired-file ~./newfile
This will copy the file from frated's account to the current directory and call it newfile.
If you really have to mail a file, you use the mhmail program. To mail a file myfile to another user frated, with MyFile as the subject type:
% mhmail frated -subject MyFile < myfile
Searching for messages
The 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:
% pick -from smith -list
and it will list the numbers of all messages from Smith that are in the current folder. You can pick messages according to any of the headers ( -to -from -subj -cc or -date) or just search all the messages for a given word ( -search).
The MH Profile
Each MH user has a file in his directory called .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:
Path: Mail or
Path: mhbox
To make a change to your .mh_profile, you edit the file and add a line for the applicable program. For example, if you would like to use vi instead of prompter as your initial editor when composing messages, you would add this line to your .mh_profile:
comp: -editor vi
or, if you want to have a format file for scan to use, you should have:
scan: -form formatfile
Almost all of the MH programs have options that can be set using the .mh_profile. You should consult the MH User's Manual for more information about this.
Many people will want to add a signature line to their .mh_profile. This line will appear as your signature on the From: line in messages you send. It looks like this:
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 show processor to be mhl. To do this you must add these lines:
showproc: mhl
moreproc: more
to your .mh_profile. You also must create a file called mhl.format in your MH directory (e.g. Mail).
A typical mhl.format file will look like this:
leftadjust,compwidth=10 ignores=received,message-id extras:nocomponent : body:nocomponentMuch more customization is possible; see the MH User's Manual for more details or type man mhl.
News
Electronic bulletin boards (newsgroups) 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 newsgroups which involve only people in the department. We also subscribe to many nationally distributed newsgroups. Newsgroups are read using the bbc program which will allow you to read the messages with an MH -like interface.
One very important newsgroup is ics.system. It contains vital news about changes in software, system downtime, new programs, and other information useful to all users.
To read a newsgroup, you type `` bbc newsgroup_name''. The bbc program will check to see if there are new messages in the named newsgroup and if there are, it will start up msh so you can read them. The msh program allows you to use regular MH commands when reading newsgroups. Type show to see the current message, next to see the next message, and so on. Type quit to quit reading the current newsgroup. If you have named more than one newsgroup on the command line, bbc will continue processing the next newsgroup in the list.
Here is an example of using bbc to read the ``ics.system'' newsgroup:
% bbc ics.system Reading ics.system, currently at message 1 of 22 (msh) show
(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: ics.system@ics.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(msh) next(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: ics.system@ics.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(msh) quit %You can see a list of all the available newsgroups by typing:
% bbc -topics
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 csh variable named mail to tell csh to check for new mail for you periodically. To do this, add the line
set mail=(60 /usr/spool/mail/$USER)
to the .login file in your home directory. This command says to check for mail if csh is about to prompt you with a % 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.
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 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:
roses: prose, srose, mrose, drose
In addition to your aliases file, you will need to modify your .mh_profile in order to use aliases. You should add the line
Aliasfile: aliases
to your .mh_profile. Now, messages addressed to roses will be distributed to all the people listed in the alias.
The ali command is used to show you what an alias expands to. You just type
% ali
and ali will respond with the expansion of the alias. Ali searches the system aliases file in addition to your private ones.
Blind Lists
There are two different types of so-called blind addressing of messages. The BCC: (blind carbon copy) 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
phrase: address_list;
where the phrase is any English phrase of one or more words, and the address_list consists of one or more addresses separated by commas. The recipients of a message addressed in this fashion will see simply
phrase: ;
so when they reply to the message, their reply will come only to the sender (or the 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 roses alias you would type:
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.