aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/articles/mh/article.sgml
blob: 06ce3754deab4ab9a9d8b700f4d255e352704452 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
<?xml version="1.0" encoding="ISO8859-1" standalone="no"?>
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN"
	"../../../share/sgml/freebsd42.dtd" [
<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//EN" "../../share/sgml/entities.ent">
%entities;
]>

<!-- $FreeBSD$ -->
<!-- FreeBSD Documentation Project -->

<article lang='en'>
  <articleinfo>
    <title>An <application>MH</application> Primer</title>

    <authorgroup>
      <author>
	<firstname>Matt</firstname>

	<surname>Midboe</surname>

	<affiliation>
	  <address>
	    <email>matt@garply.com</email>
	  </address>
	</affiliation>
      </author>
    </authorgroup>

    <pubdate>v1.0, 16 January 1996</pubdate>

    <legalnotice id="trademarks" role="trademarks">
      &tm-attrib.freebsd;
      &tm-attrib.opengroup;
      &tm-attrib.general;
    </legalnotice>

    <releaseinfo>$FreeBSD$</releaseinfo>

    <abstract>
      <para>This document contains an introduction to using
	<application>MH</application> on FreeBSD</para>
    </abstract>
  </articleinfo>

  <sect1 id="mhintro">
    <title>Introduction</title>

    <para><application>MH</application> started back in 1977 at the
      RAND Corporation, where the initial philosophies behind
      <application>MH</application> were
      developed. <application>MH</application> is not so much a
      monolithic email program but a philosophy about how best to
      develop tools for reading email. The
      <application>MH</application> developers have done a great job
      adhering to the <acronym>KISS</acronym> principle: Keep It
      Simple Stupid.  Rather than have one large program for reading,
      sending and handling email they have written specialized
      programs for each part of your email life. One might liken
      <application>MH</application> to the specialization that one
      finds in insects and nature. Each tool in
      <application>MH</application> does one thing, and does it very
      well.</para>

    <para>Beyond just the various tools that one uses to handle their
      email <application>MH</application> has done an excellent job
      keeping the configuration of each of these tools consistent and
      uniform. In fact, if you are not quite sure how something is
      supposed to work or what the arguments for some command are
      supposed to be, then you can generally guess and be right.  Each
      <application>MH</application> command is consistent about how it
      handles reading the configuration files and how it takes
      arguments on the command line.  One useful thing to remember is
      that you can always add a <option>-help</option> to the command
      to have it display the options for that command.</para>

    <para>The first thing that you need to do is to make sure that you
      have installed the <application>MH</application> package on your
      FreeBSD machine. If you installed from CDROM you should be able
      to execute the following to load <application>MH</application>:

      <informalexample>
	<screen>&prompt.root; <userinput>pkg_add /cdrom/packages/mh-6.8.3.tgz</userinput></screen>
      </informalexample>

      You will notice that it created a <filename>/usr/local/lib/mh</filename>
      directory for you as well as adding several binaries to the
      <filename>/usr/local/bin</filename> directory. If you would prefer to
      compile it yourself then you can anonymous ftp it from <ulink
	url="ftp://ftp.ics.uci.edu/">ftp.ics.uci.edu</ulink> or <ulink
	url="ftp://louie.udel.edu/">louie.udel.edu</ulink>.</para>

    <para>This primer is not a full comprehensive explanation of how
      <application>MH</application> works. This is just intended to
      get you started on the road to happier, faster mail reading. You
      should read the manual pages for the various commands. You might
      also want to read the <ulink
	url="news:comp.mail.mh">comp.mail.mh</ulink> newsgroup. Also you
      can read the <ulink
	url="http://www.faqs.org/faqs/mail/mh-faq/">FAQ for
	<application>MH</application></ulink>.	The best resource for
      <application>MH</application> is <ulink
	url="http://www.ics.uci.edu/~mh/book/">Jerry Peek's
	<application>MH</application> &amp; nmh: Email for Users &amp;
	Programmers</ulink>.</para>
  </sect1>

  <sect1>
    <title>Reading Mail</title>

    <para>This section covers how to use <command>inc</command>,
      <command>show</command>, <command>scan</command>,
      <command>next</command>, <command>prev</command>,
      <command>rmm</command>, <command>rmf</command>, and
      <command>msgchk</command>.  One of the best things about
      <application>MH</application> is the consistent interface
      between programs. One thing to keep in mind when using these
      commands is how to specify message lists.  In the case of
      <command>inc</command> this does not really make any sense but
      with commands like <command>show</command> it is useful to
      know. </para>

    <para>A message list can consist of something like <parameter>23
	20 16</parameter> which will act on messages 23, 20 and
      16. This is fairly simple but you can do more useful things
      like <parameter>23-30</parameter> which will act on all the
      messages between 23 and 30. You can also specify something
      like <parameter>cur:10</parameter> which will act on the
      current message and the next 9 messages. The
      <parameter>cur</parameter>, <parameter>last</parameter>, and
      <parameter>first</parameter> messages are special messages
      that refer to the current, last or first message in the
      folder.</para>

    <sect2 id="inc">
      <title><command>inc</command>,
	<command>msgchk</command>&mdash;read in your new email or
	check it</title>

      <para>If you just type in <userinput>inc</userinput> and hit
	<keycap>return</keycap> you will be well on your way to
	getting started with <application>MH</application>. The first
	time you run <command>inc</command> it will set up your account
	to use all the <application>MH</application> defaults and ask
	you about creating a <filename>Mail</filename> directory under
	your HOME directory. If you have mail waiting to be downloaded
	you will see something that looks like:</para>

      <informalexample>
	<screen>  29  01/15 Doug White         Re: Another Failed to boot problem&lt;&lt;On Mon, 15 J
  30  01/16 "Jordan K. Hubbar  Re: FBSD 2.1&lt;&lt;&gt; Do you want a library instead of
  31  01/16 Bruce Evans        Re: location of bad144 table&lt;&lt;&gt;&gt; &gt;It would appea
  32  01/16 "Jordan K. Hubbar  Re: video is up&lt;&lt;&gt; Anyway, mrouted won't run, ev
  33  01/16 Michael Smith      Re: FBSD 2.1&lt;&lt;Nate Williams stands accused of sa</screen>
      </informalexample>

      <para>This is the same thing you will see from a
	<command>scan</command> (see <xref linkend="scan"/>). If you just run
	<command>inc</command> with no arguments it will look on your
	computer for email that is supposed to be coming to
	you.</para>

      <para>A lot of people like to use POP for grabbing their email.
	<application>MH</application> can do POP to grab your
	email. You will need to give <command>inc</command> a few
	command line arguments.</para>

      <informalexample>
	<screen>&prompt.user; <userinput>inc -host mail.pop.org -user <replaceable>username</replaceable> -norpop</userinput></screen>
      </informalexample>

      <para>That tells <command>inc</command> to go to
	<parameter>mail.pop.org</parameter> to download your email,
	and that your username on their system is
	<replaceable>username</replaceable>. The
	<option>-norpop</option> option tells <command>inc</command>
	to use plain POP3 for downloading your
	email. <application>MH</application> has support for a few
	different dialects of POP. More than likely you will never
	ever need to use them though. While you can do more complex
	things with <command>inc</command> such as audit files and
	scan format files this will get you going.</para>

      <para>The <command>msgchk</command> command is used to get information
	on whether or not you have new email. <command>msgchk</command> takes
	the same <option>-host</option> and <option>-user</option>
	options that <command>inc</command> takes.</para>
    </sect2>

    <sect2 id="show">
      <title><command>show</command>, <command>next</command> and
	<command>prev</command>&mdash;displaying and moving through
	email</title>

      <para><command>show</command> is to show a letter in your current
	folder.  Like <command>inc</command>, <command>show</command> is a fairly
	straightforward command. If you just type <userinput>show</userinput>
	and hit <keycap>return</keycap> then it displays the current
	message. You can also give specific message numbers to
	show:</para>

      <informalexample>
	<screen>&prompt.user; <userinput>show 32 45 56</userinput></screen>
      </informalexample>

      <para>This would display message numbers 32, 45 and 56 right
	after each other. Unless you change the default behavior
	<command>show</command> basically just does a <command>more</command> on the
	email message.</para>

      <para><command>next</command> is used to move onto the next message and
	<command>prev</command> will go to the previous message. Both
	commands have an implied <command>show</command> command so that when
	you go to the next message it automatically displays
	it.</para>
    </sect2>

    <sect2 id="scan">
      <title><command>scan</command>&mdash;shows you a scan of your
	messages</title>

      <para><command>scan</command> will display a brief listing of the
	messages in your current folder. This is an example of what
	the <command>scan</command> command will give you.</para>

      <informalexample>
	<screen>  30+ 01/16 Jordan K. Hubbar   Re: FBSD 2.1&lt;&lt;&gt; Do you want a library instead of
  31  01/16 Bruce Evans        Re: location of bad144 table&lt;&lt;&gt;&gt; &gt;It would appea
  32  01/16 Jordan K. Hubbar   Re: video is up&lt;&lt;&gt; Anyway, mrouted won't run, ev
  33  01/16 Michael Smith      Re: FBSD 2.1&lt;&lt;Nate Williams stands accused of sa</screen>
      </informalexample>

      <para>Like just about everything in <application>MH</application> this display is very
	configurable.  This is the typical default display. It gives
	you the message number, the date on the email, the sender, the
	subject line, and a sentence fragment from the very beginning
	of the email if it can fit it. The <literal>+</literal> means that
	message is the current message, so if you do a
	<command>show</command> it will display that message.</para>

      <para>One useful option for scan is the
	<option>-reverse</option> option. This will list your messages
	with the highest message number first and lowest message
	number last. Another useful option with <command>scan</command> is to
	have it read from a file. If you want to scan your incoming
	mailbox on FreeBSD without having to <command>inc</command> it you
	can do <command>scan -file
	  /var/mail/<replaceable>username</replaceable></command>. This can be used
	with any file that is in the <database>mbox</database> format.</para>
    </sect2>

    <sect2 id="rmm">
      <title><command>rmm</command> and <command>rmf</command>&mdash;remove the
	current message or folder</title>

      <para><command>rmm</command> is used to remove a mail
	message. The default is typically to not actually remove the
	message but to rename the file to one that is ignored by the
	<application>MH</application> commands. You will periodically
	need to go through and physically delete the
	<quote>removed</quote> messages.</para>

      <para>The <command>rmf</command> command is used to remove folders.
	This does not just rename the files but actually removes the
	from the hard drive so you should be careful when you use this
	command.</para>
    </sect2>

    <sect2 id="samplereading">
      <title>A typical session of reading with MH</title>

      <para>The first thing that you will want to do is
	<command>inc</command> your new mail. So at a shell prompt just type
	in <command>inc</command> and hit <keycap>return</keycap>.</para>

      <informalexample>
	<screen>&prompt.user; <userinput>inc</userinput>
