]> code.delx.au - gnu-emacs/blob - man/mh-e.texi
(Scan Line Formats): Replace @samp with @kbd.
[gnu-emacs] / man / mh-e.texi
1 \input texinfo @c -*-texinfo-*-
2 @c
3 @c Note: This document requires makeinfo version 4.6 or greater to build.
4 @c
5 @c %**start of header
6 @setfilename ../info/mh-e
7 @settitle The MH-E Manual
8 @c %**end of header
9
10 @c Version of the software and manual.
11 @set VERSION 7.93+cvs
12 @c EDITION of the manual. It is either empty for the first edition or
13 @c has the form ", nth Edition" (without the quotes).
14 @set EDITION
15 @set UPDATED 2006-03-11
16 @set UPDATE-MONTH March, 2006
17
18 @c Other variables.
19 @set MH-BOOK-HOME http://www.ics.uci.edu/~mh/book/mh
20 @set MH-E-HOME http://mh-e.sourceforge.net/
21
22 @c Copyright
23 @copying
24 This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
25 Manual}, last updated @value{UPDATED}
26
27 Copyright @copyright{} 1995,
28 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
29
30 @quotation
31 The MH-E manual is free documentation; you can redistribute it and/or
32 modify it under the terms of either:
33
34 @enumerate a
35 @item
36 the GNU Free Documentation License, Version 1.2 or any later version
37 published by the Free Software Foundation; with no Invariant Sections,
38 no Front-Cover Texts, and no Back-Cover Texts.
39
40 @item
41 the GNU General Public License as published by the Free Software
42 Foundation; either version 2, or (at your option) any later version.
43 @end enumerate
44
45 The MH-E manual is distributed in the hope that it will be useful, but
46 WITHOUT ANY WARRANTY; without even the implied warranty of
47 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
48 General Public License or GNU Free Documentation License for more
49 details.
50
51 The GNU General Public License and the GNU Free Documentation License
52 appear as appendices to this document. You may also request copies by
53 writing to the Free Software Foundation, Inc., 51 Franklin Street,
54 Fifth Floor, Boston, MA 02110-1301, USA.
55 @end quotation
56 @end copying
57
58 @c Info Directory Entry
59 @dircategory Emacs
60 @direntry
61 * MH-E: (mh-e). Emacs interface to the MH mail system.
62 @end direntry
63
64 @c Title Page
65 @setchapternewpage odd
66 @titlepage
67 @title The MH-E Manual
68 @subtitle Version @value{VERSION}@value{EDITION}
69 @subtitle @value{UPDATE-MONTH}
70 @author Bill Wohler
71
72 @c Copyright Page
73 @page
74 @vskip 0pt plus 1filll
75 @insertcopying
76 @end titlepage
77
78 @ifnottex
79 @html
80 <!--
81 @end html
82 @node Top, Preface, (dir), (dir)
83 @top The MH-E Manual
84 @html
85 -->
86 @end html
87 @insertcopying
88 @end ifnottex
89
90 @c Table of Contents
91 @contents
92
93 @html
94 <!--
95 @end html
96
97 @menu
98 * Preface:: Preface
99 * Conventions:: GNU Emacs Terms and Conventions
100 * Getting Started:: Getting Started
101 * Tour Through MH-E:: Tour Through MH-E
102 * Using This Manual:: Using This Manual
103 * Incorporating Mail:: Incorporating Mail
104 * Reading Mail:: Reading Mail
105 * Folders:: Organizing Your Mail with Folders
106 * Sending Mail:: Sending Mail
107 * Editing Drafts:: Editing a Draft
108 * Aliases:: Aliases
109 * Identities:: Identities
110 * Speedbar:: The Speedbar
111 * Menu Bar:: The Menu Bar
112 * Tool Bar:: The Tool Bar
113 * Searching:: Searching Through Messages
114 * Threading:: Viewing Message Threads
115 * Limits:: Limiting Display
116 * Sequences:: Using Sequences
117 * Junk:: Dealing With Junk Mail
118 * Miscellaneous:: Miscellaneous Commands, Variables, and Buffers
119 * Scan Line Formats:: Scan Line Formats
120 * Procmail:: Reading Mailing Lists Effectively
121 * Odds and Ends:: Odds and Ends
122 * History:: History of MH-E
123 * GFDL:: GNU Free Documentation License
124 * GPL:: GNU Public License
125 * Key Index:: Key (Character) Index
126 * Command Index:: Command Index
127 * Option Index:: Option (Variable) Index
128 * Concept Index:: Concept Index
129
130 @detailmenu
131 --- The Detailed Node Listing ---
132
133 Tour Through MH-E
134
135 * Sending Mail Tour::
136 * Reading Mail Tour::
137 * Processing Mail Tour::
138 * Leaving MH-E::
139 * More About MH-E::
140
141 Using This Manual
142
143 * Options::
144 * Ranges::
145 * Folder Selection::
146
147 Reading Your Mail
148
149 * Viewing::
150 * Viewing Attachments::
151 * HTML::
152 * Digests::
153 * Reading PGP::
154 * Printing::
155 * Files and Pipes::
156 * Navigating::
157 * Miscellaneous Commands and Options::
158
159 Sending Mail
160
161 * Composing::
162 * Replying::
163 * Forwarding::
164 * Redistributing::
165 * Editing Again::
166
167 Editing a Draft
168
169 * Editing Message::
170 * Inserting Letter::
171 * Inserting Messages::
172 * Signature::
173 * Picture::
174 * Adding Attachments::
175 * Sending PGP::
176 * Checking Recipients::
177 * Sending Message::
178 * Killing Draft::
179
180 Odds and Ends
181
182 * Bug Reports::
183 * Mailing Lists::
184 * MH FAQ and Support::
185 * Getting MH-E::
186
187 History of MH-E
188
189 * From Brian Reid::
190 * From Jim Larus::
191 * From Stephen Gildea::
192 * From Bill Wohler::
193
194 @end detailmenu
195 @end menu
196
197 @html
198 -->
199 @end html
200
201 @node Preface, Conventions, Top, Top
202 @unnumbered Preface
203
204 @cindex Emacs
205 @cindex Unix commands, Emacs
206
207 This manual introduces another interface to the MH mail system that is
208 accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
209 easy to use. I don't assume that you know GNU Emacs or even MH at this
210 point, since I didn't know either of them when I discovered MH-E.
211 However, MH-E was the tip of the iceberg, and I discovered more and
212 more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
213 them.
214
215 The MH-E package is distributed with GNU Emacs@footnote{Version
216 @value{VERSION} of MH-E will appear in GNU Emacs 22.1. It is supported
217 in GNU Emacs 21, as well as XEmacs 21 (except for versions
218 21.5.9-21.5.16). It is compatible with MH versions 6.8.4 and higher,
219 all versions of nmh, and GNU mailutils 0.4 and higher.}, so you
220 shouldn't have to do anything special to use it. This manual covers
221 MH-E version @value{VERSION}. To help you decide which version you
222 have, see @ref{Getting Started}.
223
224 If you don't already use GNU Emacs but want to learn more, you can
225 read an online tutorial by starting GNU Emacs and typing @kbd{C-h t}
226 (@code{help-with-tutorial}). (To learn about this notation, see
227 @ref{Conventions}.) If you want to take the plunge, consult the
228 @iftex
229 @cite{GNU Emacs Manual},
230 @end iftex
231 @ifinfo
232 @ref{top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
233 @end ifinfo
234 @ifhtml
235 @uref{http://www.gnu.org/software/emacs/manual/html_node/,
236 @cite{GNU Emacs Manual}},
237 @end ifhtml
238 from the Free Software Foundation.
239
240 If more information is needed, you can go to the Unix manual pages of
241 the individual MH commands. When the name is not obvious, I'll guide
242 you to a relevant MH manual page that describes the action more fully.
243
244 This manual is available in both Info and online formats. The Info
245 version is distributed with Emacs and can be accessed with the
246 @command{info} command (@samp{info mh-e}) or within Emacs (@kbd{M-x
247 info @key{RET} m mh-e @key{RET}}). The online version is available at
248 @uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
249 online resource is the book @uref{http://www.ics.uci.edu/~mh/book/,
250 @cite{MH & nmh: Email for Users & Programmers}} (also known as
251 @dfn{the MH book}).
252
253 I hope you enjoy this manual! If you have any comments, or suggestions
254 for this document, please let me know.
255
256 @cindex Bill Wohler
257 @cindex Wohler, Bill
258
259 @noindent
260 Bill Wohler <@i{wohler at newt.com}>@*
261 8 February 1995@*
262 24 February 2006
263
264 @node Conventions, Getting Started, Preface, Top
265 @chapter GNU Emacs Terms and Conventions
266
267 @cindex Emacs
268 @cindex Emacs, terms and conventions
269 @cindex Unix commands, Emacs
270
271 If you're an experienced Emacs user, you can skip the following
272 conventions and definition of terms and go directly to the next
273 section (@pxref{Getting Started}).
274
275 @cindex Emacs commands
276 @cindex MH commands
277 @cindex Unix commands
278 @cindex commands
279 @cindex commands, MH
280 @cindex commands, Unix
281 @cindex commands, shell
282 @cindex functions
283 @cindex shell commands
284
285 In general, @dfn{functions} in this text refer to Emacs Lisp functions
286 that one would call from within Emacs Lisp programs (for example,
287 @code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
288 things that are run by the user, such as @kbd{i} or @kbd{M-x
289 mh-inc-folder}. Programs outside of Emacs are specifically called MH
290 commands, shell commands, or Unix commands.
291
292 @cindex conventions, key names
293 @cindex key names
294
295 The conventions for key names are as follows:
296
297 @table @kbd
298 @item C-x
299 Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
300 @c -------------------------
301 @item M-x
302 Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
303
304 Since some keyboards don't have a @key{META} key, you can generate
305 @kbd{M-x}, for example, by pressing @key{ESC} (Escape),
306 @emph{releasing it}, and then pressing the @kbd{x} key.
307 @c -------------------------
308 @item @key{RET}
309 Press the @key{RETURN} or @key{ENTER} key. This is normally used to
310 complete a command.
311 @c -------------------------
312 @item @key{SPC}
313 Press the space bar.
314 @c -------------------------
315 @item @key{TAB}
316 Press the @key{TAB} key.
317 @c -------------------------
318 @item @key{DEL}
319 Press the @key{DELETE} key.
320 @c -------------------------
321 @item @key{BS}
322 Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
323 earlier of Emacs, you will need to use the @key{DEL} key.}.
324 @end table
325
326 @cindex Emacs, prefix argument
327 @cindex prefix argument
328
329 A @dfn{prefix argument} allows you to pass an argument to any Emacs
330 function. To pass an argument, type @kbd{C-u} before the Emacs command
331 or keystroke. Numeric arguments can be passed as well. For example, to
332 insert five f's, use @kbd{C-u 5 f}. There is a default of four when
333 using @kbd{C-u}, and you can use multiple prefix arguments to provide
334 arguments of powers of four. To continue our example, you could insert
335 four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
336 @kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
337 arguments can also be inserted with the @key{META} key. Examples
338 include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
339 specifies a negative argument with no particular value.
340
341 @sp 1
342 @center @strong{NOTE}
343
344 @quotation
345 The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
346 mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
347 numerical argument before entering the command.
348 @end quotation
349 @sp 1
350
351 @cindex Emacs, variables
352 @cindex variables
353
354 Emacs uses @dfn{variables} to hold values. These can be changed via
355 calls to the function @code{setq} in @file{~/.emacs}.
356
357 @cindex Emacs, options
358 @cindex options
359 @findex customize-group
360 @findex customize-option
361
362 Variables in MH-E that are normally modified by the user are called
363 @dfn{options} and are modified through the customize functions (such
364 as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
365 @ifnothtml
366 @xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
367 GNU Emacs Manual}.
368 @end ifnothtml
369 @ifhtml
370 See section
371 @uref{http://www.gnu.org/software/emacs/manual/html_node/Easy-Customization.html,
372 Easy Customization} in @cite{The GNU Emacs Manual}.
373 @end ifhtml
374 @xref{Options}.
375
376 @cindex Emacs, faces
377 @cindex faces
378 @cindex highlighting
379 @findex customize-face
380
381 You can specify various styles for displaying text using @dfn{faces}.
382 MH-E provides a set of faces that you can use to personalize the look
383 of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
384 this.
385 @ifnothtml
386 @xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
387 GNU Emacs Manual}.
388 @end ifnothtml
389 @ifhtml
390 See section
391 @uref{http://www.gnu.org/software/emacs/manual/html_node/Face-Customization.html,
392 Face Customization} in @cite{The GNU Emacs Manual}.
393 @end ifhtml
394
395 @cindex hooks
396 @cindex normal hooks
397 @cindex abnormal hooks
398
399 Commands often offer @dfn{hooks} which enable you to extend or modify
400 the way a command works.
401 @ifnothtml
402 @ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
403 Emacs Manual}
404 @end ifnothtml
405 @ifhtml
406 See section
407 @uref{http://www.gnu.org/software/emacs/manual/html_node/Hooks.html,
408 Hooks} in @cite{The GNU Emacs Manual}
409 @end ifhtml
410 for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
411 MH-E uses normal hooks in nearly all cases, so you can assume that we
412 are talking about normal hooks unless we explicitly mention that a hook
413 is abnormal. We also follow the conventions described in that section:
414 the name of the abnormal hooks end in @code{-hooks} and all the rest
415 of the MH-E hooks end in @code{-hook}.
416
417 @cindex Emacs, mark
418 @cindex Emacs, point
419 @cindex Emacs, region
420 @cindex mark
421 @cindex point
422 @cindex region
423
424 There are several other terms that are used in Emacs that you should
425 know. The @dfn{point} is where the cursor currently is. You can save
426 your current place in the file by setting a @dfn{mark}. This operation
427 is useful in several ways. The mark can be later used when defining a
428 @dfn{region}, which is the text between the point and mark. Many
429 commands operate on regions, such as those for deleting text or
430 filling paragraphs. A mark can be set with @kbd{C-@@} (or
431 @kbd{C-@key{SPC}}).
432
433 @cindex Emacs, completion
434 @cindex Emacs, file completion
435 @cindex Emacs, folder completion
436 @cindex Emacs, minibuffer
437 @cindex completion
438 @cindex file completion
439 @cindex folder completion
440 @cindex minibuffer
441
442 The @dfn{minibuffer} is the bottom line of the Emacs window, where all
443 prompting and multiple-character input is directed. You can use
444 @dfn{completion} to enter values such as folders. Completion means
445 that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
446 A second @key{SPC} or @key{TAB} will list all possibilities at that
447 point.
448 @ifnothtml
449 @xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
450 @end ifnothtml
451 @ifhtml
452 See the section
453 @uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html,
454 Completion} in @cite{The GNU Emacs Manual}.
455 @end ifhtml
456 Note that @key{SPC} cannot be used for completing filenames and
457 folders.
458
459 The minibuffer is also where you enter Emacs function names after
460 typing @kbd{M-x}. For example, in the preface, I mentioned that you
461 could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
462 this means is that you can get a tutorial by typing either @kbd{C-h t}
463 or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
464 for @samp{help-with-tutorial} in the minibuffer after typing
465 @kbd{M-x}.
466
467 @cindex ~
468
469 The @samp{~} notation in filenames represents your home directory.
470 This notation is used by many shells including @command{bash},
471 @code{tcsh}, and @command{csh}. It is analogous to the environment
472 variable @samp{$HOME}. For example, @file{~/.emacs} can be written
473 @file{$HOME/.emacs} or using the absolute path as in
474 @file{/home/wohler/.emacs} instead.
475
476 @cindex Emacs, interrupting
477 @cindex Emacs, quitting
478 @cindex interrupting
479 @cindex quitting
480
481 @i{In case of trouble:} Emacs can be interrupted at any time with
482 @kbd{C-g}. For example, if you've started a command that requests that
483 you enter something in the minibuffer, but then you change your mind,
484 type @kbd{C-g} and you'll be back where you started. If you want to
485 exit Emacs entirely, use @kbd{C-x C-c}.
486
487 @node Getting Started, Tour Through MH-E, Conventions, Top
488 @chapter Getting Started
489
490 @cindex MH-E, versions
491 @cindex history
492 @cindex versions of MH-E
493
494 Because there are many old versions of MH-E out there, it is important
495 to know which version you have. I'll be talking about @w{Version 8}
496 which is pretty close to @w{Version 6} and @w{Version 7}. It differs
497 from @w{Version 4} and @w{Version 5} and is vastly different from
498 @w{Version 3}. @xref{History}.
499
500 @findex mh-version
501
502 To determine which version of MH-E that you have, enter @kbd{M-x
503 mh-version @key{RET}}. Hopefully it says that you're running
504 @w{Version @value{VERSION}} which is the latest version as of this
505 printing.
506
507 If your version is much older than this, please consider upgrading.
508 You can have your system administrator upgrade the system-wide
509 version, or you can install your own personal version. It's really
510 quite easy. @xref{Getting MH-E}, for instructions for getting and
511 installing MH-E.
512
513 If the @code{mh-version} command displays @samp{No MH variant
514 detected}, then you need to install MH or tell MH-E where to find
515 MH@footnote{In very old versions of MH-E, you may get the error
516 message, @samp{Cannot find the commands `inc' and `mhl' and the file
517 `components'} if MH-E can't find MH. In this case, you need to update
518 MH-E, and you may need to install MH too. However, newer versions of
519 MH-E are better at finding MH if it is on your system.}.
520
521 The option @code{mh-variant} specifies the variant used by MH-E
522 (@pxref{Options}). The default setting of this option is
523 @samp{Auto-detect} which means that MH-E will automatically choose the
524 first of nmh, MH, or GNU mailutils that it finds in the directories
525 listed in @code{mh-path} (which you can customize),
526 @code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
527 all, you may have to customize @code{mh-path} and add the directory in
528 which the command @code{mhparam} is located. If, on the other hand,
529 you have both nmh and mailutils installed (for example) and
530 @code{mh-variant-in-use} was initialized to nmh but you want to use
531 mailutils, then you can set @code{mh-variant} to @samp{mailutils}.
532
533 When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
534 @code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
535 @code{mh-variant-in-use} accordingly.
536
537 @sp 1
538 @center @strong{NOTE}
539
540 @quotation
541 Prior to version 8, it was often necessary to set some of these
542 variables in @file{~/.emacs}; now it is no longer necessary and can
543 actually cause problems.
544 @end quotation
545 @sp 1
546
547 @cindex @command{install-mh}
548 @cindex MH commands, @command{install-mh}
549
550 If you've never run MH before, you need to run @command{install-mh}
551 from the shell before you continue. This sets up your personal MH
552 environment@footnote{See the section
553 @uref{@value{MH-BOOK-HOME}/setup.htm, Setting Up MH} in the MH book.}.
554 If you don't, you'll be greeted with the error message: @samp{Install
555 MH and run install-mh before running MH-E}.
556
557 @cindex @samp{Path:} MH profile component
558 @cindex MH profile
559 @cindex MH profile component
560 @cindex MH profile component, @samp{Path:}
561
562 Your MH environment includes your @dfn{MH profile} which is found in
563 the file @file{~/.mh_profile}. This file contains a number of @dfn{MH
564 profile components}. For example, the @samp{Path:} MH profile
565 component contains the path to your mail directory, which is
566 @file{~/Mail} by default.
567
568 @cindex @samp{Draft-Folder:} MH profile component
569 @cindex @samp{Path:} MH profile component
570 @cindex @samp{Previous-Sequence:} MH profile component
571 @cindex @samp{Unseen-Sequence:} MH profile component
572 @cindex MH profile component, @samp{Draft-Folder:}
573 @cindex MH profile component, @samp{Path:}
574 @cindex MH profile component, @samp{Previous-Sequence:}
575 @cindex MH profile component, @samp{Unseen-Sequence:}
576 @findex mh-find-path
577 @vindex mh-draft-folder
578 @vindex mh-find-path-hook
579 @vindex mh-inbox
580 @vindex mh-previous-seq
581 @vindex mh-unseen-seq
582 @vindex mh-user-path
583
584 In addition to setting variables that point to MH itself, MH-E also
585 sets a handful of variables that point to where you keep your mail.
586 During initialization, the function @code{mh-find-path} sets
587 @code{mh-user-path} from your @samp{Path:} MH profile component (but
588 defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
589 from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
590 @samp{Unseen-Sequence:}, @code{mh-previous-seq} from
591 @samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
592 (defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
593 after these variables have been set. This hook can be used the change
594 the value of these variables if you need to run with different values
595 between MH and MH-E.
596
597 @node Tour Through MH-E, Using This Manual, Getting Started, Top
598 @chapter Tour Through MH-E
599
600 This chapter introduces some of the terms you'll need to know and then
601 takes you on a tour of MH-E@footnote{The keys mentioned in these
602 chapters refer to the default key bindings. If you've changed the
603 bindings, refer to the command summaries at the beginning of each
604 chapter for a mapping between default key bindings and function
605 names.}. When you're done, you'll be able to send, read, and file
606 mail, which is all that a lot of people ever do. But if you're the
607 curious or adventurous type, read the rest of the manual to be able to
608 use all the features of MH-E. I suggest you read this chapter first to
609 get the big picture, and then you can read the manual as you wish.
610
611 @menu
612 * Sending Mail Tour::
613 * Reading Mail Tour::
614 * Processing Mail Tour::
615 * Leaving MH-E::
616 * More About MH-E::
617 @end menu
618
619 @node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
620 @section Sending Mail
621
622 @cindex sending mail
623 @findex mh-smail
624
625 Let's start our tour by sending ourselves a message which we can later
626 read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
627 to send messages. You will be prompted in the minibuffer by
628 @samp{To:}. Enter your login name. The next prompt is @samp{Cc:}. Hit
629 @key{RET} to indicate that no carbon copies are to be sent. At the
630 @samp{Subject:} prompt, enter @kbd{Test} or anything else that comes
631 to mind.
632
633 @cindex MH-Letter mode
634 @cindex modes, MH-Letter
635 @cindex mode
636
637 Once you've specified the recipients and subject, your message appears
638 in an Emacs buffer whose mode@footnote{A @dfn{mode} changes Emacs to
639 make it easier to edit a particular type of text.} is MH-Letter. Enter
640 some text in the body of the message, using normal Emacs commands. You
641 should now have something like this@footnote{If you're running Emacs
642 under the X Window System, then you would also see a menu bar. Under
643 Emacs 21, you would also see a tool bar. I've left out the menu bar and
644 tool bar in all of the example screens.}:
645
646 @cartouche
647 @smallexample
648
649
650
651
652
653
654 --:-- *scratch* (Lisp Interaction)--L1--All-------------------------
655 To: wohler
656 cc:
657 Subject: Test
658 --------
659 This is a test message to get the wheels churning...#
660
661
662 --:** @{draft@} (MH-Letter)--L5--All-----------------------------------
663
664 @end smallexample
665 @end cartouche
666 @i{MH-E message composition window}
667
668 Note the line of dashes that separates the header and the body of the
669 message. It is essential that these dashes (or a blank line) are
670 present or the body of your message will be considered to be part of
671 the header.
672
673 @cindex help
674 @kindex C-c C-c
675
676 There are several commands specific to MH-Letter mode@footnote{You can
677 get quick help for the commands used most often with @kbd{C-c ?} or
678 more complete help with the @kbd{C-h m} (@code{describe-mode})
679 command.}, but at this time we'll only use @kbd{C-c C-c} to send your
680 message. Type @kbd{C-c C-c} now. That's all there is to it!
681
682 @node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
683 @section Receiving Mail
684
685 @cindex @command{inc}
686 @cindex @command{scan}
687 @cindex MH commands, @command{inc}
688 @cindex MH commands, @command{scan}
689 @cindex MH-Folder mode
690 @cindex modes, MH-Folder
691 @cindex reading mail
692 @findex mh-rmail
693
694 To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
695 This incorporates the new mail and puts the output from
696 @command{inc}@footnote{See the section
697 @uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
698 prev} in the MH book.} (called @dfn{scan lines} after the MH program
699 @command{scan}@footnote{See the section
700 @uref{@value{MH-BOOK-HOME}/faswsprs.htm, Find and Specify with scan
701 pick Ranges Sequences} in the MH book.} which prints a one-line
702 summary of each message) into a buffer called @samp{+inbox} whose
703 major mode is MH-Folder.
704
705 @sp 1
706 @center @strong{NOTE}
707
708 @quotation
709 The @kbd{M-x mh-rmail} command will show you only new mail, not mail
710 you have already read. If you were to run this tour again, you would
711 use @kbd{F r} to pull all your messages into MH-E.
712 @end quotation
713 @sp 1
714
715 @kindex @key{RET}
716 @kindex n
717 @kindex p
718
719 You should see the scan line for your message, and perhaps others. Use
720 @kbd{n} or @kbd{p} to move the cursor to your test message and type
721 @key{RET} to read your message. You should see something like:
722
723 @cartouche
724 @smallexample
725 3 t08/24 root received fax files on Wed Aug 24 11:00:13 PDT 1
726 # 4+t08/24 To:wohler Test<<This is a test message to get the wheels
727
728 -:%% @{+inbox@} 4 msgs (1-4) (MH-Folder Show)--L4--Bot--------------
729 To: wohler
730 Subject: Test
731 Date: Wed, 24 Aug 1994 13:01:13 -0700
732 From: Bill Wohler <wohler@@stop.mail-abuse.org>
733
734 This is a test message to get the wheels churning...
735
736
737
738
739
740 --:-- @{show-+inbox@} 4 (MH-Show)--L1--All---------------------------
741
742 @end smallexample
743 @end cartouche
744 @i{After incorporating new messages}
745
746 @kindex @key{DEL}
747 @kindex @key{SPC}
748
749 If you typed a long message, you can view subsequent pages with
750 @key{SPC} and previous pages with @key{DEL}.
751
752 @node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
753 @section Processing Mail
754
755 @cindex processing mail
756 @kindex r
757
758 The first thing we want to do is reply to the message that we sent
759 ourselves. Ensure that the cursor is still on the same line as your
760 test message and type @kbd{r}. You are prompted in the minibuffer with
761 @samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
762 to the original sender only, to the sender and primary recipients, or
763 to the sender and all recipients. If you simply hit @key{RET}, you'll
764 reply only to the sender. Hit @key{RET} now.
765
766 You'll find yourself in an Emacs buffer similar to that when you were
767 sending the original message, like this:
768
769 @cartouche
770 @smallexample
771 To: wohler
772 Subject: Re: Test
773 In-reply-to: Bill Wohler's message of Wed, 24 Aug 1994 13:01:13 -0700
774 <199408242001.NAA00505@@stop.mail-abuse.org>
775 --------
776 #
777
778 --:-- @{draft@} (MH-Letter)--L11--Bot---------------------------------
779 To: wohler
780 Subject: Test
781 Date: Wed, 24 Aug 1994 13:01:13 -0700
782 From: Bill Wohler <wohler@@stop.mail-abuse.org>
783
784 This is a test message to get the wheels churning...
785
786 --:-- @{show-+inbox@} 4 (MH-Show)--L1--All----------------------------
787 Composing a reply...done
788 @end smallexample
789 @end cartouche
790 @i{Composition window during reply}
791
792 @kindex C-c C-c
793 @kindex C-c C-f C-t
794
795 By default, MH will not add you to the address list of your replies,
796 so if you find that the @samp{To:} header field is missing, don't
797 worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
798 @samp{To:} field, where you can type your login name again. You can
799 move around with the arrow keys or with @kbd{C-p}
800 (@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
801 (@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
802 delete the previous character with @key{BS}. When you're finished
803 editing your message, send it with @kbd{C-c C-c} as before.
804
805 @cindex folders
806 @kindex o
807
808 You'll often want to save messages that were sent to you in an
809 organized fashion. This is done with @dfn{folders}. You can use
810 folders to keep messages from your friends, or messages related to a
811 particular topic. With your cursor in the MH-Folder buffer and
812 positioned on the message you sent to yourself, type @kbd{o} to output
813 (@command{refile} in MH parlance) that message to a folder. Enter
814 @kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
815 (or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
816 that a @samp{^} (caret) appears next to the message number, which
817 means that the message has been marked for refiling but has not yet
818 been refiled. We'll talk about how the refile is actually carried out
819 in a moment.
820
821 @cindex MH-Folder mode
822 @cindex modes, MH-Folder
823 @kindex @key{RET}
824 @kindex d
825 @kindex i
826 @kindex x
827
828 Your previous reply is now waiting in the system mailbox. You
829 incorporate this mail into your MH-Folder buffer named @samp{+inbox}
830 with the @kbd{i} command. Do this now. After the mail is incorporated,
831 use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
832 it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
833 that a @samp{D} appears next to the message number. This means that
834 the message is marked for deletion but is not yet deleted. To perform
835 the deletion (and the refile we did previously), use the @kbd{x}
836 command.
837
838 @findex mh-smail
839 @kindex m
840
841 If you want to send another message you can use @kbd{m} instead of
842 @kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
843
844 @cindex help
845 @cindex prefix characters
846 @findex describe-mode
847 @kindex ?
848 @kindex C-h m
849
850 You can get a quick reminder about these commands by typing @kbd{?}.
851 This lists several @dfn{prefix characters}. To list the commands
852 available via the prefix characters, type the prefix character
853 followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
854 available with the @kbd{C-h m} (@code{describe-mode}) command.
855
856 @node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
857 @section Leaving MH-E
858
859 @cindex Emacs, quitting
860 @cindex quitting
861
862 You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
863 to exit @command{emacs}. If you exited without running @kbd{x} in the
864 @samp{+inbox} buffer, Emacs will offer to save it for you. Type
865 @kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
866 perform any refiles and deletes that you did there.
867
868 @findex mh-rmail
869 @kindex q
870
871 If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
872 the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
873 later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
874
875 @cindex @command{packf}
876 @cindex MH commands, @command{packf}
877 @cindex exporting folders
878 @cindex folders, exporting
879 @cindex mbox-style folder
880
881 On the other hand, if you no longer want to use MH and MH-E, you can
882 take your mail with you. You can copy all of your mail into a single
883 file, mbox-style, by using the MH command @command{packf}. For
884 example, to create a file called @file{msgbox} with the messages in
885 your @samp{+inbox} folder, use @samp{packf +inbox}. The
886 @command{packf} command will append the messages to the file if it
887 already exists, so you can use @samp{folders -recurse -fast} in a
888 script to copy all of your messages into a single file, or using the
889 @samp{-file} argument, a file for each folder.
890
891 @node More About MH-E, , Leaving MH-E, Tour Through MH-E
892 @section More About MH-E
893
894 These are the basic commands to get you going, but there are plenty
895 more. If you think that MH-E is for you, read the rest of the manual
896 to find out how you can:
897
898 @itemize @bullet
899 @item
900 Print your messages (@pxref{Printing}).
901 @c -------------------------
902 @item
903 Edit messages and include your signature (@pxref{Editing Drafts}).
904 @c -------------------------
905 @item
906 Forward messages (@pxref{Forwarding}).
907 @c -------------------------
908 @item
909 Read digests (@pxref{Digests}).
910 @c -------------------------
911 @item
912 Edit bounced messages (@pxref{Editing Again}).
913 @c -------------------------
914 @item
915 Send multimedia messages (@pxref{Adding Attachments}).
916 @c -------------------------
917 @item
918 Read HTML messages (@pxref{HTML}).
919 @c -------------------------
920 @item
921 Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
922 @c -------------------------
923 @item
924 Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
925 @c -------------------------
926 @item
927 Deal with junk mail (@pxref{Junk}).
928 @c -------------------------
929 @item
930 Handle signed and encrypted messages (see @ref{Reading PGP},
931 @pxref{Sending PGP}).
932 @c -------------------------
933 @item
934 Process mail that was sent with @command{shar} or @command{uuencode}
935 (@pxref{Files and Pipes}).
936 @c -------------------------
937 @item
938 Use sequences conveniently (@pxref{Sequences}).
939 @c -------------------------
940 @item
941 Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
942 Bar}, @pxref{Menu Bar}).
943 @c -------------------------
944 @item
945 Show header fields in different fonts (@pxref{Reading Mail}).
946 @c -------------------------
947 @item
948 Find previously refiled messages (@pxref{Searching}).
949 @c -------------------------
950 @item
951 Place messages in a file (@pxref{Files and Pipes}).
952 @end itemize
953
954 Remember that you can also use MH commands when you're not running
955 MH-E (and when you are!).
956
957 @node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
958 @chapter Using This Manual
959
960 This chapter begins the meat of the manual which goes into more detail
961 about every MH-E command and option.
962
963 @cindex Emacs, info
964 @cindex Emacs, online help
965 @cindex info
966 @cindex online help
967 @findex describe-mode
968 @findex mh-help
969 @kindex ?
970 @kindex C-c ?
971
972 There are many commands, but don't get intimidated. There are command
973 summaries at the beginning of each chapter. In case you have or would
974 like to rebind the keys, the command summaries also list the
975 associated Emacs Lisp function. Furthermore, even if you're stranded
976 on a desert island with a laptop and are without your manuals, you can
977 get a summary of all these commands with GNU Emacs online help: use
978 @kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
979 @kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
980 help appears in a buffer called @samp{*MH-E Help*}
981 (@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
982 i} to read this manual via Info. The online help is quite good; try
983 running @kbd{C-h C-h}. This brings up a list of available help topics,
984 one of which displays the documentation for a given key (like @kbd{C-h
985 k C-n}). Another useful help feature is to view the manual section
986 that describes a given key (such as @kbd{C-h C-k i}). In addition,
987 review @ref{Conventions}, if any of the GNU Emacs conventions are
988 strange to you.
989
990 In addition to all of the commands, it is also possible to reconfigure
991 MH-E to fit the needs of even the most demanding user. The following
992 chapters also describe all of the options, show the defaults, and make
993 recommendations for customization.
994
995 However, when customizing your mail environment, first try to change
996 what you want in MH, and only change MH-E if changing MH is not
997 possible. That way you will get the same behavior inside and outside
998 GNU Emacs. Note that MH-E does not provide hooks for customizations
999 that can be done in MH; this omission is intentional.
1000
1001 @cindex Emacs, Emacs Lisp manual
1002 @cindex Emacs, info
1003 @cindex Emacs, online help
1004 @cindex info
1005 @cindex online help
1006
1007 I hope I've included enough examples here to get you well on your way.
1008 If you want to explore Emacs Lisp further, a programming manual does
1009 exist,
1010 @c Yes, some of the stuff in the following sections is redundant, but
1011 @c TeX barfs if the @ifs are inside the @footnote.
1012 @iftex
1013 @footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available
1014 online in the Info system by typing @kbd{C-h i m Emacs Lisp
1015 @key{RET}}. It is also available online at @*
1016 @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You
1017 can also order a printed manual, which has the desirable side-effect
1018 of helping to support the Free Software Foundation which made all this
1019 great software available. You can find an order form by running
1020 @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1021 gnu.org}.}
1022 @end iftex
1023 @ifinfo
1024 @footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1025 Emacs Lisp Reference Manual}, which may be available online in the
1026 Info system. It is also available online at
1027 @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You
1028 can also order a printed manual, which has the desirable side-effect
1029 of helping to support the Free Software Foundation which made all this
1030 great software available. You can find an order form by running
1031 @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1032 gnu.org}.}
1033 @end ifinfo
1034 @ifhtml
1035 @footnote{The
1036 @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/,
1037 The GNU Emacs Lisp Reference Manual} may also be available online in
1038 the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}. You can
1039 also order a printed manual, which has the desirable side-effect of
1040 helping to support the Free Software Foundation which made all this
1041 great software available. You can find an order form by running
1042 @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1043 gnu.org}.}
1044 @end ifhtml
1045 and you can look at the code itself for examples. Look in the Emacs
1046 Lisp directory on your system (such as
1047 @file{/usr/local/lib/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1048 files there. When calling MH-E and other Emacs Lisp functions directly
1049 from Emacs Lisp code, you'll need to know the correct arguments. Use
1050 the online help for this. For example, try @kbd{C-h f
1051 mh-execute-commands @key{RET}}. If you write your own functions,
1052 please do not prefix your symbols (variables and functions) with
1053 @samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1054 conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1055 your initials.
1056
1057 @menu
1058 * Options::
1059 * Ranges::
1060 * Folder Selection::
1061 @end menu
1062
1063 @node Options, Ranges, Using This Manual, Using This Manual
1064 @section Options
1065
1066 @cindex Emacs, customizing
1067 @cindex Emacs, setting options
1068 @cindex customizing MH-E
1069 @cindex setting options
1070 @findex customize-option
1071 @vindex mh-lpr-command-format, example
1072
1073 Many string or integer options are easy to modify using @kbd{M-x
1074 customize-option}. For example, to modify the option that controls
1075 printing, you would run @kbd{M-x customize-option @key{RET}
1076 mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1077 the string to the right of the variable. For example, you may change
1078 the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1079 use the @samp{State} combo box and select @samp{Save for Future
1080 Sessions}. To read more about @code{mh-lpr-command-format}, see
1081 @ref{Printing}.
1082
1083 @vindex mh-bury-show-buffer-flag, example
1084
1085 Options can also hold boolean values. In Emacs Lisp, the boolean
1086 values are @code{nil}, which means false, and @code{t}, which means
1087 true. The @code{customize-option} function makes it easy to change
1088 boolean values; simply click on the toggle button in the customize
1089 buffer to switch between @samp{on} (@code{t}) and @samp{off}
1090 (@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1091 to @samp{off} to keep the MH-Show buffer at the top of the buffer
1092 stack. Use the @samp{State} combo box and choose @samp{Set for Current
1093 Session} to see how the option affects the show buffer. Then choose
1094 the @samp{Erase Customization} menu item to reset the option to the
1095 default, which places the MH-Show buffer at the bottom of the buffer
1096 stack.
1097
1098 The text usually says to turn on an option by setting it to a
1099 @emph{non-@code{nil}} value, because sometimes values other than
1100 @samp{on} are meaningful. An example of this is the variable
1101 @code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
1102 hooks, involve a little more Emacs Lisp programming expertise.
1103
1104 @cindex @samp{mh} customization group
1105 @cindex customization group, @samp{mh}
1106 @findex customize-group
1107 @findex mh-customize
1108
1109 You can browse all of the MH-E options with the @code{customize-group}
1110 function. Try entering @kbd{M-x customize-group @key{RET} mh
1111 @key{RET}} to view the top-level options as well as buttons for all of
1112 the MH-E customization groups. Another way to view the MH-E
1113 customization group is to use @kbd{M-x mh-customize @key{RET}}.
1114
1115 @node Ranges, Folder Selection, Options, Using This Manual
1116 @section Ranges
1117
1118 @c Sync with mh-folder-mode docstring.
1119
1120 @cindex ranges
1121 @cindex message abbreviations
1122 @cindex message ranges
1123
1124 Many commands that operate on individual messages, such as
1125 @code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1126 argument. This argument can be used in several ways.
1127
1128 If you provide the prefix argument @kbd{C-u} to these commands, then
1129 you will be prompted for the message range. This can be any valid MH
1130 range which can include messages, sequences (@pxref{Sequences}), and
1131 the abbreviations (described in the @command{mh}(1) man page):
1132
1133 @table @samp
1134 @item <num1>-<num2>
1135 Indicates all messages in the range <num1> to <num2>, inclusive. The
1136 range must be nonempty.
1137 @c -------------------------
1138 @item <num>:N
1139 @item <num>:+N
1140 @itemx <num>:-N
1141 Up to N messages beginning with (or ending with) message num. Num may
1142 be any of the predefined symbols: first, prev, cur, next or last.
1143 @c -------------------------
1144 @item first:N
1145 @itemx prev:N
1146 @itemx next:N
1147 @itemx last:N
1148 The first, previous, next or last messages, if they exist.
1149 @c -------------------------
1150 @item all
1151 All of the messages.
1152 @end table
1153
1154 For example, a range that shows all of these things is @samp{1 2 3
1155 5-10 last:5 unseen}.
1156
1157 @vindex transient-mark-mode
1158
1159 If the option @code{transient-mark-mode} is set to @code{t} and you
1160 set a region in the MH-Folder buffer, then the MH-E command will
1161 perform the operation on all messages in that region.
1162
1163 @cindex @samp{mh-range} customization group
1164 @cindex customization group, @samp{mh-range}
1165
1166 The @samp{mh-range} customization group contains a single option which
1167 affects how ranges are interpreted.
1168
1169 @vtable @code
1170 @item mh-interpret-number-as-range-flag
1171 On means interpret a number as a range (default: @samp{on}).
1172 @end vtable
1173
1174 Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1175 interpret input such as @samp{200} as @samp{last:200} if the
1176 @code{mh-interpret-number-as-range-flag} option is on (which is the
1177 default). If you need to scan just the message 200, then use the range
1178 @samp{200:1} or @samp{200-200}.
1179
1180 @node Folder Selection, , Ranges, Using This Manual
1181 @section Folder Selection
1182
1183 @cindex folders, selecting
1184
1185 When you choose a folder in MH-E via a command such as @kbd{o}
1186 (@code{mh-refile-msg}), completion is used to enter the folder
1187 @ifnothtml
1188 (@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1189 @end ifnothtml
1190 @ifhtml
1191 (see the section
1192 @uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html,
1193 Completion} in @cite{The GNU Emacs Manual}).
1194 @end ifhtml
1195 In addition, MH-E has several ways of choosing a suitable default so
1196 that the folder can often be selected with a single @key{RET} key.
1197
1198 @cindex @samp{mh-folder-selection} customization group
1199 @cindex customization group, @samp{mh-folder-selection}
1200
1201 The @samp{mh-folder-selection} customization group contains some
1202 options which are used to help with this.
1203
1204 @vtable @code
1205 @item mh-default-folder-for-message-function
1206 Function to select a default folder for refiling or @samp{Fcc:}
1207 (default: @code{nil}).
1208 @c -------------------------
1209 @item mh-default-folder-list
1210 List of addresses and folders (default: @code{nil}).
1211 @c -------------------------
1212 @item mh-default-folder-must-exist-flag
1213 On means guessed folder name must exist to be used (default:
1214 @samp{on}).
1215 @c -------------------------
1216 @item mh-default-folder-prefix
1217 Prefix used for folder names generated from aliases (default: @code{""}).
1218 @end vtable
1219
1220 You can set the option @code{mh-default-folder-for-message-function}
1221 to a function that provides a default folder for the message to be
1222 refiled. When this function is called, the current buffer contains the
1223 message being refiled and point is at the start of the message. This
1224 function should return the default folder as a string with a leading
1225 @samp{+} sign. It can also return @code{nil} so that the last folder
1226 name is used as the default, or an empty string to suppress the
1227 default entirely.
1228
1229 Otherwise, the name of the destination folder is derived from the
1230 sender as follows:
1231
1232 @enumerate
1233 @item
1234 The folder name associated with the first address found in the list
1235 @code{mh-default-folder-list} is used. Each element in this list
1236 contains a @samp{Check Recipient} item. If this item is turned on,
1237 then the address is checked against the recipient instead of the
1238 sender. This is useful for mailing lists.
1239 @c -------------------------
1240 @item
1241 An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1242 the address is used. The prefix is used to prevent clutter in your
1243 mail directory. @xref{Aliases}.
1244 @end enumerate
1245
1246 If the derived folder does not exist, and
1247 @code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1248 folder name used is suggested. This is useful if you get mail from
1249 various people for whom you have an alias, but file them all in the
1250 same project folder.
1251
1252 @node Incorporating Mail, Reading Mail, Using This Manual, Top
1253 @chapter Incorporating Your Mail
1254
1255 @cindex incorporating
1256
1257 This chapter talks about getting mail from your system mailbox into
1258 your MH @samp{+inbox} folder. The following command accomplishes that
1259 and is found in the @samp{Folder} menu.
1260
1261 @table @kbd
1262 @cindex @samp{Folder > Incorporate New Mail} menu item
1263 @cindex menu item, @samp{Folder > Incorporate New Mail}
1264 @findex mh-inc-folder
1265 @kindex i
1266 @item i
1267 Incorporate new mail into a folder (@code{mh-inc-folder}).
1268 @end table
1269
1270 @cindex @samp{mh-inc} customization group
1271 @cindex customization group, @samp{mh-inc}
1272
1273 The following options in the @samp{mh-inc} customization group are
1274 used.
1275
1276 @vtable @code
1277 @item mh-inc-prog
1278 Program to incorporate mail (default: @code{"inc"}).
1279 @c -------------------------
1280 @item mh-inc-spool-list
1281 Alternate spool files (default: @code{nil}).
1282 @end vtable
1283
1284 The following hook is available.
1285
1286 @vtable @code
1287 @item mh-inc-folder-hook
1288 Hook run by @samp{mh-inc-folder} after incorporating mail into a
1289 folder (default: @code{nil}).
1290 @end vtable
1291
1292 If at any time you receive new mail, incorporate the new mail into
1293 your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1294 that @kbd{i} will display the @samp{+inbox} buffer, even if there
1295 isn't any new mail. You can incorporate mail from any file into the
1296 current folder by specifying a prefix argument; you'll be prompted for
1297 the name of the file to use as well as the destination folder (for
1298 example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1299
1300 @cindex @file{.emacs}
1301 @cindex Emacs, notification of new mail
1302 @cindex files, @file{.emacs}
1303 @cindex new mail
1304 @cindex notification of new mail
1305
1306 Emacs can notify you when you have new mail by displaying @samp{Mail}
1307 in the mode line. To enable this behavior, and to have a clock in the
1308 mode line besides, add the following to @file{~/.emacs}:
1309
1310 @findex display-time
1311
1312 @lisp
1313 (display-time)
1314 @end lisp
1315
1316 @cindex @command{inc}
1317 @cindex MH commands, @command{inc}
1318 @cindex incorporating
1319 @vindex mh-progs
1320
1321 The name of the program that incorporates new mail is stored in
1322 @code{mh-inc-prog}; it is @code{"inc"} by default. This program
1323 generates a one-line summary for each of the new messages. Unless it
1324 is an absolute pathname, the file is assumed to be in the
1325 @code{mh-progs} directory (@pxref{Getting Started}). You may also link
1326 a file to @command{inc} that uses a different format (see
1327 @samp{mh-profile}(5), and sections
1328 @uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
1329 prev} and @uref{@value{MH-BOOK-HOME}/mhstr.htm, MH Format Strings} in
1330 the MH book). You'll then need to modify several variables
1331 appropriately (@pxref{Scan Line Formats}).
1332
1333 You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1334 retrieve mail from arbitrary spool files other than your system
1335 mailbox, file it in folders other than your @samp{+inbox}, and assign
1336 key bindings to incorporate this mail.
1337
1338 @cindex @command{procmail}
1339 @cindex @file{.procmailrc}
1340 @cindex Unix commands, @command{procmail}
1341 @cindex files, @file{.procmailrc}
1342
1343 Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1344 use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1345 with the following recipe in @file{.procmailrc}:
1346
1347 @smallexample
1348 MAILDIR=$HOME/mail
1349 :0:
1350 * ^From mh-e-devel-admin@@stop.mail-abuse.org
1351 mh-e
1352 @end smallexample
1353
1354 In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1355 @kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1356 and click on the @samp{INS} button. Enter a @samp{Spool File} of
1357 @samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1358 Binding} of @samp{m}.
1359
1360 @cindex @command{emacsclient}
1361 @cindex @command{gnuclient}
1362 @cindex @command{xbuffy}
1363 @cindex @samp{gnuserv}
1364 @cindex Unix commands, @command{emacsclient}
1365 @cindex Unix commands, @command{gnuclient}
1366 @cindex Unix commands, @command{xbuffy}
1367
1368 You can use @command{xbuffy} to automate the incorporation of this
1369 mail using the Emacs 22 command @command{emacsclient} as follows:
1370
1371 @smallexample
1372 box ~/mail/mh-e
1373 title mh-e
1374 origMode
1375 polltime 10
1376 headertime 0
1377 command emacsclient --eval '(mh-inc-spool-mh-e)'
1378 @end smallexample
1379
1380 In XEmacs, the command @command{gnuclient} is used in a similar
1381 fashion.
1382
1383 You can set the hook @code{mh-inc-folder-hook}, which is called after
1384 new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1385 command. A good use of this hook is to rescan the whole folder either
1386 after running @kbd{M-x mh-rmail} the first time or when you've changed
1387 the message numbers from outside of MH-E.
1388
1389 @findex mh-execute-commands
1390 @findex mh-rescan-folder, example
1391 @findex mh-show, example
1392 @vindex mh-inc-folder-hook, example
1393
1394 @smalllisp
1395 @group
1396 (defun my-mh-inc-folder-hook ()
1397 "Hook to rescan folder after incorporating mail."
1398 (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,}
1399 (mh-execute-commands)) ; @r{carry them out}
1400 (mh-rescan-folder) ; @r{synchronize with +inbox}
1401 (mh-show)) ; @r{show the current message}
1402
1403 (add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1404
1405 @i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1406
1407 @end group
1408 @end smalllisp
1409
1410 @node Reading Mail, Folders, Incorporating Mail, Top
1411 @chapter Reading Your Mail
1412
1413 @cindex MH-Folder mode
1414 @cindex MH-Show mode
1415 @cindex modes, MH-Folder
1416 @cindex modes, MH-Show
1417 @cindex reading mail
1418 @cindex scan lines
1419 @findex mh-rmail
1420
1421 The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1422 command incorporates your mail and creates a buffer called
1423 @samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1424 you only new mail, not mail you have already read@footnote{If you want
1425 to see your old mail as well, use @kbd{F r} to pull all your messages
1426 into MH-E. Or, give a prefix argument to @code{mh-rmail} so it will
1427 prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1428 M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1429
1430 The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1431 summaries of each incorporated message. You can perform most MH
1432 commands on these messages via one- or two-letter commands in either
1433 the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1434 See @command{scan}(1) for a description of the contents of the scan
1435 lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1436
1437 @table @kbd
1438 @kindex ?
1439 @findex mh-help
1440 @item ?
1441 Display cheat sheet for the MH-E commands (@code{mh-help}).
1442 @c -------------------------
1443 @cindex @samp{Message > Show Message} menu item
1444 @cindex menu item, @samp{Message > Show Message}
1445 @kindex @key{RET}
1446 @findex mh-show
1447 @item @key{RET}
1448 Display message (@code{mh-show}).
1449 @c -------------------------
1450 @cindex @samp{Message > Show Message with Header} menu item
1451 @cindex menu item, @samp{Message > Show Message with Header}
1452 @kindex , (comma)
1453 @findex mh-header-display
1454 @item , (comma)
1455 Display message with all header fields (@code{mh-header-display}).
1456 @c -------------------------
1457 @kindex ; (semicolon)
1458 @findex mh-toggle-mh-decode-mime-flag
1459 @item ; (semicolon)
1460 Toggle the value of @code{mh-decode-mime-flag}
1461 (@code{mh-toggle-mh-decode-mime-flag}).
1462 @c -------------------------
1463 @kindex @key{SPC}
1464 @findex mh-page-msg
1465 @item @key{SPC}
1466 Display next page in message (@code{mh-page-msg}).
1467 @c -------------------------
1468 @kindex @key{BS}
1469 @findex mh-previous-page
1470 @item @key{BS}
1471 Display previous page in message (@code{mh-previous-page}).
1472 @c -------------------------
1473 @cindex @samp{Message > Write Message to File...} menu item
1474 @cindex menu item, @samp{Message > Write Message to File...}
1475 @kindex >
1476 @findex mh-write-msg-to-file
1477 @item >
1478 Append message to end of file (@code{mh-write-msg-to-file}).
1479 @c -------------------------
1480 @cindex @samp{Message > Pipe Message to Command...} menu item
1481 @cindex menu item, @samp{Message > Pipe Message to Command...}
1482 @kindex |
1483 @findex mh-pipe-msg
1484 @item |
1485 Pipe message through shell command (@code{mh-pipe-msg}).
1486 @c -------------------------
1487 @kindex C-d
1488 @findex mh-delete-msg-no-motion
1489 @item C-d
1490 Delete range, don't move to next message
1491 (@code{mh-delete-msg-no-motion}).
1492 @c -------------------------
1493 @cindex @samp{Message > Delete Message} menu item
1494 @cindex menu item, @samp{Message > Delete Message}
1495 @kindex d
1496 @findex mh-delete-msg
1497 @item d
1498 Delete range (@code{mh-delete-msg}).
1499 @c -------------------------
1500 @kindex D ?
1501 @findex mh-prefix-help
1502 @item D ?
1503 Display cheat sheet for the commands of the current prefix in
1504 minibuffer (@code{mh-prefix-help}).
1505 @c -------------------------
1506 @kindex D @key{SPC}
1507 @findex mh-page-digest
1508 @item D @key{SPC}
1509 Display next message in digest (@code{mh-page-digest}).
1510 @c -------------------------
1511 @kindex D @key{BS}
1512 @findex mh-page-digest-backwards
1513 @item D @key{BS}
1514 Display previous message in digest (@code{mh-page-digest-backwards}).
1515 @c -------------------------
1516 @cindex @samp{Message > Burst Digest Message} menu item
1517 @cindex menu item, @samp{Message > Burst Digest Message}
1518 @kindex D b
1519 @findex mh-burst-digest
1520 @item D b
1521 Break up digest into separate messages (@code{mh-burst-digest}).
1522 @c -------------------------
1523 @cindex @samp{Message > Go to Message by Number...} menu item
1524 @cindex menu item, @samp{Message > Go to Message by Number...}
1525 @kindex g
1526 @findex mh-goto-msg
1527 @item g
1528 Go to a message (@code{mh-goto-msg}).
1529 @c -------------------------
1530 @kindex k
1531 @findex mh-delete-subject-or-thread
1532 @item k
1533 Delete messages with same subject or thread
1534 (@code{mh-delete-subject-or-thread}).
1535 @c -------------------------
1536 @kindex K ?
1537 @findex mh-prefix-help
1538 @item K ?
1539 Display cheat sheet for the commands of the current prefix in
1540 minibuffer (@code{mh-prefix-help}).
1541 @c -------------------------
1542 @kindex K @key{TAB}
1543 @findex mh-next-button
1544 @item K @key{TAB}
1545 Go to the next button (@code{mh-next-button}).
1546 @c -------------------------
1547 @kindex K S-@key{TAB}
1548 @findex mh-prev-button
1549 @item K S-@key{TAB}
1550 Go to the previous button (@code{mh-prev-button}).
1551 @c -------------------------
1552 @kindex K a
1553 @findex mh-mime-save-parts
1554 @item K a
1555 Save attachments (@code{mh-mime-save-parts}).
1556 @c -------------------------
1557 @kindex K e
1558 @findex mh-display-with-external-viewer
1559 @item K e
1560 View attachment externally (@code{mh-display-with-external-viewer}).
1561 @c -------------------------
1562 @kindex K i
1563 @findex mh-folder-inline-mime-part
1564 @item K i
1565 Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1566 @c -------------------------
1567 @kindex K o
1568 @findex mh-folder-save-mime-part
1569 @item K o
1570 Save (output) attachment (@code{mh-folder-save-mime-part}).
1571 @c -------------------------
1572 @kindex K t
1573 @findex mh-toggle-mime-buttons
1574 @item K t
1575 Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1576 (@code{mh-toggle-mime-buttons}).
1577 @c -------------------------
1578 @kindex K v
1579 @findex mh-folder-toggle-mime-part
1580 @item K v
1581 View attachment (@code{mh-folder-toggle-mime-part}).
1582 @c -------------------------
1583 @cindex @samp{Message > Modify Message} menu item
1584 @cindex menu item, @samp{Message > Modify Message}
1585 @kindex M
1586 @findex mh-modify
1587 @item M
1588 Edit message (@code{mh-modify}).
1589 @c -------------------------
1590 @cindex @samp{Message > Go to First Message} menu item
1591 @cindex menu item, @samp{Message > Go to First Message}
1592 @kindex M-<
1593 @findex mh-first-msg
1594 @item M-<
1595 Display first message (@code{mh-first-msg}).
1596 @c -------------------------
1597 @cindex @samp{Message > Go to Last Message} menu item
1598 @cindex menu item, @samp{Message > Go to Last Message}
1599 @kindex M->
1600 @findex mh-last-msg
1601 @item M->
1602 Display last message (@code{mh-last-msg}).
1603 @c -------------------------
1604 @kindex M-n
1605 @findex mh-next-unread-msg
1606 @item M-n
1607 Display next unread message (@code{mh-next-unread-msg}).
1608 @c -------------------------
1609 @kindex M-p
1610 @findex mh-previous-unread-msg
1611 @item M-p
1612 Display previous unread message (@code{mh-previous-unread-msg}).
1613 @c -------------------------
1614 @cindex @samp{Message > Next Message} menu item
1615 @cindex menu item, @samp{Message > Next Message}
1616 @kindex n
1617 @findex mh-next-undeleted-msg
1618 @item n
1619 Display next message (@code{mh-next-undeleted-msg}).
1620 @c -------------------------
1621 @cindex @samp{Message > Previous Message} menu item
1622 @cindex menu item, @samp{Message > Previous Message}
1623 @kindex p
1624 @findex mh-previous-undeleted-msg
1625 @item p
1626 Display previous message (@code{mh-previous-undeleted-msg}).
1627 @c -------------------------
1628 @kindex P ?
1629 @findex mh-prefix-help
1630 @item P ?
1631 Display cheat sheet for the commands of the current prefix in
1632 minibuffer (@code{mh-prefix-help}).
1633 @c -------------------------
1634 @kindex P C
1635 @findex mh-ps-print-toggle-color
1636 @item P C
1637 Toggle whether color is used in printing messages
1638 (@code{mh-ps-print-toggle-color}).
1639 @c -------------------------
1640 @kindex P F
1641 @findex mh-ps-print-toggle-faces
1642 @item P F
1643 Toggle whether printing is done with faces or not
1644 (@code{mh-ps-print-toggle-faces}).
1645 @c -------------------------
1646 @kindex P f
1647 @findex mh-ps-print-msg-file
1648 @item P f
1649 Print range to file (@code{mh-ps-print-msg-file}).
1650 @c -------------------------
1651 @cindex @samp{Message > Print Message} menu item
1652 @cindex menu item, @samp{Message > Print Message}
1653 @kindex P l
1654 @findex mh-print-msg
1655 @item P l
1656 Print range the old fashioned way
1657 (@code{mh-print-msg}).
1658 @c -------------------------
1659 @kindex P p
1660 @findex mh-ps-print-msg
1661 @item P p
1662 Print range (@code{mh-ps-print-msg}).
1663 @c -------------------------
1664 @kindex X ?
1665 @findex mh-prefix-help
1666 @item X ?
1667 Display cheat sheet for the commands of the current prefix in
1668 minibuffer (@code{mh-prefix-help}).
1669 @c -------------------------
1670 @cindex @samp{Message > Unpack Uuencoded Message...} menu item
1671 @cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1672 @kindex X s
1673 @kindex X u
1674 @findex mh-store-msg
1675 @item X s
1676 @itemx X u
1677 Unpack message created with @command{uudecode} or @command{shar}
1678 (@code{mh-store-msg}).
1679 @c -------------------------
1680 @kindex Mouse-2
1681 @findex mh-show-mouse
1682 @item Mouse-2
1683 Move point to mouse event and show message (@code{mh-show-mouse}).
1684 @end table
1685
1686 Within the MH-Show buffer, the following command is defined.
1687
1688 @table @kbd
1689 @kindex @key{RET}
1690 @kindex Mouse-1
1691 @kindex Mouse-2
1692 @findex mh-press-button
1693 @item @key{RET}
1694 @itemx Mouse-1
1695 @itemx Mouse-2
1696 View contents of button (@code{mh-press-button}).
1697 @end table
1698
1699 @cindex @samp{mh-show} customization group
1700 @cindex customization group, @samp{mh-show}
1701
1702 The following table lists options in the @samp{mh-show} customization
1703 group that are used while reading mail.
1704
1705 @vtable @code
1706 @item mh-bury-show-buffer-flag
1707 On means show buffer is buried (default: @samp{on}).
1708 @c -------------------------
1709 @item mh-clean-message-header-flag
1710 On means remove extraneous header fields (default: @samp{on}).
1711 @c -------------------------
1712 @item mh-decode-mime-flag
1713 On means attachments are handled (default: @samp{on} if the Gnus
1714 @samp{mm-decode} package is present).
1715 @c -------------------------
1716 @item mh-display-buttons-for-alternatives-flag
1717 On means display buttons for all alternative attachments (default:
1718 @samp{off}).
1719 @c -------------------------
1720 @item mh-display-buttons-for-inline-parts-flag
1721 On means display buttons for all inline attachments (default:
1722 @samp{off}).
1723 @c -------------------------
1724 @item mh-do-not-confirm-flag
1725 On means non-reversible commands do not prompt for confirmation
1726 (default: @samp{off}).
1727 @c -------------------------
1728 @item mh-fetch-x-image-url
1729 Control fetching of @samp{X-Image-URL:} header field image (default:
1730 @samp{Never Fetch}).
1731 @c -------------------------
1732 @item mh-graphical-smileys-flag
1733 On means graphical smileys are displayed (default: @samp{on}).
1734 @c -------------------------
1735 @item mh-graphical-emphasis-flag
1736 On means graphical emphasis is displayed (default: @samp{on}).
1737 @c -------------------------
1738 @item mh-highlight-citation-style
1739 Style for highlighting citations (default: @samp{Multicolor}).
1740 @c -------------------------
1741 @item mh-invisible-header-fields-default
1742 List of hidden header fields (default: a checklist too long to list
1743 here).
1744 @c -------------------------
1745 @item mh-invisible-header-fields
1746 Additional header fields to hide (default: @code{nil}).
1747 @c -------------------------
1748 @item mh-lpr-command-format
1749 Command used to print (default: @code{"lpr -J '%s'"}).
1750 @c -------------------------
1751 @item mh-max-inline-image-height
1752 Maximum inline image height if @samp{Content-Disposition:} is not
1753 present (default: 0).
1754 @c -------------------------
1755 @item mh-max-inline-image-width
1756 Maximum inline image width if @samp{Content-Disposition:} is not
1757 present(default: 0).
1758 @c -------------------------
1759 @item mh-mhl-format-file
1760 Specifies the format file to pass to the @command{mhl} program
1761 (default: @samp{Use Default mhl Format (Printing Only)}).
1762 @c -------------------------
1763 @item mh-mime-save-parts-default-directory
1764 Default directory to use for @kbd{K a}.
1765 @c -------------------------
1766 @item mh-print-background-flag
1767 On means messages should be printed in the background (default:
1768 @samp{off}).
1769 @c -------------------------
1770 @item mh-show-buffer-mode-line-buffer-id
1771 Format string to produce @code{mode-line-buffer-identification} for
1772 show buffers (default: @code{" @{show-%s@} %d"}).
1773 @c -------------------------
1774 @item mh-show-maximum-size
1775 Maximum size of message (in bytes) to display automatically (default:
1776 0).
1777 @c -------------------------
1778 @item mh-show-use-xface-flag
1779 On means display face images in MH-Show buffers (default: @samp{on}).
1780 @c -------------------------
1781 @item mh-store-default-directory
1782 Default directory for @kbd{X s} (default: @samp{Current}).
1783 @c -------------------------
1784 @item mh-summary-height
1785 Number of lines in MH-Folder buffer (including the mode line)
1786 (default: depends on size of frame).
1787 @end vtable
1788
1789 The following hooks are available.
1790
1791 @vtable @code
1792 @item mh-delete-msg-hook
1793 Hook run after marking each message for deletion (default: @code{nil}).
1794 @c -------------------------
1795 @item mh-show-hook
1796 Hook run after @key{RET} shows a message (default: @code{nil}).
1797 @c -------------------------
1798 @item mh-show-mode-hook
1799 Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1800 @end vtable
1801
1802 The following faces are available.
1803
1804 @vtable @code
1805 @item mh-show-cc
1806 Face used to highlight @samp{cc:} header fields.
1807 @c -------------------------
1808 @item mh-show-date
1809 Face used to highlight @samp{Date:} header fields.
1810 @c -------------------------
1811 @item mh-show-from
1812 Face used to highlight @samp{From:} header fields.
1813 @c -------------------------
1814 @item mh-show-header
1815 Face used to deemphasize less interesting header fields.
1816 @c -------------------------
1817 @item mh-show-pgg-bad
1818 Bad PGG signature face.
1819 @c -------------------------
1820 @item mh-show-pgg-good
1821 Good PGG signature face.
1822 @c -------------------------
1823 @item mh-show-pgg-unknown
1824 Unknown or untrusted PGG signature face.
1825 @c -------------------------
1826 @item mh-show-signature
1827 Signature face.
1828 @c -------------------------
1829 @item mh-show-subject
1830 Face used to highlight @samp{Subject:} header fields.
1831 @c -------------------------
1832 @item mh-show-to
1833 Face used to highlight @samp{To:} header fields.
1834 @c -------------------------
1835 @item mh-show-xface
1836 X-Face image face.
1837 @end vtable
1838
1839 The functions and variables introduced here are explained in more
1840 detail in the following sections.
1841
1842 @menu
1843 * Viewing::
1844 * Viewing Attachments::
1845 * HTML::
1846 * Digests::
1847 * Reading PGP::
1848 * Printing::
1849 * Files and Pipes::
1850 * Navigating::
1851 * Miscellaneous Commands and Options::
1852 @end menu
1853
1854 @node Viewing, Viewing Attachments, Reading Mail, Reading Mail
1855 @section Viewing Your Mail
1856
1857 @findex mh-header-display
1858 @findex mh-page-msg
1859 @findex mh-previous-page
1860 @findex mh-show
1861 @findex mh-show-mouse
1862 @kindex , (comma)
1863 @kindex . (period)
1864 @kindex @key{BS}
1865 @kindex @key{RET}
1866 @kindex @key{SPC}
1867 @kindex Mouse-2
1868
1869 The command @key{RET} (@code{mh-show}) displays the message that the
1870 cursor is on while @kbd{Mouse-2} (@code{mh-show-mouse}) displays the
1871 message that the mouse cursor is on. If the message is already
1872 displayed, it scrolls to the beginning of the message. Use @key{SPC}
1873 (@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
1874 forwards and backwards one page at a time through the message. You can
1875 give either of these commands a prefix argument that specifies the
1876 number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
1877 command will also show the next undeleted message if it is used at the
1878 bottom of a message. MH-E normally hides a lot of the superfluous
1879 header fields that mailers add to a message, but if you wish to see
1880 all of them, use the command @kbd{,} (comma;
1881 @code{mh-header-display}).
1882
1883 The option @code{mh-show-maximum-size} provides an opportunity to skip
1884 over large messages which may be slow to load. The default value of 0
1885 means that all message are shown regardless of size.
1886
1887 A litany of options control what displayed messages look like.
1888
1889 @vindex mh-show-cc
1890 @vindex mh-show-date
1891 @vindex mh-show-from
1892 @vindex mh-show-header
1893 @vindex mh-show-subject
1894 @vindex mh-show-to
1895
1896 First, the appearance of the header fields can be modified by
1897 customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
1898 @code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
1899 The face @code{mh-show-header} is used to deemphasize the other, less
1900 interesting, header fields.
1901
1902 @cindex regular expressions, @code{mh-invisible-header-fields}
1903 @vindex mh-clean-message-header-flag
1904 @vindex mh-invisible-header-fields-default
1905 @vindex mh-invisible-header-fields
1906
1907 Normally messages are delivered with a handful of uninteresting header
1908 fields. These are hidden by turning on the option
1909 @code{mh-clean-message-header-flag} (which it is by default). The
1910 header fields listed in the option
1911 @code{mh-invisible-header-fields-default} are hidden, although you can
1912 check off any field that you would like to see. Header fields that you
1913 would like to hide that aren't listed can be added to the option
1914 @code{mh-invisible-header-fields} with a couple of caveats. Regular
1915 expressions are not allowed. Unique fields should have a @samp{:}
1916 suffix; otherwise, the element can be used to render invisible an
1917 entire class of fields that start with the same prefix. If you think a
1918 header field should be generally ignored, report a bug (@pxref{Bug
1919 Reports}).
1920
1921 @cindex @samp{Face:} header field
1922 @cindex @samp{X-Face:} header field
1923 @cindex @samp{X-Image-URL:} header field
1924 @cindex header field, @samp{Face:}
1925 @cindex header field, @samp{X-Face:}
1926 @cindex header field, @samp{X-Image-URL:}
1927 @vindex mh-show-use-xface-flag
1928
1929 MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
1930 @samp{X-Image-URL:} header fields. If any of these fields occur in the
1931 header of your message, the sender's face will appear in the
1932 @samp{From:} header field. If more than one of these fields appear,
1933 then the first field found in the order @samp{Face:}, @samp{X-Face:},
1934 and @samp{X-Image-URL:} will be used. The option
1935 @code{mh-show-use-xface-flag} is used to turn this feature on and off.
1936 This feature will be turned on by default if your system supports it.
1937
1938 The first header field used, if present, is the Gnus-specific
1939 @samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
1940 Emacs 21 and XEmacs. For more information, see
1941 @uref{http://quimby.gnus.org/circus/face/}.}.
1942
1943 @cindex @command{uncompface}
1944 @cindex Emacs, packages, x-face
1945 @cindex Unix commands, @command{uncompface}
1946 @cindex x-face package
1947 @vindex mh-show-xface
1948
1949 Next is the traditional @samp{X-Face:} header field@footnote{The
1950 display of this field requires the
1951 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
1952 @command{uncompface} program}. Recent versions of XEmacs have internal
1953 support for @samp{X-Face:} images. If your version of XEmacs does not,
1954 then you'll need both @command{uncompface} and the
1955 @uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
1956 renders the foreground and background of the image using the
1957 associated attributes of the face @code{mh-show-xface}.
1958
1959 @cindex @command{convert}
1960 @cindex @command{wget}
1961 @cindex ImageMagick
1962 @cindex Unix commands, @command{convert}
1963 @cindex Unix commands, @command{wget}
1964 @vindex mh-fetch-x-image-url
1965
1966 Finally, MH-E will display images referenced by the
1967 @samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
1968 @samp{X-Face:} fields are present@footnote{The display of the images
1969 requires the @uref{http://www.gnu.org/software/wget/wget.html,
1970 @command{wget} program} to fetch the image and the @command{convert}
1971 program from the @uref{http://www.imagemagick.org/, ImageMagick
1972 suite}.}. Of the three header fields this is the most efficient in
1973 terms of network usage since the image doesn't need to be transmitted
1974 with every single mail. The option @code{mh-fetch-x-image-url}
1975 controls the fetching of the @samp{X-Image-URL:} header field image
1976 with the following values:
1977
1978 @table @samp
1979 @item Ask Before Fetching
1980 You are prompted before the image is fetched. MH-E will remember your
1981 reply and will either use the already fetched image the next time the
1982 same URL is encountered or silently skip it if you didn't fetch it the
1983 first time. This is a good setting.
1984 @c -------------------------
1985 @item Never Fetch
1986 Images are never fetched and only displayed if they are already
1987 present in the cache. This is the default.
1988 @end table
1989
1990 There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
1991 of service) reasons. For example, fetching a URL can tip off a spammer
1992 that you've read his email (which is why you shouldn't blindly answer
1993 yes if you've set this option to @samp{Ask Before Fetching}). Someone
1994 may also flood your network and fill your disk drive by sending a
1995 torrent of messages, each specifying a unique URL to a very large
1996 file.
1997
1998 @cindex @file{.mhe-x-image-cache}
1999 @cindex files, @file{.mhe-x-image-cache}
2000
2001 The cache of images is found in the directory
2002 @file{.mhe-x-image-cache} within your MH directory. You can add your
2003 own face to the @samp{From:} field too. @xref{Picture}.
2004
2005 @cindex @command{mhl}
2006 @cindex MH commands, @command{mhl}
2007 @vindex mh-mhl-format-file
2008
2009 Normally MH-E takes care of displaying messages itself (rather than
2010 calling an MH program to do the work). If you'd rather have
2011 @command{mhl} display the message (within MH-E), change the option
2012 @code{mh-mhl-format-file} from its default value of @samp{Use Default
2013 mhl Format (Printing Only)}. You can set this option to @samp{Use
2014 Default mhl Format} to get the same output as you would get if you ran
2015 @command{mhl} from the shell. If you have a format file that you want
2016 MH-E to use, you can set this option to @samp{Specify an mhl Format
2017 File} and enter the name of your format file (@command{mhl}(1) or
2018 section @uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in
2019 the MH book tells you how to write one). Your format file should
2020 specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2021 parse the header. Note that @command{mhl} is always used for printing
2022 and forwarding; in this case, the value of @code{mh-mhl-format-file}
2023 is consulted if you have specified a format file.
2024
2025 @vindex mh-highlight-citation-style
2026 @cindex citations, highlighting
2027 @cindex highlighting citations
2028
2029 If the sender of the message has cited other messages in his message,
2030 then MH-E will highlight these citations to emphasize the sender's
2031 actual response. The option @code{mh-highlight-citation-style} can be
2032 customized to change the highlighting style. The @samp{Multicolor}
2033 method uses a different color for each indentation while the
2034 @samp{Monotone} method highlights all citations in red. To disable
2035 highlighting of citations entirely, choose @samp{None}.
2036
2037 @cindex URLs, highlighting
2038 @cindex email addresses, highlighting
2039 @cindex highlighting URLs
2040 @cindex highlighting email addresses
2041 @cindex links, following
2042 @findex goto-address-at-point
2043 @kindex C-c @key{RET}
2044 @kindex Mouse-2
2045 @vindex goto-address-highlight-p
2046
2047 Email addresses and URLs in the message are highlighted if the option
2048 @code{goto-address-highlight-p} is on, which it is by default. To view
2049 the web page for a highlighted URL or to send a message using a
2050 highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}.
2051 See @ref{Sending Mail}, to see how to configure Emacs to send the
2052 message using MH-E.
2053
2054 @cindex boldface, showing
2055 @cindex emphasis
2056 @cindex italics, showing
2057 @cindex smileys
2058 @cindex typesetting
2059 @cindex underline, showing
2060 @vindex gnus-emphasis-alist
2061 @vindex mh-decode-mime-flag
2062 @vindex mh-graphical-emphasis-flag
2063 @vindex mh-graphical-smileys-flag
2064
2065 It is a long standing custom to inject body language using a
2066 cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2067 render these as graphical widgets if the option
2068 @code{mh-graphical-smileys-flag} is turned on, which it is by default.
2069 Smileys include patterns such as :-) and ;-). Similarly, a few
2070 typesetting features are indicated in ASCII text with certain
2071 characters. If your terminal supports it, MH-E can render these
2072 typesetting directives naturally if the option
2073 @code{mh-graphical-emphasis-flag} is turned on, which it is by
2074 default. For example, _underline_ will be
2075 @ifhtml
2076 @html
2077 <u>underlined</u>,
2078 @end html
2079 @end ifhtml
2080 @ifnothtml
2081 underlined,
2082 @end ifnothtml
2083 *bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2084 and so on. See the option @code{gnus-emphasis-alist} for the whole
2085 list. Both of these options are disabled if the option
2086 @code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2087
2088 @cindex signature separator
2089 @cindex vCard
2090 @vindex mh-show-signature
2091
2092 MH-E normally renders signatures and vCards in italics so that the
2093 body of the message stands out more. MH-E depends on the presence of
2094 the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2095 customize the face @code{mh-show-signature} so the appearance of the
2096 signature block is more to your liking.
2097
2098 @vindex mh-show-hook
2099 @vindex mh-show-mode-hook
2100
2101 Two hooks can be used to control how messages are displayed. The first
2102 hook, @code{mh-show-mode-hook}, is called early on in the process of
2103 the message display. It is usually used to perform some action on the
2104 message's content. The second hook, @code{mh-show-hook}, is the last
2105 thing called after messages are displayed. It's used to affect the
2106 behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2107 early.
2108
2109 @vindex mh-show-buffer-mode-line-buffer-id
2110 @cindex MH-Show mode
2111 @cindex modes, MH-Show
2112
2113 For those who like to modify their mode lines, use
2114 @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2115 the MH-Show buffers. Place the two escape strings @samp{%s} and
2116 @samp{%d}, which will display the folder name and the message number,
2117 respectively, somewhere in the string in that order. The default value
2118 of @code{"@{show-%s@} %d"} yields a mode line of
2119
2120 @smallexample
2121 -----@{show-+inbox@} 4 (MH-Show)--Bot--------------------------------
2122 @end smallexample
2123
2124 @node Viewing Attachments, HTML, Viewing, Reading Mail
2125 @section Viewing Attachments
2126
2127 @cindex @command{mhshow}
2128 @cindex @command{show}
2129 @cindex MH commands, @command{mhshow}
2130 @cindex MH commands, @command{show}
2131 @cindex MIME
2132 @cindex attachments
2133 @cindex body parts
2134 @cindex multimedia mail
2135
2136 MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2137 Mail Extensions) messages which are simply messages with additional
2138 @dfn{body parts} or @dfn{attachments}. You can use the MH commands
2139 @command{show}@footnote{See the section
2140 @uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
2141 prev} in the MH book.} or @command{mhshow}@footnote{See the section
2142 @uref{@value{MH-BOOK-HOME}/usimim.htm#ReMIMa, Reading MIME Mail} in
2143 the MH book.} from the shell to read @sc{mime} messages@footnote{You
2144 can call them directly from Emacs if you're running the X Window
2145 System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2146 leave out the @samp{xterm -e} if you use @command{mhlist} or
2147 @command{mhstore}.}.
2148
2149 @cindex Emacs, packages, mm-decode
2150 @cindex mm-decode package
2151 @findex mh-toggle-mh-decode-mime-flag
2152 @kindex ; (semicolon)
2153 @vindex mh-decode-mime-flag
2154
2155 MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2156 package is present. If so, the option @code{mh-decode-mime-flag} will
2157 be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2158 or attachments. There isn't much point in turning off the option
2159 @code{mh-decode-mime-flag}; however, you can inspect it if it appears
2160 that the body parts are not being interpreted correctly or toggle it
2161 with the command @kbd{;} (semicolon;
2162 @code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2163 option also controls the display of quoted-printable messages and
2164 other graphical widgets. @xref{Viewing}.
2165
2166 @cindex buttons
2167 @kindex Mouse-1
2168 @kindex Mouse-2
2169 @kindex @key{RET}
2170 @findex mh-press-button
2171 @findex mh-next-button
2172 @findex mh-prev-button
2173 @kindex K @key{TAB}
2174 @kindex K S-@key{TAB}
2175
2176 Attachments in MH-E are indicated by buttons like this:
2177
2178 @example
2179 [1. image/jpeg; foo.jpg]...
2180 @end example
2181
2182 To view the contents of the button, use either @kbd{Mouse-1} or
2183 @kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2184 the cursor is over the button. This command is a toggle so if you use
2185 it again on the same attachment, it is hidden. If Emacs does not know
2186 how to display the attachment, then Emacs offers to save the
2187 attachment in a file. To move the cursor to the next button, use the
2188 command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2189 buffer is reached then the search wraps over to the start of the
2190 buffer. To move the cursor to the previous button, use the command
2191 @kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2192 buffer is reached then the search wraps over to the end of the buffer.
2193
2194 @cindex attachments, viewing
2195 @cindex viewing attachments
2196 @findex mh-folder-toggle-mime-part
2197 @kindex K v
2198
2199 Another way to view the contents of a button is to use the command
2200 @kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2201 (or hides) the attachment associated with the button under the cursor.
2202 If the cursor is not located over a button, then the cursor first
2203 moves to the next button, wrapping to the beginning of the message if
2204 necessary. This command has the advantage over the previous commands
2205 of working from the MH-Folder buffer. You can also provide a numeric
2206 prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2207 with that number. If Emacs does not know how to display the
2208 attachment, then Emacs offers to save the attachment in a file.
2209
2210 @cindex @file{/etc/mailcap}
2211 @cindex files, @file{/etc/mailcap}
2212 @findex mailcap-mime-info
2213 @findex mh-display-with-external-viewer
2214 @kindex K e
2215
2216 If Emacs does not know how to view an attachment, you could save it
2217 into a file and then run some program to open it. It is easier,
2218 however, to launch the program directly from MH-E with the command
2219 @kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2220 likely use this to view spreadsheets and documents, it is also useful
2221 to use your browser to view HTML attachments with higher fidelity than
2222 what Emacs can provide. This command displays the attachment
2223 associated with the button under the cursor. If the cursor is not
2224 located over a button, then the cursor first moves to the next button,
2225 wrapping to the beginning of the message if necessary. You can provide
2226 a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2227 labeled with that number. This command tries to provide a reasonable
2228 default for the viewer by calling the Emacs function
2229 @code{mailcap-mime-info}. This function usually reads the file
2230 @file{/etc/mailcap}.
2231
2232 @cindex attachments, saving
2233 @cindex saving attachments
2234
2235 @findex mh-folder-save-mime-part
2236 @kindex K o
2237
2238 Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2239 attachments (the mnemonic is ``output''). This command saves the
2240 attachment associated with the button under the cursor. If the cursor
2241 is not located over a button, then the cursor first moves to the next
2242 button, wrapping to the beginning of the message if necessary. You can
2243 also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2244 attachment labeled with that number. This command prompts you for a
2245 filename and suggests a specific name if it is available.
2246
2247 @cindex @command{mhn}
2248 @cindex @command{mhstore}
2249 @cindex MH commands, @command{mhn}
2250 @cindex MH commands, @command{mhstore}
2251 @findex mh-mime-save-parts
2252 @kindex K a
2253 @vindex mh-mime-save-parts-default-directory
2254
2255 You can save all of the attachments at once with the command @kbd{K a}
2256 (@code{mh-mime-save-parts}). The attachments are saved in the
2257 directory specified by the option
2258 @code{mh-mime-save-parts-default-directory} unless you use a prefix
2259 argument (as in @kbd{C-u K a}) in which case you are prompted for the
2260 directory. These directories may be superseded by MH profile
2261 components, since this function calls on @command{mhstore}
2262 (@command{mhn}) to do the work.
2263
2264 The default value for the option
2265 @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2266 that you are always prompted for the directory in which to save the
2267 attachments. However, if you usually use the same directory within a
2268 session, then you can set this option to @samp{Prompt the First Time}
2269 to avoid the prompt each time. you can make this directory permanent
2270 by choosing @samp{Directory} and entering the directory's name.
2271
2272 @cindex attachments, inline
2273 @cindex inline attachments
2274 @findex mh-toggle-mime-buttons
2275 @kindex K t
2276 @vindex mh-display-buttons-for-inline-parts-flag
2277
2278 The sender can request that attachments should be viewed inline so
2279 that they do not really appear like an attachment at all to the
2280 reader. Most of the time, this is desirable, so by default MH-E
2281 suppresses the buttons for inline attachments. On the other hand, you
2282 may receive code or HTML which the sender has added to his message as
2283 inline attachments so that you can read them in MH-E. In this case, it
2284 is useful to see the buttons so that you know you don't have to cut
2285 and paste the code into a file; you can simply save the attachment. If
2286 you want to make the buttons visible for inline attachments, you can
2287 use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2288 the visibility of these buttons. You can turn on these buttons
2289 permanently by turning on the option
2290 @code{mh-display-buttons-for-inline-parts-flag}.
2291
2292 MH-E cannot display all attachments inline however. It can display
2293 text (including @sc{html}) and images.
2294
2295 @cindex @samp{Content-Disposition:} header field
2296 @cindex header field, @samp{Content-Disposition:}
2297 @cindex inline images
2298 @vindex mh-max-inline-image-height
2299 @vindex mh-max-inline-image-width
2300
2301 Some older mail programs do not insert the needed
2302 plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2303 header field.} to tell MH-E whether to display the attachments inline
2304 or not. If this is the case, MH-E will display these images inline if
2305 they are smaller than the window. However, you might want to allow
2306 larger images to be displayed inline. To do this, you can change the
2307 options @code{mh-max-inline-image-width} and
2308 @code{mh-max-inline-image-height} from their default value of zero to
2309 a large number. The size of your screen is a good choice for these
2310 numbers.
2311
2312 @cindex alternatives
2313 @cindex attachments, alternatives
2314 @vindex mh-display-buttons-for-alternatives-flag
2315
2316 Sometimes, a mail program will produce multiple alternatives of an
2317 attachment in increasing degree of faithfulness to the original
2318 content. By default, only the preferred alternative is displayed. If
2319 the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2320 the preferred part is shown inline and buttons are shown for each of
2321 the other alternatives.
2322
2323 @kindex K i
2324 @findex mh-folder-inline-mime-part
2325
2326 You can view the raw contents of an attachment with the command @kbd{K
2327 i} (@code{mh-folder-inline-mime-part}). This command displays (or
2328 hides) the contents of the attachment associated with the button under
2329 the cursor verbatim. If the cursor is not located over a button, then
2330 the cursor first moves to the next button, wrapping to the beginning
2331 of the message if necessary. You can also provide a numeric prefix
2332 argument (as in @kbd{4 K i}) to view the attachment labeled with that
2333 number.
2334
2335 For additional information on buttons, see
2336 @ifinfo
2337 @ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2338 @end ifinfo
2339 @ifnotinfo
2340 the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2341 Article Buttons} and
2342 @uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2343 in the @cite{The Gnus Manual}.
2344 @end ifnotinfo
2345
2346 @node HTML, Digests, Viewing Attachments, Reading Mail
2347 @section HTML
2348
2349 @cindex HTML
2350 @cindex Gnus
2351 @vindex mm-text-html-renderer
2352
2353 MH-E can display messages that have been sent in HTML@footnote{This
2354 feature depends on a version of Gnus that is at least 5.10.}. The
2355 content of the message will appear in the MH-Show buffer as you would
2356 expect if the entire message is HTML, or there is an inline HTML body
2357 part. However, if there is an HTML body part that is an attachment,
2358 then you'll see a button like this:
2359
2360 @example
2361 [1. text/html; foo.html]...
2362 @end example
2363
2364 To see how to read the contents of this body part, see @ref{Viewing
2365 Attachments}.
2366
2367 The browser that MH-E uses is determined by the option
2368 @code{mm-text-html-renderer}. The default setting is set automatically
2369 based upon the presence of a known browser on your system. If you wish
2370 to use a different browser, then set this option accordingly. See the
2371 documentation for the browser you use for additional information on
2372 how to use it. In particular, find and disable the option to render
2373 images as this can tip off spammers that the email address they have
2374 used is valid.
2375
2376 If you're confused about which @code{mm-text-html-renderer} to use,
2377 here's a brief description of each, sorted by popularity, that
2378 includes the results of a quick poll of MH-E users from 2005-12-23.
2379
2380 @table @asis
2381
2382 @item @samp{w3m} 7
2383 The @samp{w3m} browser requires an external program. It's quick,
2384 produces pretty nice output, and best of all, it's the only browser
2385 that highlights links. These can be clicked with @kbd{Mouse-2} to view
2386 the content of the link in @samp{w3m} or with @kbd{S-Mouse-2} to view
2387 the content of the link in an external browser. The @samp{w3m} browser
2388 handles tables well and actually respects the table's width parameter
2389 (which can cause text to wrap if the author didn't anticipate that the
2390 page would be viewed in Emacs).
2391 @c -------------------------
2392 @item @samp{w3m-standalone} 3
2393 This browser, along with @samp{nil} for the external browser, are the
2394 only choices that work without having to download a separate lisp
2395 package or external program. This browser is quick, but does not show
2396 links. It handles simple tables but some tables get rendered much
2397 wider than the Emacs frame. This browser was the only one not to
2398 handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
2399 render @samp{&reg;}.
2400 @c -------------------------
2401 @item @samp{links} 1
2402 The @samp{links} browser requires an external program. It's quick, and
2403 produces nicer output than @samp{lynx} on single column mails in
2404 tables. However, it doesn't show links and it doesn't do as nice a job
2405 on multi-column tables as some lines wrap. At least it fits in 80
2406 columns and thus seems better than @samp{w3} and
2407 @samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
2408 @c -------------------------
2409 @item @samp{lynx} 1
2410 The @samp{lynx} browser requires an external program. It's quick and
2411 produces pretty decent output but it doesn't show links. It doesn't
2412 seem to do multi-column tables which makes output much cleaner. It
2413 centers the output and wraps long lines more than most. Handles
2414 @samp{&reg;}.
2415 @c -------------------------
2416 @item @samp{nil} 1
2417 This choice obviously requires an external browser. Like
2418 @samp{w3m-standalone}, it works out of the box. With this setting,
2419 HTML messages have a button for the body part which you can view with
2420 @kbd{K v} (@code{mh-folder-toggle-mime-part}).
2421 @c -------------------------
2422 @item @samp{w3} 0
2423 This choice does not require an external program as all of the
2424 rendering is done in lisp. You do need to get the package separately.
2425 This browser is @strong{slow}, and doesn't appear to have been updated
2426 since 2001 and the author hasn't responded to my emails. It displays
2427 unknown tags instead of hiding them, so you get to see all the
2428 Microsoft crap in certain messages. Tends to make multi-column tables
2429 wider than even a full-screen Emacs can handle. Like @samp{w3m}, you
2430 can follow links, but you have to find them first as they are not
2431 highlighted. Performs well on single-column tables and handles escapes
2432 such as @samp{&reg;}.
2433 @c -------------------------
2434 @item @samp{html2text} 0
2435 The @samp{html2text} browser requires an external program. I noticed
2436 that it can do some nasty things with simple HTML mails (like filling
2437 the entire message as if it were one paragraph, including signature).
2438 On another message, it displayed half of the HTML tags for some
2439 reason.
2440 @end table
2441
2442 For a couple more sources of information about
2443 @code{mm-text-html-renderer},
2444 @ifinfo
2445 @xref{Display Customization,,,emacs-mime}, and the documentation for
2446 the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},).
2447 @end ifinfo
2448 @ifnotinfo
2449 see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2450 Display Customization} in the @cite{The Emacs MIME Manual} and the the
2451 documentation for the Gnus command @kbd{W h} (see section
2452 @uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the
2453 @cite{The Gnus Manual}).
2454 @end ifnotinfo
2455
2456 @node Digests, Reading PGP, HTML, Reading Mail
2457 @section Digests
2458
2459 @cindex digests
2460 @findex mh-page-digest
2461 @findex mh-page-digest-backwards
2462 @kindex @key{BS}
2463 @kindex @key{SPC}
2464 @kindex D @key{BS}
2465 @kindex D @key{SPC}
2466
2467 A digest is a message that contains other messages. Special MH-E
2468 commands let you read digests conveniently. You can use @key{SPC} and
2469 @key{BS} to page through the digest as if it were a normal message,
2470 but if you wish to skip to the next message in the digest, use
2471 @kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2472 use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2473
2474 @cindex @command{burst}
2475 @cindex MH commands, @command{burst}
2476 @cindex MH-Folder Show mode
2477 @cindex modes, MH-Folder Show
2478 @findex mh-burst-digest
2479 @kindex D b
2480 @kindex d
2481 @kindex t
2482
2483 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2484 command uses the MH command @command{burst}@footnote{See the section
2485 @uref{@value{MH-BOOK-HOME}/burdig.htm, Bursting Messages} in the MH
2486 book.} to break out each message in the digest into its own message.
2487 Using this command, you can quickly delete unwanted messages, like
2488 this: Once the digest is split up, toggle out of MH-Folder Show mode
2489 with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2490 and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2491 to quickly delete messages that you don't want to read (based on the
2492 @samp{Subject:} header field). You can also burst the digest to reply
2493 directly to the people who posted the messages in the digest. One
2494 problem you may encounter is that the @samp{From:} header fields are
2495 preceded with a @samp{>} so that your reply can't create the
2496 @samp{To:} field correctly. In this case, you must correct the
2497 @samp{To:} field yourself. This is described later (@pxref{Editing
2498 Drafts}).
2499
2500 @node Reading PGP, Printing, Digests, Reading Mail
2501 @section Signed and Encrypted Messages
2502
2503 @cindex GPG
2504 @cindex GnuPG
2505 @cindex Gnus
2506 @cindex OpenPGP
2507 @cindex PGP
2508 @cindex RFC 3156
2509 @cindex encrypted messages
2510 @cindex security
2511 @cindex signed messages
2512
2513 You can read encrypted or signed PGP or GPG messages with
2514 MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2515 @cite{MIME Security with OpenPGP} is documented in
2516 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2517 MH-E can also decrypt old-style PGP messages that are not in MIME
2518 format.}. This section assumes that you already have a good
2519 understanding of GPG and have set up your keys appropriately.
2520
2521 If someone sends you a signed message, here is what you'll see:
2522
2523 @smallexample
2524 @group
2525 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2526 This is a signed message.
2527
2528 [[End of PGP Signed Part]]
2529 @end group
2530 @end smallexample
2531
2532 @cindex keychain
2533 @cindex key server
2534 @cindex signed messages
2535
2536 If the key for the given signature is not in your keychain, you'll be
2537 given the opportunity to fetch the key from a key server and verify
2538 the key. If the message is really large, the verification process can
2539 take a long time. You can press @kbd{C-g} at any time to
2540 cancel@footnote{Unfortunately in the current version, the validation
2541 process doesn't display a message so it appears that MH-E has hung. We
2542 hope that this will be fixed in the future.}.
2543
2544 If the signature doesn't check out, you might see something like this:
2545
2546 @smallexample
2547 @group
2548 [[PGP Signed Part:Failed]]
2549 This is a signed message.
2550 This is garbage added after the signature was made.
2551
2552 [[End of PGP Signed Part]]
2553 @end group
2554 @end smallexample
2555
2556 @cindex decrypting messages
2557
2558 If someone sends you an encrypted message, MH-E will ask for your
2559 passphrase to decrypt the message. You should see something like this:
2560
2561 @smallexample
2562 @group
2563 [[PGP Encrypted Part:OK]]
2564
2565 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2566 This is the secret message.
2567
2568 [[End of PGP Signed Part]]
2569
2570 [[End of PGP Encrypted Part]]
2571 @end group
2572 @end smallexample
2573
2574 If there is a problem decrypting the message, the button will say:
2575
2576 @smallexample
2577 [[PGP Encrypted Part:Failed]]
2578 @end smallexample
2579
2580 You can read the contents of this button using the methods described in
2581 @ref{Viewing Attachments}. If the message were corrupted, you'd see
2582 this:
2583
2584 @smallexample
2585 [[PGP Encrypted Part:Failed]
2586 Invalid base64 data]
2587 @end smallexample
2588
2589 If your passphrase were incorrect, you'd see something like this:
2590
2591 @smallexample
2592 [GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2593 [GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2594 [GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2595 [GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2596 gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2597 "Bill Wohler <wohler@@stop.mail-abuse.org>"
2598 gpg: public key decryption failed: bad passphrase
2599 [GNUPG:] BEGIN_DECRYPTION
2600 [GNUPG:] DECRYPTION_FAILED
2601 gpg: decryption failed: secret key not available
2602 [GNUPG:] END_DECRYPTION
2603
2604 gpg exited abnormally: '2'
2605 @end smallexample
2606
2607 @vindex mh-show-pgg-bad
2608 @vindex mh-show-pgg-good
2609 @vindex mh-show-pgg-unknown
2610
2611 The appearance of the buttons is controlled by the faces
2612 @code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2613 @code{mh-show-pgg-unknown} depending on the validity of the signature.
2614 The latter is used whether the signature is unknown or untrusted.
2615
2616 @cindex @samp{pgg} customization group
2617 @cindex PGG
2618 @cindex customization group, @samp{pgg}
2619
2620 The @samp{pgg} customization group may have some settings which may
2621 interest you.
2622 @iftex
2623 See @cite{The PGG Manual}.
2624 @end iftex
2625 @ifinfo
2626 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2627 @end ifinfo
2628 @ifhtml
2629 See
2630 @uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
2631 @cite{The PGG Manual}}.
2632 @end ifhtml
2633
2634 @node Printing, Files and Pipes, Reading PGP, Reading Mail
2635 @section Printing Your Mail
2636
2637 @cindex printing
2638 @findex mh-ps-print-msg
2639 @findex mh-ps-print-msg-file
2640 @kindex P f
2641 @kindex P p
2642
2643 To print messages in MH-E, use the command @kbd{P p}
2644 (@code{mh-ps-print-msg}). You can print all the messages in a range
2645 (as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2646 @pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2647 (@code{mh-ps-print-msg-file}). This command will print inline text
2648 attachments but will not decrypt messages. However, when a message is
2649 displayed in an MH-Show buffer, then that buffer is used verbatim for
2650 printing with the caveat that only text attachments, if opened inline,
2651 are printed. Therefore, encrypted messages can be printed by showing
2652 and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2653 use the options @code{mh-lpr-command-format} or
2654 @code{mh-print-background-flag}, described below.
2655
2656 @findex mh-ps-print-toggle-color
2657 @kindex P C
2658 @vindex ps-print-color-p
2659
2660 Colors are emulated on black-and-white printers with shades of gray.
2661 This might produce illegible output, even if your screen colors only
2662 use shades of gray. If this is the case, try using the command @kbd{P
2663 C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2664 color, and a black and white representation of the colors and see
2665 which works best. You change this setting permanently by customizing
2666 the option @code{ps-print-color-p}.
2667
2668 @findex mh-ps-print-toggle-faces
2669 @kindex P F
2670
2671 Another related function is the command @kbd{P F}
2672 (@code{mh-ps-print-toggle-faces}). This command toggles between using
2673 faces and not. When faces are enabled, the printed message will look
2674 very similar to the message in the MH-Show buffer.
2675
2676 @cindex ps-print package
2677 @cindex Emacs, packages, ps-print
2678
2679 MH-E uses the @samp{ps-print} package to do the printing, so you can
2680 customize the printing further by going to the @samp{ps-print}
2681 customization group.
2682
2683 @cindex @command{lpr}
2684 @cindex @command{mhl}
2685 @cindex MH commands, @command{mhl}
2686 @cindex Unix commands, @command{lpr}
2687 @findex mh-print-msg
2688 @kindex P l
2689
2690 An alternative to using the @samp{ps-print} package is the command
2691 @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2692 @i{l}pr). You can print all the messages in a range. The message is
2693 formatted with @command{mhl}@footnote{See the section
2694 @uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH
2695 book.} and printed with the @command{lpr} command.
2696
2697 @vindex mh-lpr-command-format
2698 @vindex mh-print-background-flag
2699
2700 The command @kbd{P l} uses two options. The option
2701 @code{mh-lpr-command-format} contains the Unix command line which
2702 performs the actual printing. The string can contain one escape,
2703 @samp{%s}, which is replaced by the name of the folder and the message
2704 number and is useful for print job names. The default setting is
2705 @code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2706 -P"} which produces a nice header and adds a bit of margin so the text
2707 fits within my printer's margins. Normally messages are printed in the
2708 foreground. If this is slow on your system, you may elect to turn on
2709 the option @code{mh-print-background-flag} to print in the background.
2710 If you do this, do not delete the message until it is printed or else
2711 the output may be truncated. These options are not used by the
2712 commands @kbd{P p} or @kbd{P f}.
2713
2714 @node Files and Pipes, Navigating, Printing, Reading Mail
2715 @section Files and Pipes
2716
2717 @cindex files
2718 @cindex pipes
2719
2720 @findex mh-refile-or-write-again
2721 @findex mh-write-msg-to-file
2722 @kindex !
2723 @kindex >
2724
2725 MH-E does offer a couple of commands that are not a part of MH@. The
2726 first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2727 a file. You are prompted for the filename. If the file already exists,
2728 the message is appended to it. You can also write the message to the
2729 file without the header by specifying a prefix argument (such as
2730 @kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2731 can be made with the command @kbd{!}
2732 (@code{mh-refile-or-write-again}).
2733
2734 @findex mh-pipe-msg
2735 @kindex |
2736
2737 You can also pipe the message through a Unix shell command with the
2738 command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2739 command through which you wish to run your message. If you give a
2740 prefix argument to this command, the message header is included in the
2741 text passed to the command (the contrived example @kbd{C-u | lpr}
2742 would be done with the @kbd{l} command instead).
2743
2744 @cindex @command{shar}
2745 @cindex @command{uuencode}
2746 @cindex Unix commands, @command{shar}
2747 @cindex Unix commands, @command{uuencode}
2748 @findex mh-store-msg
2749 @kindex X s
2750 @vindex mh-store-default-directory
2751
2752 If the message is a shell archive @command{shar} or has been run
2753 through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2754 extract the body of the message. The default directory for extraction
2755 is the current directory; however, you have a chance to specify a
2756 different extraction directory. The next time you use this command,
2757 the default directory is the last directory you used. If you would
2758 like to change the initial default directory, customize the option
2759 @code{mh-store-default-directory}, change the value from
2760 @samp{Current} to @samp{Directory}, and then enter the name of the
2761 directory for storing the content of these messages.
2762
2763 @findex mh-store-buffer
2764
2765 By the way, @kbd{X s} calls the Emacs Lisp function
2766 @code{mh-store-buffer}. I mention this because you can use it directly
2767 if you're editing a buffer that contains a file that has been run
2768 through @command{uuencode} or @command{shar}. For example, you can
2769 extract the contents of the current buffer in your home directory by
2770 typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
2771
2772 @node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
2773 @section Navigating
2774
2775 @cindex moving between messages
2776 @cindex navigation
2777 @findex mh-first-msg
2778 @findex mh-goto-msg
2779 @findex mh-last-msg
2780 @findex mh-next-undeleted-msg
2781 @findex mh-next-unread-msg
2782 @findex mh-previous-undeleted-msg
2783 @findex mh-previous-unread-msg
2784 @kindex M-<
2785 @kindex M->
2786 @kindex M-n
2787 @kindex M-p
2788 @kindex g
2789 @kindex n
2790 @kindex p
2791
2792 To move on to the next message, use the command @kbd{n}
2793 (@code{mh-next-undeleted-msg}); use @kbd{p}
2794 (@code{mh-previous-undeleted-msg}) to read the previous message. To
2795 move to the next unread message, use @kbd{M-n}
2796 (@code{mh-next-unread-msg}); use @kbd{M-p}
2797 (@code{mh-previous-unread-msg}) to move to the previous unread
2798 message. These commands can be given a prefix argument to specify how
2799 many messages to skip (for example, @kbd{5 n}). You can also move to a
2800 specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
2801 message number either before or after typing @kbd{g}. In the latter
2802 case, Emacs prompts you. Finally, you can go to the first or last
2803 message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
2804 (@code{mh-last-msg}) respectively.
2805
2806 @cindex MH-Folder mode
2807 @cindex modes, MH-Folder
2808 @findex next-line
2809 @findex previous-line
2810 @kindex C-n
2811 @kindex C-p
2812
2813 You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
2814 and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
2815 the MH-Folder window. These commands can be used in conjunction with
2816 @key{RET} to look at deleted or refiled messages.
2817
2818 @cindex deleting messages
2819 @findex mh-delete-msg
2820 @kindex d
2821
2822 To mark a message for deletion, use the command @kbd{d}
2823 (@code{mh-delete-msg}). A @samp{D} is placed by the message in the
2824 scan window, and the next undeleted message is displayed. If the
2825 previous command had been @kbd{p}, then the next message displayed is
2826 the first undeleted message previous to the message just deleted. Use
2827 @kbd{n} to force subsequent @kbd{d} commands to move forward to the
2828 next undeleted message after deleting the message under the cursor.
2829 You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
2830 frombob @key{RET}}, @pxref{Ranges}).
2831
2832 @findex mh-delete-msg-no-motion
2833 @kindex C-d
2834
2835 The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
2836 message (or messages in range) for deletion but leaves the cursor at
2837 the current message in case you wish to perform other operations on
2838 the message.
2839
2840 @findex mh-delete-subject
2841 @findex mh-delete-subject-or-thread
2842 @kindex k
2843
2844 And to delete more messages faster, you can use @kbd{k}
2845 (@code{mh-delete-subject-or-thread}) to delete all the messages with
2846 the same subject as the current message. This command puts these
2847 messages in a sequence named @samp{subject}. You can undo this action
2848 by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
2849 specifying the @samp{subject} sequence. However, if the buffer is
2850 displaying a threaded view of the folder then @kbd{k} behaves like
2851 @kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
2852
2853 @findex mh-execute-commands
2854 @kindex x
2855
2856 However you mark a message for deletion, the command @kbd{x}
2857 (@code{mh-execute-commands}) actually carries out the deletion
2858 (@pxref{Folders}).
2859
2860 @vindex mh-delete-msg-hook
2861
2862 The hook @code{mh-delete-msg-hook} is called after you mark a message
2863 for deletion. For example, a past maintainer of MH-E used this once
2864 when he kept statistics on his mail usage.
2865
2866 @node Miscellaneous Commands and Options, , Navigating, Reading Mail
2867 @section Miscellaneous Commands and Options
2868
2869 This section contains a few more miscellaneous commands and options.
2870
2871 @cindex editing message
2872 @findex mh-modify
2873 @kindex M
2874
2875 There are times when you need to edit a message. For example, you may
2876 need to fix a broken Content-Type header field. You can do this with
2877 the command @kbd{M} (@code{mh-modify}). It displays the raw message in
2878 an editable buffer. When you are done editing, save and kill the
2879 buffer as you would any other.
2880
2881 @vindex mh-do-not-confirm-flag
2882
2883 Commands such as @code{mh-pack-folder} prompt to confirm whether to
2884 process outstanding moves and deletes or not before continuing.
2885 Turning on the option @code{mh-do-not-confirm-flag} means that these
2886 actions will be performed---which is usually desired but cannot be
2887 retracted---without question@footnote{In previous versions of MH-E,
2888 this option suppressed the confirmation in @code{mh-kill-folder}.
2889 Since this kept most users from setting this option,
2890 @code{mh-kill-folder} was modified in version 6.0 to always ask for
2891 confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
2892 @xref{Folders}.}.
2893
2894 @cindex MH-Folder mode
2895 @cindex modes, MH-Folder
2896 @vindex mh-summary-height
2897
2898 The option @code{mh-summary-height} controls the number of scan lines
2899 displayed in the MH-Folder window, including the mode line. The
2900 default value of this option is @samp{Automatic} which means that the
2901 MH-Folder buffer will maintain the same proportional size if the frame
2902 is resized. If you'd prefer a fixed height, then choose the
2903 @samp{Fixed Size} option and enter the number of lines you'd like to
2904 see.
2905
2906 @vindex mh-bury-show-buffer-flag
2907
2908 Normally the buffer for displaying messages is buried at the bottom at
2909 the buffer stack. You may wish to disable this feature by turning off
2910 the option @code{mh-bury-show-buffer-flag}. One advantage of not
2911 burying the show buffer is that one can delete the show buffer more
2912 easily in an electric buffer list because of its proximity to its
2913 associated MH-Folder buffer. Try running @kbd{M-x
2914 electric-buffer-list} to see what I mean.
2915
2916 @cindex @file{.emacs}
2917 @cindex files, @file{.emacs}
2918 @cindex reading mail
2919
2920 Before we leave this section, I'll include a function that I use as a
2921 front end to MH-E@footnote{Stephen Gildea's favorite binding is
2922 @kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
2923 working window configuration, which may be quite involved---windows
2924 filled with source, compilation output, man pages, and other
2925 documentation---and your MH-E window configuration. Like the rest of
2926 the customization described in this section, simply add the following
2927 code to @file{~/.emacs}.
2928
2929 @iftex
2930 @filbreak
2931 @end iftex
2932
2933 @findex mh-rmail, example
2934
2935 @smalllisp
2936 @group
2937 (defvar my-mh-screen-saved nil
2938 "Set to non-@code{nil} when MH-E window configuration shown.")
2939 (defvar my-normal-screen nil "Normal window configuration.")
2940 (defvar my-mh-screen nil "MH-E window configuration.")
2941
2942 (defun my-mh-rmail (&optional arg)
2943 "Toggle between MH-E and normal screen configurations.
2944 With non-@code{nil} or prefix argument, @i{inc} mailbox as well
2945 when going into mail."
2946 (interactive "P") ; @r{user callable function, P=prefix arg}
2947 (setq my-mh-screen-saved ; @r{save state}
2948 (cond
2949 ;; @r{Bring up MH-E screen if arg or normal window configuration.}
2950 ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
2951 ((or arg (null my-mh-screen-saved))
2952 (setq my-normal-screen (current-window-configuration))
2953 (if (or arg (null (get-buffer "+inbox")))
2954 (mh-rmail)
2955 (set-window-configuration my-mh-screen))
2956 t) ; @r{set my-mh-screen-saved to @code{t}}
2957 ;; @r{Otherwise, save MH-E screen and restore normal screen.}
2958 (t
2959 (setq my-mh-screen (current-window-configuration))
2960 (set-window-configuration my-normal-screen)
2961 nil)))) ; @r{set my-mh-screen-saved to nil}
2962
2963 (global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x @key{RET}}
2964
2965 @i{Starting MH-E}
2966
2967 @end group
2968 @end smalllisp
2969
2970 If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
2971 @code{nil} (meaning a non-MH-E window configuration), the current
2972 window configuration is saved, either the @samp{+inbox} buffer is
2973 displayed or @code{mh-rmail} is run, and the MH-E window configuration
2974 is shown. Otherwise, the MH-E window configuration is saved and the
2975 original configuration is displayed.
2976
2977 @node Folders, Sending Mail, Reading Mail, Top
2978 @chapter Organizing Your Mail with Folders
2979
2980 @cindex folders
2981 @cindex using folders
2982
2983 This chapter discusses the things you can do with folders within MH-E.
2984 The commands in this chapter are also found in the @samp{Folder} and
2985 @samp{Message} menus.
2986
2987 @table @kbd
2988 @kindex ?
2989 @findex mh-help
2990 @item ?
2991 Display cheat sheet for the MH-E commands (@code{mh-help}).
2992 @c -------------------------
2993 @kindex !
2994 @findex mh-refile-or-write-again
2995 @item !
2996 Repeat last output command (@code{mh-refile-or-write-again}).
2997 @c -------------------------
2998 @cindex @samp{Message > Copy Message to Folder...} menu item
2999 @cindex menu item, @samp{Message > Copy Message to Folder...}
3000 @kindex c
3001 @findex mh-copy-msg
3002 @item c
3003 Copy range to folder (@code{mh-copy-msg}).
3004 @c -------------------------
3005 @kindex F ?
3006 @findex mh-prefix-help
3007 @item F ?
3008 Display cheat sheet for the commands of the current prefix in
3009 minibuffer (@code{mh-prefix-help}).
3010 @c -------------------------
3011 @kindex F '
3012 @findex mh-index-ticked-messages
3013 @item F '
3014 Display ticked messages (@code{mh-index-ticked-messages}).
3015 @c -------------------------
3016 @kindex F c
3017 @findex mh-catchup
3018 @item F c
3019 Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3020 @c -------------------------
3021 @kindex F k
3022 @findex mh-kill-folder
3023 @item F k
3024 Remove folder (@code{mh-kill-folder}).
3025 @c -------------------------
3026 @cindex @samp{Folder > List Folders} menu item
3027 @cindex menu item, @samp{Folder > List Folders}
3028 @kindex F l
3029 @findex mh-list-folders
3030 @item F l
3031 List all folders (@code{mh-list-folders}).
3032 @c -------------------------
3033 @cindex @samp{Folder > View New Messages} menu item
3034 @cindex menu item, @samp{Folder > View New Messages}
3035 @kindex F n
3036 @findex mh-index-new-messages
3037 @item F n
3038 Display unseen messages (@code{mh-index-new-messages}).
3039 @c -------------------------
3040 @cindex @samp{Folder > Pack Folder} menu item
3041 @cindex menu item, @samp{Folder > Pack Folder}
3042 @kindex F p
3043 @findex mh-pack-folder
3044 @item F p
3045 Pack folder (@code{mh-pack-folder}).
3046 @c -------------------------
3047 @kindex F q
3048 @findex mh-index-sequenced-messages
3049 @item F q
3050 Display messages in any sequence (@code{mh-index-sequenced-messages}).
3051 @c -------------------------
3052 @cindex @samp{Folder > Rescan Folder} menu item
3053 @cindex menu item, @samp{Folder > Rescan Folder}
3054 @kindex F r
3055 @findex mh-rescan-folder
3056 @item F r
3057 Rescan folder (@code{mh-rescan-folder}).
3058 @c -------------------------
3059 @cindex @samp{Folder > Search...} menu item
3060 @cindex menu item, @samp{Folder > Search...}
3061 @kindex F s
3062 @findex mh-search
3063 @item F s
3064 Search your MH mail (@code{mh-search}).
3065 @c -------------------------
3066 @cindex @samp{Folder > Sort Folder} menu item
3067 @cindex menu item, @samp{Folder > Sort Folder}
3068 @kindex F S
3069 @findex mh-sort-folder
3070 @item F S
3071 Sort folder (@code{mh-sort-folder}).
3072 @c -------------------------
3073 @kindex F u
3074 @findex mh-undo-folder
3075 @item F u
3076 Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3077 @c -------------------------
3078 @cindex @samp{Folder > Visit a Folder...} menu item
3079 @cindex menu item, @samp{Folder > Visit a Folder...}
3080 @kindex F v
3081 @findex mh-visit-folder
3082 @item F v
3083 Visit folder (@code{mh-visit-folder}).
3084 @c -------------------------
3085 @cindex @samp{Message > Refile Message} menu item
3086 @cindex menu item, @samp{Message > Refile Message}
3087 @kindex o
3088 @findex mh-refile-msg
3089 @item o
3090 Refile (output) range into folder (@code{mh-refile-msg}).
3091 @c -------------------------
3092 @cindex @samp{Folder > Quit MH-E} menu item
3093 @cindex menu item, @samp{Folder > Quit MH-E}
3094 @kindex q
3095 @findex mh-quit
3096 @item q
3097 Quit the current MH-E folder (@code{mh-quit}).
3098 @c -------------------------
3099 @cindex @samp{Folder > Toggle Show/Folder} menu item
3100 @cindex menu item, @samp{Folder > Toggle Show/Folder}
3101 @kindex t
3102 @findex mh-toggle-showing
3103 @item t
3104 Toggle between MH-Folder and MH-Folder Show modes
3105 (@code{mh-toggle-showing}).
3106 @c -------------------------
3107 @cindex @samp{Message > Undo Delete/Refile} menu item
3108 @cindex menu item, @samp{Message > Undo Delete/Refile}
3109 @kindex u
3110 @findex mh-undo
3111 @item u
3112 Undo pending deletes or refiles in range (@code{mh-undo}).
3113 @c -------------------------
3114 @cindex @samp{Message > Execute Delete/Refile} menu item
3115 @cindex menu item, @samp{Message > Execute Delete/Refile}
3116 @kindex x
3117 @findex mh-execute-commands
3118 @item x
3119 Process outstanding delete and refile requests
3120 (@code{mh-execute-commands}).
3121 @end table
3122
3123 @cindex @samp{mh-folder} customization group
3124 @cindex customization group, @samp{mh-folder}
3125
3126 The @samp{mh-folder} customization group is used to tune these
3127 commands.
3128
3129 @vtable @code
3130 @item mh-new-messages-folders
3131 Folders searched for the @samp{unseen} sequence (default:
3132 @code{Inbox}).
3133 @c -------------------------
3134 @item mh-ticked-messages-folders
3135 Folders searched for @code{mh-tick-seq} (default: @code{t}).
3136 @c -------------------------
3137 @item mh-large-folder
3138 The number of messages that indicates a large folder (default: 200).
3139 @c -------------------------
3140 @item mh-recenter-summary-flag
3141 On means to recenter the summary window (default: @samp{off}).
3142 @c -------------------------
3143 @item mh-recursive-folders-flag
3144 On means that commands which operate on folders do so recursively
3145 (default: @samp{off}).
3146 @c -------------------------
3147 @item mh-sortm-args
3148 Additional arguments for @command{sortm} (default: @code{nil}).
3149 @end vtable
3150
3151 The following hooks are available.
3152
3153 @vtable @code
3154 @item mh-after-commands-processed-hook
3155 Hook run by @kbd{x} after performing outstanding refile and delete
3156 requests (default: @code{nil}).
3157 @c -------------------------
3158 @item mh-before-commands-processed-hook
3159 Hook run by @kbd{x} before performing outstanding refile and delete
3160 requests (default: @code{nil}).
3161 @c -------------------------
3162 @item mh-before-quit-hook
3163 Hook run by q before quitting MH-E (default: @code{nil}).
3164 @c -------------------------
3165 @item mh-folder-mode-hook
3166 Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3167 @code{nil}).
3168 @c -------------------------
3169 @item mh-kill-folder-suppress-prompt-hook
3170 Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3171 @code{'mh-search-p}).
3172 @c -------------------------
3173 @item mh-quit-hook
3174 Hook run by q after quitting MH-E (default: @code{nil}).
3175 @c -------------------------
3176 @item mh-refile-msg-hook
3177 Hook run by o after marking each message for refiling (default:
3178 @code{nil}).
3179 @end vtable
3180
3181 The following faces are available for customizing the appearance of
3182 the MH-Folder buffer. @xref{Scan Line Formats}.
3183
3184 @vtable @code
3185 @item mh-folder-address
3186 Recipient face.
3187 @c -------------------------
3188 @item mh-folder-body
3189 Body text face.
3190 @c -------------------------
3191 @item mh-folder-cur-msg-number
3192 Current message number face.
3193 @c -------------------------
3194 @item mh-folder-date
3195 Date face.
3196 @c -------------------------
3197 @item mh-folder-deleted
3198 Deleted message face.
3199 @c -------------------------
3200 @item mh-folder-followup
3201 @samp{Re:} face.
3202 @c -------------------------
3203 @item mh-folder-msg-number
3204 Message number face.
3205 @c -------------------------
3206 @item mh-folder-refiled
3207 Refiled message face.
3208 @c -------------------------
3209 @vindex mh-scan-format-nmh
3210 @vindex mh-scan-sent-to-me-sender-regexp
3211 @item mh-folder-sent-to-me-hint
3212 Fontification hint face in messages sent directly to us. The detection
3213 of messages sent to us is governed by the scan format
3214 @code{mh-scan-format-nmh} and regular expression
3215 @code{mh-scan-sent-to-me-sender-regexp}.
3216 @c -------------------------
3217 @vindex mh-scan-format-nmh
3218 @vindex mh-scan-sent-to-me-sender-regexp
3219 @item mh-folder-scan-format
3220 Sender face in messages sent directly to us. The detection of messages
3221 sent to us is governed by the scan format @code{mh-scan-format-nmh}
3222 and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3223 @c -------------------------
3224 @item mh-folder-subject
3225 Subject face.
3226 @c -------------------------
3227 @item mh-folder-tick
3228 Ticked message face.
3229 @c -------------------------
3230 @item mh-folder-to
3231 @samp{To:} face.
3232 @end vtable
3233
3234 The hook @code{mh-folder-mode-hook} is called when visiting a new
3235 folder in MH-Folder mode. This could be used to set your own key
3236 bindings, for example:
3237
3238 @vindex mh-folder-mode-hook, example
3239
3240 @smalllisp
3241 @group
3242 (defvar my-mh-init-done nil
3243 "Non-@code{nil} when one-time MH-E settings made.")
3244
3245 (defun my-mh-folder-mode-hook ()
3246 "Hook to set key bindings in MH-Folder mode."
3247 (if (not my-mh-init-done) ; @r{only need to bind the keys once }
3248 (progn
3249 (local-set-key "//" 'my-search-msg)
3250 (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}}
3251 (setq my-mh-init-done t))))
3252
3253 (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3254
3255 (defun my-search-msg ()
3256 "Search for a regexp in the current message."
3257 (interactive) ; @r{user function}
3258 (save-window-excursion
3259 (other-window 1) ; @r{go to next window}
3260 (isearch-forward-regexp))) ; @r{string search; hit return}
3261 ; @r{ when done}
3262
3263 @i{Create additional key bindings via mh-folder-mode-hook}
3264
3265 @end group
3266 @end smalllisp
3267
3268 @cindex @command{folder}
3269 @cindex @command{refile}
3270 @cindex MH commands, @command{folder}
3271 @cindex MH commands, @command{refile}
3272 @findex mh-refile-msg
3273 @kindex o
3274 @vindex mh-refile-msg-hook
3275
3276 MH-E has analogies for each of the MH @command{folder} and
3277 @command{refile} commands@footnote{See the sections
3278 @uref{@value{MH-BOOK-HOME}/fol.htm#Youfol, Your Current Folder:
3279 folder} and @uref{@value{MH-BOOK-HOME}/fol.htm#Movref, Moving and
3280 Linking Messages: refile} in the MH book.}. To refile a message in
3281 another folder, use the command @kbd{o} (@code{mh-refile-msg})
3282 (mnemonic: ``output''). You are prompted for the folder name
3283 (@pxref{Folder Selection}). Note that this command can also be used to
3284 create folders. If you specify a folder that does not exist, you will
3285 be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3286 after a message is marked to be refiled.
3287
3288 If you are refiling several messages into the same folder, you can use
3289 the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3290 last refile or write (for the description of @kbd{>}
3291 (@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3292 range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3293 @key{RET}}, @pxref{Ranges}).
3294
3295 @cindex expunging refiles and deletes
3296 @cindex undoing refiles and deletes
3297
3298 If you've deleted a message or refiled it, but changed your mind, you
3299 can cancel the action before you've executed it. Use @kbd{u}
3300 (@code{mh-undo}) to undo a refile on or deletion of a single message.
3301 You can also undo refiles and deletes for messages that are found in a
3302 given range (@pxref{Ranges}).
3303
3304 Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3305 all refiles and deletes in the current folder.
3306
3307 If you've marked messages to be deleted or refiled and you want to go
3308 ahead and delete or refile the messages, use @kbd{x}
3309 (@code{mh-execute-commands}). Many MH-E commands that may affect the
3310 numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3311 you want to process refiles or deletes first and then either run
3312 @kbd{x} for you or undo the pending refiles and deletes, which are
3313 lost.
3314
3315 The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3316 before the commands are processed and
3317 @code{mh-after-commands-processed-hook} after the commands are
3318 processed. Variables that are useful with the former hook include
3319 @code{mh-delete-list} and @code{mh-refile-list} which can be used to
3320 see which changes will be made to the current folder,
3321 @code{mh-current-folder}. Variables that are useful with the latter
3322 hook include @code{mh-folders-changed}, which lists which folders were
3323 affected by deletes and refiles. This list will always include the
3324 current folder @code{mh-current-folder}.
3325
3326 If you wish to copy a message to another folder, you can use the
3327 command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3328 to @command{refile}(1)). Like the command @kbd{o}, this command
3329 prompts you for the name of the target folder and you can specify a
3330 range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3331 takes place immediately. The original copy remains in the current
3332 folder.
3333
3334 @cindex MH-Folder Show mode
3335 @cindex MH-Folder mode
3336 @cindex junk mail
3337 @cindex modes, MH-Folder
3338 @cindex modes, MH-Folder Show
3339 @cindex spam
3340
3341 The command @kbd{t} (@code{mh-toggle-showing}) switches between
3342 MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3343 this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3344 the associated show buffer so that you can perform operations on the
3345 messages quickly without reading them. This is an excellent way to
3346 prune out your junk mail or to refile a group of messages to another
3347 folder for later examination.
3348
3349 @cindex MH-Folder mode
3350 @cindex MH-Show mode
3351 @cindex modes, MH-Folder
3352 @cindex modes, MH-Show
3353 @cindex moving between messages
3354 @vindex mh-recenter-summary-flag
3355
3356 When you use @kbd{t} to toggle between show mode and scan mode, the
3357 MH-Show buffer is hidden and the MH-Folder buffer is left alone.
3358 Setting @code{mh-recenter-summary-flag} to a non-@code{nil} value
3359 causes the toggle to display as many scan lines as possible, with the
3360 cursor at the middle. The effect of @code{mh-recenter-summary-flag} is
3361 rather useful, but it can be annoying on a slow network connection.
3362
3363 When you want to read the messages that you have refiled into folders,
3364 use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3365 folder. You are prompted for the folder name. The folder buffer will
3366 show just unseen messages if there are any; otherwise, it will show
3367 all the messages in the buffer as long there are fewer than
3368 @code{mh-large-folder} messages. If there are more, then you are
3369 prompted for a range of messages to scan. You can provide a prefix
3370 argument in order to specify a range of messages to show when you
3371 visit the folder (@pxref{Ranges}). In this case, regions are not used
3372 to specify the range and @code{mh-large-folder} is ignored. Note that
3373 this command can also be used to create folders. If you specify a
3374 folder that does not exist, you will be prompted to create it.
3375
3376 If you forget where you've refiled your messages, you can find them
3377 using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3378
3379 @cindex @command{procmail}
3380 @cindex @command{rcvstore}
3381 @cindex @samp{unseen} sequence
3382 @cindex MH commands, @command{rcvstore}
3383 @cindex Unix commands, @command{procmail}
3384 @cindex sequence, @samp{unseen}
3385 @cindex unseen messages, viewing
3386 @findex mh-index-new-messages
3387 @kindex F n
3388 @vindex mh-new-messages-folders
3389
3390 If you use a program such as @command{procmail} to use
3391 @command{rcvstore} to file your incoming mail automatically, you can
3392 display new, unseen, messages using the command @kbd{F n}
3393 (@code{mh-index-new-messages}). All messages in the @samp{unseen}
3394 sequence from the folders in @code{mh-new-messages-folders} are
3395 listed. However, this list of folders can be overridden with a prefix
3396 argument: with a prefix argument, enter a space-separated list of
3397 folders, or nothing to search all folders.
3398
3399 @cindex @samp{tick} sequence
3400 @cindex sequence, @samp{tick}
3401 @cindex ticked messages, viewing
3402
3403 If you have ticked messages (@pxref{Sequences}), you can display them
3404 using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3405 messages in the @samp{tick} sequence from the folders in
3406 @code{mh-ticked-messages-folders} are listed. With a prefix argument,
3407 enter a space-separated list of folders, or nothing to search all
3408 folders.
3409
3410 @findex mh-index-sequenced-messages
3411 @kindex F q
3412 @vindex mh-new-messages-folders
3413
3414 You can display messages in any sequence with the command @kbd{F q}
3415 (@code{mh-index-sequenced-messages}). All messages from the folders in
3416 @code{mh-new-messages-folders} in the sequence you provide are listed.
3417 With a prefix argument, enter a space-separated list of folders at the
3418 prompt, or nothing to search all folders.
3419
3420 Set the options @code{mh-new-messages-folders} and
3421 @code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3422 @samp{+inbox} folder or @samp{All} to search all of the top level
3423 folders. Otherwise, list the folders that should be searched with the
3424 @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3425
3426 @cindex @samp{*MH-E Folders*}
3427 @cindex buffers, @samp{*MH-E Folders*}
3428
3429 Other commands you can perform on folders include: @kbd{F l}
3430 (@code{mh-list-folders}), to place a listing of all the folders in
3431 your mail directory in a buffer called @samp{*MH-E Folders*}
3432 (@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3433 a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3434 date (see @command{sortm}(1) to see how to sort by other criteria);
3435 @kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3436 from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3437 to rescan the folder, which is useful to grab all messages in your
3438 @samp{+inbox} after processing your new mail for the first time. If
3439 you don't want to rescan the entire folder, the commands @kbd{F r} or
3440 @kbd{F p} will accept a range (@pxref{Ranges}).
3441
3442 By default, operations on folders work only one level at a time. Set
3443 @code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3444 folders. This mostly means that you'll be able to see all your folders
3445 when you press @key{TAB} when prompted for a folder name.
3446
3447 @vindex mh-kill-folder-suppress-prompt-hooks
3448
3449 The hook @code{mh-kill-folder-suppress-prompt-hooks} is an abnormal
3450 hook run at the beginning of the command @kbd{k}. The hook functions
3451 are called with no arguments and should return a non-nil value to
3452 suppress the normal prompt when you remove a folder. This is useful
3453 for folders that are easily regenerated. The default value of
3454 @code{mh-search-p} suppresses the prompt on folders generated by
3455 searching.
3456
3457 @sp 1
3458 @center @strong{NOTE}
3459
3460 @quotation
3461 Use this hook with care. If there is a bug in your hook which returns
3462 @code{t} on @samp{+inbox} and you hit @kbd{k} by accident in the
3463 @code{+inbox} folder, you will not be happy.
3464 @end quotation
3465 @sp 1
3466
3467 @cindex @command{sortm}
3468 @cindex @file{.mh_profile}
3469 @cindex @samp{sortm:} MH profile component
3470 @cindex MH commands, @command{sortm}
3471 @cindex MH profile component, @samp{sortm:}
3472 @cindex files, @file{.mh_profile}
3473
3474 The option @code{mh-sortm-args} holds extra arguments to pass on to
3475 the command @command{sortm}@footnote{See the section
3476 @uref{@value{MH-BOOK-HOME}/sorsor.htm, Sorting Messages: sortm} in the
3477 MH book.} when a prefix argument is used with @kbd{F S}. Normally
3478 default arguments to @command{sortm} are specified in the MH profile.
3479 This option may be used to provide an alternate view. For example,
3480 @samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3481
3482 @cindex exiting
3483 @cindex quitting
3484 @findex mh-rmail
3485
3486 When you want to quit using MH-E and go back to editing, you can use
3487 the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3488 current MH-E folder and restores the buffers that were present when
3489 you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3490 buffers whose name begins with @samp{ *mh-} or @samp{*MH-E }
3491 (@pxref{Miscellaneous}). You can later restore your MH-E session by
3492 selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3493 again.
3494
3495 @vindex mh-before-quit-hook
3496 @vindex mh-quit-hook
3497
3498 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3499 called by @kbd{q} (@code{mh-quit}). The former one is called before
3500 the quit occurs, so you might use it to perform any MH-E operations;
3501 you could perform some query and abort the quit or call
3502 @code{mh-execute-commands}, for example. The latter is not run in an
3503 MH-E context, so you might use it to modify the window setup. For
3504 example, if the window configuration was saved as in the example in
3505 @ref{Miscellaneous Commands and Options}, you would also want to set
3506 @code{mh-quit-hook} to the following:
3507
3508 @c XXX Replace this with my example for killing the mail buffers.
3509
3510 @vindex mh-quit-hook, example
3511
3512 @smalllisp
3513 @group
3514 (defun my-mh-quit-hook ()
3515 "Clear window configuration variables as the MH window is gone."
3516 (setq my-mh-screen-saved nil)
3517 (setq my-mh-screen nil)
3518 (if my-normal-screen
3519 (set-window-configuration my-normal-screen))
3520 (setq my-normal-screen nil))
3521
3522 @i{Clean up window setup in mh-quit-hook}
3523 @end group
3524 @end smalllisp
3525
3526 @cindex folders, renaming
3527 @cindex renaming folders
3528 @findex dired-do-rename
3529 @kindex R
3530
3531 You can use dired to manipulate the folders themselves. For example, I
3532 renamed my @samp{+out} folder to the more common @samp{+outbox} by
3533 running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3534 moving my cursor to @samp{out} and using the command @kbd{R}
3535 (@code{dired-do-rename}).
3536
3537 @node Sending Mail, Editing Drafts, Folders, Top
3538 @chapter Sending Mail
3539
3540 @cindex sending mail
3541 @findex mh-smail
3542
3543 You can send a mail message in several ways. You can call @kbd{M-x
3544 mh-smail} directly, or from the command line like this:
3545
3546 @cindex starting from command line
3547
3548 @example
3549 $ @kbd{emacs -f mh-smail}
3550 @end example
3551
3552 @findex goto-address-at-point
3553 @vindex mail-user-agent
3554
3555 There are some commands that need to send a mail message, such as
3556 @code{goto-address-at-point}. You can configure Emacs to have these
3557 commands use MH-E by setting the option @code{mail-user-agent} to
3558 @samp{Emacs interface to MH}.
3559
3560 From within MH-E's MH-Folder mode, other methods of sending mail are
3561 available as well. These can also be found in the @samp{Message} menu.
3562
3563 @table @kbd
3564 @cindex @samp{Message > Edit Message Again} menu item
3565 @cindex menu item, @samp{Message > Edit Message Again}
3566 @kindex e
3567 @findex mh-edit-again
3568 @item e
3569 Edit a message to send it again (@code{mh-edit-again}).
3570 @c -------------------------
3571 @cindex @samp{Message > Re-edit a Bounced Message} menu item
3572 @cindex menu item, @samp{Message > Re-edit a Bounced Message}
3573 @kindex E
3574 @findex mh-extract-rejected-mail
3575 @item E
3576 Edit a message that was returned by the mail system
3577 (@code{mh-extract-rejected-mail}).
3578 @c -------------------------
3579 @cindex @samp{Message > Forward Message...} menu item
3580 @cindex menu item, @samp{Message > Forward Message...}
3581 @kindex f
3582 @findex mh-forward
3583 @item f
3584 Forward message (@code{mh-forward}).
3585 @c -------------------------
3586 @cindex @samp{Message > Reply to Message...} menu item
3587 @cindex menu item, @samp{Message > Reply to Message...}
3588 @kindex r
3589 @findex mh-reply
3590 @item r
3591 Reply to a message (@code{mh-reply}).
3592 @c -------------------------
3593 @cindex @samp{Message > Compose a New Message} menu item
3594 @cindex menu item, @samp{Message > Compose a New Message}
3595 @kindex s
3596 @findex mh-send
3597 @item s
3598 Compose a message (@code{mh-send}).
3599 @c -------------------------
3600 @cindex @samp{Message > Redistribute Message...} menu item
3601 @cindex menu item, @samp{Message > Redistribute Message...}
3602 @kindex M-d
3603 @findex mh-redistribute
3604 @item M-d
3605 Redistribute a message (@code{mh-redistribute}).
3606 @c -------------------------
3607 @findex mh-smail
3608 @item M-x mh-smail
3609 Compose a message with the MH mail system.
3610 @c -------------------------
3611 @findex mh-smail-other-window
3612 @item M-x mh-smail-other-window
3613 Compose a message with the MH mail system in other window.
3614 @end table
3615
3616 @cindex @samp{mh-sending-mail} customization group
3617 @cindex customization group, @samp{mh-sending-mail}
3618
3619 In addition, several options from the @samp{mh-sending-mail}
3620 customization group are useful when sending mail or replying to mail.
3621 They are summarized in the following table.
3622
3623 @vtable @code
3624 @item mh-compose-forward-as-mime-flag
3625 On means that messages are forwarded as attachments (default:
3626 @samp{on}).
3627 @c -------------------------
3628 @item mh-compose-letter-function
3629 Hook run when starting a new draft (default: @code{nil}).
3630 @c -------------------------
3631 @item mh-compose-prompt-flag
3632 On means prompt for header fields when composing a new draft (default:
3633 @samp{off}).
3634 @c -------------------------
3635 @item mh-forward-subject-format
3636 Format string for forwarded message subject (default: @code{"%s:
3637 %s"}).
3638 @c -------------------------
3639 @item mh-insert-x-mailer-flag
3640 On means append an @samp{X-Mailer:} header field to the header
3641 (default: @samp{on}).
3642 @c -------------------------
3643 @item mh-redist-full-contents-flag
3644 On means the @command{dist} command needs entire letter for
3645 redistribution (default: @samp{off}).
3646 @c -------------------------
3647 @item mh-reply-default-reply-to
3648 Sets the person or persons to whom a reply will be sent (default:
3649 @samp{Prompt}).
3650 @c -------------------------
3651 @item mh-reply-show-message-flag
3652 On means the MH-Show buffer is displayed using @kbd{r}
3653 (@code{mh-reply}) (default: @samp{on}).
3654 @end vtable
3655
3656 The following hooks are available.
3657
3658 @vtable @code
3659 @item mh-forward-hook
3660 Hook run by @code{mh-forward} on a forwarded letter (default:
3661 @code{nil}).
3662 @c -------------------------
3663 @item mh-letter-mode-hook
3664 Hook run by @code{mh-letter-mode} on a new letter (default:
3665 @code{nil}).
3666 @end vtable
3667
3668 The functions and options introduced here are explained in more detail
3669 in the following sections.
3670
3671 @menu
3672 * Composing::
3673 * Replying::
3674 * Forwarding::
3675 * Redistributing::
3676 * Editing Again::
3677 @end menu
3678
3679 @node Composing, Replying, Sending Mail, Sending Mail
3680 @section Composing
3681
3682 @cindex @file{.emacs}
3683 @cindex MH-Folder mode
3684 @cindex composing mail
3685 @cindex draft
3686 @cindex files, @file{.emacs}
3687 @cindex modes, MH-Folder
3688 @cindex sending mail
3689 @findex mh-smail
3690 @findex mh-smail-other-window
3691
3692 Outside of an MH-Folder buffer, you must call either @kbd{M-x
3693 mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
3694 The former command always creates a two-window layout with the current
3695 buffer on top and the draft on the bottom. Use the latter command if
3696 you would rather preserve the window layout. You may find adding the
3697 following key bindings to @file{~/.emacs} useful:
3698
3699 @smalllisp
3700 (global-set-key "\C-xm" 'mh-smail)
3701 (global-set-key "\C-x4m" 'mh-smail-other-window)
3702 @end smalllisp
3703
3704 @cindex MH-Letter mode
3705 @cindex draft folder
3706 @cindex modes, MH-Letter
3707 @findex mh-send
3708 @kindex m
3709
3710 From within a MH-Folder buffer, you can simply use the command @kbd{m}
3711 (@code{mh-send}). However you invoke @code{mh-send}, your letter
3712 appears in an Emacs buffer whose mode is MH-Letter (to see what the
3713 buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
3714 you to edit your message, to check the validity of the recipients, to
3715 insert attachments and other messages into your message, and to send
3716 the message. We'll go more into depth about editing a
3717 @dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
3718 folder} so that you can edit several drafts in parallel. To do so,
3719 create a folder named @samp{+drafts} for example, and add the profile
3720 component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
3721 message you're composing) in just a moment (@pxref{Editing Drafts}).
3722
3723 @vindex mh-compose-prompt-flag
3724
3725 If you prefer to be prompted for the recipient and subject fields
3726 before the MH-Letter buffer appears, turn on the option
3727 @code{mh-compose-prompt-flag}.
3728
3729 @cindex @samp{X-Mailer:} header field
3730 @cindex header field, @samp{X-Mailer:}
3731 @vindex mh-insert-x-mailer-flag
3732
3733 MH-E adds an @samp{X-Mailer:} header field to the header that includes
3734 the version of MH-E and Emacs that you are using. If you don't want to
3735 participate in our marketing, you can turn off the option
3736 @code{mh-insert-x-mailer-flag}.
3737
3738 @cindex @command{repl}
3739 @cindex @file{components}
3740 @cindex MH commands, @command{repl}
3741 @cindex Mail mode
3742 @cindex files, @file{components}
3743 @cindex modes, Mail
3744 @vindex mail-mode-hook
3745 @vindex mh-letter-mode-hook
3746 @vindex text-mode-hook
3747
3748 Two hooks are provided to run commands on your freshly created draft.
3749 The first hook, @code{mh-letter-mode-hook}, allows you to do some
3750 processing before editing a letter@footnote{Actually, because
3751 MH-Letter mode inherits from Mail mode, the hooks
3752 @code{text-mode-hook} and @code{mail-mode-hook} are run (in that
3753 order) before @code{mh-letter-mode-hook}.}. For example, you may wish
3754 to modify the header after @command{repl} has done its work, or you
3755 may have a complicated @file{components} file and need to tell MH-E
3756 where the cursor should go. Here's an example of how you would use
3757 this hook. You can add the hook using @code{add-hook} or by running
3758 @kbd{M-x customize-option @key{RET} mh-letter-mode-hook
3759 @key{RET}}---all of the other hooks are set in a similar fashion.
3760
3761 @findex mh-insert-signature, example
3762
3763 @smalllisp
3764 @group
3765 (defvar letter-mode-init-done-flag nil
3766 "Non-nil means one-time MH-E settings have been made.")
3767
3768 (defun my-mh-letter-mode-hook ()
3769 "Prepare letter for editing."
3770 (when (not letter-mode-init-done) ; @r{only need to bind the keys once}
3771 (local-set-key "\C-ctb" 'add-enriched-text)
3772 (local-set-key "\C-cti" 'add-enriched-text)
3773 (local-set-key "\C-ctf" 'add-enriched-text)
3774 (local-set-key "\C-cts" 'add-enriched-text)
3775 (local-set-key "\C-ctB" 'add-enriched-text)
3776 (local-set-key "\C-ctu" 'add-enriched-text)
3777 (local-set-key "\C-ctc" 'add-enriched-text)
3778 (setq letter-mode-init-done t))
3779 (save-excursion
3780 (goto-char (point-max)) ; @r{go to end of message to}
3781 (mh-insert-signature))) ; @r{insert signature}
3782
3783 (add-hook 'mh-letter-mode-hook 'my-mh-letter-mode-hook)
3784
3785 @i{Prepare draft for editing via mh-letter-mode-hook}
3786
3787 @end group
3788 @end smalllisp
3789
3790 The function, @code{add-enriched-text} is defined in the example in
3791 @ref{Adding Attachments}.
3792
3793 @vindex mh-compose-letter-function
3794
3795 The second hook, a function really, is
3796 @code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
3797 is called just before editing a new message; however, it is the last
3798 function called before you edit your message. The consequence of this
3799 is that you can write a function to write and send the message for
3800 you. This function is passed three arguments: the contents of the
3801 @samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
3802
3803 @node Replying, Forwarding, Composing, Sending Mail
3804 @section Replying to Mail
3805
3806 @cindex @command{mhl}
3807 @cindex @file{mhl.reply}
3808 @cindex MH commands, @command{mhl}
3809 @cindex files, @file{mhl.reply}
3810 @cindex replying
3811 @findex mh-reply
3812 @kindex r
3813
3814 To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
3815 command.
3816
3817 When you reply to a message, you are first prompted with @samp{Reply
3818 to whom?}. You have several choices here.
3819
3820 @smallexample
3821 @group
3822 @b{Response} @b{Reply Goes To}
3823
3824 @kbd{from} @r{The person who sent the message. This is the default,}
3825 @r{so @key{RET} is sufficient.}
3826
3827 @kbd{to} @r{Replies to the sender, plus all recipients in the}
3828 @r{@samp{To:} header field.}
3829
3830 @kbd{all}
3831 @kbd{cc} @r{Forms a reply to the sender, plus all recipients.}
3832 @end group
3833 @end smallexample
3834
3835 @cindex @command{repl}
3836 @cindex MH commands, @command{repl}
3837
3838 Depending on your answer, @command{repl}@footnote{See the section
3839 @uref{@value{MH-BOOK-HOME}/reprep.htm, Replying to Messages: repl} in
3840 the MH book.} is given a different argument to form your reply.
3841 Specifically, a choice of @kbd{from} or none at all runs @samp{repl
3842 -nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
3843 either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}.
3844
3845 @cindex MH-Letter mode
3846 @cindex MH-Show mode
3847 @cindex draft
3848 @cindex modes, MH-Letter
3849 @cindex modes, MH-Show
3850
3851 Two windows are then created. One window contains the message to which
3852 you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
3853 (@pxref{Editing Drafts}), is in the other window.
3854
3855 If you supply a prefix argument (as in @kbd{C-u r}), the message you
3856 are replying to is inserted in your reply after having first been run
3857 through @command{mhl} with the format file @file{mhl.reply}. See
3858 @command{mhl}(1) or the section
3859 @uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH
3860 book to see how you can modify the default @file{mhl.reply} file.
3861
3862 @vindex mh-yank-behavior
3863
3864 Alternatively, you can customize the option @code{mh-yank-behavior}
3865 and choose one of its @samp{Automatically} variants to do the same
3866 thing. @xref{Inserting Letter}. If you do so, the prefix argument has
3867 no effect.
3868
3869 Another way to include the message automatically in your draft is to
3870 use @samp{repl: -filter repl.filter} in your MH profile.
3871
3872 If you include the message automatically, you can hide the MH-Show
3873 buffer by turning off the option @code{mh-reply-show-message-flag}.
3874
3875 If you wish to customize the header or other parts of the reply draft,
3876 please see @command{repl}(1) and @code{mh-format}(5).
3877
3878 @vindex mh-reply-default-reply-to
3879
3880 The @code{mh-reply-default-reply-to} option is set to @samp{Prompt} by
3881 default so that you are prompted for the recipient of a reply. If you
3882 find that most of the time that you specify @kbd{cc} when you reply to
3883 a message, set this option to @samp{cc}. Other choices include
3884 @samp{from}, @samp{to}, or @samp{all}. You can always edit the
3885 recipients in the draft.
3886
3887 @node Forwarding, Redistributing, Replying, Sending Mail
3888 @section Forwarding Mail
3889
3890 @cindex @command{forw}
3891 @cindex MH commands, @command{forw}
3892 @cindex draft
3893 @cindex forwarding
3894 @findex mh-forward
3895 @kindex f
3896 @vindex mh-forward-hook
3897
3898 To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
3899 are prompted for the @samp{To:} and @samp{cc:} recipients. You are
3900 given a draft to edit that looks like it would if you had run the MH
3901 command @command{forw}@footnote{See the section
3902 @uref{@value{MH-BOOK-HOME}/forfor.htm, Forwarding Messages: forw} in
3903 the MH book.}. You can then add some text (@pxref{Editing Drafts}).
3904 You can forward several messages by using a range (@pxref{Ranges}).
3905 All of the messages in the range are inserted into your draft. The
3906 hook @code{mh-forward-hook} is called on the draft.
3907
3908 @cindex @file{.mh_profile}
3909 @cindex @samp{forw:} MH profile component
3910 @cindex MH profile component, @samp{forw:}
3911 @cindex files, @file{.mh_profile}
3912 @vindex mh-compose-forward-as-mime-flag
3913
3914 By default, the option @code{mh-compose-forward-as-mime-flag} is on
3915 which means that the forwarded messages are included as attachments.
3916 If you would prefer to forward your messages verbatim (as text,
3917 inline), then turn off this option. Forwarding messages verbatim works
3918 well for short, textual messages, but your recipient won't be able to
3919 view any non-textual attachments that were in the forwarded message.
3920 Be aware that if you have @samp{forw: -mime} in your MH profile, then
3921 forwarded messages will always be included as attachments regardless
3922 of the settings of @code{mh-compose-forward-as-mime-flag}.
3923
3924 @vindex mh-forward-subject-format
3925
3926 The format of the @samp{Subject:} header field for forwarded messages
3927 is controlled by the option @code{mh-forward-subject-format}. This
3928 option is a string which includes two escapes (@samp{%s}). The first
3929 @samp{%s} is replaced with the sender of the original message, and the
3930 second one is replaced with the original @samp{Subject:}. The default
3931 value of @code{"%s: %s"} takes a message with the header:
3932
3933 @smallexample
3934 @group
3935 To: Bill Wohler <wohler@@stop.mail-abuse.org>
3936 Subject: Re: 49er football
3937 From: Greg DesBrisay <gd@@stop.mail-abuse.org>
3938 @end group
3939 @end smallexample
3940
3941 and creates a subject header field of:
3942
3943 @smallexample
3944 Subject: Greg DesBrisay: Re: 49er football
3945 @end smallexample
3946
3947 @node Redistributing, Editing Again, Forwarding, Sending Mail
3948 @section Redistributing Your Mail
3949
3950 @cindex @command{dist}
3951 @cindex MH commands, @command{dist}
3952 @cindex redistributing
3953 @findex mh-redistribute
3954 @kindex M-d
3955
3956 The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
3957 to forwarding mail, but it does not allow you to edit the message, nor
3958 does it add your name to the @samp{From:} header field. It appears to
3959 the recipient as if the message had come from the original sender.
3960 When you run this command, you are prompted for the recipients.
3961
3962 For more information on redistributing messages, see
3963 @command{dist}(1). Also investigate the command @kbd{e}
3964 (@code{mh-edit-again}) for another way to redistribute messages
3965 (@pxref{Editing Again}).
3966
3967 @cindex @command{send}
3968 @cindex MH commands, @command{send}
3969 @vindex mh-redist-full-contents-flag
3970
3971 The option @code{mh-redist-full-contents-flag} must be turned on if
3972 @command{dist}@footnote{See the section
3973 @uref{@value{MH-BOOK-HOME}/disdis.htm, Distributing Messages with
3974 dist} in the MH book.} requires the whole letter for redistribution,
3975 which is the case if @command{send}@footnote{See the section
3976 @uref{@value{MH-BOOK-HOME}/sensen.htm, Sending Some Mail: comp send}
3977 in the MH book.} is compiled with the @sc{berk} option (which many
3978 people abhor). If you find that MH will not allow you to redistribute
3979 a message that has been redistributed before, turn off this option.
3980
3981 @node Editing Again, , Redistributing, Sending Mail
3982 @section Editing Old Drafts and Bounced Messages
3983
3984 @cindex @file{draft}
3985 @cindex files, @file{draft}
3986 @cindex re-editing drafts
3987 @findex mh-edit-again
3988 @kindex e
3989
3990 If you don't complete a draft for one reason or another, and if the
3991 draft buffer is no longer available, you can pick your draft up again
3992 with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
3993 folder, your last @file{draft} file will be used. If you use draft
3994 folders, you'll need to visit the draft folder with @kbd{F v drafts
3995 @key{RET}}, use @kbd{n} to move to the appropriate message, and then
3996 use @kbd{e} to prepare the message for editing.
3997
3998 The @kbd{e} command can also be used to take messages that were sent
3999 to you and to send them to more people.
4000
4001 @cindex Mailer-Daemon
4002 @findex mh-extract-rejected-mail
4003 @kindex E
4004
4005 Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4006 complained that your mail wasn't posted for some reason or another. In
4007 this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4008 the message for editing by removing the @i{Mailer-Daemon} envelope and
4009 unneeded header fields. Fix whatever addressing problem you had, and
4010 send the message again with @kbd{C-c C-c}.
4011
4012 @node Editing Drafts, Aliases, Sending Mail, Top
4013 @chapter Editing a Draft
4014
4015 @cindex MH-Letter mode
4016 @cindex draft
4017 @cindex editing draft
4018 @cindex modes, MH-Letter
4019
4020 When you edit a message that you want to send (called a @dfn{draft} in
4021 this case), the mode used is MH-Letter. This mode provides several
4022 commands in addition to the normal Emacs editing commands to help you
4023 edit your draft. These can also be found in the @samp{Letter} menu.
4024
4025 @table @kbd
4026 @kindex @key{SPC}
4027 @findex mh-letter-complete-or-space
4028 @item @key{SPC}
4029 Perform completion or insert space (@code{mh-letter-complete-or-space}).
4030 @c -------------------------
4031 @kindex M-@key{TAB}
4032 @findex mh-letter-complete
4033 @item M-@key{TAB}
4034 Perform completion on header field or word preceding point
4035 (@code{mh-letter-complete}).
4036 @c -------------------------
4037 @kindex , (comma)
4038 @findex mh-letter-confirm-address
4039 @item , (comma)
4040 Flash alias expansion (@code{mh-letter-confirm-address}).
4041 @c -------------------------
4042 @kindex @key{TAB}
4043 @findex mh-letter-next-header-field-or-indent
4044 @item @key{TAB}
4045 Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4046 @c -------------------------
4047 @kindex S-@key{TAB}
4048 @findex mh-letter-previous-header-field
4049 @item S-@key{TAB}
4050 Cycle to the previous header field
4051 (@code{mh-letter-previous-header-field}).
4052 @c -------------------------
4053 @kindex C-c ?
4054 @findex mh-help
4055 @item C-c ?
4056 Display cheat sheet for the MH-E commands (@code{mh-help}).
4057 @c -------------------------
4058 @cindex @samp{Letter > Send This Draft} menu item
4059 @cindex menu item, @samp{Letter > Send This Draft}
4060 @kindex C-c C-c
4061 @findex mh-send-letter
4062 @item C-c C-c
4063 Save draft and send message (@code{mh-send-letter}).
4064 @c -------------------------
4065 @kindex C-c C-d
4066 @findex mh-insert-identity
4067 @item C-c C-d
4068 Insert fields specified by the given identity
4069 (@code{mh-insert-identity}). @xref{Identities}.
4070 @c -------------------------
4071 @cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4072 @cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4073 @kindex C-c C-e
4074 @findex mh-mh-to-mime
4075 @item C-c C-e
4076 Compose @sc{mime} message from MH-style directives
4077 (@code{mh-mh-to-mime}).
4078 @c -------------------------
4079 @kindex C-c C-f C-a
4080 @kindex C-c C-f a
4081 @findex mh-to-field
4082 @item C-c C-f C-a
4083 @itemx C-c C-f a
4084 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4085 @c -------------------------
4086 @kindex C-c C-f C-b
4087 @kindex C-c C-f b
4088 @item C-c C-f C-b
4089 @itemx C-c C-f b
4090 Move to @samp{Bcc:} header field (@code{mh-to-field}).
4091 @c -------------------------
4092 @kindex C-c C-f C-c
4093 @kindex C-c C-f c
4094 @item C-c C-f C-c
4095 @itemx C-c C-f c
4096 Move to @samp{Cc:} header field (@code{mh-to-field}).
4097 @c -------------------------
4098 @kindex C-c C-f C-d
4099 @kindex C-c C-f d
4100 @item C-c C-f C-d
4101 @itemx C-c C-f d
4102 Move to @samp{Dcc:} header field (@code{mh-to-field}).
4103 @c -------------------------
4104 @kindex C-c C-f C-f
4105 @kindex C-c C-f f
4106 @findex mh-to-fcc
4107 @item C-c C-f C-f
4108 @itemx C-c C-f f
4109 Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4110 @c -------------------------
4111 @kindex C-c C-f C-l
4112 @kindex C-c C-f l
4113 @item C-c C-f C-l
4114 @itemx C-c C-f l
4115 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4116 @c -------------------------
4117 @kindex C-c C-f C-m
4118 @kindex C-c C-f m
4119 @item C-c C-f C-m
4120 @itemx C-c C-f m
4121 Move to @samp{From:} header field (@code{mh-to-field}).
4122 @c -------------------------
4123 @kindex C-c C-f C-r
4124 @kindex C-c C-f r
4125 @item C-c C-f C-r
4126 @itemx C-c C-f r
4127 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4128 @c -------------------------
4129 @kindex C-c C-f C-s
4130 @kindex C-c C-f s
4131 @item C-c C-f C-s
4132 @itemx C-c C-f s
4133 Move to @samp{Subject:} header field (@code{mh-to-field}).
4134 @c -------------------------
4135 @kindex C-c C-f C-t
4136 @kindex C-c C-f t
4137 @item C-c C-f C-t
4138 @itemx C-c C-f t
4139 Move to @samp{To:} header field (@code{mh-to-field}).
4140 @c -------------------------
4141 @cindex @samp{Letter > Insert a Message...} menu item
4142 @cindex menu item, @samp{Letter > Insert a Message...}
4143 @kindex C-c C-i
4144 @findex mh-insert-letter
4145 @item C-c C-i
4146 Insert a message (@code{mh-insert-letter}).
4147 @c -------------------------
4148 @kindex C-c C-m C-e
4149 @findex mh-mml-secure-message-encrypt
4150 @item C-c C-m C-e
4151 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4152 @c -------------------------
4153 @cindex @samp{Letter > Compose Forward...} menu item
4154 @cindex menu item, @samp{Letter > Compose Forward...}
4155 @kindex C-c C-m C-f
4156 @kindex C-c C-m f
4157 @findex mh-compose-forward
4158 @item C-c C-m C-f
4159 @itemx C-c C-m f
4160 Add tag to forward a message (@code{mh-compose-forward}).
4161 @c -------------------------
4162 @cindex @samp{Letter > Compose Get File (MH)...} menu item
4163 @cindex menu item, @samp{Letter > Compose Get File (MH)...}
4164 @kindex C-c C-m C-g
4165 @kindex C-c C-m g
4166 @findex mh-mh-compose-anon-ftp
4167 @item C-c C-m C-g
4168 @itemx C-c C-m g
4169 Add tag to include anonymous ftp reference to a file
4170 (@code{mh-mh-compose-anon-ftp}).
4171 @c -------------------------
4172 @cindex @samp{Letter > Compose Insertion...} menu item
4173 @cindex menu item, @samp{Letter > Compose Insertion...}
4174 @kindex C-c C-m C-i
4175 @kindex C-c C-m i
4176 @findex mh-compose-insertion
4177 @item C-c C-m C-i
4178 @itemx C-c C-m i
4179 Add tag to include a file such as an image or sound
4180 (@code{mh-compose-insertion}).
4181 @c -------------------------
4182 @cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4183 @cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4184 @kindex C-c C-m C-m
4185 @kindex C-c C-m m
4186 @findex mh-mml-to-mime
4187 @item C-c C-m C-m
4188 @itemx C-c C-m m
4189 Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4190 @c -------------------------
4191 @kindex C-c C-m C-n
4192 @kindex C-c C-m n
4193 @findex mh-mml-unsecure-message
4194 @item C-c C-m C-n
4195 @itemx C-c C-m n
4196 Remove any secure message tags (@code{mh-mml-unsecure-message}).
4197 @c -------------------------
4198 @kindex C-c C-m C-s
4199 @findex mh-mml-secure-message-sign
4200 @item C-c C-m C-s
4201 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4202 @c -------------------------
4203 @cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4204 @cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4205 @kindex C-c C-m C-t
4206 @kindex C-c C-m t
4207 @findex mh-mh-compose-external-compressed-tar
4208 @item C-c C-m C-t
4209 @itemx C-c C-m t
4210 Add tag to include anonymous ftp reference to a compressed tar file
4211 (@code{mh-mh-compose-external-compressed-tar}).
4212 @c -------------------------
4213 @cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4214 @cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4215 @kindex C-c C-m C-u
4216 @kindex C-c C-m u
4217 @findex mh-mh-to-mime-undo
4218 @item C-c C-m C-u
4219 @itemx C-c C-m u
4220 Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4221 @c -------------------------
4222 @kindex C-c C-m C-x
4223 @kindex C-c C-m x
4224 @findex mh-mh-compose-external-type
4225 @item C-c C-m C-x
4226 @itemx C-c C-m x
4227 Add tag to refer to a remote file
4228 (@code{mh-mh-compose-external-type}).
4229 @c -------------------------
4230 @kindex C-c C-m e e
4231 @findex mh-mml-secure-message-encrypt
4232 @item C-c C-m e e
4233 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4234 @c -------------------------
4235 @kindex C-c C-m e s
4236 @findex mh-mml-secure-message-signencrypt
4237 @item C-c C-m e s
4238 Add tag to encrypt and sign the message@*
4239 (@code{mh-mml-secure-message-signencrypt}).
4240 @c -------------------------
4241 @kindex C-c C-m s e
4242 @findex mh-mml-secure-message-signencrypt
4243 @item C-c C-m s e
4244 Add tag to encrypt and sign the message@*
4245 (@code{mh-mml-secure-message-signencrypt}).
4246 @c -------------------------
4247 @kindex C-c C-m s s
4248 @findex mh-mml-secure-message-sign
4249 @item C-c C-m s s
4250 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4251 @c -------------------------
4252 @cindex @samp{Letter > Split Current Line} menu item
4253 @cindex menu item, @samp{Letter > Split Current Line}
4254 @kindex C-c C-o
4255 @findex mh-open-line
4256 @item C-c C-o
4257 Insert a newline and leave point before it (@code{mh-open-line}).
4258 @c -------------------------
4259 @cindex @samp{Letter > Kill This Draft} menu item
4260 @cindex menu item, @samp{Letter > Kill This Draft}
4261 @kindex C-c C-q
4262 @findex mh-fully-kill-draft
4263 @item C-c C-q
4264 Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4265 @c -------------------------
4266 @cindex @samp{Letter > Insert Signature} menu item
4267 @cindex menu item, @samp{Letter > Insert Signature}
4268 @kindex C-c C-s
4269 @findex mh-insert-signature
4270 @item C-c C-s
4271 Insert signature in message (@code{mh-insert-signature}).
4272 @c -------------------------
4273 @kindex C-c C-t
4274 @findex mh-letter-toggle-header-field-display
4275 @item C-c C-t
4276 Toggle display of header field at point
4277 (@code{mh-letter-toggle-header-field-display}).
4278 @c -------------------------
4279 @cindex @samp{Letter > Check Recipient} menu item
4280 @cindex menu item, @samp{Letter > Check Recipient}
4281 @kindex C-c C-w
4282 @findex mh-check-whom
4283 @item C-c C-w
4284 Verify recipients, showing expansion of any aliases
4285 (@code{mh-check-whom}).
4286 @c -------------------------
4287 @cindex @samp{Letter > Yank Current Message} menu item
4288 @cindex menu item, @samp{Letter > Yank Current Message}
4289 @kindex C-c C-y
4290 @findex mh-yank-cur-msg
4291 @item C-c C-y
4292 Insert the current message into the draft buffer
4293 (@code{mh-yank-cur-msg}).
4294 @c -------------------------
4295 @kindex C-c M-d
4296 @findex mh-insert-auto-fields
4297 @item C-c M-d
4298 Insert custom fields if recipient is found in
4299 @code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4300 @xref{Identities}.
4301 @end table
4302
4303 @cindex @samp{mh-letter} customization group
4304 @cindex customization group, @samp{mh-letter}
4305
4306 Several options from the @samp{mh-letter} customization group are used
4307 while editing a draft.
4308
4309 @vtable @code
4310 @item mh-compose-insertion
4311 Type of @sc{mime} message tags in messages (default: @samp{MML} if
4312 available; otherwise @samp{MH}).
4313 @c -------------------------
4314 @item mh-compose-skipped-header-fields
4315 List of header fields to skip over when navigating in draft (default:
4316 @code{'("From"} @code{"Organization"} @code{"References"}
4317 @code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4318 @code{"X-Image-URL"} @code{"X-Mailer")}.
4319 @c -------------------------
4320 @item mh-compose-space-does-completion-flag
4321 On means @key{SPC} does completion in message header (default:
4322 @samp{off}).
4323 @c -------------------------
4324 @item mh-delete-yanked-msg-window-flag
4325 On means delete any window displaying the message (default: @samp{off}).
4326 @c -------------------------
4327 @item mh-extract-from-attribution-verb
4328 Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4329 (default: @code{"wrote:"}).
4330 @c -------------------------
4331 @item mh-ins-buf-prefix
4332 String to put before each line of a yanked or inserted message
4333 (default: @code{"> "}).
4334 @c -------------------------
4335 @item mh-letter-complete-function
4336 Function to call when completing outside of address or folder fields
4337 (default: @code{ispell-complete-word}).
4338 @c -------------------------
4339 @item mh-letter-fill-column
4340 Fill column to use in MH-Letter mode (default: 72).
4341 @c -------------------------
4342 @item mh-mml-method-default
4343 Default method to use in security tags (default: @samp{PGP (MIME)} if
4344 support for it is available; otherwise @samp{None}).
4345 @c -------------------------
4346 @item mh-signature-file-name
4347 Source of user's signature (default: @code{"~/.signature"}).
4348 @c -------------------------
4349 @item mh-signature-separator-flag
4350 On means a signature separator should be inserted (default:
4351 @samp{on}).
4352 @c -------------------------
4353 @item mh-x-face-file
4354 File containing X-Face or Face header field to insert in outgoing mail.
4355 (default: @code{"~/.face"}).
4356 @c -------------------------
4357 @item mh-yank-behavior
4358 Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4359 @samp{Body With Attribution}).
4360 @end vtable
4361
4362 The following hooks are available.
4363
4364 @vtable @code
4365 @item mail-citation-hook
4366 Hook for modifying a citation just inserted in the mail buffer
4367 (default: @code{nil}).
4368 @c -------------------------
4369 @item mh-before-send-letter-hook
4370 Hook run at the beginning of the @kbd{C-c C-c} command (default:
4371 @samp{nil}).
4372 @c -------------------------
4373 @item mh-mh-to-mime-hook
4374 Hook run on the formatted letter by @kbd{C-c C-e} (default:
4375 @samp{nil}).
4376 @c -------------------------
4377 @item mh-insert-signature-hook
4378 Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4379 @code{nil}).
4380 @end vtable
4381
4382 The following face is available.
4383
4384 @vtable @code
4385 @item mh-letter-header-field
4386 Editable header field value face in draft buffers.
4387 @end vtable
4388
4389 The commands and options introduced here are explained in more
4390 detail in the following sections.
4391
4392 @menu
4393 * Editing Message::
4394 * Inserting Letter::
4395 * Inserting Messages::
4396 * Signature::
4397 * Picture::
4398 * Adding Attachments::
4399 * Sending PGP::
4400 * Checking Recipients::
4401 * Sending Message::
4402 * Killing Draft::
4403 @end menu
4404
4405 @node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4406 @section Editing the Message
4407
4408 @cindex @samp{Bcc:} header field
4409 @cindex @samp{Cc:} header field
4410 @cindex @samp{Dcc:} header field
4411 @cindex @samp{From:} header field
4412 @cindex @samp{Mail-Followup-To:} header field
4413 @cindex @samp{Mail-Reply-To:} header field
4414 @cindex @samp{Reply-To:} header field
4415 @cindex @samp{Subject:} header field
4416 @cindex @samp{To:} header field
4417 @cindex editing header
4418 @cindex header field, @samp{Bcc:}
4419 @cindex header field, @samp{Cc:}
4420 @cindex header field, @samp{Dcc:}
4421 @cindex header field, @samp{From:}
4422 @cindex header field, @samp{Mail-Followup-To:}
4423 @cindex header field, @samp{Mail-Reply-To:}
4424 @cindex header field, @samp{Reply-To:}
4425 @cindex header field, @samp{Subject:}
4426 @cindex header field, @samp{To:}
4427 @findex mh-to-field
4428 @kindex C-c C-f C-t
4429 @kindex C-c C-f t
4430
4431 Because the header is part of the message, you can edit the header
4432 fields as you wish. However, several convenience commands exist to
4433 help you create and edit them. For example, the command @kbd{C-c C-f
4434 C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4435 cursor to the @samp{To:} header field, creating it if necessary. The
4436 commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4437 @samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4438 @samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4439
4440 @findex mh-to-fcc
4441 @kindex C-c C-f C-f
4442 @kindex C-c C-f f
4443
4444 One command behaves differently from the others, namely, @kbd{C-c C-f
4445 C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4446 will prompt you for the folder name in which to file a copy of the
4447 draft. @xref{Folder Selection}.
4448
4449 @findex indent-relative
4450 @findex mh-letter-next-header-field-or-indent
4451 @findex mh-letter-previous-header-field
4452 @kindex S-@key{TAB}
4453 @kindex @key{TAB}
4454 @vindex mh-compose-skipped-header-fields
4455 @vindex mh-letter-header-field
4456
4457 Within the header of the message, the command@* @key{TAB}
4458 (@code{mh-letter-next-header-field-or-indent}) moves between fields
4459 that are highlighted with the face @code{mh-letter-header-field},
4460 skipping those fields listed in
4461 @code{mh-compose-skipped-header-fields}. After the last field, this
4462 command then moves point to the message body before cycling back to
4463 the first field. If point is already past the first line of the
4464 message body, then this command indents by calling
4465 @code{indent-relative} with the given prefix argument. The command
4466 @kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4467 backwards between the fields and cycles to the body of the message
4468 after the first field. Unlike the command @key{TAB}, it will always
4469 take point to the last field from anywhere in the body.
4470
4471 @cindex alias completion
4472 @cindex completion
4473 @cindex spell check
4474 @findex ispell-complete-word
4475 @findex mh-letter-complete
4476 @findex mh-letter-complete-or-space
4477 @findex mh-letter-confirm-address
4478 @kindex , (comma)
4479 @kindex M-@key{TAB}
4480 @kindex @key{SPC}
4481 @vindex mh-letter-complete-function
4482
4483 If the field contains addresses (for example, @samp{To:} or
4484 @samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4485 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4486 completion (@pxref{Aliases}). In the body of the message,
4487 @kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4488 which is set to @samp{'ispell-complete-word} by default. The command
4489 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4490 that is passed to the @code{mh-letter-complete-function}. In addition,
4491 turn on the option @code{mh-compose-space-does-completion-flag} to use
4492 the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4493 completion in the header as well; use a prefix argument to specify
4494 more than one space. Addresses are separated by a comma; when you
4495 press the comma, the command @code{mh-letter-confirm-address} flashes
4496 the alias expansion in the minibuffer if
4497 @code{mh-alias-flash-on-comma} is turned on.
4498
4499 @kindex C-c C-t
4500 @findex mh-letter-toggle-header-field-display
4501 @c XXX Document the replacement for the inaccessible 'long argument.
4502
4503 Use the command @kbd{C-c C-t}
4504 @code{mh-letter-toggle-header-field-display} to display truncated
4505 header fields. This command is a toggle so entering it again will hide
4506 the field. This command takes a prefix argument: if negative then the
4507 field is hidden, if positive then the field is displayed (for example,
4508 @kbd{C-u C-c C-t}).
4509
4510 Be sure to leave a row of dashes or a blank line between the header
4511 and the body of the message.
4512
4513 @vindex mh-letter-fill-column
4514
4515 The body of the message is edited as you would edit any Emacs buffer
4516 although there are a few commands and options to assist you. You can
4517 change the fill column in MH-Letter mode with the option
4518 @code{mh-letter-fill-column}. By default, this option is 72 to allow
4519 others to quote your message without line wrapping.
4520
4521 @cindex filling paragraphs
4522 @cindex paragraphs, filling
4523 @findex fill-paragraph
4524 @kindex M-q
4525 @vindex mh-ins-buf-prefix
4526
4527 You'll often include messages that were sent from user agents that
4528 haven't yet realized that paragraphs consist of more than a single
4529 line. This makes for long lines that wrap in an ugly fashion. You'll
4530 find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4531 quoted messages, even if they are nested, just as long as all of the
4532 quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4533 Letter}). For example, let's assume you have the following in your
4534 draft:
4535
4536 @example
4537 @group
4538 > Hopefully this gives you an idea of what I'm currently doing. I'm \
4539 not sure yet whether I'm completely satisfied with my setup, but \
4540 it's worked okay for me so far.
4541 @end group
4542 @end example
4543
4544 Running @kbd{M-q} on this paragraph produces:
4545
4546 @example
4547 @group
4548 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4549 > sure yet whether I'm completely satisfied with my setup, but it's
4550 > worked okay for me so far.
4551 @end group
4552 @end example
4553
4554 @findex mh-open-line
4555 @findex open-line
4556 @kindex C-c C-o
4557 @kindex C-o
4558
4559 The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4560 command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4561 after point. It differs in that it also inserts the right number of
4562 quoting characters and spaces so that the next line begins in the same
4563 column as it was. This is useful when breaking up paragraphs in
4564 replies. For example, if this command was used when point was after
4565 the first period in the paragraph above, the result would be this:
4566
4567 @example
4568 @group
4569 > Hopefully this gives you an idea of what I'm currently doing.
4570
4571 > I'm not
4572 > sure yet whether I'm completely satisfied with my setup, but it's
4573 > worked okay for me so far.
4574 @end group
4575 @end example
4576
4577 @node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4578 @section Inserting Letter to Which You're Replying
4579
4580 @cindex inserting messages
4581 @cindex replying to messages
4582 @cindex yanking messages
4583 @findex mh-yank-cur-msg
4584 @kindex C-c C-y
4585
4586 It is often useful to insert a snippet of text from a letter that
4587 someone mailed to provide some context for your reply. The command
4588 @kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4589 attribution, yanking a portion of text from the message to which
4590 you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4591 before each line.
4592
4593 @example
4594 @group
4595 Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4596
4597 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4598 > sure yet whether I'm completely satisfied with my setup, but it's
4599 > worked okay for me so far.
4600 @end group
4601 @end example
4602
4603 @vindex mh-extract-from-attribution-verb
4604
4605 The attribution consists of the sender's name and email address
4606 followed by the content of the option
4607 @code{mh-extract-from-attribution-verb}. This option can be set to
4608 @samp{wrote:}, @samp{a écrit:}, and @samp{schrieb:}. You can also use
4609 the @samp{Custom String} menu item to enter your own verb.
4610
4611 @vindex mh-ins-buf-prefix
4612
4613 The prefix @code{"> "} is the default setting for the option
4614 @code{mh-ins-buf-prefix}. I suggest that you not modify this option
4615 since it is used by many mailers and news readers: messages are far
4616 easier to read if several included messages have all been indented by
4617 the same string. This prefix is not inserted if you use one of the
4618 supercite flavors of @code{mh-yank-behavior} or you have added a
4619 @code{mail-citation-hook} as described below.
4620
4621 @vindex mh-delete-yanked-msg-window-flag
4622
4623 You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4624 option to delete the window containing the original message after
4625 yanking it to make more room on your screen for your reply.
4626
4627 @vindex mh-yank-behavior
4628 @cindex Emacs, packages, supercite
4629 @cindex supercite package
4630
4631 You can control how the message to which you are replying is yanked
4632 into your reply using @code{mh-yank-behavior}. To include the entire
4633 message, including the entire header, use @samp{Body and
4634 Header}@footnote{If you'd rather have the header cleaned up, use
4635 @kbd{C-u r} instead of @kbd{r} when replying
4636 (@pxref{Replying}).}@footnote{In the past you would use this setting
4637 and set @code{mail-citation-hook} to @samp{supercite}, but this usage
4638 is now deprecated in favor of the @samp{Invoke supercite} setting.}.
4639 Use @samp{Body} to yank just the body without the header. To yank only
4640 the portion of the message following the point, set this option to
4641 @samp{Below Point}.
4642
4643 Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
4644 full-bodied, full-featured, citation package that comes standard with
4645 Emacs.} to pass the entire message and header through supercite.
4646
4647 If the @samp{Body With Attribution} setting is used, then the message
4648 minus the header is yanked and a simple attribution line is added at
4649 the top using the value of the option
4650 @code{mh-extract-from-attribution-verb}. This is the default.
4651
4652 If the @samp{Invoke supercite} or @samp{Body With Attribution}
4653 settings are used, the @samp{-noformat} argument is passed to the
4654 @command{repl} program to override a @samp{-filter} or @samp{-format}
4655 argument. These settings also have @samp{Automatically} variants that
4656 perform the action automatically when you reply so that you don't need
4657 to use @kbd{C-c C-y} at all. Note that this automatic action is only
4658 performed if the show buffer matches the message being replied to.
4659 People who use the automatic variants tend to turn on the option
4660 @code{mh-delete-yanked-msg-window-flag} as well so that the show
4661 window is never displayed.
4662
4663 If the show buffer has a region, the option @code{mh-yank-behavior} is
4664 ignored unless its value is one of @samp{Attribution} variants in
4665 which case the attribution is added to the yanked region.
4666
4667 @findex trivial-cite
4668 @vindex mail-citation-hook
4669
4670 If this isn't enough, you can gain full control over the appearance of
4671 the included text by setting @code{mail-citation-hook} to a function
4672 that modifies it. This hook is ignored if the option
4673 @code{mh-yank-behavior} is set to one of the supercite flavors.
4674 Otherwise, this option controls how much of the message is passed to
4675 the hook. The function can find the citation between point and mark
4676 and it should leave point and mark around the modified citation text
4677 for the next hook function. The standard prefix
4678 @code{mh-ins-buf-prefix} is not added if this hook is set.
4679
4680 For example, if you use the hook function
4681 @uref{http://shasta.cs.uiuc.edu/~lrclause/tc.html,
4682 @code{trivial-cite}} (which is NOT part of Emacs), set
4683 @code{mh-yank-behavior} to @samp{Body and Header}.
4684
4685 @node Inserting Messages, Signature, Inserting Letter, Editing Drafts
4686 @section Inserting Messages
4687
4688 @cindex inserting messages
4689 @findex mh-insert-letter
4690 @findex mh-yank-behavior
4691 @kindex C-c C-i
4692 @vindex mh-ins-buf-prefix
4693 @vindex mh-invisible-header-fields-compiled
4694
4695 Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
4696 This command prompts you for the folder and message number, which
4697 defaults to the current message in that folder. It then inserts the
4698 messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
4699 @code{mh-yank-behavior} is set to one of the supercite flavors in
4700 which case supercite is used to format the message. Certain
4701 undesirable header fields (see
4702 @code{mh-invisible-header-fields-compiled}) are removed before
4703 insertion.
4704
4705 If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
4706 left intact, the message is not indented, and @samp{> } is not
4707 inserted before each line. This command leaves the mark before the
4708 letter and point after it.
4709
4710 @node Signature, Picture, Inserting Messages, Editing Drafts
4711 @section Inserting Your Signature
4712
4713 @cindex signature
4714 @findex mh-insert-signature
4715 @kindex C-c C-s
4716
4717 You can insert your signature at the current cursor location with the
4718 command @kbd{C-c C-s} (@code{mh-insert-signature}).
4719
4720 @cindex @file{.signature}
4721 @cindex files, @file{.signature}
4722 @cindex vCard
4723 @vindex mh-signature-file-name
4724
4725 By default, the text of your signature is taken from the file
4726 @file{~/.signature}. You can read from other sources by changing the
4727 option @code{mh-signature-file-name}. This file may contain a
4728 @dfn{vCard} in which case an attachment is added with the vCard.
4729
4730 @findex mh-signature-separator-p
4731 @vindex mh-signature-separator
4732 @vindex mh-signature-separator-regexp
4733
4734 The option @code{mh-signature-file-name} may also be a symbol, in
4735 which case that function is called. You may not want a signature
4736 separator to be added for you; instead you may want to insert one
4737 yourself. Options that you may find useful to do this include
4738 @code{mh-signature-separator} (when inserting a signature separator)
4739 and @code{mh-signature-separator-regexp} (for finding said separator).
4740 The function @code{mh-signature-separator-p}, which reports @code{t}
4741 if the buffer contains a separator, may be useful as well.
4742
4743 @cindex signature separator
4744 @vindex mh-signature-separator-flag
4745
4746 A signature separator (@code{"-- "}) will be added if the signature
4747 block does not contain one and @code{mh-signature-separator-flag} is
4748 on. It is not recommended that you change this option since various
4749 mail user agents, including MH-E, use the separator to present the
4750 signature differently, and to suppress the signature when replying or
4751 yanking a letter into a draft.
4752
4753 @vindex mh-insert-signature-hook
4754
4755 The hook @code{mh-insert-signature-hook} is run after the signature is
4756 inserted. Hook functions may access the actual name of the file or the
4757 function used to insert the signature with
4758 @code{mh-signature-file-name}.
4759
4760 The signature can also be inserted using Identities.
4761 @xref{Identities}.
4762
4763 @node Picture, Adding Attachments, Signature, Editing Drafts
4764 @section Inserting Your Picture
4765
4766 @cindex @file{.face}
4767 @cindex files, @file{.face}
4768 @vindex mh-x-face-file
4769
4770 You can insert your picture in the header of your mail message so that
4771 recipients see your face in the @samp{From:} header field if their
4772 mail user agent is sophisticated enough. In MH-E, this is done by
4773 placing your image in the file named by the option
4774 @code{mh-x-face-file} which is @file{~/.face} by default.
4775
4776 @cindex @samp{Face:} header field
4777 @cindex @samp{X-Face:} header field
4778 @cindex @samp{X-Image-URL:} header field
4779 @cindex header field, @samp{Face:}
4780 @cindex header field, @samp{X-Face:}
4781 @cindex header field, @samp{X-Image-URL:}
4782
4783 If the file starts with either of the strings @samp{X-Face:},
4784 @samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
4785 message header verbatim. Otherwise it is assumed that the file
4786 contains the value of the @samp{X-Face:} header field.
4787
4788 @cindex @command{compface}
4789 @cindex Unix commands, @command{compface}
4790
4791 The @samp{X-Face:} header field, which is a low-resolution, black and
4792 white image, can be generated using the
4793 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
4794 @command{compface}} command. The @uref{http://www.dairiki.org/xface/,
4795 @cite{Online X-Face Converter}} is a useful resource for quick
4796 conversion of images into @samp{X-Face:} header fields.
4797
4798 Use the @uref{http://quimby.gnus.org/circus/face/make-face,
4799 @command{make-face}} script to convert a JPEG image to the higher
4800 resolution, color, @samp{Face:} header field.
4801
4802 The URL of any image can be used for the @samp{X-Image-URL:} field and
4803 no processing of the image is required.
4804
4805 To prevent the setting of any of these header fields, either set
4806 @code{mh-x-face-file} to @code{nil}, or simply ensure that the file
4807 defined by this option doesn't exist.
4808
4809 @xref{Viewing}, to see how these header fields are displayed in MH-E.
4810
4811 @node Adding Attachments, Sending PGP, Picture, Editing Drafts
4812 @section Adding Attachments
4813
4814 @cindex @command{mhbuild}
4815 @cindex @command{mhn}
4816 @cindex MH commands, @command{mhbuild}
4817 @cindex MH commands, @command{mhn}
4818 @cindex MIME
4819 @cindex multimedia mail
4820
4821 MH-E has the capability to create multimedia messages. It uses the
4822 @sc{mime} (Multipurpose Internet Mail Extensions)
4823 protocol@footnote{@sc{mime} is defined in
4824 @uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
4825 @sc{mime} protocol allows you to incorporate images, sound, video,
4826 binary files, and even commands that fetch a file with @samp{ftp} when
4827 your recipient reads the message!
4828
4829 If you were to create a multimedia message with plain MH commands, you
4830 would insert @command{mhbuild} or @command{mhn} directives (henceforth
4831 called @dfn{MH-style directives} into your draft and use the
4832 @command{mhbuild} command in nmh or @command{mhn} command in MH and
4833 GNU mailutils to expand them. MH-E works in much the same way,
4834 although it provides a handful of commands prefixed with @kbd{C-c C-m}
4835 to insert the directives so you don't need to remember the syntax of
4836 them. Remember: you can always add MH-style directives by
4837 hand@footnote{See the section
4838 @uref{@value{MH-BOOK-HOME}/usimim.htm#SeMIMa, Sending MIME Mail} in
4839 the MH book.}.
4840
4841 @cindex MIME Meta Language (MML)
4842 @cindex MML
4843 @vindex mh-compose-insertion
4844
4845 In addition to MH-style directives, MH-E also supports MML (@sc{mime}
4846 Meta Language) tags@footnote{
4847 @ifinfo
4848 @c Although the third argument should default to the
4849 @c first, makeinfo goes to the wrong Info file without it being
4850 @c different--it seems to be getting our own Composing node.
4851 @xref{Composing,,Composing with MML,emacs-mime}.
4852 @end ifinfo
4853 @ifnotinfo
4854 See the section Composing in
4855 @uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
4856 Manual}}.
4857 @end ifnotinfo
4858 }. The option @code{mh-compose-insertion} can be used to choose
4859 between them. By default, this option is set to @samp{MML} if it is
4860 supported since it provides a lot more functionality. This option can
4861 also be set to @samp{MH} if MH-style directives are preferred.
4862
4863 @cindex media types
4864 @cindex MIME, media types
4865
4866 The MH-E @sc{mime} commands require a @dfn{media type} for each body
4867 part or attachment. For example, a PDF document is of type
4868 @samp{application/pdf} and an HTML document is of type
4869 @samp{text/html}. Some commands fill in the media type for you,
4870 whereas others require you to enter one.
4871
4872 @cindex @command{file}
4873 @cindex @file{/etc/mime.types}
4874 @cindex Unix commands, @command{file}
4875 @cindex files, @file{/etc/mime.types}
4876 @findex mailcap-mime-types
4877
4878 In the cases where MH-E can do so, it will determine the media type
4879 automatically. It uses the @command{file} command to do this. Failing
4880 that, the Emacs function @code{mailcap-mime-types} is used to provide
4881 a list from which to choose. This function usually reads the file
4882 @file{/etc/mime.types}.
4883
4884 Whether the media type is chosen automatically, or you choose it from
4885 a list, use the type that seems to match best the file that you are
4886 including. In the case of binaries, the media type
4887 @samp{application/x-executable} can be useful. If you can't find an
4888 appropriate media type, use @samp{text/plain} for text messages and
4889 @samp{application/octet-stream} for everything else.
4890
4891 @cindex content description
4892 @cindex MIME, content description
4893
4894 You are also sometimes asked for a @dfn{content description}. This is
4895 simply an optional brief phrase, in your own words, that describes the
4896 object. If you don't care to enter a content description, just press
4897 return and none will be included; however, a reader may skip over
4898 multimedia fields unless the content description is compelling.
4899
4900 You can also create your own @sc{mime} body parts. In the following
4901 example, I describe how you can create and edit a @samp{text/enriched}
4902 body part to liven up your plain text messages with boldface,
4903 underlining, and italics. I include an Emacs function which inserts
4904 enriched text tags.
4905
4906 @smalllisp
4907 @group
4908 (defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
4909 ("u" . "underline")
4910 ("s" . "smaller") ("B" . "bigger")
4911 ("f" . "fixed")
4912 ("c" . "center"))
4913 "Alist of (final-character . tag) choices for add-enriched-text.
4914 Additional types can be found in RFC 1563.")
4915
4916 (defun add-enriched-text (begin end)
4917 "Add enriched text tags around region.
4918 The tag used comes from the list enriched-text-types and is
4919 specified by the last keystroke of the command. When called from Lisp,
4920 arguments are BEGIN and END@."
4921 (interactive "r")
4922 ;; @r{Set type to the tag indicated by the last keystroke.}
4923 (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
4924 enriched-text-types))))
4925 (save-restriction ; @r{restores state from narrow-to-region}
4926 (narrow-to-region begin end) ; @r{narrow view to region}
4927 (goto-char (point-min)) ; @r{move to beginning of text}
4928 (insert "<" type ">") ; @r{insert beginning tag}
4929 (goto-char (point-max)) ; @r{move to end of text}
4930 (insert "</" type ">")))) ; @r{insert terminating tag}
4931 @i{Emacs function for entering enriched text}
4932
4933 @end group
4934 @end smalllisp
4935
4936 To use the function @code{add-enriched-text}, first add it to
4937 @file{~/.emacs} and create key bindings for it (@pxref{Composing}).
4938
4939 Then, in your plain text message, set the mark with @kbd{C-@@} or
4940 @kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
4941 b}. This adds @samp{<bold>} where you set the mark and adds
4942 @samp{</bold>} at the location of your cursor, giving you something
4943 like: @samp{You should be <bold>very</bold>}.
4944
4945 Before sending this message, use @kbd{C-c C-m C-m}
4946 (@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
4947 (@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
4948 MIME header fields. Then replace @samp{text/plain} with
4949 @samp{text/enriched} in the @samp{Content-Type:} header field.
4950
4951 You may also be interested in investigating @code{sgml-mode}.
4952
4953 @subheading Including Files
4954
4955 @cindex MIME, images
4956 @cindex MIME, sound
4957 @cindex MIME, video
4958 @cindex attachments, inserting
4959 @cindex images
4960 @cindex sound
4961 @cindex video
4962 @findex mh-compose-insertion
4963 @kindex C-c C-m C-i
4964 @kindex C-c C-m i
4965
4966 Binaries, images, sound, and video can be inserted in your message
4967 with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
4968 are prompted for the filename containing the object, the media type if
4969 it cannot be determined automatically, and a content description. If
4970 you're using MH-style directives, you will also be prompted for
4971 additional attributes.
4972
4973 @subheading Forwarding Multimedia Messages
4974
4975 @findex mh-compose-forward
4976 @kindex C-c C-m C-f
4977 @kindex C-c C-m f
4978
4979 Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
4980 C-f} (@code{mh-compose-forward}). You are prompted for a content
4981 description, the name of the folder in which the messages to forward
4982 are located, and a range of messages, which defaults to the current
4983 message in that folder. @xref{Ranges}.
4984
4985 @subheading Including an FTP Reference
4986
4987 @cindex @command{ftp}
4988 @cindex MIME, @command{ftp}
4989 @cindex Unix commands, @command{ftp}
4990 @findex mh-mh-compose-anon-ftp
4991 @kindex C-c C-m C-g
4992 @kindex C-c C-m g
4993
4994 You can have your message initiate an @command{ftp} transfer when the
4995 recipient reads the message. To do this, use the command @kbd{C-c C-m
4996 C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
4997 host and filename, the media type, and the content description.
4998
4999 @subheading Including tar Files
5000
5001 @cindex @command{ftp}
5002 @cindex @command{tar}
5003 @cindex MIME, @command{ftp}
5004 @cindex MIME, @command{tar}
5005 @cindex Unix commands, @command{ftp}
5006 @cindex Unix commands, @command{tar}
5007 @findex mh-mh-compose-external-compressed-tar
5008 @kindex C-c C-m C-t
5009 @kindex C-c C-m t
5010
5011 If the remote file is a compressed tar file, you can use @kbd{C-c C-m
5012 C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
5013 to retrieving the file via anonymous @emph{ftp} as per the command
5014 @kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
5015 be uncompressed and untarred. You are prompted for the remote host and
5016 filename and the content description.
5017
5018 @subheading Including Other External Files
5019
5020 @findex mh-mh-compose-external-type
5021 @kindex C-c C-m C-x
5022 @kindex C-c C-m x
5023
5024 The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5025 a general utility for referencing external files. In fact, all of the
5026 other commands that insert tags to access external files call this
5027 command. You are prompted for the access type, remote host and
5028 filename, and content type. If you provide a prefix argument, you are
5029 also prompted for a content description, attributes, parameters, and a
5030 comment.
5031
5032 @subheading Previewing Multimedia Messages
5033
5034 When you are finished editing a @sc{mime} message, it might look like this:
5035
5036 @cartouche
5037 @smallexample
5038 3 t08/24 root received fax files on Wed Aug 24 11:00:
5039 4+t08/24 To:wohler Test<<This is a test message to get the
5040
5041
5042
5043
5044
5045 --:%% @{+inbox@} 4 msgs (1-4) (MH-Folder Show)--L4--Bot---------------
5046 To: wohler
5047 cc:
5048 Subject: Test of MIME
5049 --------
5050 Here is the SETI@@Home logo:
5051
5052 <#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5053 disposition=inline description="SETI@@home logo">
5054 <#/part>
5055 --:** @{draft@} (MH-Letter)--L8--All----------------------------------
5056
5057 @end smallexample
5058 @end cartouche
5059 @i{MH-E @sc{mime} draft}
5060
5061 @findex mh-mml-to-mime
5062 @kindex C-c C-m C-m
5063 @kindex C-c C-m m
5064
5065 Typically, you send a message with attachments just like any other
5066 message (@pxref{Sending Message}).
5067
5068 However, you may take a sneak preview of the @sc{mime} encoding if you
5069 wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5070 The following screen shows the @sc{mime} encoding specified by the
5071 tags. You can see why mail user agents are usually built to hide these
5072 details from the user.
5073
5074 @cartouche
5075 @smallexample
5076 To: wohler
5077 cc:
5078 Subject: Test of MIME
5079 MIME-Version: 1.0
5080 Content-Type: multipart/mixed; boundary="=-=-="
5081 --------
5082 --=-=-=
5083
5084 Here is the SETI@@Home logo:
5085
5086
5087 --=-=-=
5088 Content-Type: image/x-xpm
5089 Content-Disposition: inline; filename=setiathome.xpm
5090 Content-Transfer-Encoding: base64
5091 Content-Description: SETI@@home logo
5092
5093 LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2NCAy
5094 --:-- @{draft@} (MH-Letter)--L2--Top----------------------------------
5095
5096 @end smallexample
5097 @end cartouche
5098 @i{MH-E @sc{mime} draft ready to send}
5099
5100 This action can be undone by running @kbd{C-_} (@code{undo}).
5101
5102 @cindex @command{mhbuild}
5103 @cindex @command{mhn}
5104 @cindex MH commands, @command{mhbuild}
5105 @cindex MH commands, @command{mhn}
5106 @findex mh-mh-to-mime
5107 @findex mh-mh-to-mime-undo
5108 @kindex C-c C-e
5109 @kindex C-c C-m C-u
5110 @kindex C-c C-m u
5111
5112 If you're using MH-style directives, use @kbd{C-c C-e}
5113 (@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5114 command @command{mhbuild} (@command{mhn}) on the message which expands
5115 the tags@footnote{See the section
5116 @uref{@value{MH-BOOK-HOME}/usimim.htm#SeMIMa, Sending MIME Mail} in
5117 the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5118 (@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5119 file. You are prompted to confirm this action, but you can avoid the
5120 confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5121 C-u}).
5122
5123 @vindex mh-mh-to-mime-args
5124
5125 If you wish to pass additional arguments to @command{mhbuild}
5126 (@command{mhn}) to affect how it builds your message, use the option
5127 @code{mh-mh-to-mime-args}. For example, you can build a consistency
5128 check into the message by setting @code{mh-mh-to-mime-args} to
5129 @samp{-check}. The recipient of your message can then run
5130 @samp{mhbuild -check} on the message---@command{mhbuild}
5131 (@command{mhn}) will complain if the message has been corrupted on the
5132 way. The command @kbd{C-c C-e} (@code{mh-mh-to-mime}) only consults
5133 this option when given a prefix argument (as in @kbd{C-u C-c C-e}).
5134
5135 @vindex mh-mh-to-mime-hook
5136
5137 The hook @code{mh-mh-to-mime-hook} is called after the message has
5138 been formatted by @kbd{C-c C-e} (@code{mh-mh-to-mime})
5139
5140 @node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5141 @section Signing and Encrypting Messages
5142
5143 @cindex signing messages
5144 @cindex encrypting messages
5145 @cindex RFC 3156
5146
5147 MH-E can sign and encrypt messages as defined in
5148 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5149 should choose to sign or encrypt your message, use one of the
5150 following commands to do so any time before sending your message.
5151
5152 @findex mh-mml-secure-message-encrypt
5153 @findex mh-mml-secure-message-sign
5154 @findex mh-mml-secure-message-signencrypt
5155 @kindex C-c C-m C-e
5156 @kindex C-c C-m C-s
5157 @kindex C-c C-m e e
5158 @kindex C-c C-m e s
5159 @kindex C-c C-m s e
5160 @kindex C-c C-m s s
5161
5162 The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5163 inserts the following tag:
5164
5165 @example
5166 <#secure method=pgpmime mode=sign>
5167 @end example
5168
5169 This is used to sign your message digitally. Likewise, the command
5170 @kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5171 following tag:
5172
5173 @example
5174 <#secure method=pgpmime mode=encrypt>
5175 @end example
5176
5177 This is used to encrypt your message. Finally, the command @kbd{C-c
5178 C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5179 following tag:
5180
5181 @example
5182 <#secure method=pgpmime mode=signencrypt>
5183 @end example
5184
5185 @findex mh-mml-unsecure-message
5186 @kindex C-c C-m C-n
5187 @kindex C-c C-m n
5188
5189 This is used to sign and encrypt your message. In each of these cases,
5190 a proper multipart message is created for you when you send the
5191 message. Use the command @kbd{C-c C-m C-n}
5192 (@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5193 argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5194 possible security methods (see @code{mh-mml-method-default}).
5195
5196 @vindex mh-mml-method-default
5197
5198 The option @code{mh-mml-method-default} is used to select between a
5199 variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5200 if it is supported; otherwise, the default is @samp{None}. Other
5201 mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5202
5203 @cindex @samp{pgg} customization group
5204 @cindex PGG
5205 @cindex customization group, @samp{pgg}
5206
5207 The @samp{pgg} customization group may have some settings which may
5208 interest you.
5209 @iftex
5210 See @cite{The PGG Manual}.
5211 @end iftex
5212 @ifinfo
5213 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5214 @end ifinfo
5215 @ifhtml
5216 See
5217 @uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
5218 @cite{The PGG Manual}}.
5219 @end ifhtml
5220
5221 @cindex @samp{Fcc:} header field
5222 @cindex header field, @samp{Fcc:}
5223 @vindex pgg-encrypt-for-me
5224
5225 In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5226 all messages I encrypt are encrypted with my public key as well. If
5227 you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5228 field, this setting is vital so that you can read the mail you write!
5229
5230 @node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5231 @section Checking Recipients
5232
5233 @cindex @samp{*MH-E Recipients*}
5234 @cindex @command{whom}
5235 @cindex MH commands, @command{whom}
5236 @cindex buffers, @samp{*MH-E Recipients*}
5237 @cindex checking recipients
5238 @cindex recipients, checking
5239 @findex mh-check-whom
5240 @kindex C-c C-w
5241
5242 The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5243 you can check the actual address(es) in the alias. A new buffer named
5244 @samp{*MH-E Recipients*} is created with the output of @command{whom}
5245 (@pxref{Miscellaneous})@footnote{See the section
5246 @uref{@value{MH-BOOK-HOME}/senove.htm#WhaPro, What now? -- and the
5247 whatnow Program} in the MH book.}.
5248
5249 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5250 @section Sending a Message
5251
5252 @cindex @samp{*MH-E Mail Delivery*}
5253 @cindex buffers, @samp{*MH-E Mail Delivery*}
5254 @cindex sending mail
5255 @findex mh-send-letter
5256 @kindex C-c C-c
5257
5258 When you are all through editing a message, you send it with the
5259 command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5260 argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5261 delivery; this output can be found in a buffer called @samp{*MH-E Mail
5262 Delivery*} (@pxref{Miscellaneous}).
5263
5264 @cindex sending mail
5265 @cindex spell check
5266 @vindex mh-before-send-letter-hook
5267
5268 The hook @code{mh-before-send-letter-hook} is run at the beginning of
5269 the command @kbd{C-c C-c}. For example, if you want to check your
5270 spelling in your message before sending, add the function
5271 @code{ispell-message}.
5272
5273 @cindex @command{send}
5274 @cindex MH commands, @command{send}
5275 @vindex mh-send-prog
5276
5277 In case the MH @command{send} program@footnote{See the section
5278 @uref{@value{MH-BOOK-HOME}/sensen.htm, Sending Some Mail: comp send}
5279 in the MH book.} is installed under a different name, use
5280 @code{mh-send-prog} to tell MH-E the name.
5281
5282 @node Killing Draft, , Sending Message, Editing Drafts
5283 @section Killing the Draft
5284
5285 @cindex killing draft
5286 @findex kill-buffer
5287 @findex mh-fully-kill-draft
5288 @kindex C-c C-q
5289 @kindex C-x k
5290
5291 If for some reason you are not happy with the draft, you can use the
5292 command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5293 buffer and delete the draft message. Use the command @kbd{C-x k}
5294 (@code{kill-buffer}) if you don't want to delete the draft message.
5295
5296 @node Aliases, Identities, Editing Drafts, Top
5297 @chapter Aliases
5298
5299 @cindex aliases
5300
5301 MH aliases are used in the same way in MH-E as they are in MH. Any
5302 alias listed as a recipient will be expanded when the message is sent.
5303 This chapter discusses other things you can do with aliases in MH-E.
5304
5305 @cindex MH-Letter mode
5306 @cindex modes, MH-Letter
5307
5308 The following commands are available in MH-Letter mode with the
5309 exception of @code{mh-alias-reload} which can be called from anywhere.
5310
5311 @table @kbd
5312 @kindex @key{SPC}
5313 @findex mh-letter-complete-or-space
5314 @item @key{SPC}
5315 Perform completion or insert space (@code{mh-letter-complete-or-space}).
5316 @c -------------------------
5317 @kindex M-@key{TAB}
5318 @findex mh-letter-complete
5319 @item M-@key{TAB}
5320 Perform completion on header field or word preceding point
5321 (@code{mh-letter-complete}).
5322 @c -------------------------
5323 @findex mh-alias-apropos
5324 @item mh-alias-apropos
5325 Show all aliases or addresses that match a regular expression.
5326 @c -------------------------
5327 @findex mh-alias-grab-from-field
5328 @item mh-alias-grab-from-field
5329 Add alias for the sender of the current message
5330 @c -------------------------
5331 @findex mh-alias-reload
5332 @item mh-alias-reload
5333 Reload MH aliases.
5334 @end table
5335
5336 @cindex @samp{mh-alias} customization group
5337 @cindex customization group, @samp{mh-alias}
5338
5339 The @samp{mh-alias} customization group contains options associated
5340 with aliases.
5341
5342 @vtable @code
5343 @item mh-alias-completion-ignore-case-flag
5344 On means don't consider case significant in MH alias completion
5345 (default: @samp{on}).
5346 @c -------------------------
5347 @item mh-alias-expand-aliases-flag
5348 On means to expand aliases entered in the minibuffer (default:
5349 @samp{off}).
5350 @c -------------------------
5351 @item mh-alias-flash-on-comma
5352 Specify whether to flash address or warn on translation (default: @samp{Flash
5353 but Don't Warn If No Alias}).
5354 @c -------------------------
5355 @item mh-alias-insert-file
5356 Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5357 Profile Component}).
5358 @c -------------------------
5359 @item mh-alias-insertion-location
5360 Specifies where new aliases are entered in alias files (default:
5361 @samp{Alphabetical}).
5362 @c -------------------------
5363 @item mh-alias-local-users
5364 If @samp{on}, local users are added to alias completion (default:
5365 @samp{on}).
5366 @c -------------------------
5367 @item mh-alias-local-users-prefix
5368 String prefixed to the real names of users from the password file
5369 (default: @code{"local."}.
5370 @c -------------------------
5371 @item mh-alias-passwd-gecos-comma-separator-flag
5372 On means the GECOS field in the password file uses a comma separator
5373 (default: @samp{on}).
5374 @end vtable
5375
5376 The following hook is available.
5377
5378 @vtable @code
5379 @item mh-alias-reloaded-hook
5380 Hook run by @code{mh-alias-reload} after loading aliases (default:
5381 @code{nil}).
5382 @end vtable
5383
5384 @heading Adding Addresses to Draft
5385
5386 You can use aliases when you are adding recipients to a message.
5387
5388 @findex minibuffer-complete
5389 @kindex @key{TAB}
5390
5391 In order to use minibuffer prompting for recipients and the subject
5392 line in the minibuffer, turn on the option
5393 @code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5394 @key{TAB} (@code{minibuffer-complete}) command to complete aliases
5395 (and optionally local logins) when prompted for the recipients. Turn
5396 on the option @code{mh-alias-expand-aliases-flag} if you want these
5397 aliases to be expanded to their respective addresses in the draft.
5398
5399 Otherwise, you can complete aliases in the header of the draft with
5400 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5401 (@code{mh-letter-complete-or-space}).
5402
5403 As MH ignores case in the aliases, so too does MH-E. However, you may
5404 turn off the option @code{mh-alias-completion-ignore-case-flag} to
5405 make case significant which can be used to segregate completion of
5406 your aliases. You might use uppercase for mailing lists and lowercase
5407 for people. For example, you might have:
5408
5409 @example
5410 mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5411 MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5412 @end example
5413
5414 When this option is turned off, if you were to type @kbd{M} in the
5415 @samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5416 if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5417 you'd get Mark's address. Note that this option affects completion
5418 only. If you were to enter @kbd{Mark.Baushke}, it would still be
5419 identified with your @samp{mark.baushke} alias.
5420
5421 To verify that the alias you've entered is valid, the alias will be
5422 displayed in the minibuffer when you type a comma
5423 (@code{mh-letter-confirm-address} or
5424 @code{mh-alias-minibuffer-confirm-address} if the option
5425 @code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5426 behavior can be controlled with the option
5427 @code{mh-alias-flash-on-comma} which provides three choices:
5428 @samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5429 Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5430
5431 For another way to verify the alias expansion, see @ref{Checking
5432 Recipients}.
5433
5434 @heading Loading Aliases
5435
5436 @cindex @command{ali}
5437 @cindex @file{/etc/nmh/MailAliases}
5438 @cindex @samp{Aliasfile:} MH profile component
5439 @cindex MH commands, @command{ali}
5440 @cindex MH profile component, @samp{Aliasfile:}
5441 @cindex files, @file{/etc/nmh/MailAliases}
5442
5443 MH-E loads aliases for completion and folder name hints from various
5444 places. It uses the MH command @command{ali}@footnote{See the section
5445 @uref{@value{MH-BOOK-HOME}/mh.htm, MH Aliases} in the MH book.} to
5446 read aliases from the files listed in the profile component
5447 @samp{Aliasfile:} as well as system-wide aliases (for example,
5448 @file{/etc/nmh/MailAliases}).
5449
5450 @cindex @file{/etc/passwd}
5451 @cindex files, @file{/etc/passwd}
5452
5453 In addition, aliases are created from @file{/etc/passwd} entries with
5454 a user ID larger than a magical number, typically 200. This can be a
5455 handy tool on a machine where you and co-workers exchange messages.
5456 These aliases have the form @samp{local.@var{first.last}} if a real
5457 name is present in the password file. Otherwise, the alias will have
5458 the form @samp{local.@var{login}}.
5459
5460 The prefix @samp{local.} can be modified via the option
5461 @code{mh-alias-local-users-prefix}. This option can also be set to
5462 @samp{Use Login}.
5463
5464 For example, consider the following password file entry:
5465
5466 @example
5467 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5468 @end example
5469
5470 The following settings of option @code{mh-alias-local-users-prefix}
5471 will produce the associated aliases:
5472
5473 @table @code
5474 @item "local."
5475 local.peter.galbraith
5476 @c -------------------------
5477 @item ""
5478 peter.galbraith
5479 @c -------------------------
5480 @item Use Login
5481 psg
5482 @end table
5483
5484 In the example above, commas are used to separate different values
5485 within the so-called GECOS field. This is a fairly common usage.
5486 However, in the rare case that the GECOS field in your password file
5487 is not separated by commas and whose contents may contain commas, you
5488 can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5489 off.
5490
5491 @cindex @samp{ypcat passwd}
5492 @cindex NIS, obtaining local aliases from
5493
5494 If you're on a system with thousands of users you don't know, and the
5495 loading of local aliases slows MH-E down noticeably, then the local
5496 alias feature can be disabled by turning off the option
5497 @code{mh-alias-local-users}. This option also takes a string which is
5498 executed to generate the password file. For example, use @samp{ypcat
5499 passwd} to obtain the NIS password file.
5500
5501 Since aliases are updated frequently, MH-E reloads aliases
5502 automatically whenever an alias lookup occurs if an alias source has
5503 changed. However, you can reload your aliases manually by calling the
5504 command @kbd{M-x mh-alias-reload} directly. This command runs
5505 @code{mh-alias-reloaded-hook} after the aliases have been loaded.
5506
5507 @heading Adding Aliases
5508
5509 In the past, you have manually added aliases to your alias file(s)
5510 listed in your @samp{Aliasfile:} profile component. MH-E provides
5511 other methods for maintaining your alias file(s).
5512
5513 You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5514 you for the alias and address that you would like to add. If the alias
5515 exists already, you will have the choice of inserting the new alias
5516 before or after the old alias. In the former case, this alias will be
5517 used when sending mail to this alias. In the latter case, the alias
5518 serves as an additional folder name hint when filing messages
5519 (@pxref{Folder Selection}).
5520
5521 Earlier, the alias prefix @samp{local} was presented. You can use
5522 other prefixes to organize your aliases or disambiguate entries. You
5523 might use prefixes for locales, jobs, or activities. For example, I
5524 have:
5525
5526 @example
5527 ; Work
5528 attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5529 isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5530 ...
5531 ; Sport
5532 diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5533 sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5534 ...
5535 ; Personal
5536 ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5537 ...
5538 @end example
5539
5540 Using prefixes instead of postfixes helps you explore aliases during
5541 completion. If you forget the name of an old dive buddy, you can enter
5542 @samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5543
5544 An alias for the sender of the current message is added automatically
5545 by clicking on the @samp{Grab From alias} tool bar button or by running
5546 the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5547 recipients of the current message are added by placing your cursor
5548 over the desired recipient and giving the @kbd{M-x
5549 mh-alias-add-address-under-point} command.
5550
5551 The options @code{mh-alias-insert-file} and
5552 @code{mh-alias-insertion-location} controls how and where these aliases
5553 are inserted.
5554
5555 The default setting of this option is @samp{Use Aliasfile Profile
5556 Component}. This option can also hold the name of a file or a list a
5557 file names. If this option is set to a list of file names, or the
5558 @samp{Aliasfile:} profile component contains more than one file name,
5559 MH-E will prompt for one of them.
5560
5561 The option @code{mh-alias-insertion-location} is set to
5562 @samp{Alphabetical} by default. If you organize your alias file in
5563 other ways, then the settings @samp{Top} and @samp{Bottom} might be
5564 more appropriate.
5565
5566 @heading Querying Aliases
5567
5568 @cindex regular expressions, @code{mh-alias-apropos}
5569
5570 If you can't quite remember an alias, you can use @kbd{M-x
5571 mh-alias-apropos} to show all aliases or addresses that match a
5572 regular expression
5573 @ifnothtml
5574 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
5575 GNU Emacs Manual}).
5576 @end ifnothtml
5577 @ifhtml
5578 (see the section
5579 @uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
5580 Syntax of Regular Expressions} in
5581 @cite{The GNU Emacs Manual}).
5582 @end ifhtml
5583
5584 @node Identities, Speedbar, Aliases, Top
5585 @chapter Identities
5586
5587 @cindex identities
5588 @cindex multiple personalities
5589
5590 MH-E supports the concept of multiple personalities or identities.
5591 This means that you can easily have a different header and signature
5592 at home and at work.
5593
5594 A couple of commands are used to insert identities in MH-Letter mode
5595 which are also found in the @samp{Identity} menu.
5596
5597 @table @kbd
5598 @kindex C-c C-d
5599 @findex mh-insert-identity
5600 @item C-c C-d
5601 Insert fields specified by given identity (@code{mh-insert-identity}).
5602 @c -------------------------
5603 @cindex @samp{Identity > Insert Auto Fields} menu item
5604 @cindex menu item, @samp{Identity > Insert Auto Fields}
5605 @kindex C-c M-d
5606 @findex mh-insert-auto-fields
5607 @item C-c M-d
5608 Insert custom fields if recipient found in @code{mh-auto-fields-list}
5609 (@code{mh-insert-auto-fields}).
5610 @end table
5611
5612 @cindex @samp{mh-identity} customization group
5613 @cindex customization group, @samp{mh-identity}
5614
5615 The @samp{mh-identity} customization group contains the following
5616 options.
5617
5618 @vtable @code
5619 @item mh-auto-fields-list
5620 List of recipients for which header lines are automatically inserted
5621 (default: @code{nil}).
5622 @c -------------------------
5623 @item mh-auto-fields-prompt-flag
5624 On means to prompt before sending if fields inserted (default:
5625 @samp{on})
5626 @c -------------------------
5627 @item mh-identity-default
5628 Default identity to use when @code{mh-letter-mode} is called (default:
5629 @samp{None}).
5630 @c -------------------------
5631 @item mh-identity-handlers
5632 Handler functions for fields in @code{mh-identity-list}.
5633 @c -------------------------
5634 @item mh-identity-list
5635 List of identities (default: @code{nil}).
5636 @end vtable
5637
5638 Some of the common header fields that people change depending on the
5639 context are the @samp{From:} and @samp{Organization:} fields, as well
5640 as the signature.
5641
5642 This is done by customizing the option @code{mh-identity-list}. In the
5643 customization buffer for this option, click on the @samp{INS} button
5644 and enter a label such as @samp{Home} or @samp{Work}. Then click on
5645 the @samp{INS} button with the label @samp{Add at least one item
5646 below}. The @samp{Value Menu} has the following menu items:
5647
5648 @table @samp
5649 @cindex header field, @samp{From:}
5650 @cindex @samp{From:} header field
5651 @item From Field
5652 Specify an alternate @samp{From:} header field. You must include a
5653 valid email address. A standard format is @samp{First Last
5654 <login@@host.domain>}. If you use an initial with a period, then you
5655 must quote your name as in @samp{"First I. Last"
5656 <login@@host.domain>}.
5657 @c -------------------------
5658 @cindex header field, @samp{Organization:}
5659 @cindex @samp{Organization:} header field
5660 @item Organization Field
5661 People usually list the name of the company where they work here.
5662 @c -------------------------
5663 @item Other Field
5664 Set any arbitrary header field and value here. Unless the header field
5665 is a standard one, precede the name of your field's label with
5666 @samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
5667 @c -------------------------
5668 @item Attribution Verb
5669 This value overrides the setting of
5670 @code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
5671 @c -------------------------
5672 @cindex signature
5673 @vindex mh-signature-file-name
5674 @item Signature
5675 Set your signature with this item. You can specify the contents of
5676 @code{mh-signature-file-name}, a file, or a function.
5677 @xref{Signature}.
5678 @c -------------------------
5679 @item GPG Key ID
5680 Specify a different key to sign or encrypt messages.
5681 @end table
5682
5683 @cindex Identity menu
5684 @cindex menu, Identity
5685
5686 You can select the identities you have added via the menu called
5687 @samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
5688 C-d} (@code{mh-insert-identity}). To clear the fields and signature
5689 added by the identity, select the @samp{None} identity.
5690
5691 @cindex @samp{Identity > Save as Default} menu item
5692 @cindex menu item, @samp{Identity > Save as Default}
5693 @cindex @samp{Identity > Set Default for Session} menu item
5694 @cindex menu item, @samp{Identity > Set Default for Session}
5695 @cindex @samp{Identity > Customize Identities} menu item
5696 @cindex menu item, @samp{Identity > Customize Identities}
5697
5698 The @samp{Identity} menu contains two other items to save you from
5699 having to set the identity on every message. The menu item @samp{Set
5700 Default for Session} can be used to set the default identity to the
5701 current identity until you exit Emacs. The menu item @samp{Save as
5702 Default} sets the option @code{mh-identity-default} to the current
5703 identity setting. You can also customize the option
5704 @code{mh-identity-default} in the usual fashion. If you find that you
5705 need to add another identity, the menu item @samp{Customize
5706 Identities} is available for your convenience.
5707
5708 @cindex regular expressions, @code{mh-auto-fields-list}
5709
5710 The option @code{mh-auto-fields-list} can also be used to set the
5711 identity depending on the recipient to provide even more control. To
5712 customize @code{mh-auto-fields-list}, click on the @samp{INS} button
5713 and enter a regular expression for the recipient's address
5714 @ifnothtml
5715 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
5716 GNU Emacs Manual}).
5717 @end ifnothtml
5718 @ifhtml
5719 (see the section
5720 @uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
5721 Syntax of Regular Expressions} in
5722 @cite{The GNU Emacs Manual}).
5723 @end ifhtml
5724 Click on the @samp{INS} button with the @samp{Add at least one item
5725 below} label. The @samp{Value Menu} contains the following menu items:
5726
5727 @table @samp
5728 @item Identity
5729 Select an identity from those configured in @code{mh-identity-list}.
5730 All of the information for that identity will be added if the
5731 recipient matches.
5732 @c -------------------------
5733 @cindex @samp{Fcc:} header field
5734 @cindex header field, @samp{Fcc:}
5735 @item Fcc Field
5736 Insert an @samp{Fcc:} header field with the folder you provide. When
5737 you send the message, MH will put a copy of your message in this
5738 folder.
5739 @c -------------------------
5740 @cindex @samp{Mail-Followup-To:} header field
5741 @cindex header field, @samp{Mail-Followup-To:}
5742 @item Mail-Followup-To Field
5743 Insert an @samp{Mail-Followup-To:} header field with the recipients
5744 you provide. If the recipient's mail user agent supports this header
5745 field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
5746 their replies will go to the addresses listed. This is useful if their
5747 replies go both to the list and to you and you don't have a mechanism
5748 to suppress duplicates. If you reply to someone not on the list, you
5749 must either remove the @samp{Mail-Followup-To:} field, or ensure the
5750 recipient is also listed there so that he receives replies to your
5751 reply.
5752 @c -------------------------
5753 @item Other Field
5754 Other header fields may be added using this menu item.
5755 @end table
5756
5757 These fields can only be added after the recipient is known. Because
5758 you can continue to add recipients as you edit the draft, MH-E waits
5759 until the message is sent to perform the auto-insertions. This seems
5760 strange at first, but you'll get used to it. There are two ways to
5761 help you feel that the desired fields are added. The first is the
5762 action when the message is sent: if any fields are added
5763 automatically, you are given a chance to see and to confirm these
5764 fields before the message is actually sent. You can do away with this
5765 confirmation by turning off the option
5766 @code{mh-auto-fields-prompt-flag}. The second method is manual: once
5767 the header contains one or more recipients, you may run the command
5768 @kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
5769 @samp{Identity -> Insert Auto Fields} menu item to insert these fields
5770 manually. However, if you use this command, the automatic insertion
5771 when the message is sent is disabled.
5772
5773 You should avoid using the same header field in
5774 @code{mh-auto-fields-list} and @code{mh-identity-list} definitions
5775 that may apply to the same message as the result is undefined.
5776
5777 The option @code{mh-identity-handlers} is used to change the way that
5778 fields, signatures, and attributions in @code{mh-identity-list} are
5779 added. To customize @code{mh-identity-handlers}, replace the name of
5780 an existing handler function associated with the field you want to
5781 change with the name of a function you have written. You can also
5782 click on an @samp{INS} button and insert a field of your choice and
5783 the name of the function you have written to handle it.
5784
5785 The @samp{Field} field can be any field that you've used in your
5786 @code{mh-identity-list}. The special fields @samp{:attribution-verb},
5787 @samp{:signature}, or @samp{:pgg-default-user-id} are used for the
5788 @code{mh-identity-list} choices @samp{Attribution Verb},
5789 @samp{Signature}, and @samp{GPG Key ID} respectively.
5790
5791 The handler associated with the @samp{:default} field is used when no
5792 other field matches.
5793
5794 The handler functions are passed two or three arguments: the field
5795 itself (for example, @samp{From}), or one of the special fields (for
5796 example, @samp{:signature}), and the action @samp{'remove} or
5797 @samp{'add}. If the action is @samp{'add}, an additional argument
5798 containing the value for the field is given.
5799
5800 @node Speedbar, Menu Bar, Identities, Top
5801 @chapter The Speedbar
5802
5803 @cindex folder navigation
5804 @cindex speedbar
5805
5806 You can also use the speedbar
5807 @ifnothtml
5808 (@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
5809 @end ifnothtml
5810 @ifhtml
5811 (see the section
5812 @uref{http://www.gnu.org/software/emacs/manual/html_node/Speedbar.html,
5813 Speedbar Frames} in @cite{The GNU Emacs Manual})
5814 @end ifhtml
5815 to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
5816 @key{RET}}. You will see a new frame appear with all of your MH
5817 folders. Folders with unseen messages appear in boldface. Click on a
5818 folder name with @kbd{Mouse-2} to visit that folder in a similar
5819 fashion to the command @kbd{F v} (@code{mh-visit-folder})
5820 (@pxref{Folders}). Click on the @samp{+} icon to expand and view the
5821 sub-folders of that folder.
5822
5823 The speedbar can be manipulated with the keyboard as well. Use the
5824 Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
5825 the cursor over the desired folder and then use the shortcuts for the
5826 menu items listed in the table below.
5827
5828 @table @samp
5829 @findex mh-speed-view
5830 @item Visit Folder (@key{RET})
5831 Visits the selected folder just as if you had used @kbd{F v}
5832 (@code{mh-speed-view}).
5833 @c -------------------------
5834 @findex mh-speed-expand-folder
5835 @item Expand Nested Folders (@kbd{+})
5836 Expands the selected folder in the speedbar, exposing the children
5837 folders inside it (@code{mh-speed-expand-folder}).
5838 @c -------------------------
5839 @findex mh-speed-contract-folder
5840 @item Contract Nested Folders (@kbd{-})
5841 Contracts or collapses the selected folder in the speedbar, hiding the
5842 children folders inside it (@code{mh-speed-contract-folder}).
5843 @c -------------------------
5844 @findex mh-speed-refresh
5845 @item Refresh Speedbar (@kbd{r})
5846 Regenerates the list of folders in the speedbar. Run this command if
5847 you've added or deleted a folder, or want to update the unseen message
5848 count before the next automatic update (@code{mh-speed-refresh}).
5849 @end table
5850
5851 You can click on @kbd{Mouse-3} to bring up a context menu that
5852 contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
5853 (@code{delete-frame}).
5854
5855 @cindex @command{flists}
5856 @cindex MH commands, @command{flists}
5857 @cindex @samp{mh-speedbar} customization group
5858 @cindex customization group, @samp{mh-speedbar}
5859
5860 The MH-E speedbar uses the MH command @command{flists}@footnote{See
5861 the section @uref{@value{MH-BOOK-HOME}/morseq.htm#flist, Searching for
5862 Sequences with flist} in the MH book.} to generate the list of
5863 folders. The @samp{mh-speedbar} customization group contains the
5864 following option which controls how often the speedbar calls
5865 @command{flists}.
5866
5867 @vtable @code
5868 @item mh-speed-update-interval
5869 Time between speedbar updates in seconds (default: 60). Set to 0 to
5870 disable automatic update.
5871 @end vtable
5872
5873 You can modify the appearance of the folders in the speedbar by
5874 customizing the following faces.
5875
5876 @vtable @code
5877 @item mh-speedbar-folder
5878 Basic folder face.
5879 @c -------------------------
5880 @item mh-speedbar-folder-with-unseen-messages
5881 Folder face when folder contains unread messages.
5882 @c -------------------------
5883 @item mh-speedbar-selected-folder
5884 Selected folder face.
5885 @c -------------------------
5886 @item mh-speedbar-selected-folder-with-unseen-messages
5887 Selected folder face when folder contains unread messages.
5888 @end vtable
5889
5890 @node Menu Bar, Tool Bar, Speedbar, Top
5891 @chapter The Menu Bar
5892
5893 @cindex menu bar
5894
5895 @cindex Folder menu
5896 @cindex Identity menu
5897 @cindex Letter menu
5898 @cindex MH-Folder mode
5899 @cindex MH-Letter mode
5900 @cindex MH-Search mode
5901 @cindex Message menu
5902 @cindex Search menu
5903 @cindex Sequence menu
5904 @cindex menu, Folder
5905 @cindex menu, Identity
5906 @cindex menu, Letter
5907 @cindex menu, Message
5908 @cindex menu, Search
5909 @cindex menu, Sequence
5910 @cindex modes, MH-Folder
5911 @cindex modes, MH-Letter
5912 @cindex modes, MH-Search
5913
5914 For those of you who prefer to mouse and menu instead of using the
5915 meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
5916 functions. The MH-Folder buffer adds the @samp{Folder},
5917 @samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
5918 the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
5919 the @samp{Search} menu. There's no need to list the actual items here,
5920 as you can more easily see them for yourself, and the functions are
5921 already described elsewhere in this manual.
5922
5923 For a description of the menu bar, please
5924 @ifnothtml
5925 @xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
5926 @end ifnothtml
5927 @ifhtml
5928 see the section
5929 @uref{http://www.gnu.org/software/emacs/manual/html_node/Menu-Bar.html,
5930 The Menu Bar} in @cite{The GNU Emacs Manual}.
5931 @end ifhtml
5932
5933 The Emacs manual describes how to get online help for a particular
5934 menu item. You can also look up a menu item in the index of this
5935 manual in two ways: all of the menu items are listed alphabetically,
5936 and you can also browse all of the items under the index entry
5937 @samp{menu item}.
5938
5939 @node Tool Bar, Searching, Menu Bar, Top
5940 @chapter The Tool Bar
5941
5942 @cindex tool bar
5943 @cindex @samp{mh-tool-bar} customization group
5944 @cindex customization group, @samp{mh-tool-bar}
5945
5946 Emacs also provides a graphical tool bar. For a description of the
5947 tool bar, please
5948 @ifnothtml
5949 @xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
5950 @end ifnothtml
5951 @ifhtml
5952 see the section
5953 @uref{http://www.gnu.org/software/emacs/manual/html_node/Tool-Bars.html,
5954 Tool Bars} in @cite{The GNU Emacs Manual}.
5955 @end ifhtml
5956
5957 MH-E adds several icons to this tool bar; you can modify the MH-E
5958 aspects of the tool bar via the @samp{mh-tool-bar} customization group.
5959
5960 @vtable @code
5961 @item mh-tool-bar-folder-buttons
5962 List of buttons to include in MH-Folder tool bar (default: a checklist
5963 too long to list here).
5964 @c -------------------------
5965 @item mh-tool-bar-letter-buttons
5966 List of buttons to include in MH-Letter tool bar (default: a checklist
5967 too long to list here).
5968 @c -------------------------
5969 @item mh-tool-bar-search-function
5970 Function called by the tool bar search button (default:
5971 @code{mh-search}).
5972 @c -------------------------
5973 @item mh-xemacs-tool-bar-position
5974 Tool bar location (default: @samp{Same As Default Tool Bar}).
5975 @c -------------------------
5976 @item mh-xemacs-use-tool-bar-flag
5977 If on, use tool bar (default: on, if supported).
5978 @end vtable
5979
5980 In GNU Emacs, icons for some of MH-E's functions are added to the tool
5981 bar. In XEmacs, you have the opportunity to create a separate tool bar for
5982 the MH-E icons.
5983
5984 In either case, you can select which of these functions you'd like to
5985 see by customizing the options @code{mh-tool-bar-folder-buttons} and
5986 @code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
5987 customizes the tool bar in MH-Folder mode and the latter in MH-Letter
5988 mode. Both of these options present you with a list of functions;
5989 check the functions whose icons you want to see and clear the check
5990 boxes for those you don't.
5991
5992 The function associated with the searching icon can be set via the
5993 option @code{mh-tool-bar-search-function}. By default, this is set to
5994 @code{mh-search}. @xref{Searching}. You can also choose @samp{Other
5995 Function} from the @samp{Value Menu} and enter a function of your own
5996 choosing.
5997
5998 XEmacs provides a couple of extra options. The first,
5999 @code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
6000 icons at all. By default, this option is turned on if the window
6001 system supports tool bars. If your system doesn't support tool bars,
6002 then you won't be able to turn on this option.
6003
6004 The second extra option is @code{mh-xemacs-tool-bar-position} which
6005 controls the placement of the tool bar along the four edges of the
6006 frame. You can choose from one of @samp{Same As Default Tool Bar},
6007 @samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
6008 variable is set to anything other than @samp{Same As Default Tool Bar}
6009 and the default tool bar is in a different location, then two tool
6010 bars will be displayed: the MH-E tool bar and the default tool bar.
6011
6012 @node Searching, Threading, Tool Bar, Top
6013 @chapter Searching Through Messages
6014
6015 @cindex searching
6016
6017 @findex mh-search
6018 @kindex F s
6019
6020 Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6021 helps you find messages that lie buried in your folders
6022 (@pxref{Folders}). This chapter covers this command in more detail.
6023 Several commands are used to compose the search criteria and to start
6024 searching. A couple of them can be found in the @samp{Search} menu.
6025
6026 @table @kbd
6027 @kindex C-c ?
6028 @findex mh-help
6029 @item C-c ?
6030 Display cheat sheet for the MH-E commands (@code{mh-help}).
6031 @c -------------------------
6032 @cindex @samp{Search > Perform Search} menu item
6033 @cindex menu item, @samp{Search > Perform Search}
6034 @kindex C-c C-c
6035 @findex mh-index-do-search
6036 @item C-c C-c
6037 Find messages using @code{mh-search-program}
6038 (@code{mh-index-do-search}).
6039 @c -------------------------
6040 @cindex @samp{Search > Search with pick} menu item
6041 @cindex menu item, @samp{Search > Search with pick}
6042 @kindex C-c C-p
6043 @findex mh-pick-do-search
6044 @item C-c C-p
6045 Find messages using @command{pick} (@code{mh-pick-do-search}).
6046 @c -------------------------
6047 @kindex C-c ?
6048 @findex mh-help
6049 @item C-c ?
6050 Display cheat sheet for the MH-E commands (@code{mh-help}).
6051 @c -------------------------
6052 @kindex C-c C-f C-a
6053 @kindex C-c C-f a
6054 @findex mh-to-field
6055 @item C-c C-f a
6056 @itemx C-c C-f C-a
6057 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6058 @c -------------------------
6059 @kindex C-c C-f C-b
6060 @kindex C-c C-f b
6061 @item C-c C-f b
6062 @itemx C-c C-f C-b
6063 Move to @samp{Bcc:} header field (@code{mh-to-field}).
6064 @c -------------------------
6065 @kindex C-c C-f C-c
6066 @kindex C-c C-f c
6067 @item C-c C-f c
6068 @itemx C-c C-f C-c
6069 Move to @samp{Cc:} header field (@code{mh-to-field}).
6070 @c -------------------------
6071 @kindex C-c C-f C-d
6072 @kindex C-c C-f d
6073 @item C-c C-f d
6074 @itemx C-c C-f C-d
6075 Move to @samp{Dcc:} header field (@code{mh-to-field}).
6076 @c -------------------------
6077 @kindex C-c C-f C-f
6078 @kindex C-c C-f f
6079 @item C-c C-f f
6080 @itemx C-c C-f C-f
6081 Move to @samp{Fcc:} header field (@code{mh-to-field}).
6082 @c -------------------------
6083 @kindex C-c C-f C-l
6084 @kindex C-c C-f l
6085 @item C-c C-f l
6086 @itemx C-c C-f C-l
6087 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6088 @c -------------------------
6089 @kindex C-c C-f C-m
6090 @kindex C-c C-f m
6091 @item C-c C-f m
6092 @itemx C-c C-f C-m
6093 Move to @samp{From:} header field (@code{mh-to-field}).
6094 @c -------------------------
6095 @kindex C-c C-f C-r
6096 @kindex C-c C-f r
6097 @item C-c C-f r
6098 @itemx C-c C-f C-r
6099 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6100 @c -------------------------
6101 @kindex C-c C-f C-s
6102 @kindex C-c C-f s
6103 @item C-c C-f s
6104 @itemx C-c C-f C-s
6105 Move to @samp{Subject:} header field (@code{mh-to-field}).
6106 @c -------------------------
6107 @kindex C-c C-f C-t
6108 @kindex C-c C-f t
6109 @item C-c C-f t
6110 @itemx C-c C-f C-t
6111 Move to @samp{To:} header field (@code{mh-to-field}).
6112 @end table
6113
6114 Another few commands are available in the MH-Folder buffer resulting
6115 from a search.
6116
6117 @table @kbd
6118 @kindex @key{TAB}
6119 @findex mh-index-next-folder
6120 @item @key{TAB}
6121 Jump to the next folder marker (@code{mh-index-next-folder}).
6122 @c -------------------------
6123 @kindex S-@key{TAB}
6124 @findex mh-index-previous-folder
6125 @item S-@key{TAB}
6126 Jump to the previous folder marker (@code{mh-index-previous-folder}).
6127 @c -------------------------
6128 @kindex v
6129 @findex mh-index-visit-folder
6130 @item v
6131 Visit original folder from where the message at point was found
6132 (@code{mh-index-visit-folder}).
6133 @end table
6134
6135 @cindex @samp{mh-search} customization group
6136 @cindex customization group, @samp{mh-search}
6137
6138 There is one option from the @samp{mh-search} customization group used
6139 in searching.
6140
6141 @vtable @code
6142 @item mh-search-program
6143 Search program that MH-E shall use (default: @samp{Auto-detect}).
6144 @end vtable
6145
6146 The following hook is available.
6147
6148 @vtable @code
6149 @item mh-search-mode-hook
6150 Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6151 @end vtable
6152
6153 The following face is available.
6154
6155 @vtable @code
6156 @item mh-search-folder
6157 Folder heading face in MH-Folder buffers created by searches.
6158 @end vtable
6159
6160 The command @kbd{F s} (@code{mh-search-folder}) helps you find
6161 messages in your entire corpus of mail. You can search for messages to
6162 or from a particular person or about a particular subject. In fact,
6163 you can also search for messages containing selected strings in any
6164 arbitrary header field or any string found within the messages.
6165
6166 Out of the box, MH-E uses @command{pick} to find messages. With a
6167 little extra effort, you can set an indexing program which rewards you
6168 with extremely quick results. The drawback is that sometimes the index
6169 does not contain the words you're looking for. You can still use
6170 @command{pick} in these situations.
6171
6172 You are prompted for the folder to search. This can be @samp{all} to
6173 search all folders. Note that the search works recursively on the
6174 listed folder.
6175
6176 @cindex MH-Search mode
6177 @cindex modes, MH-Search
6178
6179 Next, an MH-Search buffer appears where you can enter search criteria.
6180
6181 @cartouche
6182 @smallexample
6183 From: #
6184 To:
6185 Cc:
6186 Date:
6187 Subject:
6188 --------
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198 --:** search-pattern (MH-Search)--L1--All-----------------------------
6199
6200 @end smallexample
6201 @end cartouche
6202 @i{Search window}
6203
6204 @cindex @command{pick}
6205 @cindex MH commands, @command{pick}
6206
6207 Edit this template by entering your search criteria in an appropriate
6208 header field that is already there, or create a new field yourself. If
6209 the string you're looking for could be anywhere in a message, then
6210 place the string underneath the row of dashes.
6211
6212 As an example, let's say that we want to find messages from Ginnean
6213 about horseback riding in the Kosciusko National Park (Australia)
6214 during January, 1994. Normally we would start with a broad search and
6215 narrow it down if necessary to produce a manageable amount of data,
6216 but we'll cut to the chase and create a fairly restrictive set of
6217 criteria as follows:
6218
6219 @smallexample
6220 @group
6221 From: ginnean
6222 To:
6223 Cc:
6224 Date: Jan 1994
6225 Subject:
6226 --------
6227 horse
6228 kosciusko
6229 @end group
6230 @end smallexample
6231
6232 As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6233 C-t} (@code{mh-to-field}) to help you fill in the blanks.
6234 @xref{Editing Message}.
6235
6236 If you find that you do the same thing over and over when editing the
6237 search template, you may wish to bind some shortcuts to keys. This can
6238 be done with the variable @code{mh-search-mode-hook}, which is called
6239 when @kbd{F s} is run on a new pattern.
6240
6241 @cindex @samp{+mhe-index}
6242 @cindex folders, @samp{+mhe-index}
6243 @findex mh-index-do-search
6244 @findex mh-index-next-folder
6245 @findex mh-index-previous-folder
6246 @findex mh-pick-do-search
6247 @kindex @key{TAB}
6248 @kindex C-c C-c
6249 @kindex F s
6250 @kindex S-@key{TAB}
6251 @vindex mh-search-folder
6252
6253 To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6254 Sometimes you're searching for text that is either not indexed, or
6255 hasn't been indexed yet. In this case you can override the default
6256 method with the pick method by running the command @kbd{C-c C-p}
6257 (@code{mh-pick-do-search}).
6258
6259 The messages that are found are put in a temporary sub-folder of
6260 @samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6261 buffer is special because it displays messages from multiple folders;
6262 each set of messages from a given folder has a heading with the folder
6263 name. The appearance of the heading can be modified by customizing the
6264 face @code{mh-search-folder}. You can jump back and forth between the
6265 headings using the commands @kbd{@key{TAB}}
6266 (@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6267 (@code{mh-index-previous-folder}).
6268
6269 In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6270 used to visit the folder of the message at point. Initially, only the
6271 messages that matched the search criteria are displayed in the folder.
6272 While the temporary buffer has its own set of message numbers, the
6273 actual messages numbers are shown in the visited folder. Thus, the
6274 command @kbd{v} is useful to find the actual message number of an
6275 interesting message, or to view surrounding messages with the command
6276 @kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6277
6278 Because this folder is temporary, you'll probably get in the habit of
6279 killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6280 @xref{Folders}.
6281
6282 You can regenerate the results by running @kbd{F s} with a prefix
6283 argument.
6284
6285 @cindex @command{procmail}
6286 @cindex Unix commands, @command{procmail}
6287 @cindex @samp{X-MHE-Checksum:} header field
6288 @cindex header field, @samp{X-MHE-Checksum:}
6289
6290 Note: This command uses an @samp{X-MHE-Checksum:} header field to
6291 cache the MD5 checksum of a message. This means that if an incoming
6292 message already contains an @samp{X-MHE-Checksum:} field, that message
6293 might not be found by this command. The following @command{procmail}
6294 recipe avoids this problem by renaming the existing header field:
6295
6296 @smallexample
6297 @group
6298 :0 wf
6299 | formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6300 @end group
6301 @end smallexample
6302
6303 @xref{Limits}, for an alternative interface to searching.
6304
6305 @section Configuring Indexed Searches
6306
6307 @cindex @command{grep}
6308 @cindex @command{mairix}
6309 @cindex @command{namazu}
6310 @cindex @command{pick}
6311 @cindex @command{swish++}
6312 @cindex @command{swish-e}
6313 @cindex Unix commands, @command{grep}
6314 @cindex Unix commands, @command{mairix}
6315 @cindex Unix commands, @command{namazu}
6316 @cindex Unix commands, @command{pick}
6317 @cindex Unix commands, @command{swish++}
6318 @cindex Unix commands, @command{swish-e}
6319 @findex mh-search
6320 @kindex F s
6321 @vindex mh-search-program
6322
6323 The command @kbd{F s} (@code{mh-search}) runs the command defined by
6324 the option @code{mh-search-program}. The default value is
6325 @samp{Auto-detect} which means that MH-E will automatically choose one
6326 of @command{swish++}, @command{swish-e}, @command{mairix},
6327 @command{namazu}, @command{pick} and @command{grep} in that order. If,
6328 for example, you have both @command{swish++} and @command{mairix}
6329 installed and you want to use @command{mairix}, then you can set this
6330 option to @samp{mairix}.
6331
6332 The following sub-sections describe how to set up the various indexing
6333 programs to use with MH-E.
6334
6335 @subsection swish++
6336
6337 @cindex @command{swish++}
6338 @cindex Unix commands, @command{swish++}
6339
6340 In the examples below, replace @file{/home/user/Mail} with the path to
6341 your MH directory.
6342
6343 First create the directory @file{/home/user/Mail/.swish++}. Then
6344 create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6345 following contents:
6346
6347 @smallexample
6348 @group
6349 IncludeMeta Bcc Cc Comments Content-Description From Keywords
6350 IncludeMeta Newsgroups Resent-To Subject To
6351 IncludeMeta Message-Id References In-Reply-To
6352 IncludeFile Mail *
6353 IndexFile /home/user/Mail/.swish++/swish++.index
6354 @end group
6355 @end smallexample
6356
6357 Use the following command line to generate the swish index. Run this
6358 daily from cron:
6359
6360 @smallexample
6361 @group
6362 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6363 -o -path /home/user/Mail/.swish++ -prune \
6364 -o -name "[0-9]*" -print \
6365 | index -c /home/user/Mail/.swish++/swish++.conf -
6366 @end group
6367 @end smallexample
6368
6369 This command does not index the folders that hold the results of your
6370 searches in @samp{+mhe-index} since they tend to be ephemeral and the
6371 original messages are indexed anyway.
6372
6373 @cindex @command{index}
6374 @cindex Unix commands, @command{index}
6375 @cindex @command{index++}
6376 @cindex Unix commands, @command{index++}
6377
6378 On some systems (Debian GNU/Linux, for example), use @command{index++}
6379 instead of @command{index}.
6380
6381 @subsection swish
6382
6383 @cindex @command{swish-e}
6384 @cindex Unix commands, @command{swish-e}
6385
6386 In the examples below, replace @file{/home/user/Mail} with the path to
6387 your MH directory.
6388
6389 First create the directory @file{/home/user/Mail/.swish}. Then create
6390 the file @file{/home/user/Mail/.swish/config} with the following
6391 contents:
6392
6393 @smallexample
6394 @group
6395 DefaultContents TXT*
6396 IndexDir /home/user/Mail
6397 IndexFile /home/user/Mail/.swish/index
6398 IndexName "Mail Index"
6399 IndexDescription "Mail Index"
6400 IndexPointer "http://nowhere"
6401 IndexAdmin "nobody"
6402 #MetaNames automatic
6403 IndexReport 3
6404 FollowSymLinks no
6405 UseStemming no
6406 IgnoreTotalWordCountWhenRanking yes
6407 WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6408 BeginCharacters abcdefghijklmnopqrstuvwxyz
6409 EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6410 IgnoreLimit 50 1000
6411 IndexComments 0
6412 FileRules filename contains \D
6413 FileRules pathname contains /home/user/Mail/.swish
6414 FileRules pathname contains /home/user/Mail/mhe-index
6415 FileRules filename is index
6416 @end group
6417 @end smallexample
6418
6419 This configuration does not index the folders that hold the results of
6420 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6421 the original messages are indexed anyway.
6422
6423 If there are any directories you would like to ignore, append lines
6424 like the following to @file{config}:
6425
6426 @smallexample
6427 FileRules pathname contains /home/user/Mail/scripts
6428 @end smallexample
6429
6430 @cindex @command{swish-e}
6431 @cindex Unix commands, @command{swish-e}
6432
6433 Use the following command line to generate the swish index. Run this
6434 daily from cron:
6435
6436 @smallexample
6437 swish-e -c /home/user/Mail/.swish/config
6438 @end smallexample
6439
6440 @subsection mairix
6441
6442 @cindex @command{mairix}
6443 @cindex Unix commands, @command{mairix}
6444
6445 In the examples below, replace @file{/home/user/Mail} with the path to
6446 your MH directory.
6447
6448 First create the directory @file{/home/user/Mail/.mairix}. Then create
6449 the file @file{/home/user/Mail/.mairix/config} with the following
6450 contents:
6451
6452 @smallexample
6453 @group
6454 base=/home/user/Mail
6455
6456 # List of folders that should be indexed. 3 dots at the end means there
6457 # are subfolders within the folder
6458 mh=archive...:inbox:drafts:news:sent:trash
6459
6460 vfolder_format=raw
6461 database=/home/user/Mail/mairix/database
6462 @end group
6463 @end smallexample
6464
6465 Use the following command line to generate the mairix index. Run this daily
6466 from cron:
6467
6468 @smallexample
6469 mairix -f /home/user/Mail/.mairix/config
6470 @end smallexample
6471
6472 @subsection namazu
6473
6474 @cindex @command{namazu}
6475 @cindex Unix commands, @command{namazu}
6476
6477 In the examples below, replace @file{/home/user/Mail} with the path to
6478 your MH directory.
6479
6480 First create the directory @file{/home/user/Mail/.namazu}. Then create
6481 the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
6482 contents:
6483
6484 @smallexample
6485 @group
6486 package conf; # Don't remove this line!
6487 $ADDRESS = 'user@@localhost';
6488 $ALLOW_FILE = "[0-9]*";
6489 $EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
6490 @end group
6491 @end smallexample
6492
6493 This configuration does not index the folders that hold the results of
6494 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6495 the original messages are indexed anyway.
6496
6497 Use the following command line to generate the namazu index. Run this
6498 daily from cron:
6499
6500 @smallexample
6501 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
6502 /home/user/Mail
6503 @end smallexample
6504
6505 @subsection pick
6506
6507 @cindex @command{pick}
6508 @cindex MH commands, @command{pick}
6509
6510 This search method does not require any setup.
6511
6512 Read @command{pick}(1) or the section
6513 @uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in
6514 the MH book to find out more about how to enter the criteria.
6515
6516 @subsection grep
6517
6518 @cindex @command{grep}
6519 @cindex Unix commands, @command{grep}
6520
6521 This search method does not require any setup.
6522
6523 Unlike the other search methods, this method does not use the
6524 MH-Search buffer. Instead, you simply enter a regular expression in
6525 the minibuffer. For help in constructing regular expressions, see your
6526 man page for @command{grep}.
6527
6528 @node Threading, Limits, Searching, Top
6529 @chapter Viewing Message Threads
6530
6531 @cindex threading
6532
6533 MH-E groups messages by @dfn{threads} which are messages that are part
6534 of the same discussion and usually all have the same @samp{Subject:}
6535 header field. Other ways to organize messages in a folder include
6536 limiting (@pxref{Limits}) or using full-text indexed searches
6537 (@pxref{Searching}).
6538
6539 A thread begins with a single message called a @dfn{root}. All replies
6540 to the same message are @dfn{siblings} of each other. Any message that
6541 has replies to it is an @dfn{ancestor} of those replies.
6542
6543 There are several commands that you can use to navigate and operate on
6544 threads.
6545
6546 @table @kbd
6547 @kindex T ?
6548 @findex mh-prefix-help
6549 @item T ?
6550 Display cheat sheet for the commands of the current prefix in
6551 minibuffer (@code{mh-prefix-help}).
6552 @c -------------------------
6553 @kindex T o
6554 @findex mh-thread-refile
6555 @item T o
6556 Refile (output) thread into folder (@code{mh-thread-refile}).
6557 @c -------------------------
6558 @kindex T d
6559 @findex mh-thread-delete
6560 @item T d
6561 Delete thread (@code{mh-thread-delete}).
6562 @c -------------------------
6563 @kindex T t
6564 @findex mh-toggle-threads
6565 @item T t
6566 Toggle threaded view of folder (@code{mh-toggle-threads}).
6567 @c -------------------------
6568 @kindex T n
6569 @findex mh-thread-next-sibling
6570 @item T n
6571 Display next sibling (@code{mh-thread-next-sibling}).
6572 @c -------------------------
6573 @kindex T p
6574 @findex mh-thread-previous-sibling
6575 @item T p
6576 Display previous sibling (@code{mh-thread-previous-sibling}).
6577 @c -------------------------
6578 @kindex T u
6579 @findex mh-thread-ancestor
6580 @item T u
6581 Display ancestor of current message (@code{mh-thread-ancestor}).
6582 @end table
6583
6584 The @samp{mh-thread} customization group contains one option.
6585
6586 @vtable @code
6587 @item mh-show-threads-flag
6588 On means new folders start in threaded mode (default: @samp{off}).
6589 @end vtable
6590
6591 Threading large number of messages can be time consuming so the option
6592 @code{mh-show-threads-flag} is turned off by default. If you turn on
6593 this option, then threading will be done only if the number of
6594 messages being threaded is less than @code{mh-large-folder}. In any
6595 event, threading can be turned on (and off) with the command @kbd{T t}
6596 (@code{mh-toggle-threads}).
6597
6598 There are a few commands to help you navigate threads. If you do not
6599 care for the way a particular thread has turned, you can move up the
6600 chain of messages with the command @kbd{T u}
6601 (@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
6602 (@code{mh-thread-next-sibling} or @kbd{T p}
6603 (@code{mh-thread-previous-sibling}) to jump to the next or previous
6604 sibling, skipping the sub-threads. The command @kbd{T u} can also take
6605 a prefix argument to jump to the message that started everything.
6606
6607 There are threaded equivalents for the commands that delete and refile
6608 messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
6609 current message and all its children. Similarly, the command @kbd{T d}
6610 (@code{mh-thread-delete}) deletes the current message and all its
6611 children. These commands do not refile or delete sibling messages.
6612 @xref{Navigating}, for a description of the similar command @kbd{k}
6613 (@code{mh-delete-subject-or-thread}).
6614
6615 If you find that threading is too slow, it may be that you have
6616 @code{mh-large-folder} set too high. Threading is one of the few
6617 features of MH-E that really benefits from compiling. If you haven't
6618 compiled MH-E, I encourage you to do so@footnote{If you're not sure
6619 if MH-E has been byte-compiled, you could try running @samp{locate
6620 mh-thread.elc} or otherwise find MH-E on your system and ensure that
6621 @file{mh-thread.elc} exists. If you have multiple versions and you
6622 find that one is compiled but the other is not, then go into your
6623 @samp{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
6624 ensure that the byte-compiled version appears first in the
6625 @code{load-path}. If you find that MH-E is not compiled and you
6626 installed MH-E yourself, please refer to the installation directions
6627 in the file @file{README} in the distribution.}.
6628
6629 @node Limits, Sequences, Threading, Top
6630 @chapter Limiting Display
6631
6632 @cindex limits
6633 @cindex filters
6634
6635 Another way to organize messages in a folder besides threading
6636 (@pxref{Threading}) or using full-text indexed searches
6637 (@pxref{Searching}) is by limiting the folder display to messages that
6638 are similar to the current message.
6639
6640 @table @kbd
6641 @kindex / ?
6642 @findex mh-prefix-help
6643 @item / ?
6644 Display cheat sheet for the commands of the current prefix in
6645 minibuffer (@code{mh-prefix-help}).
6646 @c -------------------------
6647 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
6648 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
6649 @kindex / '
6650 @findex mh-narrow-to-tick
6651 @item / '
6652 Limit to messages in the @samp{tick} sequence
6653 (@code{mh-narrow-to-tick}).
6654 @c -------------------------
6655 @kindex / c
6656 @findex mh-narrow-to-cc
6657 @item / c
6658 Limit to messages with the same @samp{Cc:} field
6659 (@code{mh-narrow-to-cc}).
6660 @c -------------------------
6661 @kindex / m
6662 @findex mh-narrow-to-from
6663 @item / m
6664 Limit to messages with the same @samp{From:} field
6665 (@code{mh-narrow-to-from}).
6666 @c -------------------------
6667 @kindex / g
6668 @findex mh-narrow-to-range
6669 @item / g
6670 Limit to range (@code{mh-narrow-to-range}).
6671 @c -------------------------
6672 @cindex @samp{Sequence > Narrow to Subject Sequence} menu item
6673 @cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
6674 @kindex / s
6675 @findex mh-narrow-to-subject
6676 @item / s
6677 Limit to messages with the same @samp{Subject:} field
6678 (@code{mh-narrow-to-subject}).
6679 @c -------------------------
6680 @kindex / t
6681 @findex mh-narrow-to-to
6682 @item / t
6683 Limit to messages with the same @samp{To:} field
6684 (@code{mh-narrow-to-to}).
6685 @c -------------------------
6686 @cindex @samp{Sequence > Widen from Sequence} menu item
6687 @cindex menu item, @samp{Sequence > Widen from Sequence}
6688 @kindex / w
6689 @findex mh-widen
6690 @item / w
6691 Remove last restriction (@code{mh-widen}).
6692 @end table
6693
6694 All of the limiting commands above refine the display in some way.
6695
6696 @cindex @command{pick}
6697 @cindex MH commands, @command{pick}
6698
6699 The commands @kbd{/ c}, @code{/ m}, @code{/ s}, and @code{/ t}
6700 restrict the display to messages matching the content of the
6701 respective field in the current message. However, you can give any of
6702 these a prefix argument to edit the @command{pick} expression used to
6703 narrow the view@footnote{See @command{pick}(1) or the section
6704 @uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in
6705 the MH book.}.
6706
6707 @cindex @samp{tick} sequence
6708 @cindex sequence, @samp{tick}
6709 @cindex ticked messages, viewing
6710
6711 You can also limit the display to messages in the @samp{tick} sequence
6712 with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
6713 @xref{Sequences}, for information on putting message into the
6714 @samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
6715 command to limit the display to messages in a range (@pxref{Ranges}).
6716
6717 Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
6718 command. Give this command a prefix argument to remove all limits.
6719
6720 @node Sequences, Junk, Limits, Top
6721 @chapter Using Sequences
6722
6723 @cindex sequences
6724
6725 For the whole scoop on MH sequences, refer to
6726 @samp{mh-sequence}(5)@footnote{See the section
6727 @uref{@value{MH-BOOK-HOME}/morseq.htm, More About Sequences} in the MH
6728 book.}. As you've read, several of the MH-E commands can operate on a
6729 sequence, which is a shorthand for a range or group of messages. For
6730 example, you might want to forward several messages to a friend or
6731 colleague. Here's how to manipulate sequences. These commands are also
6732 available in the @samp{Sequence} menu.
6733
6734 @table @kbd
6735 @cindex @samp{Sequence > Toggle Tick Mark} menu item
6736 @cindex menu item, @samp{Sequence > Toggle Tick Mark}
6737 @kindex '
6738 @findex mh-toggle-tick
6739 @item '
6740 Toggle tick mark of range (@code{mh-toggle-tick}).
6741 @c -------------------------
6742 @kindex S ?
6743 @findex mh-prefix-help
6744 @item S ?
6745 Display cheat sheet for the commands of the current prefix in
6746 minibuffer (@code{mh-prefix-help}).
6747 @c -------------------------
6748 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
6749 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
6750 @kindex S '
6751 @findex mh-narrow-to-tick
6752 @item S '
6753 Limit to ticked messages (@code{mh-narrow-to-tick}).
6754 @c -------------------------
6755 @cindex @samp{Sequence > Delete Message from Sequence...} menu item
6756 @cindex menu item, @samp{Sequence > Delete Message from Sequence...}
6757 @kindex S d
6758 @findex mh-delete-msg-from-seq
6759 @item S d
6760 Delete range from sequence (@code{mh-delete-msg-from-seq}).
6761 @c -------------------------
6762 @cindex @samp{Sequence > Delete Sequence...} menu item
6763 @cindex menu item, @samp{Sequence > Delete Sequence...}
6764 @kindex S k
6765 @findex mh-delete-seq
6766 @item S k
6767 Delete sequence (@code{mh-delete-seq}).
6768 @c -------------------------
6769 @cindex @samp{Sequence > List Sequences in Folder...} menu item
6770 @cindex menu item, @samp{Sequence > List Sequences in Folder...}
6771 @kindex S l
6772 @findex mh-list-sequences
6773 @item S l
6774 List all sequences in folder (@code{mh-list-sequences}).
6775 @c -------------------------
6776 @cindex @samp{Sequence > Narrow to Sequence...} menu item
6777 @cindex menu item, @samp{Sequence > Narrow to Sequence...}
6778 @kindex S n
6779 @findex mh-narrow-to-seq
6780 @item S n
6781 Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
6782 @c -------------------------
6783 @cindex @samp{Sequence > Add Message to Sequence...} menu item
6784 @cindex menu item, @samp{Sequence > Add Message to Sequence...}
6785 @kindex S p
6786 @findex mh-put-msg-in-seq
6787 @item S p
6788 Add range to sequence (@code{mh-put-msg-in-seq}).
6789 @c -------------------------
6790 @cindex @samp{Sequence > List Sequences for Message} menu item
6791 @cindex menu item, @samp{Sequence > List Sequences for Message}
6792 @kindex S s
6793 @findex mh-msg-is-in-seq
6794 @item S s
6795 Display the sequences in which the current message appears
6796 (@code{mh-msg-is-in-seq}).
6797 @c -------------------------
6798 @cindex @samp{Sequence > Widen from Sequence} menu item
6799 @cindex menu item, @samp{Sequence > Widen from Sequence}
6800 @kindex S w
6801 @findex mh-widen
6802 @item S w
6803 Remove last restriction (@code{mh-widen}).
6804 @c -------------------------
6805 @findex mh-update-sequences
6806 @item M-x mh-update-sequences
6807 Flush MH-E's state out to MH@.
6808 @end table
6809
6810 @cindex @samp{mh-sequences} customization group
6811 @cindex customization group, @samp{mh-sequences}
6812
6813 The @samp{mh-sequences} customization group contains the options
6814 associated with sequences.
6815
6816 @vtable @code
6817 @item mh-refile-preserves-sequences-flag
6818 On means that sequences are preserved when messages are refiled
6819 (default: @samp{on}).
6820 @c -------------------------
6821 @item mh-tick-seq
6822 The name of the MH sequence for ticked messages (default: @samp{'tick}).
6823 @c -------------------------
6824 @item mh-update-sequences-after-mh-show-flag
6825 On means flush MH sequences to disk after message is shown (default:
6826 @samp{on}).
6827 @end vtable
6828
6829 The following hook is available.
6830
6831 @vtable @code
6832 @item mh-unseen-updated-hook
6833 Hook run after the unseen sequence has been updated (default: @code{nil}).
6834 @end vtable
6835
6836 @cindex @command{pick}
6837 @cindex MH commands, @command{pick}
6838
6839 To place a message in a sequence, use @kbd{S p}
6840 (@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
6841 the messages in a sequence to another sequence (for example, @kbd{C-u
6842 S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
6843
6844 @cindex @samp{tick} sequence
6845 @cindex sequence, @samp{tick}
6846 @cindex ticking messages
6847
6848 One specific use of the @kbd{S p} command is @kbd{'}
6849 (@code{mh-toggle-tick}) which adds messages to the @samp{tick}
6850 sequence. This sequence can be viewed later with the @kbd{F '} command
6851 (@pxref{Folders}).
6852
6853 You can customize the option @code{mh-tick-seq} if you already use the
6854 @samp{tick} sequence for your own use. You can also disable all of the
6855 ticking functions by choosing the @samp{Disable Ticking} item but
6856 there isn't much advantage to that.
6857
6858 @cindex MH-Folder mode
6859 @cindex modes, MH-Folder
6860
6861 Once you've placed some messages in a sequence, you may wish to narrow
6862 the field of view to just those messages in the sequence you've
6863 created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
6864 prompted for the name of the sequence. What this does is show only
6865 those messages that are in the selected sequence in the MH-Folder
6866 buffer. In addition, it limits further MH-E searches to just those
6867 messages. To narrow the view to the messages in the @samp{tick}
6868 sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
6869 widen the view to all your messages again, use @kbd{S w}
6870 (@code{mh-widen}).
6871
6872 @cindex @samp{*MH-E Sequences*}
6873 @cindex buffers, @samp{*MH-E Sequences*}
6874
6875 You can see which sequences in which a message appears with the
6876 command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
6877 display the sequences in which another message appears (as in @kbd{C-u
6878 42 S s @key{RET}}). Or, you can list all sequences in a selected
6879 folder (default is current folder) with @kbd{S l}
6880 (@code{mh-list-sequences}). The list appears in a buffer named
6881 @samp{*MH-E Sequences*} (@pxref{Miscellaneous}).
6882
6883 @cindex @samp{Previous-Sequence:} MH profile component
6884 @cindex @samp{cur} sequence
6885 @cindex MH profile component, @samp{Previous-Sequence:}
6886 @cindex sequence, @samp{Previous-Sequence}
6887 @cindex sequence, @samp{cur}
6888
6889 If a message is in any sequence (except
6890 @samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
6891 @samp{cur}) when it is refiled, then it will still be in those
6892 sequences in the destination folder. If this behavior is not desired,
6893 then turn off the option @code{mh-refile-preserves-sequences-flag}.
6894
6895 If you want to remove a message (or range, @pxref{Ranges}) from a
6896 sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
6897 to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
6898 the latter case you are prompted for the sequence to delete. Note that
6899 this deletes only the sequence, not the messages in the sequence. If
6900 you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
6901 Mail}).
6902
6903 @cindex @samp{Unseen-Sequence:} MH profile component
6904 @cindex MH profile component, @samp{Unseen-Sequence:}
6905 @cindex sequence, @samp{Unseen-Sequence}
6906
6907 Three sequences are maintained internally by MH-E and pushed out to MH
6908 when a message is shown. They include the sequence specified by your
6909 @samp{Unseen-Sequence:} profile component, @samp{cur}, and the
6910 sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
6911 by default. If you do not like this behavior, turn off the option
6912 @code{mh-update-sequences-after-mh-show-flag}. You can then update the
6913 state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
6914 mh-update-sequences} commands.
6915
6916 @vindex mh-seen-list
6917 @vindex mh-unseen-updated-hook
6918
6919 The hook @code{mh-unseen-updated-hook} is run after the unseen
6920 sequence has been updated. The variable @code{mh-seen-list} can be
6921 used by this hook to obtain the list of messages which were removed
6922 from the unseen sequence.
6923
6924 @cindex @command{mark}
6925 @cindex MH commands, @command{mark}
6926
6927 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
6928 command dealing with sequences is @command{mark}@footnote{See the
6929 section @uref{@value{MH-BOOK-HOME}/mmbwm.htm, Make Message Bookmarks
6930 with mark} in the MH book.}.
6931
6932 @node Junk, Miscellaneous, Sequences, Top
6933 @chapter Dealing With Junk Mail
6934
6935 @cindex Marshall Rose
6936 @cindex junk mail
6937 @cindex spam
6938
6939 Marshall Rose once wrote a paper on MH entitled, @cite{How to process
6940 200 messages a day and still get some real work done}. This chapter
6941 could be entitled, @cite{How to process 1000 spams a day and still get
6942 some real work done}.
6943
6944 @cindex blacklisting
6945 @cindex ham
6946 @cindex viruses
6947 @cindex whitelisting
6948 @cindex worms
6949
6950 We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
6951 any unwanted message which includes spam, @dfn{viruses}, and
6952 @dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
6953 a sender as one who sends junk mail is called @dfn{blacklisting}; the
6954 opposite is called @dfn{whitelisting}.
6955
6956 @table @kbd
6957 @kindex J ?
6958 @findex mh-prefix-help
6959 @item J ?
6960 Display cheat sheet for the commands of the current prefix in
6961 minibuffer (@code{mh-prefix-help}).
6962 @c -------------------------
6963 @kindex J b
6964 @findex mh-junk-blacklist
6965 @item J b
6966 Blacklist range as spam (@code{mh-junk-blacklist}).
6967 @c -------------------------
6968 @kindex J w
6969 @findex mh-junk-whitelist
6970 @item J w
6971 Whitelist range as ham (@code{mh-junk-whitelist}).
6972 @c -------------------------
6973 @item @code{mh-spamassassin-identify-spammers}
6974 Identify spammers who are repeat offenders.
6975 @end table
6976
6977 @cindex @samp{mh-junk} customization group
6978 @cindex customization group, @samp{mh-junk}
6979
6980 The following table lists the options from the @samp{mh-junk}
6981 customization group.
6982
6983 @vtable @code
6984 @item mh-junk-background
6985 If on, spam programs are run in background (default: @samp{off}).
6986 @c -------------------------
6987 @item mh-junk-disposition
6988 Disposition of junk mail (default: @samp{Delete Spam}).
6989 @c -------------------------
6990 @item mh-junk-program
6991 Spam program that MH-E should use (default: @samp{Auto-detect}).
6992 @end vtable
6993
6994 @cindex SpamProbe
6995 @cindex Spamassassin
6996 @cindex bogofilter
6997 @cindex spam filters, SpamProbe
6998 @cindex spam filters, Spamassassin
6999 @cindex spam filters, bogofilter
7000
7001 MH-E depends on @uref{http://www.spamassassin.org/, SpamAssassin},
7002 @uref{http://bogofilter.sourceforge.net/, bogofilter}, or
7003 @uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
7004 away. This chapter describes briefly how to configure these programs
7005 to work well with MH-E and how to use MH-E's interface that provides
7006 continuing education for these programs.
7007
7008 The default setting of the option @code{mh-junk-program} is
7009 @samp{Auto-detect} which means that MH-E will automatically choose one
7010 of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
7011 example, you have both SpamAssassin and bogofilter installed and you
7012 want to use bogofilter, then you can set this option to
7013 @samp{Bogofilter}.
7014
7015 The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7016 program in use with the content of the range (@pxref{Ranges}) and then
7017 handles the message(s) as specified by the option
7018 @code{mh-junk-disposition}. By default, this option is set to
7019 @samp{Delete Spam} but you can also specify the name of the folder
7020 which is useful for building a corpus of spam for training purposes.
7021
7022 In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7023 reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7024 incorrectly classified as spam. It then refiles the message into the
7025 @file{+inbox} folder.
7026
7027 By default, the programs are run in the foreground, but this can be
7028 slow when junking large numbers of messages. If you have enough memory
7029 or don't junk that many messages at the same time, you might try
7030 turning on the option @code{mh-junk-background}.
7031
7032 The following sections discuss the various counter-spam measures that
7033 MH-E can work with.
7034
7035 @cindex @file{.procmailrc}
7036 @cindex files, @file{.procmailrc}
7037
7038 @heading SpamAssassin
7039
7040 SpamAssassin is one of the more popular spam filtering programs. Get
7041 it from your local distribution or from the
7042 @uref{http://spamassassin.org/, SpamAssassin web site}.
7043
7044 To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7045
7046 @cindex @command{spamc}
7047 @cindex @samp{X-Spam-Level:} header field
7048 @cindex @samp{X-Spam-Status:} header field
7049 @cindex header field, @samp{X-Spam-Level:}
7050 @cindex header field, @samp{X-Spam-Status:}
7051
7052 @smallexample
7053 MAILDIR=$HOME/`mhparam Path`
7054
7055 # Fight spam with SpamAssassin.
7056 :0fw
7057 | spamc
7058
7059 # Anything with a spam level of 10 or more is junked immediately.
7060 :0:
7061 * ^X-Spam-Level: ..........
7062 /dev/null
7063
7064 :0:
7065 * ^X-Spam-Status: Yes
7066 spam/.
7067 @end smallexample
7068
7069 If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7070
7071 Note that one of the recipes above throws away messages with a score
7072 greater than or equal to 10. Here's how you can determine a value that
7073 works best for you.
7074
7075 First, run @samp{spamassassin -t} on every mail message in your
7076 archive and use @command{gnumeric} to verify that the average plus the
7077 standard deviation of good mail is under 5, the SpamAssassin default
7078 for ``spam''.
7079
7080 Using @command{gnumeric}, sort the messages by score and view the
7081 messages with the highest score. Determine the score which encompasses
7082 all of your interesting messages and add a couple of points to be
7083 conservative. Add that many dots to the @samp{X-Spam-Level:} header
7084 field above to send messages with that score down the drain.
7085
7086 In the example above, messages with a score of 5-9 are set aside in
7087 the @samp{+spam} folder for later review. The major weakness of
7088 rules-based filters is a plethora of false positives so it is
7089 worthwhile to check.
7090
7091 If SpamAssassin classifies a message incorrectly, or is unsure, you can
7092 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7093 @kbd{J w} (@code{mh-junk-whitelist}).
7094
7095 @cindex @command{sa-learn}
7096 @cindex @file{.spamassassin/user_prefs}
7097 @cindex files, @file{.spamassassin/user_prefs}
7098
7099 The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7100 @samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7101 deletes the message, and sends the message to the Razor, so that
7102 others might not see this spam. If the @command{sa-learn} command is
7103 available, the message is also recategorized as spam.
7104
7105 The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7106 @samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7107 the @command{sa-learn} command is available, the message is also
7108 recategorized as ham.
7109
7110 Over time, you'll observe that the same host or domain occurs
7111 repeatedly in the @samp{blacklist_from} entries, so you might think
7112 that you could avoid future spam by blacklisting all mail from a
7113 particular domain. The utility function
7114 @code{mh-spamassassin-identify-spammers} helps you do precisely that.
7115 This function displays a frequency count of the hosts and domains in
7116 the @samp{blacklist_from} entries from the last blank line in
7117 @file{~/.spamassassin/user_prefs} to the end of the file. This
7118 information can be used so that you can replace multiple
7119 @samp{blacklist_from} entries with a single wildcard entry such as:
7120
7121 @smallexample
7122 blacklist_from *@@*amazingoffersdirect2u.com
7123 @end smallexample
7124
7125 In versions of SpamAssassin (2.50 and on) that support a Bayesian
7126 classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7127 @command{sa-learn} to recategorize the message as spam. Neither MH-E,
7128 nor SpamAssassin, rebuilds the database after adding words, so you
7129 will need to run @samp{sa-learn --rebuild} periodically. This can be
7130 done by adding the following to your @file{crontab}:
7131
7132 @smallexample
7133 0 * * * * sa-learn --rebuild > /dev/null 2>&1
7134 @end smallexample
7135
7136 @heading Bogofilter
7137
7138 Bogofilter is a Bayesian spam filtering program. Get it from your
7139 local distribution or from the
7140 @uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7141
7142 Bogofilter is taught by running:
7143
7144 @smallexample
7145 bogofilter -n < good-message
7146 @end smallexample
7147
7148 on every good message, and
7149
7150 @smallexample
7151 bogofilter -s < spam-message
7152 @end smallexample
7153
7154 @cindex full training
7155
7156 on every spam message. This is called a @dfn{full training}; three
7157 other training methods are described in the FAQ that is distributed
7158 with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7159 each type of message to start doing a good job.
7160
7161 To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7162
7163 @cindex @samp{X-Bogosity:} header field
7164 @cindex header field, @samp{X-Bogosity:}
7165
7166 @smallexample
7167 MAILDIR=$HOME/`mhparam Path`
7168
7169 # Fight spam with Bogofilter.
7170 :0fw
7171 | bogofilter -3 -e -p
7172
7173 :0:
7174 * ^X-Bogosity: Yes, tests=bogofilter
7175 spam/.
7176
7177 :0:
7178 * ^X-Bogosity: Unsure, tests=bogofilter
7179 spam/unsure/.
7180 @end smallexample
7181
7182 If bogofilter classifies a message incorrectly, or is unsure, you can
7183 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7184 w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7185
7186 The @cite{Bogofilter FAQ} suggests that you run the following
7187 occasionally to shrink the database:
7188
7189 @smallexample
7190 bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7191 mv wordlist.db wordlist.db.prv
7192 mv wordlist.db.new wordlist.db
7193 @end smallexample
7194
7195 The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7196 bogofilter.
7197
7198 @heading SpamProbe
7199
7200 SpamProbe is a Bayesian spam filtering program. Get it from your local
7201 distribution or from the @uref{http://spamprobe.sourceforge.net,
7202 SpamProbe web site}.
7203
7204 To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7205
7206 @cindex @command{formail}
7207 @cindex @samp{X-SpamProbe:} header field
7208 @cindex header field, @samp{X-SpamProbe:}
7209
7210 @smallexample
7211 MAILDIR=$HOME/`mhparam Path`
7212
7213 # Fight spam with SpamProbe.
7214 :0
7215 SCORE=| spamprobe receive
7216
7217 :0 wf
7218 | formail -I "X-SpamProbe: $SCORE"
7219
7220 :0:
7221 *^X-SpamProbe: SPAM
7222 spam/.
7223 @end smallexample
7224
7225 If SpamProbe classifies a message incorrectly, you can use the MH-E
7226 commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7227 (@code{mh-junk-whitelist}) to update SpamProbe's training.
7228
7229 @heading Other Things You Can Do
7230
7231 There are a couple of things that you can add to @file{~/.procmailrc}
7232 in order to filter out a lot of spam and viruses. The first is to
7233 eliminate any message with a Windows executable (which is most likely
7234 a virus). The second is to eliminate mail in character sets that you
7235 can't read.
7236
7237 @cindex @samp{Content-Transfer-Encoding:} header field
7238 @cindex @samp{Content-Type:} header field
7239 @cindex @samp{Subject:} header field
7240 @cindex header field, @samp{Content-Transfer-Encoding:}
7241 @cindex header field, @samp{Content-Type:}
7242 @cindex header field, @samp{Subject:}
7243
7244 @smallexample
7245 MAILDIR=$HOME/`mhparam Path`
7246
7247 #
7248 # Filter messages with win32 executables/virii.
7249 #
7250 # These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7251 # pattern. The string "this program cannot be run in MS-DOS mode"
7252 # encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7253 # positives (Roland Smith via Pete from the bogofilter mailing list).
7254 #
7255 :0 B:
7256 * ^Content-Transfer-Encoding:.*base64
7257 * ^TVqQAAMAAAAEAAAA//8AALg
7258 * 4fug4AtAnNIbg
7259 spam/exe/.
7260
7261 #
7262 # Filter mail in unreadable character sets (from the Bogofilter FAQ).
7263 #
7264 UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7265
7266 :0:
7267 * 1^0 $ ^Subject:.*=\?($UNREADABLE)
7268 * 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7269 spam/unreadable/.
7270
7271 :0:
7272 * ^Content-Type:.*multipart
7273 * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7274 spam/unreadable/.
7275 @end smallexample
7276
7277 @node Miscellaneous, Scan Line Formats, Junk, Top
7278 @chapter Miscellaneous Commands, Variables, and Buffers
7279
7280 This chapter covers the following command and the various MH-E
7281 buffers,
7282
7283 @ftable @code
7284 @item mh-version
7285 Display version information about MH-E and the MH mail handling
7286 system.
7287 @end ftable
7288
7289 @cindex @samp{*MH-E Info*}
7290 @cindex MH-E version
7291 @cindex buffers, @samp{*MH-E Info*}
7292 @cindex version
7293
7294 One command worth noting is @kbd{M-x mh-version}. You can compare the
7295 version this command prints to the latest release (@pxref{Getting
7296 MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
7297 @samp{*MH-E Info*}, should usually be included with any bug report you
7298 submit (@pxref{Bug Reports}).
7299
7300 @heading MH-E Buffers
7301
7302 Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
7303 several other buffers. They are:
7304
7305 @table @samp
7306 @cindex @samp{*MH-E Folders*}
7307 @cindex buffers, @samp{*MH-E Folders*}
7308 @findex mh-list-folders
7309 @item *MH-E Folders*
7310 @kindex F l
7311 This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
7312 @xref{Folders}.
7313 @c -------------------------
7314 @cindex @samp{*MH-E Help*}
7315 @cindex buffers, @samp{*MH-E Help*}
7316 @findex mh-help
7317 @item *MH-E Help*
7318 @kindex ?
7319 @kindex C-c ?
7320 This buffer contains the output of @kbd{?} (@code{mh-help}) and
7321 @kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
7322 @c -------------------------
7323 @cindex @samp{*MH-E Info*}
7324 @cindex buffers, @samp{*MH-E Info*}
7325 @item *MH-E Info*
7326 This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
7327 @c -------------------------
7328 @cindex @samp{*MH-E Log*}
7329 @cindex buffers, @samp{*MH-E Log*}
7330 @item *MH-E Log*
7331 This buffer contains the last 100 lines of the output of the various
7332 MH commands.
7333 @c -------------------------
7334 @cindex @samp{*MH-E Mail Delivery*}
7335 @cindex buffers, @samp{*MH-E Mail Delivery*}
7336 @item *MH-E Mail Delivery*
7337 This buffer contains the transcript of a mail delivery. @xref{Sending
7338 Message}.
7339 @c -------------------------
7340 @cindex @samp{*MH-E Recipients*}
7341 @cindex buffers, @samp{*MH-E Recipients*}
7342 @findex mh-check-whom
7343 @item *MH-E Recipients*
7344 @kindex C-c C-w
7345 This buffer contains the output of @kbd{C-c C-w}
7346 (@code{mh-check-whom}) and is killed when draft is sent.
7347 @xref{Checking Recipients}.
7348 @c -------------------------
7349 @cindex @samp{*MH-E Sequences*}
7350 @cindex buffers, @samp{*MH-E Sequences*}
7351 @item *MH-E Sequences*
7352 This buffer contains the output of @kbd{S l}
7353 (@code{mh-list-sequences}). @xref{Sequences}.
7354 @c -------------------------
7355 @cindex @samp{*mh-temp*}
7356 @cindex buffers, @samp{*mh-temp*}
7357 @item *mh-temp
7358 This is a scratch, ephemeral, buffer used by MH-E functions. Note that
7359 it is hidden because the first character in the name is a space.
7360 You'll generally not have any need for this buffer.
7361 @end table
7362
7363 @node Scan Line Formats, Procmail, Miscellaneous, Top
7364 @appendix Scan Line Formats
7365
7366 @cindex scan line formats
7367
7368 This appendix discusses how MH-E creates, parses, and manipulates scan
7369 lines. If you have your own MH scan or inc format files, you
7370 @strong{can} teach MH-E how to handle them, but it isn't easy as
7371 you'll see.
7372
7373 @cindex @samp{mh-scan-line-formats} customization group
7374 @cindex customization group, @samp{mh-scan-line-formats}
7375
7376 This table lists the options in the @samp{mh-scan-line-formats}
7377 customization group.
7378
7379 @vtable @code
7380 @item mh-adaptive-cmd-note-flag
7381 On means that the message number width is determined dynamically
7382 (default: @samp{on}).
7383 @c -------------------------
7384 @item mh-scan-format-file
7385 Specifies the format file to pass to the scan program (default:
7386 @samp{Use MH-E scan Format}).
7387 @c -------------------------
7388 @item mh-scan-prog
7389 Program used to scan messages (default: @code{"scan"}).
7390 @end vtable
7391
7392 @findex mh-set-cmd-note
7393 @vindex mh-adaptive-cmd-note-flag
7394 @vindex mh-scan-format-file
7395
7396 There are a couple of caveats when creating your own scan format file.
7397 First, MH-E will not work if your scan lines do not include message
7398 numbers. It will work poorly if you don't dedicate a column for
7399 showing the current message and notations. You won't be able to use
7400 the option @code{mh-adaptive-cmd-note-flag} or the threading features
7401 (@pxref{Threading}).
7402
7403 @cindex message numbers
7404
7405 If you've created your own format to handle long message numbers,
7406 you'll be pleased to know you no longer need it since MH-E adapts its
7407 internal format based upon the largest message number if
7408 @code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
7409 fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
7410 and call @code{mh-set-cmd-note} with the width specified by your
7411 format file (see @code{mh-scan-format-file}). For example, the default
7412 width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
7413
7414 @vindex mh-scan-format-nmh
7415 @vindex mh-scan-format-mh
7416
7417 The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
7418 scan Format}. This means that the format string will be taken from the
7419 either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
7420 on whether MH or nmh (or GNU mailutils) is in use. This setting also
7421 enables you to turn on the option @code{mh-adaptive-cmd-note-flag}.
7422 You can also set this option to @samp{Use Default scan Format} to get
7423 the same output as you would get if you ran @command{scan} from the
7424 shell. If you have a format file that you want MH-E to use but not MH,
7425 you can set this option to @samp{Specify a scan Format File} and enter
7426 the name of your format file.
7427
7428 The scan format that MH-E uses when @code{mh-scan-format-file} is set
7429 to its default of @samp{Use MH-E scan Format} is held in the variables
7430 @code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
7431 whether you are using nmh (or GNU mailutils) or not. Typically, you
7432 create your own format files rather than modifying these variables.
7433 The value of @code{mh-scan-format-nmh} is:
7434
7435 @smallexample
7436 (concat
7437 "%4(msg)"
7438 "%<(cur)+%| %>"
7439 "%<@{replied@}-"
7440 "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
7441 "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
7442 "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
7443 "%?(nonnull(comp@{newsgroups@}))n%>"
7444 "%<(zero) %>"
7445 "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
7446 "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
7447 "%<(zero)%17(decode(friendly@{from@}))%> "
7448 "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
7449 @end smallexample
7450
7451 @cindex RFC 2047, decoding
7452 @cindex decoding RFC 2047
7453
7454 The setting for @code{mh-scan-format-mh} is similar, except that MH
7455 doesn't have the function @code{decode} (which is used to decode RFC
7456 2047 encodings).
7457
7458 @cindex notations, scan line
7459 @cindex scan line notations
7460
7461 These strings are passed to the @command{scan} program via the
7462 @option{-format} argument. The formats are identical to the defaults
7463 except that additional hints for fontification have been added to the
7464 existing notations in the fifth column (remember that in Emacs, the
7465 columns start at 0). The values of the fifth column, in priority
7466 order, are: @samp{-} if the message has been replied to, @samp{t} if
7467 an address in the @samp{To:} field matches one of the mailboxes of the
7468 current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
7469 the @samp{Bcc:} field matches, and @samp{n} if a non-empty
7470 @samp{Newsgroups:} field is present.
7471
7472 @cindex @command{scan}
7473 @cindex MH commands, @command{scan}
7474 @vindex mh-progs
7475 @vindex mh-scan-prog
7476
7477 The name of the program that generates a listing of one line per
7478 message is held in @code{mh-scan-prog} (default: @code{"scan"}).
7479 Unless this variable contains an absolute pathname, it is assumed to
7480 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
7481 link another program to @command{scan} (see @samp{mh-profile}(5)) to
7482 produce a different type of listing@footnote{See the section
7483 @uref{@value{MH-BOOK-HOME}/faswsprs.htm, Find and Specify with scan
7484 pick Ranges Sequences} in the MH book.}.
7485
7486 @cindex regular expressions, scan line formats
7487
7488 If you change the format of the scan lines you'll need to tell MH-E
7489 how to parse the new format. As you will see, quite a lot of variables
7490 are involved to do that. Use @kbd{M-x apropos @key{RET}
7491 mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
7492 will also have to call @code{mh-set-cmd-note} if your notations are
7493 not in column 4 (columns in Emacs start with 0). Note that unlike most
7494 of the user options described in this manual, these are variables and
7495 must be set with @code{setq} instead of in a customization buffer. For
7496 help with regular expressions, see
7497 @ifnothtml
7498 @ref{Regexps, , Syntax of Regular Expressions, emacs, The
7499 GNU Emacs Manual}.
7500 @end ifnothtml
7501 @ifhtml
7502 section
7503 @uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
7504 Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
7505 @end ifhtml
7506
7507 The first variable has to do with pruning out garbage.
7508
7509 @vtable @code
7510 @cindex @command{inc}
7511 @cindex MH commands, @command{inc}
7512 @cindex @command{scan}
7513 @cindex MH commands, @command{scan}
7514 @item mh-scan-valid-regexp
7515 This regular expression describes a valid scan line. This is used to
7516 eliminate error messages that are occasionally produced by
7517 @command{inc}@footnote{See the section
7518 @uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
7519 prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
7520 @end vtable
7521
7522 Next, many variables control how the scan lines are parsed.
7523
7524 @vindex mh-folder-font-lock-keywords
7525
7526 @vtable @code
7527 @vindex mh-folder-body
7528 @vindex mh-folder-font-lock-keywords
7529 @item mh-scan-body-regexp
7530 This regular expression matches the message body fragment. Note that
7531 the default setting of @code{mh-folder-font-lock-keywords} expects
7532 this expression to contain at least one parenthesized expression which
7533 matches the body text as in the default of
7534 @code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
7535 correct, the body fragment will not be highlighted with the face
7536 @code{mh-folder-body}.
7537 @c -------------------------
7538 @vindex mh-folder-cur-msg-number
7539 @vindex mh-folder-font-lock-keywords
7540 @vindex mh-note-cur
7541 @item mh-scan-cur-msg-number-regexp
7542 This regular expression matches the current message. It must match
7543 from the beginning of the line. Note that the default setting of
7544 @code{mh-folder-font-lock-keywords} expects this expression to contain
7545 at least one parenthesized expression which matches the message number
7546 as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
7547 expression includes the leading space and current message marker
7548 @samp{+} within the parenthesis since it looks better to highlight
7549 these items as well. The highlighting is done with the face
7550 @code{mh-folder-cur-msg-number}. This regular expression should be
7551 correct as it is needed by non-fontification functions. See also
7552 @code{mh-note-cur}.
7553 @c -------------------------
7554 @vindex mh-folder-date
7555 @vindex mh-folder-font-lock-keywords
7556 @vindex mh-scan-sent-to-me-sender-regexp
7557 @item mh-scan-date-regexp
7558 This regular expression matches a valid date. It must @strong{not} be
7559 anchored to the beginning or the end of the line. Note that the
7560 default setting of @code{mh-folder-font-lock-keywords} expects this
7561 expression to contain only one parenthesized expression which matches
7562 the date field as in the default of
7563 @code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
7564 not correct, the date will not be highlighted with the face
7565 @code{mh-folder-date}.
7566 @c -------------------------
7567 @vindex mh-folder-deleted
7568 @vindex mh-folder-font-lock-keywords
7569 @vindex mh-note-deleted
7570 @item mh-scan-deleted-msg-regexp
7571 This regular expression matches deleted messages. It must match from
7572 the beginning of the line. Note that the default setting of
7573 @code{mh-folder-font-lock-keywords} expects this expression to contain
7574 at least one parenthesized expression which matches the message number
7575 as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
7576 includes the leading space within the parenthesis since it looks
7577 better to highlight it as well. The highlighting is done with the face
7578 @code{mh-folder-deleted}. This regular expression should be correct as
7579 it is needed by non-fontification functions. See also
7580 @code{mh-note-deleted}.
7581 @c -------------------------
7582 @vindex mh-folder-font-lock-keywords
7583 @vindex mh-folder-msg-number
7584 @item mh-scan-good-msg-regexp
7585 This regular expression matches ``good'' messages. It must match from
7586 the beginning of the line. Note that the default setting of
7587 @code{mh-folder-font-lock-keywords} expects this expression to contain
7588 at least one parenthesized expression which matches the message number
7589 as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
7590 expression includes the leading space within the parenthesis since it
7591 looks better to highlight it as well. The highlighting is done with
7592 the face @code{mh-folder-msg-number}. This regular expression should
7593 be correct as it is needed by non-fontification functions.
7594 @c -------------------------
7595 @vindex mh-scan-format-file
7596 @item mh-scan-msg-format-regexp
7597 This regular expression finds the message number width in a scan
7598 format. Note that the message number must be placed in a parenthesized
7599 expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
7600 variable is only consulted if @code{mh-scan-format-file} is set to
7601 @samp{Use MH-E scan Format}.
7602 @c -------------------------
7603 @vindex mh-scan-format-file
7604 @item mh-scan-msg-format-string
7605 This is a format string for the width of the message number in a scan
7606 format. Use @samp{0%d} for zero-filled message numbers. This variable
7607 is only consulted if @code{mh-scan-format-file} is set to @samp{Use
7608 MH-E scan Format} (default: @code{"%d"}).
7609 @c -------------------------
7610 @item mh-scan-msg-number-regexp
7611 This regular expression extracts the message number. It must match
7612 from the beginning of the line. Note that the message number must be
7613 placed in a parenthesized expression as in the default of @w{@code{"^
7614 *\\([0-9]+\\)"}}.
7615 @c -------------------------
7616 @item mh-scan-msg-overflow-regexp
7617 This regular expression matches overflowed message numbers (default:
7618 @code{"^[?0-9][0-9]"}).
7619 @c -------------------------
7620 @item mh-scan-msg-search-regexp
7621 This regular expression matches a particular message. It is a format
7622 string; use @samp{%d} to represent the location of the message number
7623 within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
7624 @c -------------------------
7625 @vindex mh-folder-address
7626 @vindex mh-folder-font-lock-keywords
7627 @vindex mh-folder-to
7628 @item mh-scan-rcpt-regexp
7629 This regular expression specifies the recipient in messages you sent.
7630 Note that the default setting of @code{mh-folder-font-lock-keywords}
7631 expects this expression to contain two parenthesized expressions. The
7632 first is expected to match the @samp{To:} that the default scan format
7633 file generates. The second is expected to match the recipient's name
7634 as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
7635 regular expression is not correct, the @samp{To:} string will not be
7636 highlighted with the face @code{mh-folder-to} and the recipient will not be
7637 highlighted with the face @code{mh-folder-address}.
7638 @c -------------------------
7639 @vindex mh-folder-font-lock-keywords
7640 @vindex mh-folder-refiled
7641 @vindex mh-note-refiled
7642 @item mh-scan-refiled-msg-regexp
7643 This regular expression matches refiled messages. It must match from
7644 the beginning of the line. Note that the default setting of
7645 @code{mh-folder-font-lock-keywords} expects this expression to contain
7646 at least one parenthesized expression which matches the message number
7647 as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
7648 includes the leading space within the parenthesis since it looks
7649 better to highlight it as well. The highlighting is done with the face
7650 @code{mh-folder-refiled}. This regular expression should be correct as
7651 it is needed by non-fontification functions. See also
7652 @code{mh-note-refiled}.
7653 @c -------------------------
7654 @vindex mh-folder-font-lock-keywords
7655 @vindex mh-folder-sent-to-me-sender
7656 @vindex mh-mh-folder-sent-to-me-hint
7657 @vindex mh-scan-format-nmh
7658 @item mh-scan-sent-to-me-sender-regexp
7659 This regular expression matches messages sent to us. Note that the
7660 default setting of @code{mh-folder-font-lock-keywords} expects this
7661 expression to contain at least two parenthesized expressions. The
7662 first should match the fontification hint (see
7663 @code{mh-scan-format-nmh}) and the second should match the user name
7664 as in the default of
7665 @w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
7666 If this regular expression is not correct, the notation hints will not
7667 be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
7668 the sender will not be highlighted with the face
7669 @code{mh-folder-sent-to-me-sender}.
7670 @c -------------------------
7671 @vindex mh-folder-followup
7672 @vindex mh-folder-font-lock-keywords
7673 @vindex mh-folder-subject
7674 @item mh-scan-subject-regexp
7675 This regular expression matches the subject. It must match from the
7676 beginning of the line. Note that the default setting of
7677 @samp{mh-folder-font-lock-keywords} expects this expression to contain
7678 at least three parenthesized expressions. The first is expected to
7679 match the @samp{Re:} string, if any, and is highlighted with the face
7680 @code{mh-folder-followup}. The second matches an optional bracketed
7681 number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
7682 sub-expression of the first expression). The third is expected to
7683 match the subject line itself which is highlighted with the face
7684 @code{mh-folder-subject}. For example, the default is
7685 @w{@code{"^ *[0-9]+........[ ]*...................}}@*
7686 @w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
7687 This regular expression should be correct as it is needed by
7688 non-fontification functions. Note that this example is broken up on
7689 two lines for readability, but is actually a single string.
7690 @end vtable
7691
7692 Finally, there are a slew of variables that control how MH-E annotates
7693 the scan lines.
7694
7695 @vtable @code
7696 @item mh-cmd-note
7697 Column for notations (default: 4). This variable should be set with
7698 the function @code{mh-set-cmd-note}. This variable may be updated
7699 dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
7700 variables contain the notational characters. Note that columns in
7701 Emacs start with 0.
7702 @c -------------------------
7703 @item mh-note-copied
7704 Messages that have been copied are marked by this character (default:
7705 @code{?C}).
7706 @c -------------------------
7707 @item mh-note-cur
7708 The current message (in MH, not in MH-E) is marked by this character
7709 (default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
7710 @c -------------------------
7711 @item mh-note-deleted
7712 Messages that have been deleted are marked by this character (default:
7713 @code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
7714 @c -------------------------
7715 @item mh-note-dist
7716 Messages that have been redistributed are marked by this character
7717 (default: @code{?R}).
7718 @c -------------------------
7719 @item mh-note-forw
7720 Messages that have been forwarded are marked by this character
7721 (default: @code{?F}).
7722 @c -------------------------
7723 @item mh-note-printed
7724 Messages that have been printed are marked by this character (default:
7725 @code{?P}).
7726 @c -------------------------
7727 @item mh-note-refiled
7728 Messages that have been refiled are marked by this character (default:
7729 @code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
7730 @c -------------------------
7731 @item mh-note-repl
7732 Messages that have been replied to are marked by this character
7733 (default: @code{?-}).
7734 @c -------------------------
7735 @item mh-note-seq
7736 Messages in a user-defined sequence are marked by this character
7737 (default: @code{?%}). Messages in the @samp{search} sequence are
7738 marked by this character as well.
7739 @end vtable
7740
7741 For example, let's say I have the following in @file{scan.format}
7742 which displays the sender, the subject, and the message number. This
7743 format places a @samp{+} after the message number for the current
7744 message according to MH; it also uses that column for notations.
7745
7746 @example
7747 %20(decode(friendly@{from@})) %50(decode@{subject@}) %4(msg)%<(cur)+%| %>
7748 @end example
7749
7750 @vindex mh-scan-format-file, example
7751
7752 The first thing you have to do is tell MH-E to use this file.
7753 Customize @code{mh-scan-format-file} and set its value to @samp{Use
7754 Default scan Format}. If you didn't get already turn off
7755 @code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
7756
7757 Next, tell MH-E what a valid scan line looks like so that you can at
7758 least display the output of scan in your MH-Folder buffer.
7759
7760 @vindex mh-scan-valid-regexp, example
7761
7762 @lisp
7763 (setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
7764 @end lisp
7765
7766 Now, in order to get rid of the @samp{Cursor not pointing to message}
7767 message, you need to tell MH-E how to access the message number. You
7768 should also see why MH-E requires that you include a message number in
7769 the first place.
7770
7771 @vindex mh-scan-msg-number-regexp, example
7772 @vindex mh-scan-msg-search-regexp, example
7773
7774 @lisp
7775 (setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
7776 (setq mh-scan-msg-search-regexp " %d[+D^ ]$")
7777 @end lisp
7778
7779 In order to get the next and previous commands working, add this.
7780
7781 @vindex mh-scan-good-msg-regexp, example
7782
7783 @lisp
7784 (setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
7785 @end lisp
7786
7787 Note that the current message isn't marked with a @samp{+} when moving
7788 between the next and previous messages. Here is the code required to
7789 get this working.
7790
7791 @vindex set-mh-cmd-note, example
7792 @vindex mh-scan-cur-msg-number-regexp, example
7793
7794 @lisp
7795 (set-mh-cmd-note 76)
7796 (setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
7797 @end lisp
7798
7799 Finally, add the following to delete and refile messages.
7800
7801 @vindex mh-scan-deleted-msg-regexp, example
7802 @vindex mh-scan-refiled-msg-regexp, example
7803
7804 @lisp
7805 (setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
7806 (setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
7807 @end lisp
7808
7809 This is just a bare minimum; it's best to adjust all of the regular
7810 expressions to ensure that MH-E and highlighting perform well.
7811
7812 @node Procmail, Odds and Ends, Scan Line Formats, Top
7813 @appendix Reading Mailing Lists Effectively
7814
7815 @cindex @command{procmail}
7816 @cindex @command{slocal}
7817 @cindex Gnus
7818 @cindex MH commands, @command{slocal}
7819 @cindex Unix commands, @command{procmail}
7820 @cindex mailing lists, reading
7821
7822 This appendix explains how to use @uref{http://www.procmail.org/,
7823 procmail} to file mail from mailing lists into folders which can then
7824 be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
7825 can be used as well, but procmail is more flexible and more packages
7826 exist for procmail than for slocal.}. Some mailing lists have such
7827 high traffic that Gnus must be used and I discuss how to use Gnus
7828 side-by-side with MH-E.
7829
7830 @cindex @file{.procmailrc}
7831 @cindex files, @file{.procmailrc}
7832
7833 First, I'll describe how to put mail from your mailing lists directly
7834 into an MH folder using @command{procmail}. First, add the following
7835 to @file{~/.procmailrc}. While the logging variables aren't strictly
7836 necessary, they are extremely useful.
7837
7838 @smallexample
7839 [1] # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
7840 [2] PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
7841 [3]
7842 [4] # Point LOGFILE at the actual log file.
7843 [5] LOGFILE=$HOME/.procmail.log
7844 [6]
7845 [7] # This setting provides just the right amount of information.
7846 [8] LOGABSTRACT=all
7847 [9]
7848 [10] # Uncomment the following line to see how your patterns match.
7849 [11] #VERBOSE=yes
7850 [12]
7851 [13] # Place mail sent to any MH-E mailing list in +mh-e.
7852 [14] :0 w: mh-e$LOCKEXT
7853 [15] * ^TO.*mh-e-.*@.*sourceforge.net
7854 [16] | myrcvstore -create +mh-e
7855 @end smallexample
7856
7857 @cindex @command{rcvstore}
7858 @cindex MH commands, @command{rcvstore}
7859
7860 Line 14 creates a lock file in your mail directory based upon the name
7861 of the folder. This is done because @command{rcvstore} does not
7862 perform locking. While this lock file will prevent @command{procmail}
7863 from writing to a folder concurrently, there is a slight chance that
7864 you might lose a message if you're performing operations on a folder
7865 at the same time @command{rcvstore} is placing a message there. You
7866 have been warned. Now that that disclaimer is out of the way, note
7867 that I've been using this set-up for over a decade and haven't lost
7868 anything to my knowledge@footnote{See
7869 @uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
7870 Savannah issue #4361} to see if @command{rcvstore} locking is still an
7871 issue.}.
7872
7873 @cindex @samp{Unseen-Sequence:} MH profile component
7874 @cindex MH profile component, @samp{Unseen-Sequence:}
7875
7876 Line 16 uses the following script, @code{myrcvstore}, to massage the
7877 message as described in the comment and file the message in the given
7878 folder@footnote{The @samp{-create} argument wasn't always the default
7879 to @command{rcvstore}.}.
7880
7881 @smallexample
7882 #! /bin/sh
7883
7884 # Accepts a message on standard input and passes it through rcvstore
7885 # after first passing it through any filters. All arguments are passed
7886 # on to rcvstore.
7887
7888 # Force the "From user date" to become part of header. One reason this
7889 # is done is because the presence of the From field confuses dist so
7890 # that dist adds a new header, rather than using the existing header.
7891 # Note that this should not be done for any message that goes into a
7892 # Gnus incoming file (Gnus will thrown an error) nor should it be
7893 # applied to any message that goes to the system mailbox because the
7894 # entire mailbox will be incorporated as a single message.
7895 formail -c -z -R 'From ' X-Envelope-From: |
7896 rcvstore $@@
7897 @end smallexample
7898
7899 If your version of @command{rcvstore} doesn't add messages to the
7900 @samp{unseen} sequence by default, add the following line to your MH
7901 profile:
7902
7903 @example
7904 Unseen-Sequence: unseen
7905 @end example
7906
7907 Now view your new messages with the speedbar (@pxref{Speedbar}) or with
7908 @kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
7909
7910 If you're on a mailing list that is so voluminous that it is
7911 impossible to read every message, it usually better to read the
7912 mailing list like a newsgroup in a news reader. Emacs has a built-in
7913 newsreader called Gnus. The remainder of this appendix talks about how
7914 to use Gnus with an MH message store. The version of Gnus that was
7915 used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
7916 work but versions prior to 5.8 use different options.
7917
7918 This table contains a list of Gnus options that you will have to
7919 modify. Note that for them to become accessible, you'll have to load
7920 @file{nnml.el} first. This can be done with @kbd{M-x load-library
7921 @key{RET} nnml @key{RET}}.
7922
7923 @vtable @code
7924 @item gnus-secondary-select-methods
7925 Select the @samp{nnml} value. This select method uses directories for
7926 folders and individual files for messages, just like MH. You do not
7927 have to set an address.
7928 @c -------------------------
7929 @item mail-sources
7930 Select the @samp{Several files in a directory} value, check the
7931 @samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
7932 your mail.
7933 @c -------------------------
7934 @item message-mail-user-agent
7935 In order to send mail within Gnus using MH-E, set this option to
7936 @samp{mail-user-agent} and set the @samp{mail-user-agent} option to
7937 @samp{Emacs interface to MH}.
7938 @c -------------------------
7939 @item nnmail-keep-last-article
7940 Since Gnus keeps track of which messages you have read, it would be
7941 bad if Gnus expired the last message, for example, message 100, and
7942 @command{rcvstore} gave the next new message number 1. Gnus would then
7943 ignore it since it thinks that you've read messages 1-100. Turning on
7944 this option ensures that the last message is never removed thereby
7945 eliminating this problem.
7946 @end vtable
7947
7948 Next add the following to @file{~/.procmailrc}. If you don't subscribe
7949 to the GnuCash mailing list, substitute one to which you are
7950 subscribed.
7951
7952 @example
7953 MAILDIR=$HOME/`mhparam Path`
7954 # Place mail sent to the GnuCash mailing list in gnucash.spool, where
7955 # Gnus will pick it up.
7956 :0:
7957 * ^TO.*gnucash.*@.*gnucash.org
7958 gnucash.spool
7959 @end example
7960
7961 Wait for some messages to appear in @file{gnucash.spool} and run Gnus
7962 with @kbd{M-x gnus @key{RET}}. To view the folder created in the
7963 example above, you would tell Gnus about it the first time only with
7964 @kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
7965 known as @samp{+gnucash}.
7966
7967 @node Odds and Ends, History, Procmail, Top
7968 @appendix Odds and Ends
7969
7970 This appendix covers a few topics that don't fit elsewhere. Here I
7971 tell you how to report bugs and how to get on the MH-E mailing lists.
7972 I also point out some additional sources of information.
7973
7974 @menu
7975 * Bug Reports::
7976 * Mailing Lists::
7977 * MH FAQ and Support::
7978 * Getting MH-E::
7979 @end menu
7980
7981 @node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
7982 @appendixsec Bug Reports
7983
7984 @cindex SourceForge
7985 @cindex bugs
7986
7987 Bug reports should be filed at
7988 @uref{https://sourceforge.net/bugs/?group_id=13357, SourceForge}. You
7989 need to be a SourceForge user to submit bug reports, but this is easy
7990 enough to do that it shouldn't be a restriction for you. Please
7991 include the output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in
7992 any bug report you send unless you're 110% positive we won't ask for
7993 it.
7994
7995 @node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
7996 @appendixsec MH-E Mailing Lists
7997
7998 @cindex SourceForge
7999 @cindex mailing lists
8000
8001 There are several mailing lists for MH-E. They are @i{mh-e-users at
8002 lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
8003 and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
8004 the archives at @uref{https://sourceforge.net/mail/?group_id=13357,
8005 SourceForge}. Do not report bugs on these lists; please submit them
8006 via SourceForge (@pxref{Bug Reports}).
8007
8008 @node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
8009 @appendixsec MH FAQ and Support
8010
8011 @cindex FAQ
8012 @cindex MH FAQ
8013
8014 The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8015 Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8016 @samp{comp.mail.mh}. While very little is there that deals with MH-E
8017 specifically, there is an incredible wealth of material about MH
8018 itself which you will find useful.
8019
8020 @cindex support
8021
8022 You can find FAQs on MH-E at the
8023 @uref{https://sourceforge.net/support/?group_id=13357, Support
8024 Requests} page on SourceForge. If you don't find the answer to your
8025 question, file a support request and your question will become a new
8026 FAQ!
8027
8028 @node Getting MH-E, , MH FAQ and Support, Odds and Ends
8029 @appendixsec Getting MH-E
8030
8031 @cindex MH-E, obtaining
8032 @cindex getting MH-E
8033 @cindex obtaining MH-E
8034
8035 Because MH-E is undergoing a phase of sustained growth, the version of
8036 MH-E in your Emacs is likely to be out of date although it is most
8037 likely to be more up to date than the copy that comes with the MH
8038 distribution in @file{miscellany/mh-e}.
8039
8040 @cindex change log
8041 @cindex release notes
8042
8043 @c intentionally wordy to avoid overfull hbox
8044 New MH-E releases are always available for downloading at
8045 @uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
8046 SourceForge} before they appear in an Emacs release. You can read the
8047 release notes on that page to determine if the given release of MH-E
8048 is already installed in your version of Emacs. You can also read the
8049 change log to see if you are interested in what the given release of
8050 MH-E has to offer (although we have no doubt that you will be
8051 extremely interested in all new releases).
8052
8053 @cindex @samp{MH-E-NEWS}
8054 @cindex @samp{README}
8055 @cindex files, @samp{MH-E-NEWS}
8056 @cindex files, @samp{README}
8057 @cindex news
8058
8059 After you download and extract the MH-E tarball, read the
8060 @file{README} file and @file{MH-E-NEWS}. These correspond to the
8061 release notes and change log mentioned above. The file @file{README}
8062 contains instructions on installing MH-E. If you're already running
8063 Emacs, please quit that session and start again to load in the new
8064 MH-E. Check that you're running the new version with the command
8065 @kbd{M-x mh-version}.
8066
8067 @cindex contributed software
8068 @cindex manual
8069 @cindex documentation
8070
8071 In addition to the mh-e package, the
8072 @uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
8073 SourceForge} site also contains doc and contrib packages. The former
8074 is the latest release of this manual, and the latter contains a few
8075 contributed packages you might find useful.
8076
8077 @node History, GFDL, Odds and Ends, Top
8078 @appendix History of MH-E
8079
8080 @cindex Bill Wohler
8081 @cindex Brian Reid
8082 @cindex Gildea, Stephen
8083 @cindex Jim Larus
8084 @cindex Larus, Jim
8085 @cindex MH-E, versions
8086 @cindex Reid, Brian
8087 @cindex SourceForge
8088 @cindex Stephen Gildea
8089 @cindex Wohler, Bill
8090 @cindex history of MH-E
8091 @cindex versions of MH-E
8092
8093 MH-E was originally written by Brian Reid in 1983 and has changed
8094 hands several times since then. Jim Larus wanted to do something
8095 similar for GNU Emacs, and ended up completely rewriting it that same
8096 year. In 1989, Stephen Gildea picked it up and added many
8097 improvements. Bill Wohler then took over in 2000 and moved its
8098 development to @uref{http://sourceforge.net/, SourceForge} where it
8099 lives today.
8100
8101 @menu
8102 * From Brian Reid::
8103 * From Jim Larus::
8104 * From Stephen Gildea::
8105 * From Bill Wohler::
8106 @end menu
8107
8108 @node From Brian Reid, From Jim Larus, History, History
8109 @appendixsec From Brian Reid
8110
8111 @cindex Brian Reid
8112 @cindex Reid, Brian
8113
8114 One day in 1983 I got the flu and had to stay home from work for three
8115 days with nothing to do. I used that time to write MHE@. The
8116 fundamental idea behind MHE was that it was a ``puppeteer'' driving
8117 the MH programs underneath it. MH had a model that the editor was
8118 supposed to run as a sub-process of the mailer, which seemed to me at
8119 the time to be the tail wagging the dog. So I turned it around and
8120 made the editor drive the MH programs. I made sure that the UCI people
8121 (who were maintaining MH at the time) took in my changes and made them
8122 stick.
8123
8124 Today, I still use my own version of MHE because I don't at all like
8125 the way that GNU MH-E works and I've never gotten to be good enough at
8126 hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8127 version of MHE and the GNU Emacs version of MH-E have almost nothing
8128 in common except similar names. They work differently, have different
8129 conceptual models, and have different key bindings@footnote{After
8130 reading this article, I questioned Brian about his version of MHE, and
8131 received some great ideas for improving MH-E such as a dired-like
8132 method of selecting folders; and removing the prompting when sending
8133 mail, filling in the blanks in the draft buffer instead. I passed them
8134 on to Stephen Gildea, the current maintainer, and he was excited about
8135 the ideas as well. Perhaps one day, MH-E will again resemble MHE
8136 (draft form editing was introduced in version 7.4).}.
8137
8138 Brian Reid, June 1994
8139
8140 @node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8141 @appendixsec From Jim Larus
8142
8143 @cindex Jim Larus
8144 @cindex Larus, Jim
8145
8146 Brian Reid, while at CMU or shortly after going to Stanford wrote a
8147 mail reading program called MHE for Gosling Emacs. It had much the
8148 same structure as MH-E (i.e., invoked MH programs), though it was
8149 simpler and the commands were slightly different. Unfortunately, I no
8150 longer have a copy so the differences are lost in the mists of time.
8151
8152 In '82-83, I was working at BBN and wrote a lot of mlisp code in
8153 Gosling Emacs to make it look more like Tennex Emacs. One of the
8154 packages that I picked up and improved was Reid's mail system. In '83,
8155 I went back to Berkeley. About that time, Stallman's first version of
8156 GNU Emacs came out and people started to move to it from Gosling Emacs
8157 (as I recall, the transition took a year or two). I decided to port
8158 Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8159 GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8160 bit the bullet and rewrote the code by hand (it was a lot smaller and
8161 simpler then, so it took only a day or two).
8162
8163 Soon after that, MH-E became part of the standard Emacs distribution
8164 and suggestions kept dribbling in for improvements. MH-E soon reached
8165 sufficient functionality to keep me happy, but I kept on improving it
8166 because I was a graduate student with plenty of time on my hands and
8167 it was more fun than my dissertation. In retrospect, the one thing
8168 that I regret is not writing any documentation, which seriously
8169 limited the use and appeal of the package.
8170
8171 @cindex @command{xmh}, in MH-E history
8172
8173 In '89, I came to Wisconsin as a professor and decided not to work on
8174 MH-E. It was stable, except for minor bugs, and had enough
8175 functionality, so I let it be for a few years. Stephen Gildea of BBN
8176 began to pester me about the bugs, but I ignored them. In 1990, he
8177 went off to the X Consortium, said good bye, and said that he would
8178 now be using @command{xmh}. A few months later, he came back and said
8179 that he couldn't stand @command{xmh} and could I put a few more bug fixes
8180 into MH-E. At that point, I had no interest in fixing MH-E, so I gave
8181 the responsibility of maintenance to him and he has done a fine job
8182 since then.
8183
8184 Jim Larus, June 1994
8185
8186 @node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8187 @appendixsec From Stephen Gildea
8188
8189 @cindex Gildea, Stephen
8190 @cindex Stephen Gildea
8191
8192 In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8193 me. In my previous job, I had been using RMAIL, but as my folders tend
8194 to run large, I was frustrated with the speed of RMAIL@. However, I
8195 stuck with it because I wanted the GNU Emacs interface. I am very
8196 familiar and comfortable with the Emacs interface (with just a few
8197 modifications of my own) and dislike having to use applications with
8198 embedded editors; they never live up to Emacs.
8199
8200 MH is the mail reader of choice at BBN, so I converted to it. Since I
8201 didn't want to give up using an Emacs interface, I started using MH-E.
8202 As is my wont, I started hacking on it almost immediately. I first
8203 used version 3.4m. One of the first features I added was to treat the
8204 folder buffer as a file-visiting buffer: you could lock it, save it,
8205 and be warned of unsaved changes when killing it. I also worked to
8206 bring its functionality a little closer to RMAIL@. Jim Larus was very
8207 cooperative about merging in my changes, and my efforts first appeared
8208 in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8209 MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8210 with Emacs 18.56 in 1990, was noticeably faster.
8211
8212 When I moved to the X Consortium I became the first person there to
8213 not use xmh. (There is now one other engineer there using MH-E.) About
8214 this point I took over maintenance of MH-E from Jim and was finally
8215 able to add some features Jim hadn't accepted, such as the backward
8216 searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8217
8218 Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8219 Version 4.0 added many new features, including background folder
8220 collection and support for composing @sc{mime} messages. (Reading
8221 @sc{mime} messages remains to be done, alas.) While writing this book,
8222 Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8223 and inconsistencies that required a new major version to fix, and so
8224 version 5 was released.
8225
8226 Stephen Gildea, June 1994
8227
8228 @node From Bill Wohler, , From Stephen Gildea, History
8229 @appendixsec From Bill Wohler
8230
8231 @cindex Wohler, Bill
8232 @cindex Bill Wohler
8233
8234 The preface originally included the following text which I use to
8235 begin my story:
8236
8237 @quotation
8238 But it's important to note a brief history of MH-E.
8239
8240 @w{Version 3} was prevalent through the @w{Emacs 18} and early
8241 @w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8242 which introduced several new and changed commands. Next, @w{Version
8243 5.0} was released, which fixed some bugs and incompatibilities, and
8244 was incorporated into @w{Emacs 19.29}.
8245 @end quotation
8246
8247 After a long break, Stephen handed the reins over to me in 2000. I
8248 moved the project to a new site called SourceForge and organized a
8249 great team of developers. Our first release in late 2001 was version
8250 6. It appeared in Emacs 21.2 and had menus and tool bar buttons.
8251
8252 Then, indexed searches, improved MIME handling, a speedbar, multiple
8253 identities, alias completion, an index view of unseen messages, spam
8254 software support, Face and X-Image-URL header field support, Fcc
8255 completion, arbitrary range handling, and draft form editing were
8256 introduced in the version 7 series in Emacs 21.4 (2004).
8257
8258 Version 8 development was mostly driven by the rewrite of the manual.
8259 It also brought mailutils support, S/MIME support, picon support, and
8260 an improved interface for hiding header fields. The CVS repository was
8261 migrated from SourceForge to Savannah (only for those files that were
8262 already part of Emacs) and the software was completely reorganized to
8263 push back two decades of entropy. It appeared in Emacs 22.1 (2006).
8264
8265 Bill Wohler, February 2006
8266
8267 @node GFDL, GPL, History, Top
8268 @appendix GNU FREE DOCUMENTATION LICENSE
8269 @center Version 1.2, November 2002
8270
8271 @display
8272 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
8273 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
8274
8275 Everyone is permitted to copy and distribute verbatim copies
8276 of this license document, but changing it is not allowed.
8277 @end display
8278 @sp 1
8279 @enumerate 0
8280 @item
8281 PREAMBLE
8282
8283 The purpose of this License is to make a manual, textbook, or other
8284 functional and useful document ``free'' in the sense of freedom: to
8285 assure everyone the effective freedom to copy and redistribute it,
8286 with or without modifying it, either commercially or noncommercially.
8287 Secondarily, this License preserves for the author and publisher a way
8288 to get credit for their work, while not being considered responsible
8289 for modifications made by others.
8290
8291 This License is a kind of ``copyleft'', which means that derivative
8292 works of the document must themselves be free in the same sense. It
8293 complements the GNU General Public License, which is a copyleft
8294 license designed for free software.
8295
8296 We have designed this License in order to use it for manuals for free
8297 software, because free software needs free documentation: a free
8298 program should come with manuals providing the same freedoms that the
8299 software does. But this License is not limited to software manuals;
8300 it can be used for any textual work, regardless of subject matter or
8301 whether it is published as a printed book. We recommend this License
8302 principally for works whose purpose is instruction or reference.
8303
8304 @sp 1
8305 @item
8306 APPLICABILITY AND DEFINITIONS
8307
8308 This License applies to any manual or other work, in any medium, that
8309 contains a notice placed by the copyright holder saying it can be
8310 distributed under the terms of this License. Such a notice grants a
8311 world-wide, royalty-free license, unlimited in duration, to use that
8312 work under the conditions stated herein. The ``Document'', below,
8313 refers to any such manual or work. Any member of the public is a
8314 licensee, and is addressed as ``you''. You accept the license if you
8315 copy, modify or distribute the work in a way requiring permission
8316 under copyright law.
8317
8318 A ``Modified Version'' of the Document means any work containing the
8319 Document or a portion of it, either copied verbatim, or with
8320 modifications and/or translated into another language.
8321
8322 A ``Secondary Section'' is a named appendix or a front-matter section of
8323 the Document that deals exclusively with the relationship of the
8324 publishers or authors of the Document to the Document's overall subject
8325 (or to related matters) and contains nothing that could fall directly
8326 within that overall subject. (Thus, if the Document is in part a
8327 textbook of mathematics, a Secondary Section may not explain any
8328 mathematics.) The relationship could be a matter of historical
8329 connection with the subject or with related matters, or of legal,
8330 commercial, philosophical, ethical or political position regarding
8331 them.
8332
8333 The ``Invariant Sections'' are certain Secondary Sections whose titles
8334 are designated, as being those of Invariant Sections, in the notice
8335 that says that the Document is released under this License. If a
8336 section does not fit the above definition of Secondary then it is not
8337 allowed to be designated as Invariant. The Document may contain zero
8338 Invariant Sections. If the Document does not identify any Invariant
8339 Sections then there are none.
8340
8341 The ``Cover Texts'' are certain short passages of text that are listed,
8342 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
8343 the Document is released under this License. A Front-Cover Text may
8344 be at most 5 words, and a Back-Cover Text may be at most 25 words.
8345
8346 A ``Transparent'' copy of the Document means a machine-readable copy,
8347 represented in a format whose specification is available to the
8348 general public, that is suitable for revising the document
8349 straightforwardly with generic text editors or (for images composed of
8350 pixels) generic paint programs or (for drawings) some widely available
8351 drawing editor, and that is suitable for input to text formatters or
8352 for automatic translation to a variety of formats suitable for input
8353 to text formatters. A copy made in an otherwise Transparent file
8354 format whose markup, or absence of markup, has been arranged to thwart
8355 or discourage subsequent modification by readers is not Transparent.
8356 An image format is not Transparent if used for any substantial amount
8357 of text. A copy that is not ``Transparent'' is called ``Opaque.''
8358
8359
8360 Examples of suitable formats for Transparent copies include plain
8361 ASCII without markup, Texinfo input format, LaTeX input format, SGML
8362 or XML using a publicly available DTD, and standard-conforming simple
8363 HTML, PostScript or PDF designed for human modification. Examples of
8364 transparent image formats include PNG, XCF and JPG. Opaque formats
8365 include proprietary formats that can be read and edited only by
8366 proprietary word processors, SGML or XML for which the DTD and/or
8367 processing tools are not generally available, and the
8368 machine-generated HTML, PostScript or PDF produced by some word
8369 processors for output purposes only.
8370
8371 The ``Title Page'' means, for a printed book, the title page itself,
8372 plus such following pages as are needed to hold, legibly, the material
8373 this License requires to appear in the title page. For works in
8374 formats which do not have any title page as such, ``Title Page'' means
8375 the text near the most prominent appearance of the work's title,
8376 preceding the beginning of the body of the text.
8377
8378 A section ``Entitled XYZ'' means a named subunit of the Document whose
8379 title either is precisely XYZ or contains XYZ in parentheses following
8380 text that translates XYZ in another language. (Here XYZ stands for a
8381 specific section name mentioned below, such as ``Acknowledgements'',
8382 ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
8383 of such a section when you modify the Document means that it remains a
8384 section ``Entitled XYZ'' according to this definition.
8385
8386 The Document may include Warranty Disclaimers next to the notice which
8387 states that this License applies to the Document. These Warranty
8388 Disclaimers are considered to be included by reference in this
8389 License, but only as regards disclaiming warranties: any other
8390 implication that these Warranty Disclaimers may have is void and has
8391 no effect on the meaning of this License.
8392 @sp 1
8393 @item
8394 VERBATIM COPYING
8395
8396 You may copy and distribute the Document in any medium, either
8397 commercially or noncommercially, provided that this License, the
8398 copyright notices, and the license notice saying this License applies
8399 to the Document are reproduced in all copies, and that you add no other
8400 conditions whatsoever to those of this License. You may not use
8401 technical measures to obstruct or control the reading or further
8402 copying of the copies you make or distribute. However, you may accept
8403 compensation in exchange for copies. If you distribute a large enough
8404 number of copies you must also follow the conditions in section 3.
8405
8406 You may also lend copies, under the same conditions stated above, and
8407 you may publicly display copies.
8408 @sp 1
8409 @item
8410 COPYING IN QUANTITY
8411
8412 If you publish printed copies (or copies in media that commonly have
8413 printed covers) of the Document, numbering more than 100, and the
8414 Document's license notice requires Cover Texts, you must enclose the
8415 copies in covers that carry, clearly and legibly, all these Cover
8416 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
8417 the back cover. Both covers must also clearly and legibly identify
8418 you as the publisher of these copies. The front cover must present
8419 the full title with all words of the title equally prominent and
8420 visible. You may add other material on the covers in addition.
8421 Copying with changes limited to the covers, as long as they preserve
8422 the title of the Document and satisfy these conditions, can be treated
8423 as verbatim copying in other respects.
8424
8425 If the required texts for either cover are too voluminous to fit
8426 legibly, you should put the first ones listed (as many as fit
8427 reasonably) on the actual cover, and continue the rest onto adjacent
8428 pages.
8429
8430 If you publish or distribute Opaque copies of the Document numbering
8431 more than 100, you must either include a machine-readable Transparent
8432 copy along with each Opaque copy, or state in or with each Opaque copy
8433 a computer-network location from which the general network-using
8434 public has access to download using public-standard network protocols
8435 a complete Transparent copy of the Document, free of added material.
8436 If you use the latter option, you must take reasonably prudent steps,
8437 when you begin distribution of Opaque copies in quantity, to ensure
8438 that this Transparent copy will remain thus accessible at the stated
8439 location until at least one year after the last time you distribute an
8440 Opaque copy (directly or through your agents or retailers) of that
8441 edition to the public.
8442
8443 It is requested, but not required, that you contact the authors of the
8444 Document well before redistributing any large number of copies, to give
8445 them a chance to provide you with an updated version of the Document.
8446 @sp 1
8447 @item
8448 MODIFICATIONS
8449
8450 You may copy and distribute a Modified Version of the Document under
8451 the conditions of sections 2 and 3 above, provided that you release
8452 the Modified Version under precisely this License, with the Modified
8453 Version filling the role of the Document, thus licensing distribution
8454 and modification of the Modified Version to whoever possesses a copy
8455 of it. In addition, you must do these things in the Modified Version:
8456
8457 A. Use in the Title Page (and on the covers, if any) a title distinct
8458 from that of the Document, and from those of previous versions
8459 (which should, if there were any, be listed in the History section
8460 of the Document). You may use the same title as a previous version
8461 if the original publisher of that version gives permission.@*
8462 B. List on the Title Page, as authors, one or more persons or entities
8463 responsible for authorship of the modifications in the Modified
8464 Version, together with at least five of the principal authors of the
8465 Document (all of its principal authors, if it has fewer than five),
8466 unless they release you from this requirement.@*
8467 C. State on the Title page the name of the publisher of the
8468 Modified Version, as the publisher.@*
8469 D. Preserve all the copyright notices of the Document.@*
8470 E. Add an appropriate copyright notice for your modifications
8471 adjacent to the other copyright notices.@*
8472 F. Include, immediately after the copyright notices, a license notice
8473 giving the public permission to use the Modified Version under the
8474 terms of this License, in the form shown in the Addendum below.@*
8475 G. Preserve in that license notice the full lists of Invariant Sections
8476 and required Cover Texts given in the Document's license notice.@*
8477 H. Include an unaltered copy of this License.@*
8478 I. Preserve the section Entitled ``History'', Preserve its Title, and add
8479 to it an item stating at least the title, year, new authors, and
8480 publisher of the Modified Version as given on the Title Page. If
8481 there is no section Entitled ``History'' in the Document, create one
8482 stating the title, year, authors, and publisher of the Document as
8483 given on its Title Page, then add an item describing the Modified
8484 Version as stated in the previous sentence.@*
8485 J. Preserve the network location, if any, given in the Document for
8486 public access to a Transparent copy of the Document, and likewise
8487 the network locations given in the Document for previous versions
8488 it was based on. These may be placed in the ``History'' section.
8489 You may omit a network location for a work that was published at
8490 least four years before the Document itself, or if the original
8491 publisher of the version it refers to gives permission.@*
8492 K. For any section Entitled ``Acknowledgements'' or ``Dedications'',
8493 Preserve the Title of the section, and preserve in the section all
8494 the substance and tone of each of the contributor acknowledgements
8495 and/or dedications given therein.@*
8496 L. Preserve all the Invariant Sections of the Document,
8497 unaltered in their text and in their titles. Section numbers
8498 or the equivalent are not considered part of the section titles.@*
8499 M. Delete any section Entitled ``Endorsements.'' Such a section
8500 may not be included in the Modified Version.@*
8501 N. Do not retitle any existing section to be Entitled ``Endorsements''
8502 or to conflict in title with any Invariant Section.@*
8503 O. Preserve any Warranty Disclaimers.@*
8504 @sp 1
8505 If the Modified Version includes new front-matter sections or
8506 appendices that qualify as Secondary Sections and contain no material
8507 copied from the Document, you may at your option designate some or all
8508 of these sections as invariant. To do this, add their titles to the
8509 list of Invariant Sections in the Modified Version's license notice.
8510 These titles must be distinct from any other section titles.
8511
8512 You may add a section Entitled ``Endorsements'', provided it contains
8513 nothing but endorsements of your Modified Version by various
8514 parties--for example, statements of peer review or that the text has
8515 been approved by an organization as the authoritative definition of a
8516 standard.
8517
8518 You may add a passage of up to five words as a Front-Cover Text, and a
8519 passage of up to 25 words as a Back-Cover Text, to the end of the list
8520 of Cover Texts in the Modified Version. Only one passage of
8521 Front-Cover Text and one of Back-Cover Text may be added by (or
8522 through arrangements made by) any one entity. If the Document already
8523 includes a cover text for the same cover, previously added by you or
8524 by arrangement made by the same entity you are acting on behalf of,
8525 you may not add another; but you may replace the old one, on explicit
8526 permission from the previous publisher that added the old one.
8527
8528 The author(s) and publisher(s) of the Document do not by this License
8529 give permission to use their names for publicity for or to assert or
8530 imply endorsement of any Modified Version.
8531 @sp 1
8532 @item
8533 COMBINING DOCUMENTS
8534
8535 You may combine the Document with other documents released under this
8536 License, under the terms defined in section 4 above for modified
8537 versions, provided that you include in the combination all of the
8538 Invariant Sections of all of the original documents, unmodified, and
8539 list them all as Invariant Sections of your combined work in its
8540 license notice, and that you preserve all their Warranty Disclaimers.
8541
8542 The combined work need only contain one copy of this License, and
8543 multiple identical Invariant Sections may be replaced with a single
8544 copy. If there are multiple Invariant Sections with the same name but
8545 different contents, make the title of each such section unique by
8546 adding at the end of it, in parentheses, the name of the original
8547 author or publisher of that section if known, or else a unique number.
8548 Make the same adjustment to the section titles in the list of
8549 Invariant Sections in the license notice of the combined work.
8550
8551 In the combination, you must combine any sections Entitled ``History''
8552 in the various original documents, forming one section Entitled
8553 ``History''; likewise combine any sections Entitled ``Acknowledgements'',
8554 and any sections Entitled ``Dedications.'' You must delete all sections
8555 Entitled ``Endorsements.''
8556 @sp 1
8557 @item
8558 COLLECTIONS OF DOCUMENTS
8559
8560 You may make a collection consisting of the Document and other documents
8561 released under this License, and replace the individual copies of this
8562 License in the various documents with a single copy that is included in
8563 the collection, provided that you follow the rules of this License for
8564 verbatim copying of each of the documents in all other respects.
8565
8566 You may extract a single document from such a collection, and distribute
8567 it individually under this License, provided you insert a copy of this
8568 License into the extracted document, and follow this License in all
8569 other respects regarding verbatim copying of that document.
8570 @sp 1
8571 @item
8572 AGGREGATION WITH INDEPENDENT WORKS
8573
8574 A compilation of the Document or its derivatives with other separate
8575 and independent documents or works, in or on a volume of a storage or
8576 distribution medium, is called an ``aggregate'' if the copyright
8577 resulting from the compilation is not used to limit the legal rights
8578 of the compilation's users beyond what the individual works permit.
8579 When the Document is included in an aggregate, this License does not
8580 apply to the other works in the aggregate which are not themselves
8581 derivative works of the Document.
8582
8583 If the Cover Text requirement of section 3 is applicable to these
8584 copies of the Document, then if the Document is less than one half of
8585 the entire aggregate, the Document's Cover Texts may be placed on
8586 covers that bracket the Document within the aggregate, or the
8587 electronic equivalent of covers if the Document is in electronic form.
8588 Otherwise they must appear on printed covers that bracket the whole
8589 aggregate.
8590 @sp 1
8591 @item
8592 TRANSLATION
8593
8594 Translation is considered a kind of modification, so you may
8595 distribute translations of the Document under the terms of section 4.
8596 Replacing Invariant Sections with translations requires special
8597 permission from their copyright holders, but you may include
8598 translations of some or all Invariant Sections in addition to the
8599 original versions of these Invariant Sections. You may include a
8600 translation of this License, and all the license notices in the
8601 Document, and any Warranty Disclaimers, provided that you also include
8602 the original English version of this License and the original versions
8603 of those notices and disclaimers. In case of a disagreement between
8604 the translation and the original version of this License or a notice
8605 or disclaimer, the original version will prevail.
8606
8607 If a section in the Document is Entitled ``Acknowledgements'',
8608 ``Dedications'', or ``History'', the requirement (section 4) to Preserve
8609 its Title (section 1) will typically require changing the actual
8610 title.
8611 @sp 1
8612 @item
8613 TERMINATION
8614
8615 You may not copy, modify, sublicense, or distribute the Document except
8616 as expressly provided for under this License. Any other attempt to
8617 copy, modify, sublicense or distribute the Document is void, and will
8618 automatically terminate your rights under this License. However,
8619 parties who have received copies, or rights, from you under this
8620 License will not have their licenses terminated so long as such
8621 parties remain in full compliance.
8622 @sp 1
8623 @item
8624 FUTURE REVISIONS OF THIS LICENSE
8625
8626 The Free Software Foundation may publish new, revised versions
8627 of the GNU Free Documentation License from time to time. Such new
8628 versions will be similar in spirit to the present version, but may
8629 differ in detail to address new problems or concerns. See
8630 http://www.gnu.org/copyleft/.
8631
8632 Each version of the License is given a distinguishing version number.
8633 If the Document specifies that a particular numbered version of this
8634 License ``or any later version'' applies to it, you have the option of
8635 following the terms and conditions either of that specified version or
8636 of any later version that has been published (not as a draft) by the
8637 Free Software Foundation. If the Document does not specify a version
8638 number of this License, you may choose any version ever published (not
8639 as a draft) by the Free Software Foundation.
8640
8641 @end enumerate
8642
8643 @unnumberedsec ADDENDUM: How to use this License for your documents
8644
8645 To use this License in a document you have written, include a copy of
8646 the License in the document and put the following copyright and
8647 license notices just after the title page:
8648
8649 @smallexample
8650 @group
8651 Copyright (C) @var{year} @var{your name}.
8652 Permission is granted to copy, distribute and/or modify this document
8653 under the terms of the GNU Free Documentation License, Version 1.2
8654 or any later version published by the Free Software Foundation;
8655 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
8656 A copy of the license is included in the section entitled ``GNU
8657 Free Documentation License''.
8658 @end group
8659 @end smallexample
8660
8661 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
8662 replace the ``with...Texts.'' line with this:
8663
8664 @smallexample
8665 @group
8666 with the Invariant Sections being @var{list their titles}, with the
8667 Front-Cover Texts being @var{list}, and with the Back-Cover Texts being
8668 @var{list}.
8669 @end group
8670 @end smallexample
8671
8672 If you have Invariant Sections without Cover Texts, or some other
8673 combination of the three, merge those two alternatives to suit the
8674 situation.
8675
8676 If your document contains nontrivial examples of program code, we
8677 recommend releasing these examples in parallel under your choice of
8678 free software license, such as the GNU General Public License,
8679 to permit their use in free software.
8680
8681 @node GPL, Key Index, GFDL, Top
8682 @appendix GNU GENERAL PUBLIC LICENSE
8683 @center Version 2, June 1991
8684
8685 @display
8686 Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
8687 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
8688
8689 Everyone is permitted to copy and distribute verbatim copies
8690 of this license document, but changing it is not allowed.
8691 @end display
8692
8693 @unnumberedsec Preamble
8694
8695 The licenses for most software are designed to take away your
8696 freedom to share and change it. By contrast, the GNU General Public
8697 License is intended to guarantee your freedom to share and change free
8698 software---to make sure the software is free for all its users. This
8699 General Public License applies to most of the Free Software
8700 Foundation's software and to any other program whose authors commit to
8701 using it. (Some other Free Software Foundation software is covered by
8702 the GNU Library General Public License instead.) You can apply it to
8703 your programs, too.
8704
8705 When we speak of free software, we are referring to freedom, not
8706 price. Our General Public Licenses are designed to make sure that you
8707 have the freedom to distribute copies of free software (and charge for
8708 this service if you wish), that you receive source code or can get it
8709 if you want it, that you can change the software or use pieces of it
8710 in new free programs; and that you know you can do these things.
8711
8712 To protect your rights, we need to make restrictions that forbid
8713 anyone to deny you these rights or to ask you to surrender the rights.
8714 These restrictions translate to certain responsibilities for you if you
8715 distribute copies of the software, or if you modify it.
8716
8717 For example, if you distribute copies of such a program, whether
8718 gratis or for a fee, you must give the recipients all the rights that
8719 you have. You must make sure that they, too, receive or can get the
8720 source code. And you must show them these terms so they know their
8721 rights.
8722
8723 We protect your rights with two steps: (1) copyright the software, and
8724 (2) offer you this license which gives you legal permission to copy,
8725 distribute and/or modify the software.
8726
8727 Also, for each author's protection and ours, we want to make certain
8728 that everyone understands that there is no warranty for this free
8729 software. If the software is modified by someone else and passed on, we
8730 want its recipients to know that what they have is not the original, so
8731 that any problems introduced by others will not reflect on the original
8732 authors' reputations.
8733
8734 Finally, any free program is threatened constantly by software
8735 patents. We wish to avoid the danger that redistributors of a free
8736 program will individually obtain patent licenses, in effect making the
8737 program proprietary. To prevent this, we have made it clear that any
8738 patent must be licensed for everyone's free use or not licensed at all.
8739
8740 The precise terms and conditions for copying, distribution and
8741 modification follow.
8742
8743 @iftex
8744 @unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
8745 @end iftex
8746 @ifinfo
8747 @center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
8748 @end ifinfo
8749
8750 @enumerate 0
8751 @item
8752 This License applies to any program or other work which contains
8753 a notice placed by the copyright holder saying it may be distributed
8754 under the terms of this General Public License. The ``Program,'' below,
8755 refers to any such program or work, and a ``work based on the Program''
8756 means either the Program or any derivative work under copyright law:
8757 that is to say, a work containing the Program or a portion of it,
8758 either verbatim or with modifications and/or translated into another
8759 language. (Hereinafter, translation is included without limitation in
8760 the term ``modification.'') Each licensee is addressed as ``you.''
8761
8762 Activities other than copying, distribution and modification are not
8763 covered by this License; they are outside its scope. The act of
8764 running the Program is not restricted, and the output from the Program
8765 is covered only if its contents constitute a work based on the
8766 Program (independent of having been made by running the Program).
8767 Whether that is true depends on what the Program does.
8768
8769 @item
8770 You may copy and distribute verbatim copies of the Program's
8771 source code as you receive it, in any medium, provided that you
8772 conspicuously and appropriately publish on each copy an appropriate
8773 copyright notice and disclaimer of warranty; keep intact all the
8774 notices that refer to this License and to the absence of any warranty;
8775 and give any other recipients of the Program a copy of this License
8776 along with the Program.
8777
8778 You may charge a fee for the physical act of transferring a copy, and
8779 you may at your option offer warranty protection in exchange for a fee.
8780
8781 @item
8782 You may modify your copy or copies of the Program or any portion
8783 of it, thus forming a work based on the Program, and copy and
8784 distribute such modifications or work under the terms of Section 1
8785 above, provided that you also meet all of these conditions:
8786
8787 @enumerate a
8788 @item
8789 You must cause the modified files to carry prominent notices
8790 stating that you changed the files and the date of any change.
8791
8792 @item
8793 You must cause any work that you distribute or publish, that in
8794 whole or in part contains or is derived from the Program or any
8795 part thereof, to be licensed as a whole at no charge to all third
8796 parties under the terms of this License.
8797
8798 @item
8799 If the modified program normally reads commands interactively
8800 when run, you must cause it, when started running for such
8801 interactive use in the most ordinary way, to print or display an
8802 announcement including an appropriate copyright notice and a
8803 notice that there is no warranty (or else, saying that you provide
8804 a warranty) and that users may redistribute the program under
8805 these conditions, and telling the user how to view a copy of this
8806 License. (Exception: if the Program itself is interactive but
8807 does not normally print such an announcement, your work based on
8808 the Program is not required to print an announcement.)
8809 @end enumerate
8810
8811 These requirements apply to the modified work as a whole. If
8812 identifiable sections of that work are not derived from the Program,
8813 and can be reasonably considered independent and separate works in
8814 themselves, then this License, and its terms, do not apply to those
8815 sections when you distribute them as separate works. But when you
8816 distribute the same sections as part of a whole which is a work based
8817 on the Program, the distribution of the whole must be on the terms of
8818 this License, whose permissions for other licensees extend to the
8819 entire whole, and thus to each and every part regardless of who wrote it.
8820
8821 Thus, it is not the intent of this section to claim rights or contest
8822 your rights to work written entirely by you; rather, the intent is to
8823 exercise the right to control the distribution of derivative or
8824 collective works based on the Program.
8825
8826 In addition, mere aggregation of another work not based on the Program
8827 with the Program (or with a work based on the Program) on a volume of
8828 a storage or distribution medium does not bring the other work under
8829 the scope of this License.
8830
8831 @item
8832 You may copy and distribute the Program (or a work based on it,
8833 under Section 2) in object code or executable form under the terms of
8834 Sections 1 and 2 above provided that you also do one of the following:
8835
8836 @enumerate a
8837 @item
8838 Accompany it with the complete corresponding machine-readable
8839 source code, which must be distributed under the terms of Sections
8840 1 and 2 above on a medium customarily used for software interchange; or,
8841
8842 @item
8843 Accompany it with a written offer, valid for at least three
8844 years, to give any third party, for a charge no more than your
8845 cost of physically performing source distribution, a complete
8846 machine-readable copy of the corresponding source code, to be
8847 distributed under the terms of Sections 1 and 2 above on a medium
8848 customarily used for software interchange; or,
8849
8850 @item
8851 Accompany it with the information you received as to the offer
8852 to distribute corresponding source code. (This alternative is
8853 allowed only for noncommercial distribution and only if you
8854 received the program in object code or executable form with such
8855 an offer, in accord with Subsection b above.)
8856 @end enumerate
8857
8858 The source code for a work means the preferred form of the work for
8859 making modifications to it. For an executable work, complete source
8860 code means all the source code for all modules it contains, plus any
8861 associated interface definition files, plus the scripts used to
8862 control compilation and installation of the executable. However, as a
8863 special exception, the source code distributed need not include
8864 anything that is normally distributed (in either source or binary
8865 form) with the major components (compiler, kernel, and so on) of the
8866 operating system on which the executable runs, unless that component
8867 itself accompanies the executable.
8868
8869 If distribution of executable or object code is made by offering
8870 access to copy from a designated place, then offering equivalent
8871 access to copy the source code from the same place counts as
8872 distribution of the source code, even though third parties are not
8873 compelled to copy the source along with the object code.
8874
8875 @item
8876 You may not copy, modify, sublicense, or distribute the Program
8877 except as expressly provided under this License. Any attempt
8878 otherwise to copy, modify, sublicense or distribute the Program is
8879 void, and will automatically terminate your rights under this License.
8880 However, parties who have received copies, or rights, from you under
8881 this License will not have their licenses terminated so long as such
8882 parties remain in full compliance.
8883
8884 @item
8885 You are not required to accept this License, since you have not
8886 signed it. However, nothing else grants you permission to modify or
8887 distribute the Program or its derivative works. These actions are
8888 prohibited by law if you do not accept this License. Therefore, by
8889 modifying or distributing the Program (or any work based on the
8890 Program), you indicate your acceptance of this License to do so, and
8891 all its terms and conditions for copying, distributing or modifying
8892 the Program or works based on it.
8893
8894 @item
8895 Each time you redistribute the Program (or any work based on the
8896 Program), the recipient automatically receives a license from the
8897 original licensor to copy, distribute or modify the Program subject to
8898 these terms and conditions. You may not impose any further
8899 restrictions on the recipients' exercise of the rights granted herein.
8900 You are not responsible for enforcing compliance by third parties to
8901 this License.
8902
8903 @item
8904 If, as a consequence of a court judgment or allegation of patent
8905 infringement or for any other reason (not limited to patent issues),
8906 conditions are imposed on you (whether by court order, agreement or
8907 otherwise) that contradict the conditions of this License, they do not
8908 excuse you from the conditions of this License. If you cannot
8909 distribute so as to satisfy simultaneously your obligations under this
8910 License and any other pertinent obligations, then as a consequence you
8911 may not distribute the Program at all. For example, if a patent
8912 license would not permit royalty-free redistribution of the Program by
8913 all those who receive copies directly or indirectly through you, then
8914 the only way you could satisfy both it and this License would be to
8915 refrain entirely from distribution of the Program.
8916
8917 If any portion of this section is held invalid or unenforceable under
8918 any particular circumstance, the balance of the section is intended to
8919 apply and the section as a whole is intended to apply in other
8920 circumstances.
8921
8922 It is not the purpose of this section to induce you to infringe any
8923 patents or other property right claims or to contest validity of any
8924 such claims; this section has the sole purpose of protecting the
8925 integrity of the free software distribution system, which is
8926 implemented by public license practices. Many people have made
8927 generous contributions to the wide range of software distributed
8928 through that system in reliance on consistent application of that
8929 system; it is up to the author/donor to decide if he or she is willing
8930 to distribute software through any other system and a licensee cannot
8931 impose that choice.
8932
8933 This section is intended to make thoroughly clear what is believed to
8934 be a consequence of the rest of this License.
8935
8936 @item
8937 If the distribution and/or use of the Program is restricted in
8938 certain countries either by patents or by copyrighted interfaces, the
8939 original copyright holder who places the Program under this License
8940 may add an explicit geographical distribution limitation excluding
8941 those countries, so that distribution is permitted only in or among
8942 countries not thus excluded. In such case, this License incorporates
8943 the limitation as if written in the body of this License.
8944
8945 @item
8946 The Free Software Foundation may publish revised and/or new versions
8947 of the General Public License from time to time. Such new versions will
8948 be similar in spirit to the present version, but may differ in detail to
8949 address new problems or concerns.
8950
8951 Each version is given a distinguishing version number. If the Program
8952 specifies a version number of this License which applies to it and ``any
8953 later version,'' you have the option of following the terms and conditions
8954 either of that version or of any later version published by the Free
8955 Software Foundation. If the Program does not specify a version number of
8956 this License, you may choose any version ever published by the Free Software
8957 Foundation.
8958
8959 @item
8960 If you wish to incorporate parts of the Program into other free
8961 programs whose distribution conditions are different, write to the author
8962 to ask for permission. For software which is copyrighted by the Free
8963 Software Foundation, write to the Free Software Foundation; we sometimes
8964 make exceptions for this. Our decision will be guided by the two goals
8965 of preserving the free status of all derivatives of our free software and
8966 of promoting the sharing and reuse of software generally.
8967
8968 @iftex
8969 @heading NO WARRANTY
8970 @end iftex
8971 @ifinfo
8972 @center NO WARRANTY
8973 @end ifinfo
8974
8975 @item
8976 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
8977 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW@. EXCEPT WHEN
8978 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
8979 PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
8980 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8981 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE@. THE ENTIRE RISK AS
8982 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU@. SHOULD THE
8983 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
8984 REPAIR OR CORRECTION.
8985
8986 @item
8987 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
8988 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
8989 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
8990 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
8991 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
8992 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
8993 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
8994 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
8995 POSSIBILITY OF SUCH DAMAGES.
8996 @end enumerate
8997
8998 @iftex
8999 @heading END OF TERMS AND CONDITIONS
9000 @end iftex
9001 @ifinfo
9002 @center END OF TERMS AND CONDITIONS
9003 @end ifinfo
9004
9005 @page
9006 @unnumberedsec How to Apply These Terms to Your New Programs
9007
9008 If you develop a new program, and you want it to be of the greatest
9009 possible use to the public, the best way to achieve this is to make it
9010 free software which everyone can redistribute and change under these terms.
9011
9012 To do so, attach the following notices to the program. It is safest
9013 to attach them to the start of each source file to most effectively
9014 convey the exclusion of warranty; and each file should have at least
9015 the ``copyright'' line and a pointer to where the full notice is found.
9016
9017 @smallexample
9018 @var{one line to give the program's name and an idea of what it does.}
9019 Copyright (C) 19@var{yy} @var{name of author}
9020
9021 This program is free software; you can redistribute it and/or
9022 modify it under the terms of the GNU General Public License
9023 as published by the Free Software Foundation; either version 2
9024 of the License, or (at your option) any later version.
9025
9026 This program is distributed in the hope that it will be useful,
9027 but WITHOUT ANY WARRANTY; without even the implied warranty of
9028 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE@. See the
9029 GNU General Public License for more details.
9030
9031 You should have received a copy of the GNU General Public License along
9032 with this program; if not, write to the Free Software Foundation, Inc.,
9033 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9034 @end smallexample
9035
9036 Also add information on how to contact you by electronic and paper mail.
9037
9038 If the program is interactive, make it output a short notice like this
9039 when it starts in an interactive mode:
9040
9041 @smallexample
9042 Gnomovision version 69, Copyright (C) 20@var{yy} @var{name of author}
9043 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
9044 type `show w'. This is free software, and you are welcome
9045 to redistribute it under certain conditions; type `show c'
9046 for details.
9047 @end smallexample
9048
9049 The hypothetical commands @samp{show w} and @samp{show c} should show
9050 the appropriate parts of the General Public License. Of course, the
9051 commands you use may be called something other than @samp{show w} and
9052 @samp{show c}; they could even be mouse-clicks or menu items---whatever
9053 suits your program.
9054
9055 You should also get your employer (if you work as a programmer) or your
9056 school, if any, to sign a ``copyright disclaimer'' for the program, if
9057 necessary. Here is a sample; alter the names:
9058
9059 @smallexample
9060 @group
9061 Yoyodyne, Inc., hereby disclaims all copyright
9062 interest in the program `Gnomovision'
9063 (which makes passes at compilers) written
9064 by James Hacker.
9065
9066 @var{signature of Ty Coon}, 1 April 1989
9067 Ty Coon, President of Vice
9068 @end group
9069 @end smallexample
9070
9071 This General Public License does not permit incorporating your program into
9072 proprietary programs. If your program is a subroutine library, you may
9073 consider it more useful to permit linking proprietary applications with the
9074 library. If this is what you want to do, use the GNU Library General
9075 Public License instead of this License.
9076
9077 @node Key Index, Command Index, GPL, Top
9078 @unnumbered Key (Character) Index
9079 @printindex ky
9080
9081 @node Command Index, Option Index, Key Index, Top
9082 @unnumbered Command Index
9083 @printindex fn
9084
9085 @node Option Index, Concept Index, Command Index, Top
9086 @unnumbered Option (Variable) Index
9087 @printindex vr
9088
9089 @node Concept Index, , Option Index, Top
9090 @unnumbered Concept Index
9091 @printindex cp
9092
9093 @bye
9094
9095 @c Ispell Helpers
9096 @c
9097 @c The following are words that ispell should ignore that would not
9098 @c normally be in a dictionary (global or personal). Be careful not to
9099 @c include words here that could potentially be typos of other words
9100 @c (such as url, elisp, or MHE).
9101 @c
9102 @c LocalWords: CTRL ESC SPC f's
9103 @c LocalWords: addr Aliasfile alist
9104 @c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
9105 @c LocalWords: cmd CMU contrib cron
9106 @c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
9107 @c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
9108 @c LocalWords: ImageMagick inbox ispell keychain
9109 @c LocalWords: Larus licensor LocalWords lookup lpr
9110 @c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
9111 @c LocalWords: MML msg multipart
9112 @c LocalWords: Namazu NIS nenscript nnml num
9113 @c LocalWords: packmbox passphrase pathname prev procmail prog repl
9114 @c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
9115 @c LocalWords: sublicense supercite speedbar
9116 @c LocalWords: Tennex texi texinfo Thelen thelenm
9117 @c LocalWords: UCI undeleted whatnow wohler xmh ypcat
9118 @c
9119 @c See http://www.oreilly.com/oreilly/author/stylesheet.html.
9120 @c See http://en.wikipedia.org/.
9121 @c
9122 @c Note the lowercase mh which is needed to avoid hits in the
9123 @c functions and variables. Occasionally, check for accidental
9124 @c inclusion of mh in text by uncommenting the following and executing
9125 @c it with C-x C-e. You want to see "Search failed"
9126 @c (let ((case-fold-search nil))
9127 @c (goto-char (point-min))
9128 @c (search-forward-regexp "^mh\\( \\|$\\)"))
9129 @c
9130 @c An extremely useful setting for texinfo-mode-hook is:
9131 @c (add-to-list
9132 @c 'ispell-skip-region-alist
9133 @c (list
9134 @c (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9135 @c "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9136 @c "@[@{}.]\\|"
9137 @c "[^@]\\|"
9138 @c "@\\(end \\)?group\\|"
9139 @c "@\\(end \\)?cartouche\\)+"
9140 @c "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9141 @c "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9142 @c "^@end [a-z]+$\\|"
9143 @c "^@\\([fv]\\|print\\)index .*$\\|"
9144 @c "@uref{[^,]+,\\|"
9145 @c "@[a-z]+\\|"
9146 @c "/[a-z.]+[/}]\\)")))))
9147 @c
9148 @c Cross References
9149 @c
9150 @c See existing cross-references to the Emacs manual and the Emacs
9151 @c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9152 @c Emacs Lisp Reference Manual'' respectively).
9153
9154 @c @ftable Sorting
9155 @c
9156 @c As per index (sort of): Punctuation, keyboard characters (such as
9157 @c RET and BS) upper and lowercase mixed (lower comes before
9158 @c uppercase), control characters go with uppercase C, meta characters
9159 @c go with uppercase M.
9160 @c In some cases, the sort isn't strictly ASCII.
9161 @c For example, SPC (mh-page-msg) reads better before BS
9162 @c (mh-previous-page) and . (mh-show) is better before ,
9163 @c (mh-header-display).
9164
9165 @c @vtable Sorting
9166 @c
9167 @c Alphabetical, pull hooks into their own table.
9168
9169 @c Local Variables:
9170 @c sentence-end-double-space: nil
9171 @c End:
9172
9173 @ignore
9174 arch-tag: b778477d-1a10-4a99-84de-f877a2ea6bef
9175 @end ignore