MH for Beginners Mary Hegardt Tim Morgan April 12, 1990 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 for Xeroxing in suite CS408. 1 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: To:, From:, Subject:, and so on. The headers are separated from the body by a blank line. As in 1 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 "bboards" (electronic bulletin boards) facility will be discussed later. An electronic mail address looks like "name @site ". The 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 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 "@site " part. 2 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 mes- sages 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 ad- vantage of existing Unix1 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. 3 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. ________________________________________________ 1 Unix is a trademark of AT&T Bell Laboratories 2 3.1 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 ZOTnet mail, type "inc" (or mail) TERM = (dm1520) % inc Incorporating new mail into inbox ... 1+ 10/29 1732-PST Tim Morgan new bboard! < 3 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 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 __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. dana 4 3.2 Selecting 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 "cur- rent message". 3.3 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: 5 Subject: Lunch --------- Where are we going for lunch today ? Mary -------- What now ? send At 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 editor 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 push Sends the message in the background 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. 6 3.4 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 ?. 3.5 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 mes- sage 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. 3.6 The Advanced Features You will probably want to master the beginning MH concepts before you tackle the following. . . 3.7 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 7 "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. 4 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". You can also copy files across the network using rcp: % rcp icsd:frated/desired-file ./newfile This copies frated's file on the system icsd to the current directory. 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 5 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 8 from Smith you can type: % pick -from smith -list and it will list the numbers of all messages from Smith that are in the cur- rent 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). 6 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 infor- mation 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: 9 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 mhless. To do this you must add this line showproc: mhless to your .mh_profile. You also must create a file called ".mhlessrc" contain- ing the words which appear at the beginning of the lines you don't want to see. The typical ".mhlessrc" file will look like this: Received Via BB-Posted Return-Path The ".mhlessrc" file must be in your home directory. 7 BBoards Electronic bulletin boards (BBoards) are a convenient way for a group of peo- ple 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 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 informa- tion useful to all users. 10 To read a BBoard, you type "bbc BBoard__name ". The bbc program will check to see if there are new messages in the named BBoard 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 BBoards. Type "show" to see the current message, "next" to see the next message, and so on. Type "quit" to quit reading the current BBoard. If you have named more than one BBoard on the command line or in your .mh_profile, bbc will continue processing the next BBoard in the list. Here is an example of using bbc to read the system BBoard: 11 % bbc system Reading 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: network@UCI.EDU Subject: Imagen 24300 Date: Wed, 29 Jan 86 15:19:43 -0800 From: Tinh Tang 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: 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 (msh) quit % 12 You can see a list of all the available BBoards by typing: % bbc -topics You can also put a line in your ".mh_profile" listing all the BBoards you want to read on a regular basis: bboards: system movies mh-users events Then you only need to type "bbc" to read all your BBoards. 8 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. 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 ".maildelivery". In this file, put the line * - 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: % man 5 maildelivery 13 This will tell you about all the options available to you if you use maildelivery files. 9 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 flag "-alias aliases" to the entries for the commands ali, whom, send, and push, cre- ating entries for these programs if they aren't already in 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 alias and ali will respond with the expansion of the alias. Ali searches the system aliases file in addition to your private ones. 10 Blind Lists There are two different types of so-called "blind addressing" of messages. The 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 14 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. 15