9 Mary Hegardt Tim Morgan
21 This document is another in a continuing series on use of the MH mail system
23 at UCI. It is intended for those users accustomed to the mm "user agent"
25 (mail program) under Tops-20 and who are already familiar with network
27 mail, but who may not be experienced Unix users. For an introduction
29 to MH, see "MH For Beginners" by Mary Hegardt and Tim Morgan. For
31 complete, detailed information on the MH system, see The Rand MH Message
33 Handling System: User's Manual by Marshall T. Rose and John L. Romine.
35 Both documents are available for Xeroxing in suite CS408.
39 1.1 UNIX Versus Tops-20
43 The Unix1 paradigm is that each command, or program, should perform
45 only one function. An extension of this idea is that the operating system
47 implements only those functions which are necessary, but it does so in a
49 very general way so that programs may still accomplish their functions. This
51 philosophy probably evolved because the original versions of Unix ran on
53 PDP-11 minicomputers which had only a small memory space for each pro-
56 ________________________________________________
57 1 Unix is a trademark of AT&T Bell Laboratories
66 Consequently, all commands in Unix, with a very few exceptions, are in
68 actuality programs. On Tops-20, in contrast, many of the most frequently
70 used commands are built into the user's shell, or exec. Both the Exec and
72 csh, which is typically the user's command interface on Unix, will accept
74 and parse command lines, attempting to invoke a command as a program if
76 it is not one of the built-in commands. Unix and Tops-20 are surprisingly
78 similar internally: the use of the shell, separate processes for each command
80 or program to execute, standard input and output for each program, and
82 many other ideas are common to both operating systems. Users should be
84 familiar with the capabilities of the shell, which is described in the document
86 "Introduction to the Csh."
90 1.2 The MH User Interface
94 The MH mail "user agent" is different from most other mail systems. mm,
96 for example, is a monolithic system because one program implements all the
98 mail-related functions. The disadvantages of monolithic systems are that
100 (a) they are large, so they tend to put more burden on the computer system,
102 and (b) they allow for much less flexibility. In contrast, MH implements each
104 mail command as a separate program: there is no single program called mh.
106 This approach facilitates interspersing mail commands with other, perhaps
111 Another unique feature of MH is that it takes advantage of the facilities
113 provided by the operating system. Most mail agents, such as mm, maintain
115 a file containing the user's mail in a special, usually undocumented, format.
117 When a message is deleted, mm must take care of compacting the mail file.
119 It must be able to distinguish the separate messages contained in the file.
121 mm must also implement a simple text editor to allow the user to enter and
123 modify a message while it is being composed. These functions are essentially
125 those provided by the operating system when separate files are stored within
127 a directory. Therefore, the approach taken by MH is that each message is
129 kept in a separate file. This file simply contains the message, with no other
131 special formatting characters or requirements. All the messages are stored
133 within a normal Unix directory. This approach makes it easy to add new
135 MH commands, to edit messages using standard text editors, etc.
144 All your MH related files are stored in a directory within your home directory.
146 Usually this directory is called Mail or mhbox, although you are free to name
148 it as you choose. Another file in your home directory called .mh_profile is
150 equivalent to the MM.INIT file under mm. It contains all the options which
152 you prefer for the various MH commands. It also contains the name of the
154 MH directory and the name that you want on your outgoing mail in the
156 From: field (your "signature ").
164 2.1 Incorporating Mail
168 Another important difference between mm and MH is the concept of the mail-
170 drop file. Under Tops-20, the mail transport system delivers new messages
172 directly into the recipient's MAIL.TXT file, where they may then be processed
174 with mm. In contrast, the Unix mail transport system, called MMDF-II,
176 makes no assumptions about the user agent used by the recipient. Instead,
178 it puts all new mail into a special file called the maildrop. This file is in the
180 /usr/spool/mail directory. When you log in, if there is new mail for you
182 in your maildrop, you will be so notified by the message
185 You have new ZOTnet mail -- type inc (or mail)
188 When you are ready to process this new mail, you may type the command
194 ("incorporate") which will copy the new mail into separate files, one per mes-
196 sage, stored in your "inbox" folder. A folder is a subdirectory beneath your
198 MH directory which is used to store related messages. Additional information
200 on folders is given in Section 4.5, page 13. The "inbox" is a distinguished
202 folder because by default inc will always copy new mail into that folder,
204 removing it from the maildrop.
207 If this is the first time you have used inc or any other MH command, the
209 mh-install program will inform you that it is creating your Mail directory.
211 It will also create the "inbox" folder directory, and .mh_profile.
224 As inc processes each message, it prints a "scan" listing showing the message
226 number, the date the message was sent, the name of the sender, the subject,
228 and sometimes the initial part of the text of the message. A "scan" listing
230 is thus similar to the output of the HEADERS command in mm. Each message
232 within a folder is given a number, starting with 1, by which it can be ref-
234 erenced. Inc will display the numbers assigned to each new message in its
239 As in mm, there is a "current message" number which usually identifies the
241 message most recently manipulated by the user. With most MH commands,
243 this will be the default message if no messages are explicitly specified in
245 a command. Inc makes the first new message the current message, which
247 is indicated by a "+" character in the scan listing, just after the message
252 Many MH commands take a list of messages to process. A message desig-
254 nation is either a single message number, two message numbers separated
256 by a dash. The dash format indicates a range of messages including the
258 endpoints. A message list consists of one or more message designations sep-
260 arated by spaces. For example, messages 11 through 15 and message 17 may
262 be indicated by typing
268 as the argument to some command. There are also several predefined names
270 for messages or lists of messages which may be used in place of message
275 cur The current message (the last one that was handled). Equivalent
277 to "." or "CURRENT" in mm.
279 next The next message
281 prev The previous message
283 first The first message in the current folder.
285 last The last message in the folder. Equivalent to % or * in mm.
287 all All messages (first last ). Same as in mm.
290 It is also possible for you to define your own named sequences of messages.
299 See the pick command description for more details.
303 3 Processing Messages
307 This section contains a list of the common mm commands and their equiva-
309 lents in the in MH mail system. A short textual note describes how the MH
311 commands differ from their mm counterparts.
319 As mentioned in Section 2.2, the scan command may be used to summarize
321 the messages in a folder, similar to the HEADERS command in mm. Unlike
323 most MH commands, however, scan defaults to all the messages in the current
325 folder unless you specify one or messages on the command line to be scanned.
333 is equivalent to typing HEADERS ALL (or H A) in mm.
341 Unlike the READ command in mm, in MH there is no special mail-reading
343 mode (indicated in mm by the R> prompt). The command to read messages
345 in MH is show. If no message list is specified, then the current message
347 is displayed. The message is displayed by your "showproc", as specified in
349 the .mh_profile, described in Section 4.2. Normally, your "showproc" will
351 be more or mhless. Both of these programs__will__display_ your messages one
353 screenful at a time. You press the __space_bar______ __on your terminal to see the
355 next screenful, or the __return____ _key to see the next line.
370 (which will display the first message following the current message in the
372 current folder) can be abbreviated as simply
378 Similarly, the command "show prev" can be abbreviated as simply "prev".
381 To get a paper copy of a mail message, take the output from the show com-
383 mand and pipe it into the imprint command.
389 See the manual page for imprint for more information.
393 3.3 Deleting Messages
397 The equivalent of the DELETE command in mm is rmm in MH (remove mes-
399 sages). It acts on the current message unless messages are specified on the
401 command line. Unlike mm, the deleted messages will no longer show up in
403 a "scan" listing. But the messages are not completely removed; they are
405 renamed to have a comma prepended to the name of the file containing the
407 message within its folder directory. Therefore, if you need to recover a mes-
409 sage, it is possible to go into the directory and rename the message back.
411 Be careful in doing this not to overwrite a new message with the same mes-
413 sage number! It is a Unix convention that files whose names begin with a
415 comma will be removed from disk (expunged ) early each morning. Therefore,
417 your deleted messages will be available for the rest of the day, unless you re-
419 move another message subsequently which has the same message. Then the
421 previously deleted message is gone.
429 The equivalent of the REPLY command in mm is repl in MH. Repl may be
431 given the number of the message to which you wish to reply, or it will default
433 to the current message. When replying in mm, you are prompted asking
435 if you wish to reply to all the recipients of the message to which you are
437 replying, or only to its sender. In MH, normally the reply will be constructed
446 to be sent to all the recipients. You may select which recipients receive copies
448 of your reply by using the -query option on repl, or by putting this option
450 in your .mh_profile, as described in Section 4.2. If you wish a reply to go
452 to everyone but yourself, you can use repl -nocc me.
460 The equivalent of the SEND mm command is comp ("compose") in MH. These
462 two commands are fairly similar, except that the recipient of the message
464 cannot be specified on the comp command line. The comp program invokes
466 a simple editor called prompter which will prompt you for the To:, Cc:, and
468 Subject: fields of the message. Then a line of dashes is typed, and you
470 may enter the__body__of your message (its text,__in__mm_ terms). When you are
472 finished, type __ctrl__-__D (equivalent to typing __ESC_______or control-Z in mm). Then
474 you'll receive the prompt
480 which is similar to mm's S> prompt. You may receive a list__of__the_ options
482 that you have at this point by typing "?" followed by __return____._ Here is a
484 short list of the options and their meanings. Notice that, unlike mm, there
486 are very few commands to modify the message (such as the TEXT, TO, CC, etc.,
488 commands which may be typed at the S> prompt in mm). In place of these
490 commands, you use the edit command to invoke your favorite text editor
492 on the message, and you use it to make the equivalent changes. You also use
494 your editor to include other files into the body of the message, rather than
496 using control-B, as in mm. One additional use of the edit command is for
498 spelling checking. In mm, you may use the command SPELL for this purpose.
500 In MH, you type "edit spell"2 instead. This will cause the spelling checker
502 to be run, giving you a list of the possibly misspelled words in your message.
506 edit editor Edit the message using the specified editor. When you
508 exit, you will be back at What now?.
509 ________________________________________________
510 2 Actually, any program named after the "edit" command will be invoked with what-
512 ever arguments you have given and a path to the file containing the message you are
522 list Shows the message you just typed
525 whom -check Verifies that the addresses you have used are valid as far
527 as our system can tell
530 send Sends the message to the recipients
533 push Sends the message in the background
536 quit Quits without sending the message. Saves the text of
538 the message as a "draft". Type comp -use to get back
543 quit -delete Quit, throwing away the draft
551 The forw command is used in MH to forward messages. It will take a list
553 of messages on the command line to be forwarded, or it will default to the
555 current message if none are specified. It will prompt you like comp does
557 for the To:, Cc:, and Subject: fields. Note that, unlike mm's FORWARD
559 command, forw will not construct a subject line automatically. Also as with
561 comp, you will have the opportunity to add additional text to the message(s)
563 which you are forwarding, ended with a control-D.
571 The equivalent of the RESEND command in mm is the dist ("distribute")
573 command in MH. Dist works very much like the forw command, except
575 that the prompts will be Resend-To:, Resend-Cc:, etc. After filling in the
577 headers, a line of dashes is typed giving the impression that additional text
579 can be entered. Nothing could be further from the truth; if you add any text
581 at this point the dist will fail. Your only opportunity to add text is in the
596 4.1 Selecting Messages
600 In mm, you may use several reserved command words to select messages
602 in place of an explicit list of message numbers. For example, you can
604 type "DELETE FROM SMITH" to remove all the messages from a user named
606 "Smith". Rather than building such a capability into each MH program
608 which can process message lists, a special program called pick is used in-
610 stead. Just as there are predefined sequences of messages, such as "all",
612 "cur", etc., you may use pick to define your own sequences. Pick is capable
614 of selecting messages from a folder based on the To:, From:, Subject:, Cc:,
616 or Date: fields, or by searching the body of the message. The patterns to
618 be searched for may include full regular expressions (see the "man" page for
620 ed(1) for more information) or simple strings.
623 Pick may be used in one of two ways. First, it may output the sequence of
625 message numbers which match the search parameters. Using the backquot-
627 ing mechanism of the shell, these message numbers may then become the
629 arguments to other MH programs. The second way to use pick is to have it
631 define a new sequence name which will be the messages which were selected.
633 Only this second method of using pick will be described here; see pick(l) if
635 you wish to use the first method.
638 In your .mh_profile, add the line
644 Then each time you use the pick command, it will define the resulting se-
646 quence of messages to be called "sel". Then to "pick" all the messages in the
648 current folder which are from "Smith", just type
654 To see a summary of those messages, type
660 Then to the remove the messages, type the command
672 You can pick messages according to any of the headers (-to -from -subj
674 -cc or -date) or just search all the messages for a given word (-search).
678 4.2 Customizing Your Mail Environment
682 In mm, you use the PROFILE command to tailor your mail environment.
684 This command writes a file called MM.INIT in your home directory which
686 is then read by subsequent executions of mm. In the MH system, the file
688 .mh_profile serves the same purpose. It is edited with any normal text
690 editor, rather than using a special-purpose command to modify it. The
692 format of the file is line oriented, one line per MH program or MH option to
694 be set. The only required line in the profile is the name of the primary MH
696 mail directory, which is by default Mail. This information is specified by the
704 The textual name you would like to have on your outgoing mail is specified
706 by the Signature: line. For example,
709 Signature: Mary Hegardt
712 The BBoards which you like to read should also be listed in the .mh_profile
714 (see Section 4.6, page 14, for additional information). For example, if you
716 read the "system" BBoard (where all important announcements are posted),
718 as well as "whimsey" and "imagen-users" BBoards, your .mh_profile should
723 bboards: system whimsey imagen-users
726 Other options may be specified on a per-program basis. The format for these
728 lines is the same. First, the program name is given followed by a colon. Then
730 any flags which are to be the default options for that program are given. Here
732 is a short list of the most common options which you may want to set in your
746 The showproc is the program used to show messages to you. By default, it
748 is the more command. Mhless is the same as more except that it omits the
750 headers of the messages which you indicate that you wish not to see. Type
756 for more information about this program.
762 Selecting this option causes an automatic scan of new messages on BBoards to
764 be made when reading BBoards with bbc, similar to the scan listing produced
772 causes repl to ask for each address in the message being replied to if it should
774 be included in the To: or Cc: fields of the reply being composed.
780 This line will cause messages "picked" by the pick command to be put into
782 a sequence named "sel". This sequence name may then be used just as the
784 built-in sequences ("last", "first", etc.).
792 Using MH, you may specify your own private mail aliases. This feature allows
794 you to store lists of addresses or long internet addresses of people with whom
796 you frequently correspond in one file, and then to address them using short
798 mnemonic names. Typically, you will call your alias file "aliases"; it must
800 be stored in your MH directory. The format of this file is simple. The alias
802 is given, followed by a colon, followed by one or more legal mail addresses
804 separated by commas. For example, you might for some reason have an alias
806 for all the users named "Rose" in the ICS department:
809 roses: prose, srose, mrose, drose
812 In addition to your "aliases" file, you will need to modify your .mh_profile
814 in order to use aliases. You should add the flag "-alias aliases" to the
823 entries for the commands ali, whom, send, and push, creating entries for
825 these programs if they aren't already in your .mh_profile. Now, messages
827 addressed to "roses" will be distributed to all the people listed in the alias.
830 The ali command is used to show you what an alias expands to. You just
838 and ali will respond with the expansion of the alias. Ali searches the system
840 aliases file in addition to your private ones.
848 There are two different types of so-called "blind addressing" of messages.
850 Users of mm may already be familiar with the "Blind Carbon Copy", or
852 BCC: field. It allows you to add recipients to your message just like those
854 who are CC'd, but the normal recipients will not see that the BCC recipients
856 were copied on the message, their replies will not go to the blind recipients,
858 and the blind recipients cannot (easily) reply to the message.
861 The second type of blind mailing is actually called a "group address list",
863 although it is commonly referred to as a "blind list". The format of this type
868 phrase : address__list ;
871 where the "phrase " is any English phrase of one or more words, and the
873 address__list consists of one or more addresses separated by commas. The
875 recipients of a message addressed in this fashion will see simply
881 so when they reply to the message, their reply will come only to the sender
883 (or the Reply-To: field, if one was specified), rather than going to all the
885 recipients of the original list. For example, to use a group address list for the
887 "roses" alias you would type:
890 To: People Named Rose: roses;
899 This type of group address is very useful for making up lists of related people,
901 such as all the people working on a particular research project.
909 As mentioned previously, folders are directories within your MH directory
911 used to store related messages. There is no equivalent of the folder concept
913 in the mm system. Usually, you will use only the folder "inbox", so you won't
915 have to worry about folders. However, if you process a large volume of mail,
917 then folders become invaluable in managing the messages which you wish to
919 keep for future reference.
922 Just as there is a "current message," MH maintains a "current folder," which
924 will normally be "inbox". You can change folders either by specifying the
926 folder on the command line of MH programs which take a list of messages as
928 an argument, or by using the folder command:
931 % folder +folder__name
934 In general, the folder name is indicated by a "+" sign followed immediately
936 by the folder name, all preceeding any list of messages. For example, you
938 may read the most recent message in a folder called "job__offers" using the
943 % show +job__offers last
946 This command will have the side-effect of setting the current folder to be
948 "job__offers". You may move messages from the current folder into the
950 "job__offers" folder using the command
953 % refile +job__offers messages
956 where, as usual, the messages list will default to the current message in the
958 current folder if none are specified. Note that, in contrast with the show
960 command and most other MH commands, the messages are not considered
962 to be in the folder "job__offers". You may obtain a summary of all your folders
964 by typing the command
976 When you remove messages from a folder using the rmm command, the
978 deleted messages will show up as a "hole" in the message numbering. The
986 will cause all the messages within one folder to be renumbered starting with 1.
988 Similarly, the command
994 will do the same thing for all your folders.
997 To remove an empty folder, use the command
1008 Two special-purpose programs are utilized in reading BBoards. The first is
1010 bbc, which is used to check a list of BBoards for new messages. The list of
1012 messages may be given on the command line, or if not, it will be taken from
1014 the BBoards: list in your .mh_profile. You may obtain a list of all the
1016 available BBoards by typing the command
1022 For each BBoard with unseen messages, bbc will invoke the MH shell, msh,
1030 The msh program allows you to read BBoard mail as if it were normal mes-
1032 sages in one of your folders. Almost all the MH commands will work just
1034 as the normally do. Typing the command "quit" to msh causes it to stop
1036 reading the current BBoard and go on to the next one containing unseen
1038 messages, or to exit if there are no more such BBoards. Typing control-D
1040 causes msh to exit unconditionally. The command mark followed by a mes-
1042 sage number causes msh to act as if you have seen that message and all
1053 4.7 Checking for Mail
1057 Under Unix, there are about a dozen different ways to check for new mail.
1059 The easiest way to do it is to set the csh variable named "mail" to tell csh
1061 to check for new mail for you periodically. To do this, add the line
1064 set mail=(60 /usr/spool/mail/$USER)
1067 to your .login file in your home directory. This command says to check
1069 for mail if csh is about to prompt you with a % sign, and if it has been at
1071 least 60 seconds since it last checked for mail. The advantage of this method
1073 of mail notification, besides simplicity, is that you will never be interrupted
1075 by a mail notification. You will only be notified of new mail when you are
1077 between commands, when the shell is about to prompt you.
1080 If you desire asynchronous mail notification, which will print to your terminal
1082 regardless of what you are currently doing, you may make use of a "Receive
1084 Mail Hook" called "rcvtty". To do this, create a file in your home directory
1086 called ".maildelivery". In this file, put the line
1089 * - pipe R /usr/uci/lib/mh/rcvtty
1092 Then each time new mail arrives, you will receive a one-line "scan" listing
1094 of the mail if your terminal is world-writable. For more information on
1096 "maildelivery" files, type:
1099 % man 5 maildelivery
1107 Normally when you use comp, it creates the message being composed in a
1109 file called "draft" in your MH directory. If you use the "quit" option at
1111 the "What now?" prompt, this file will remain there. You may later use the
1119 to resume composing the message.
1128 If you begin composing a new message and there is already a "draft" file,_you___
1130 will be asked for the disposition of this file. Typing ? __return____ _will give you
1132 a list of the options at this point. Normally you will either replace (delete)
1134 the old draft and begin a new one or use the old one.
1137 The -file switch to comp may be used to specify the name of a draft other
1139 than "draft". For example, one might type
1145 to begin composing a message maintained in the draft file "mary". Typing
1148 % comp -file mary -use
1151 would cause comp to resume composing this same draft after a "quit" com-
1153 mand to the "What now?" prompt.
1156 Very advanced users of MH maintain multiple draft files in a draft folder.
1158 This is a normal folder which holds all your drafts, rather than having just
1160 one draft in your MH directory named "draft". If you feel that you need to
1162 use draft folders, you should consult the MH User's Manual for additional