Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!sdd.hp.com!cs.utexas.edu!uunet!ora!jerry From: jerry@ora.com (Jerry Peek) Newsgroups: comp.mail.mh Subject: Re: Beginner questions (LONG) Message-ID: <1991Jun23.084301.2040@ora.com> Date: 23 Jun 91 08:43:01 GMT References: <44917@netnews.upenn.edu> Distribution: usa Organization: O'Reilly and Associates Inc., Cambridge, MA Lines: 171 In <44917@netnews.upenn.edu> maddog@eniac.seas.upenn.edu (maddog) writes: > 3) I would appreciate any (detailed) examples of .maildelivery, *comps, > .mh_profile, etc. from which I could learn. Well, maddog, if you're a student you might not have any spare $$ :-) to get a copy of the "MH & xmh" Nutshell Handbook. And I haven't seen many MH profiles posted to this newsgroup. So, here's a section from the book with a sample file. Some of the explanation is in other parts of the book, but this section should help a lot. I hope this is useful to lots of people and not too long for the rest of you... --Jerry Peek, O'Reilly & Associates, jerry@ora.com or uunet!ora!jerry --------------------------------------------------------------------------- There are several kinds of components in your MH profile: - Components for individual MH commands, such as repl and inc. These lines start with the name of the command and a colon. The other part of each component is one or more command line parameters that you'd like that command to use by default. For example, this line tells repl to ask you who should get copies of your reply, then to start the emacs editor: repl: -query -editor emacs You use the same syntax for other MH commands, including the command versions explained in Chapter 9. Lines 19-30 and lines 31-56 of the file below are this kind. - Other components apply to (in general) more than one MH command. For example, this component tells MH commands that you want to use the vi editor wherever possible: Editor: vi The mh-profile(5) reference page in Appendix G has a list of these. See lines 1-18 of the file below. In most cases, this type of setting is overriden by settings you make for individual MH commands. For instance, repl: -editor emacs would override a setting like Editor: vi - You can make comments in the MH profile by typing an "impossible" command name, followed by a colon. For instance, if you don't have an MH command named "comment" (which you won't, unless you followed the steps in Chapter 9)--you can use that as a label for comments. You can also add other characters, like XXX, to "comment out" an existing component. Here's one way you might make a comment, and comment out a line: comment: this isn't working now; figure out why! XXXrepl: -querry Lines 1-3, 24, and others in the file below show another way to make comments. - Don't leave blank (empty) lines in the MH profile. The file below is an example of the MH profile from a real MH hacker. The line numbers to the left of each line (like 23>) are not part of the file; they are for reference only. 1> #: 2> #: First section: Overall setup for MH 3> #: 4> Aliasfile: aliases 5> Alternate-Mailboxes: ehuser@*.xxx.yyy.zzz, emma@animals*, 6> ehuser@quack.phl.ph.com, *uucpit!ehuser 7> Draft-Folder: drafts 8> Folder-protect: 750 9> Msg-protect: 640 10> Path: .Mail 11> Previous-Sequence: pseq 12> prompter-next: vi 13> rmmproc: /home/ehuser/.bin/rmmer 14> Sequence-Negation: not 15> showproc: mhl 16> Signature: "Emma H. User" 17> Unseen-Sequence: unseen 18> vi-next: spel 19> #: 20> #: Lines for specific standard MH programs: 21> #: 22> anno: -inplace 23> dist: -annotate -inplace -editor distprompter 24> #: -nodashmunging only works if you give -filter or -format: 25> forw: -anno -inpl -form components -format -nodashmunging 26> inc: -form scan.time 27> mhl: -nobell 28> pick: -seq picked -list 29> repl: -query -nocc me -annotate -inplace -editor prompter.nopre 30> rmf: -interactive 31> #: 32> #: Stuff for new versions of MH programs and shell scripts: 33> #: 34> auto_forw_send: -draftfolder +drafts 35> bomb: -form bombcomps -anno -inpl -editor head -query -nocc me -nocc cc 36> checkm: -file /usr/spool/mail/ehuser -form scan.checkm -width 150 37> cur: cur -form scan.more -width 235 38> curlast: cur-last 39> fo: -fast 40> foll: -form follcomps 41> follx: -form follcomps -filter follxfilt -editor vi 42> l10: last:10 43> l20: last:20 44> l5: last:5 45> l: last 46> msgnums: -format %(msg) 47> prompter.nopre: -noprepend -rapid 48> push: -push -draftfolder +drafts -forward -verbose 49> rapid: -rapid -prepend 50> replx: -filter replxfilt -query -nocc me -anno -inpl -editor prompter.nopre 51> resend: -editor resend.fixmsg 52> #: for 'rn' replies... there's gotta be a better way!: 53> rn-ans: -editor rn-ans.fixmsg 54> showpr: -format 'Message %(msg)' -mhl 55> showv: -showproc more 56> thanks: -form thankscomps -anno -inpl -editor cat -nocc all -whatnow push Let's take a look at some of the lines in that example. The file is divided arbitrarily into three parts. (See the list above for the two general kinds of lines.) - Lines 5-6 list other addresses where this user, ehuser, gets mail. It lets MH find all messages which are actually from the user. See Section 8.6, "Defining Alternate Mailboxes." - Lines 8-9 set the default UNIX filesystem protections that MH will use for new folders and messages. This particular protection scheme sets folders (mode 750) so that people in ehuser's group can scan them. All the messages (mode 640) will also be readable by her group. See Section 8.7, "Sharing Other User's Folders." - The signature in line 16 doesn't go at the end of mail messages; it's put in the From: component. See Section 6.4.2, "Signature." - Line 24 is a comment for the line below it, a reminder of why the line is written the way it is. This is a good thing to do, especially in long MH profile files. - Line 35 is a version of repl that sends a picture of a bomb with its fuse burning. (Chapter 9, New Versions of MH Commands, explains how to make command versions.) The idea and the bombcomps component file came from the mtrenv directory in the MH distribution. The -editor head doesn't actually edit the message; it uses the UNIX head(1) command to show the first ten lines of the draft on the screen. After that comes a What now? prompt, where you can choose a real editor if you want to. - Lines 37-38 and lines 42-46 are all versions of scan that scan different ranges of messages. For example, l10: scans the last 10 messages, and l20: scans the last 20. See Section 9.7, "Versions of scan." - Line 47 is a workaround for a common MH problem: needing to give different switches to prompter for different mail-composing commands. It's used in line 29 and line 50. See section 9.5, "Version of prompter: prompter.nopre." - The rmmproc: entry in line 13 uses the full pathname of a shell script that's used for removing messages. You don't always need to give full pathnames to commands--for instance, line 51 calls a program named resend.fixmsg with only its name; in this case, MH will search your shell's search path for the command you specify. - Line 54 is for a shell script (program). Your shell scripts can read the MH profile. Section 12.5, "Get Information from MH Profile with mhprofile," shows how.