Incorporating new mail into inbox...

  36+ 01/19 Stephen L. Lange   Request...&lt;&lt;Please remove me as contact for pind
  37  01/19 Matt Thomas        Re: kern/950: Two PCI bridge chips fail (multipl
  38  01/19 Amancio Hasty Jr   Re: FreeBSD and VAT&lt;&lt;&gt;&gt;&gt; Bill Fenner said: &gt; In
&prompt.user;</screen>
      </informalexample>

      <para>This shows you the new email that has been added to your
	mailbox. So the next thing to do is <command>show</command> the email
	and move around.</para>

      <informalexample>
	<screen>&prompt.user; <userinput>show</userinput>
Received: by sashimi.wwa.com (Smail3.1.29.1 #2)
        id m0tdMZ2-001W2UC; Fri, 19 Jan 96 13:33 CST
Date: Fri, 19 Jan 1996 13:33:31 -0600 (CST)
From: "Stephen L. Lange" &lt;stvlange@wwa.com&gt;
To: matt@garply.com
Subject: Request...
Message-Id: &lt;Pine.BSD.3.91.960119133211.824A-100000@sashimi.wwa.com&gt;
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


Please remove me as contact for pindat.com

&prompt.user; <userinput>rmm</userinput>
&prompt.user; <userinput>next</userinput>
Received: from localhost (localhost [127.0.0.1]) by whydos.lkg.dec.com (8.6.11/8
.6.9) with SMTP id RAA24416; Fri, 19 Jan 1996 17:56:48 GMT
Message-Id: &lt;199601191756.RAA24416@whydos.lkg.dec.com&gt;
X-Authentication-Warning: whydos.lkg.dec.com: Host localhost didn't use HELO pro
tocol
To: hsu@clinet.fi
Cc: hackers@FreeBSD.org
Subject: Re: kern/950: Two PCI bridge chips fail (multiple multiport ethernet
 boards)
In-Reply-To: Your message of "Fri, 19 Jan 1996 00:18:36 +0100."
             &lt;199601182318.AA11772@Sysiphos&gt;
X-Mailer: exmh version 1.5omega 10/6/94
Date: Fri, 19 Jan 1996 17:56:40 +0000
From: Matt Thomas &lt;matt@lkg.dec.com&gt;
Sender: owner-hackers@FreeBSD.org
Precedence: bulk


This is due to a typo in pcireg.h (to
which I am probably the guilty party).</screen>
      </informalexample>

      <para>The <command>rmm</command> removed the current message and the
	<command>next</command> command moved me on to the next message.  Now
	if I wanted to look at ten most recent messages so I could
	read one of them here is what I would do:</para>

      <informalexample>
	<screen>&prompt.user; <userinput>scan last:10</userinput>
  26  01/16 maddy              Re: Testing some stuff&lt;&lt;yeah, well, Trinity has
  27  01/17 Automatic digest   NET-HAPPENINGS Digest - 16 Jan 1996 to 17 Jan 19
  28  01/17 Evans A Criswell   Re: Hey dude&lt;&lt;&gt;From matt@tempest.garply.com Tue
  29  01/16 Karl Heuer         need configure/make volunteers&lt;&lt;The FSF is looki
  30  01/18 Paul Stephanouk    Re: [alt.religion.scientology] Raw Meat (humor)&lt;
  31  01/18 Bill Lenherr       Re: Linux NIS Solaris&lt;&lt;--- On Thu, 18 Jan 1996 1
  34  01/19 John Fieber        Re: Stuff for the email section?&lt;&lt;On Fri, 19 Jan
  35  01/19 support@foo.garpl  [garply.com #1138] parlor&lt;&lt;Hello. This is the Ne
  37+ 01/19 Matt Thomas        Re: kern/950: Two PCI bridge chips fail (multipl
  38  01/19 Amancio Hasty Jr   Re: FreeBSD and VAT&lt;&lt;&gt;&gt;&gt; Bill Fenner said: &gt; In
&prompt.user;</screen>
      </informalexample>

      <para>Then if I wanted to read message number 27 I would do a
	<userinput>show 27</userinput> and it would be displayed. As
	you can probably tell from this sample session
	<application>MH</application> is pretty easy to use and
	looking through emails and displaying them is fairly intuitive
	and easy.</para>
    </sect2>
  </sect1>

  <sect1>
    <title>Folders and Mail Searching</title>

    <para>Anybody who gets lots of email definitely wants to be able
      to prioritize, stamp, brief, de-brief, and number their emails
      in a variety of different ways. <application>MH</application>
      can do this better than just about anything. One thing that we
      have not really talked about is the concept of folders. You have
      undoubtedly come across the folders concept using other email
      programs. <application>MH</application> has folders too.
      <application>MH</application> can even do sub-folders of a
      folder. One thing you should keep in mind with
      <application>MH</application> is that when you ran
      <command>inc</command> for the first time and it asked you if it
      could create a <filename>Mail</filename> directory it began
      storing everything in that directory. If you look at that
      directory you will find a directory named
      <filename>inbox</filename>. The <filename>inbox</filename>
      directory houses all of your incoming mail that has not been
      thrown anywhere else.</para>

    <para>Whenever you create a new folder a new directory is going to
      be created underneath your <application>MH</application>
      <filename>Mail</filename> directory, and messages in that folder
      are going to be stored in that directory.  When a new email
      message comes, it is thrown into your <filename>inbox</filename>
      directory with a file name that is equivalent to the message
      number.  So even if you did not have any of the
      <application>MH</application> tools to read your email you could
      still use standard &unix; commands to munge around in those
      directories and just more your files. It is this simplicity that
      really gives you a lot of power with what you can do with your
      email.</para>

    <para>Just as you can use message lists like <parameter>23 16
	42</parameter> with most <application>MH</application>
      commands there is a folder option you can specify with just
      about every <application>MH</application> command. If you do a
      <command>scan +freebsd</command> it will scan your
      <filename>freebsd</filename> folder, and your current folder
      will be changed to <filename>freebsd</filename>. If you do a
      <command>show +freebsd 23 16 42</command>,
      <command>show</command> is going to switch to your
      <filename>freebsd</filename> folder and display messages 23,
      16 and 42.  So remember that
      <option>+<replaceable>folder</replaceable></option>
      syntax. You will need to make sure you use it to make commands
      process different folders. Remember you default folder for
      mail is <filename>inbox</filename> so doing a <command>folder
	+inbox</command> should always get you back to your mail. Of
      course, in <application>MH</application>'s infinite
      flexibility this can be changed but most places have probably
      left it as <command>inbox</command>.</para>

    <sect2>
      <title><command>pick</command>&mdash;search email that matches certain
	criteria</title>

      <para><command>pick</command> is one of the more complex commands in
	the <application>MH</application> system. So you might want to read the
	<citerefentry><refentrytitle>pick</refentrytitle><manvolnum>1</manvolnum></citerefentry> man
	page for a more thorough understanding. At its simplest level
	you can do something like</para>

      <informalexample>
	<screen>&prompt.user; <userinput>pick -search pci</userinput>
15
42
55
56
57</screen>
      </informalexample>

      <para>This will tell <command>pick</command> to look through every
	single line in every message in your current folder and tell
	you which message numbers it found the word <literal>pci</literal>
	in. You can then <command>show</command> those messages and read them
	if you wish or <command>rmm</command> them. You would have to specify
	something like <command>show 15 42 55-57</command> to display them
	though. A slightly more useful thing to do is this:</para>

      <informalexample>
	<screen>&prompt.user; <userinput>pick -search pci -seq pick</userinput>
5 hits
&prompt.user; <userinput>show pick</userinput></screen>
      </informalexample>

      <para>This will show you the same messages you just did not have
	to work as hard to do it. The <option>-seq</option> option is
	really an abbreviation of <option>-sequence</option> and
	<command>pick</command> is just a sequence which contains the
	message numbers that matched. You can use sequences with just
	about any <application>MH</application> command. So you could
	have done an <command>rmm pick</command> and all those
	messages would be removed instead. You sequence can be named
	anything. If you run pick again it will overwrite the old
	sequence if you use the same name.</para>

      <para>Doing a <command>pick -search</command> can be a bit more
	time consuming than just searching for message from someone,
	or to someone. So <command>pick</command> allows you to use the
	following predefined search criteria:</para>

      <variablelist>
	<varlistentry>
	  <term><option>-to</option></term>

	  <listitem>
	    <para>search based upon who the message is to</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-cc</option></term>

	  <listitem>
	    <para>search based on who is in the <literal>Cc:</literal> list</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-from</option></term>

	  <listitem>
	    <para>search for who sent the message</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-subject</option></term>

	  <listitem>
	    <para>search for emails with this subject</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-date</option></term>

	  <listitem>
	    <para>find emails with a matching date</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>--<replaceable>component</replaceable></option></term>

	  <listitem>
	    <para>search for any other component in the header. (i.e.
	      <option>--reply-to</option> to find all emails with a certain
	      reply-to in the header)</para>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para>This allows you to do things like

	<informalexample>
	  <screen>&prompt.user; <userinput>pick -to freebsd-hackers@FreeBSD.org -seq hackers</userinput></screen>
	</informalexample>

	to get a list of all the email send to the FreeBSD hackers
	mailing list. <command>pick</command> also allows you to group these
	criteria in different ways using the following options:</para>

      <itemizedlist>
	<listitem>
	  <para>&hellip; <option>-and</option> &hellip;</para>
	</listitem>

	<listitem>
	  <para>&hellip; <option>-or</option> &hellip;</para>
	</listitem>

	<listitem>
	  <para><option>-not</option> &hellip;</para>
	</listitem>

	<listitem>
	  <para><option>-lbrace</option> &hellip;
	    <option>-rbrace</option></para>
	</listitem>
      </itemizedlist>

      <para>These commands allow you to do things like</para>

      <informalexample>
	<screen>&prompt.user; <userinput>pick -to freebsd-hackers -or -cc freebsd-hackers</userinput></screen>
      </informalexample>

      <para>That will grab all the email in your <filename
	  class="directory">inbox</filename> that was sent to
	freebsd-hackers or cc'd to that list. The brace options allow
	you to group search criteria together. This is sometimes very
	necessary as in the following example</para>

      <informalexample>
	<screen>&prompt.user; <userinput>pick -lbrace -to freebsd-hackers -and
  -not -cc freebsd-questions -rbrace -and -subject pci</userinput></screen>
      </informalexample>

      <para>Basically this says <quote>pick (to freebsd-hackers and
	  not cc'd on freebsd-questions) and the subject is
	  pci</quote>.  It should look through your folder and find
	all messages sent to the freebsd-hackers list that are not cc'd
	to the freebsd-questions list and contain <quote>pci</quote> in
	the subject line. Ordinarily you might have to worry about
	something called operator precedence. Remember in math how you
	evaluate from left to right and you do multiplication and
	division first and addition and subtraction second?
	<application>MH</application> has the same type of rules for
	<command>pick</command>. It is fairly complex so you might
	want to study the manual page. This document is just to help
	you get acquainted with <application>MH</application>.</para>
    </sect2>

    <sect2>
      <title><command>folder</command>, <command>folders</command>,
	<command>refile</command>&mdash;three useful programs for folder
	maintenance</title>

      <para>There are three programs which are primarily just for
	manipulating your folders. The <command>folder</command>
	program is used to switch between folders, pack them, and list
	them. At its simplest level you can do a <command>folder
	  +<replaceable>newfolder</replaceable></command> and you will
	be switched into <replaceable>newfolder</replaceable>. From
	there on out all your <application>MH</application> commands
	like <command>comp</command>, <command>repl</command>,
	<command>scan</command>, and <command>show</command> will act
	on that <command>newfolder</command> folder.</para>

      <para>Sometimes when you are reading and deleting messages you
	will develop <quote>holes</quote> in your folders. If you do a
	<command>scan</command> you might just see messages 34, 35, 36, 43,
	55, 56, 57, 80. If you do a <command>folder -pack</command>
	this will renumber all your messages so that there are no
	holes. It does not actually delete any messages though. So you
	may need to periodically go through and physically delete
	<command>rmm</command>'d messages.</para>

      <para>If you need statistics on your folders you can do a
	<command>folders</command> or <command>folder -all</command> to list
	all your folders, how many messages they have, what the
	current message is in each one and so on. This line of stats
	it displays for all your folders is the same one you get when
	you change to a folder with <command>folder +foldername</command>. A
	<command>folders</command> command looks like this:</para>

      <informalexample>
	<screen>                Folder      # of messages (  range  ); cur  msg  (other files)
              announce  has    1 message  (   1-   1).
                drafts  has   no messages.
             f-hackers  has   43 messages (   1-  43).
           f-questions  has   16 messages (   1-  16).
                 inbox+ has   35 messages (   1-  38); cur=  37.
                 lists  has    8 messages (   1-   8).
             netfuture  has    1 message  (   1-   1).
                   out  has   31 messages (   1-  31).
              personal  has    6 messages (   1-   6).
                  todo  has   58 messages (   1-  58); cur=   1.

                     TOTAL=  199 messages in 13 folders.</screen>
      </informalexample>

      <para>The <command>refile</command> command is what you use to move
	messages between folders. When you do something like
	<command>refile 23 +netfuture</command> message number 23 is moved
	into the <filename>netfuture</filename> folder. You could also do
	something like <command>refile 23 +netfuture/latest</command> which
	would put message number 23 in a subfolder called
	<filename>latest</filename> under the <filename>netfuture</filename> folder.
	If you want to keep a message in the current folder and link
	it you can do a <command>refile -link 23 +netfuture</command>
	which would keep 23 in your current <filename>inbox</filename> but
	also list in your <filename>netfuture</filename> folder. You are
	probably beginning to realize some of the really powerful
	things you can do with <application>MH</application>.</para>
    </sect2>
  </sect1>

  <sect1>
    <title>Sending Mail</title>

    <para>Email is a two way street for most people so you want to be
      able to send something back. The way
      <application>MH</application> handles sending mail can be a bit
      difficult to follow at first, but it allows for incredible
      flexibility. The first thing <application>MH</application> does
      is to copy a components file into your outgoing email. A
      components file is basically a skeleton email letter with stuff
      like the <literal>To:</literal> and <literal>Subject:</literal>
      headers already in it.  You are then sent into your editor where
      you fill in the header information and then type the body of
      your message below the dashed lines in the message.  When you
      leave the editor, the <command>whatnow</command> program is run.
      When you are at the <prompt>What now?</prompt> prompt you can
      tell it to <command>send</command>, <command>list</command>,
      <command>edit</command>, <command>push</command>, and
      <command>quit</command>. Most of these commands are
      self-explanatory. So the message sending process involves
      copying a component file, editing your email, and then telling
      the <command>whatnow</command> program what to do with your
      email.</para>

    <sect2>
      <title><command>comp</command>, <command>forw</command>,
	<command>reply</command>&mdash;compose, forward or reply to a message
	to someone</title>

      <para>The <command>comp</command> program has a few useful command line
	options. The most important one to know right now is the
	<option>-editor</option> option. When <application>MH</application> is installed the
	default editor is usually a program called
	<command>prompter</command> which comes with <application>MH</application>. It is not a very
	exciting editor and basically just gets the job done. So when
	you go to compose a message to someone you might want to use
	<command>comp -editor /usr/bin/vi</command> or <command>comp -editor
	/usr/local/bin/pico</command> instead. Once you have run
	<emphasis>comp</emphasis> you are in your editor and you see
	something that looks like this:</para>

      <informalexample>
	<screen>To:
cc:
Subject:
--------</screen>
      </informalexample>

      <para>You need to put the person you are sending the mail to
	after the <literal>To:</literal> line. It works the same way for the
	other headers also, so you would need to put your subject
	after the <literal>Subject:</literal> line. Then you would just put
	the body of your message after the dashed lines. It may seem a
	bit simplistic since a lot of email programs have special
	requesters that ask you for this information but there really
	is no point to that. Plus this really gives you excellent
	flexibility.</para>

      <informalexample>
	<screen>To:<userinput>freebsd-rave@FreeBSD.org</userinput>
cc:
Subject:<userinput>And on the 8th day God created the FreeBSD core team</userinput>
--------
<userinput>Wow this is an amazing operating system. Thanks!</userinput></screen>
      </informalexample>

      <para>You can now save this message and exit your editor. You
	will see the <prompt>What now?</prompt> prompt and you can type in
	<userinput>send</userinput> or <userinput>s</userinput> and hit
	<keycap>return</keycap>. Then the FreeBSD core team will receive
	their just rewards. As I mentioned earlier, you can also use
	other commands at the <prompt>What now?</prompt> prompt.
	For example you can use <command>quit</command>, if you do not want
	to send the message.</para>

      <para>The <command>forw</command> command is stunningly similar. The
	big difference being that the message you are forwarding is
	automatically included in the outgoing message. When you run
	<command>forw</command> it will forward your current message. You can
	always tell it to forward something else by doing something
	like <command>forw 23</command> and then message number 23 will be
	put in your outgoing message instead of the current message.
	Beyond those small differences <command>forw</command> functions
	exactly the same as <command>comp</command>. You go through the exact
	same message sending process.</para>

      <para>The <command>repl</command> command will reply to the
	current message, unless you give it a different message to
	reply to. <command>repl</command> will do its best to go ahead
	and fill in some of the email headers already. So you will
	notice that the <literal>To:</literal> header already has the
	address of the recipient in there. Also the
	<literal>Subject:</literal> line will already be filled in.
	You then go about the normal message composition process and
	you are done. One useful command line option to know here is
	the <option>-cc</option> option. You can use
	<parameter>all</parameter>, <parameter>to</parameter>,
	<parameter>cc</parameter>, <parameter>me</parameter> after the
	<option>-cc</option> option to have <command>repl</command>
	automatically add the various addresses to the
	<literal>Cc:</literal> list in the message. You have probably
	noticed that the original message is not included. This is
	because most <application>MH</application> setups are
	configured to do this from the start.</para>
    </sect2>

    <sect2>
      <title><filename>components</filename>, and
	<filename>replcomps</filename>&mdash;components files for
	<command>comp</command> and <command>repl</command></title>

      <para>The <filename>components</filename> file is usually in
	<filename>/usr/local/lib/mh</filename>. You can copy that file
	into your <application>MH</application> Mail directory and
	edit to contain what you want it to contain. It is a fairly
	basic file. You have various email headers at the top, a
	dashed line and then nothing. The <command>comp</command>
	command just copies this <filename>components</filename> file
	and then edits it. You can add any kind of valid RFC822 header
	you want. For instance you could have something like this in
	your <filename>components</filename> file:</para>

      <informalexample>
	<screen>To:
Fcc: out
Subject:
X-Mailer: MH 6.8.3
X-Home-Page: http://www.FreeBSD.org/
-------</screen>
      </informalexample>

      <para><application>MH</application> would then copy this
	components file and throw you into your editor. The
	<filename>components</filename> file is fairly simple.  If you
	wanted to have a signature on those messages you would just
	put your signature in that <filename>components</filename>
	file.</para>

      <para>The <filename>replcomps</filename> file is a bit more complex. The
	default <filename>replcomps</filename> looks like this:</para>

      <informalexample>
	<screen>%(lit)%(formataddr %&lt;{reply-to}%?{from}%?{sender}%?{return-path}%&gt;)\
%&lt;(nonnull)%(void(width))%(putaddr To: )\n%&gt;\
%(lit)%(formataddr{to})%(formataddr{cc})%(formataddr(me))\
%&lt;(nonnull)%(void(width))%(putaddr cc: )\n%&gt;\
%&lt;{fcc}Fcc: %{fcc}\n%&gt;\
%&lt;{subject}Subject: Re: %{subject}\n%&gt;\
%&lt;{date}In-reply-to: Your message of "\
%&lt;(nodate{date})%{date}%|%(pretty{date})%&gt;."%&lt;{message-id}
             %{message-id}%&gt;\n%&gt;\
--------</screen>
      </informalexample>

      <para>It is in the same basic format as the
	<filename>components</filename> file but it contains quite a few extra
	formatting codes. The <literal>%(lit)</literal> command makes room
	for the address. The <literal>%(formataddr)</literal> is a function
	that returns a proper email address. The next part is
	<literal>%&lt;</literal> which means if and the
	<literal>{reply-to}</literal> means the reply-to field in the
	original message. So that might be translated this way:</para>

      <informalexample>
	<screen>%&lt;<emphasis remap="bf">if</emphasis> {reply-to} <emphasis remap="bf">the original message has a reply-to</emphasis>
then give that to formataddr, %? <emphasis remap="bf">else</emphasis> {from} <emphasis remap="bf">take the
from address</emphasis>, %? <emphasis remap="bf">else</emphasis> {sender} <emphasis remap="bf">take the sender address</emphasis>, %?
<emphasis remap="bf">else</emphasis> {return-path} <emphasis remap="bf">take the return-path from the original
message</emphasis>, %&gt; <emphasis remap="bf">endif</emphasis>.</screen>
      </informalexample>

      <para>As you can tell <application>MH</application> formatting
	can get rather involved. You can probably decipher what most
	of the other functions and variables mean. All of the
	information on writing these format strings is in the
	MH-Format manual page. The really nice thing is that once you
	have built your customized <filename>replcomps</filename> file
	you will not need to touch it again.  No other email program
	really gives you the power and flexibility that
	<application>MH</application> gives you.</para>
    </sect2>
  </sect1>
</article>