1\input texinfo   @c -*- mode: texinfo; coding: utf-8; -*-
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.info
7@settitle The MH-E Manual
8@include docstyle.texi
9@c %**end of header
10
11@c Version of the software and manual.
12@set VERSION 8.6
13@c Edition of the manual. It is either empty for the first edition or
14@c has the form ", nth Edition" (without the quotes).
15@set EDITION
16@set UPDATED 2016-04-29
17@set UPDATE-MONTH April, 2016
18
19@c Other variables.
20@set MH-BOOK-HOME https://rand-mh.sourceforge.io/book/
21@set MH-E-HOME https://mh-e.sourceforge.io/
22
23@c Copyright
24@copying
25This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
26Manual}, last updated @value{UPDATED}.
27
28Copyright @copyright{} 1995, 2001--2003, 2005--2021 Free Software
29Foundation, Inc.
30
31@c This dual license has been agreed upon by the FSF.
32
33@quotation
34Permission is granted to copy, distribute and/or modify this document
35under the terms of either:
36
37@enumerate a
38@item
39the GNU Free Documentation License, Version 1.3 or any later version
40published by the Free Software Foundation; with no Invariant Sections,
41with the Front-Cover Texts being ``A GNU Manual,'' and with the
42Back-Cover Texts as in (a) below. A copy of the license is included in
43the section entitled ``GNU Free Documentation License.''
44
45(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
46modify this GNU manual.''
47
48@item
49the GNU General Public License as published by the Free Software
50Foundation; either version 3, or (at your option) any later version. A
51copy of the license is included in the section entitled ``GNU General
52Public License.''
53@end enumerate
54
55@end quotation
56@end copying
57
58@c Info Directory Entry
59@dircategory Emacs network features
60@direntry
61* MH-E: (mh-e).                 Emacs interface to the MH mail system.
62@end direntry
63
64@c Title Page
65@titlepage
66@title The MH-E Manual
67@subtitle Version @value{VERSION}@value{EDITION}
68@subtitle @value{UPDATE-MONTH}
69@author Bill Wohler
70
71@c Copyright Page
72@page
73@vskip 0pt plus 1filll
74@insertcopying
75@end titlepage
76
77@ifnottex
78@html
79<!--
80@end html
81@node Top, Preface, (dir), (dir)
82@top The MH-E Manual
83@html
84-->
85@end html
86@insertcopying
87@end ifnottex
88
89@c Table of Contents
90@contents
91
92@html
93<!--
94@end html
95
96@menu
97* Preface::                     Preface
98* Conventions::                 GNU Emacs Terms and Conventions
99* Getting Started::             Getting Started
100* Tour Through MH-E::           Tour Through MH-E
101* Using This Manual::           Using This Manual
102* Incorporating Mail::          Incorporating Mail
103* Reading Mail::                Reading Mail
104* Folders::                     Organizing Your Mail with Folders
105* Sending Mail::                Sending Mail
106* Editing Drafts::              Editing a Draft
107* Aliases::                     Aliases
108* Identities::                  Identities
109* Speedbar::                    The Speedbar
110* Menu Bar::                    The Menu Bar
111* Tool Bar::                    The Tool Bar
112* Searching::                   Searching Through Messages
113* Threading::                   Viewing Message Threads
114* Limits::                      Limiting Display
115* Sequences::                   Using Sequences
116* Junk::                        Dealing With Junk Mail
117* Miscellaneous::               Miscellaneous Commands, Variables, and Buffers
118* Scan Line Formats::           Scan Line Formats
119* Procmail::                    Reading Mailing Lists Effectively
120* Odds and Ends::               Odds and Ends
121* History::                     History of MH-E
122* GFDL::                        GNU Free Documentation License
123* GPL::                         GNU General Public License
124* Key Index::                   Key (Character) Index
125* Command Index::               Command Index
126* Option Index::                Option (Variable) Index
127* Concept Index::               Concept Index
128
129@detailmenu
130 --- The Detailed Node Listing ---
131
132Tour Through MH-E
133
134* Sending Mail Tour::
135* Reading Mail Tour::
136* Processing Mail Tour::
137* Leaving MH-E::
138* More About MH-E::
139
140Using This Manual
141
142* Options::
143* Ranges::
144* Folder Selection::
145
146Reading Your Mail
147
148* Viewing::
149* Viewing Attachments::
150* HTML::
151* Digests::
152* Reading PGP::
153* Printing::
154* Files and Pipes::
155* Navigating::
156* Miscellaneous Commands and Options::
157
158Sending Mail
159
160* Composing::
161* Replying::
162* Forwarding::
163* Redistributing::
164* Editing Again::
165
166Editing a Draft
167
168* Editing Message::
169* Inserting Letter::
170* Inserting Messages::
171* Signature::
172* Picture::
173* Adding Attachments::
174* Sending PGP::
175* Checking Recipients::
176* Sending Message::
177* Killing Draft::
178
179Odds and Ends
180
181* Bug Reports::
182* Mailing Lists::
183* MH FAQ and Support::
184* Getting MH-E::
185
186History of MH-E
187
188* From Brian Reid::
189* From Jim Larus::
190* From Stephen Gildea::
191* From Bill Wohler::
192
193@end detailmenu
194@end menu
195
196@html
197-->
198@end html
199
200@node Preface, Conventions, Top, Top
201@unnumbered Preface
202
203@cindex Emacs
204@cindex Unix commands, Emacs
205@cindex preface
206
207This manual introduces another interface to the MH mail system that is
208accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
209easy to use. I don't assume that you know GNU Emacs or even MH at this
210point, since I didn't know either of them when I discovered MH-E@.
211However, MH-E was the tip of the iceberg, and I discovered more and
212more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
213them.
214
215The MH-E package is distributed with Emacs@footnote{Version
216@value{VERSION} of MH-E appeared in Emacs 24.4. It is supported in GNU
217Emacs 23 and higher, as well as XEmacs 21.4.22 and 21.5.31. MH-E is
218known not to work with GNU Emacs versions 20 and below, and XEmacs
219version 21.5.9--21.5.16. It is compatible with MH versions 6.8.4 and
220higher, all versions of nmh, and GNU mailutils 1.0 and higher}, so you
221shouldn't have to do anything special to use it. Gnus is also
222required; version 5.10 or higher is recommended. This manual covers
223MH-E version @value{VERSION}. To help you decide which version you
224have, see @ref{Getting Started}.
225
226@findex help-with-tutorial
227@kindex C-h t
228
229If you don't already use GNU Emacs but want to learn more, you can
230read a built-in tutorial by starting GNU Emacs and typing @kbd{C-h t}
231(@code{help-with-tutorial}). (To learn about this notation, see
232@ref{Conventions}.) If you want to take the plunge, consult the
233@iftex
234@cite{GNU Emacs Manual},
235@end iftex
236@ifinfo
237@ref{Top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
238@end ifinfo
239@ifhtml
240@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/,
241@cite{GNU Emacs Manual}},
242@end ifhtml
243from the Free Software Foundation.
244
245If more information is needed, you can go to the Unix manual pages of
246the individual MH commands. When the name is not obvious, I'll guide
247you to a relevant MH manual page that describes the action more fully.
248
249@c ":" does not work in index entries in Info.
250@cindex @cite{MH & nmh - Email for Users & Programmers}
251@cindex MH book
252@cindex info
253@kindex C-h i
254
255This manual is available in both Info and online formats. The Info
256version is distributed with Emacs and can be accessed with the
257@command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i
258m mh-e @key{RET}}). The online version is available at
259@uref{https://mh-e.sourceforge.io/manual/, SourceForge}. Another great
260online resource is the book
261@uref{https://rand-mh.sourceforge.io/book/, @cite{MH & nmh: Email for
262Users & Programmers}} (also known as @dfn{the MH book}).
263
264I hope you enjoy this manual! If you have any comments, or suggestions
265for this document, please let me know.
266
267@cindex Bill Wohler
268@cindex Wohler, Bill
269
270@noindent
271Bill Wohler <@i{wohler at newt.com}>@*
2728 February 1995@*
27324 February 2006
274
275@node Conventions, Getting Started, Preface, Top
276@chapter GNU Emacs Terms and Conventions
277
278@cindex Emacs
279@cindex Emacs, conventions
280@cindex Emacs, terms
281@cindex Unix commands, Emacs
282@cindex conventions, Emacs
283@cindex terms, Emacs
284
285If you're an experienced Emacs user, you can skip the following
286conventions and definition of terms and go directly to the next
287section (@pxref{Getting Started}).
288
289@cindex Emacs commands
290@cindex MH commands
291@cindex Unix commands
292@cindex commands
293@cindex commands, MH
294@cindex commands, Unix
295@cindex commands, shell
296@cindex functions
297@cindex shell commands
298
299In general, @dfn{functions} in this text refer to Emacs Lisp functions
300that one would call from within Emacs Lisp programs (for example,
301@code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
302things that are run by the user, such as @kbd{i} or @kbd{M-x
303mh-inc-folder}. Programs outside of Emacs are specifically called MH
304commands, shell commands, or Unix commands.
305
306@cindex conventions, key names
307@cindex key names
308
309The conventions for key names are as follows:
310
311@table @kbd
312@item C-x
313Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
314@c -------------------------
315@item M-x
316Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
317
318Since some keyboards don't have a @key{META} key, you can generate
319@kbd{M-x}, for example, by pressing @key{ESC} (Escape),
320@emph{releasing it}, and then pressing the @kbd{x} key.
321@c -------------------------
322@item @key{RET}
323Press the @key{RETURN} or @key{ENTER} key. This is normally used to
324complete a command.
325@c -------------------------
326@item @key{SPC}
327Press the space bar.
328@c -------------------------
329@item @key{TAB}
330Press the @key{TAB} key.
331@c -------------------------
332@item @key{DEL}
333Press the @key{DELETE} key.
334@c -------------------------
335@item @key{BS}
336Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
337earlier of Emacs, you will need to use the @key{DEL} key.}.
338@end table
339
340@cindex Emacs, prefix argument
341@cindex prefix argument
342@kindex C-u
343
344A @dfn{prefix argument} allows you to pass an argument to any Emacs
345function. To pass an argument, type @kbd{C-u} before the Emacs command
346or keystroke. Numeric arguments can be passed as well. For example, to
347insert five f's, use @kbd{C-u 5 f}. There is a default of four when
348using @kbd{C-u}, and you can use multiple prefix arguments to provide
349arguments of powers of four. To continue our example, you could insert
350four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
351@kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
352arguments can also be inserted with the @key{META} key. Examples
353include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
354specifies a negative argument with no particular value.
355
356@sp 1
357@center @strong{NOTE}
358
359@quotation
360The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
361mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
362numerical argument before entering the command.
363@end quotation
364@sp 1
365
366@cindex @file{.emacs}
367@cindex Emacs, variables
368@cindex files, @file{.emacs}
369@cindex variables
370@findex setq
371
372Emacs uses @dfn{variables} to hold values. These can be changed via
373calls to the function @code{setq} in @file{~/.emacs}.
374
375@cindex Emacs, options
376@cindex options
377@findex customize-group
378@findex customize-option
379
380Variables in MH-E that are normally modified by the user are called
381@dfn{options} and are modified through the customize functions (such
382as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
383@ifnothtml
384@xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
385GNU Emacs Manual}.
386@end ifnothtml
387@ifhtml
388See section
389@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html,
390Easy Customization} in @cite{The GNU Emacs Manual}.
391@end ifhtml
392@xref{Options}.
393
394@cindex Emacs, faces
395@cindex faces
396@cindex highlighting
397@findex customize-face
398
399You can specify various styles for displaying text using @dfn{faces}.
400MH-E provides a set of faces that you can use to personalize the look
401of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
402this.
403@ifnothtml
404@xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
405GNU Emacs Manual}.
406@end ifnothtml
407@ifhtml
408See section
409@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Face-Customization.html,
410Face Customization} in @cite{The GNU Emacs Manual}.
411@end ifhtml
412
413@cindex abnormal hooks
414@cindex hooks
415@cindex normal hooks
416@findex add-hook
417@findex customize-option
418
419Commands often offer @dfn{hooks} which enable you to extend or modify
420the way a command works.
421@ifnothtml
422@ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
423Emacs Manual}
424@end ifnothtml
425@ifhtml
426See section
427@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html,
428Hooks} in @cite{The GNU Emacs Manual}
429@end ifhtml
430for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
431MH-E uses normal hooks in nearly all cases, so you can assume that we
432are talking about normal hooks unless we explicitly mention that a
433hook is abnormal. We also follow the conventions described in that
434section: the name of the abnormal hooks end in @code{-functions} and all
435the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
436either @code{customize-option} or @code{add-hook}.
437
438@cindex Emacs, mark
439@cindex Emacs, point
440@cindex Emacs, region
441@cindex mark
442@cindex point
443@cindex region
444@kindex C-@@
445@kindex C-SPC
446
447There are several other terms that are used in Emacs that you should
448know. The @dfn{point} is where the cursor currently is. You can save
449your current place in the file by setting a @dfn{mark}. This operation
450is useful in several ways. The mark can be later used when defining a
451@dfn{region}, which is the text between the point and mark. Many
452commands operate on regions, such as those for deleting text or
453filling paragraphs. A mark can be set with @kbd{C-@@} (or
454@kbd{C-@key{SPC}}).
455
456@cindex completion
457@cindex Emacs, completion
458@cindex Emacs, file completion
459@cindex Emacs, folder completion
460@cindex Emacs, minibuffer
461@cindex file completion
462@cindex folder completion
463@cindex minibuffer
464@kindex SPC
465@kindex TAB
466
467The @dfn{minibuffer} is the bottom line of the Emacs window, where all
468prompting and multiple-character input is directed. You can use
469@dfn{completion} to enter values such as folders. Completion means
470that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
471A second @key{SPC} or @key{TAB} will list all possibilities at that
472point.
473@ifnothtml
474@xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
475@end ifnothtml
476@ifhtml
477See the section
478@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
479Completion} in @cite{The GNU Emacs Manual}.
480@end ifhtml
481Note that @key{SPC} cannot be used for completing filenames and
482folders.
483
484@findex help-with-tutorial
485@kindex C-h t
486@kindex M-x
487
488The minibuffer is also where you enter Emacs function names after
489typing @kbd{M-x}. For example, in the preface, I mentioned that you
490could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
491this means is that you can get a tutorial by typing either @kbd{C-h t}
492or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
493for @samp{help-with-tutorial} in the minibuffer after typing
494@kbd{M-x}.
495
496@cindex ~
497
498The @samp{~} notation in filenames represents your home directory.
499This notation is used by many shells including @command{bash},
500@code{tcsh}, and @command{csh}. It is analogous to the environment
501variable @samp{$HOME}. For example, @file{~/.emacs} can be written
502@file{$HOME/.emacs} or using the absolute path as in
503@file{/home/wohler/.emacs} instead.
504
505@cindex Emacs, interrupting
506@cindex Emacs, quitting
507@cindex interrupting
508@cindex quitting
509
510@i{In case of trouble:} Emacs can be interrupted at any time with
511@kbd{C-g}. For example, if you've started a command that requests that
512you enter something in the minibuffer, but then you change your mind,
513type @kbd{C-g} and you'll be back where you started. If you want to
514exit Emacs entirely, use @kbd{C-x C-c}.
515
516@node Getting Started, Tour Through MH-E, Conventions, Top
517@chapter Getting Started
518
519@cindex MH-E, versions
520@cindex history
521@cindex versions of MH-E
522
523Because there are many old versions of MH-E out there, it is important
524to know which version you have. I'll be talking about @w{Version 8}
525which is pretty close to @w{Version 6} and @w{Version 7}. It differs
526from @w{Version 4} and @w{Version 5} and is vastly different from
527@w{Version 3}. @xref{History}.
528
529@findex mh-version
530
531To determine which version of MH-E that you have, enter @kbd{M-x
532mh-version @key{RET}}. Hopefully it says that you're running
533@w{Version @value{VERSION}} which is the latest version as of this
534printing.
535
536If your version is much older than this, please consider upgrading.
537You can have your system administrator upgrade the system-wide
538version, or you can install your own personal version. It's really
539quite easy. @xref{Getting MH-E}, for instructions for getting and
540installing MH-E.
541
542If the @code{mh-version} command displays @samp{No MH variant
543detected}@footnote{In very old versions of MH-E, you may get the error
544message, @samp{Cannot find the commands `inc' and `mhl' and the file
545`components'} if MH-E can't find MH@. In this case, you need to update
546MH-E, and you may need to install MH too. However, newer versions of
547MH-E are better at finding MH if it is on your system.}, then you need
548to install MH or tell MH-E where to find MH.
549
550@cindex Debian
551@cindex nmh
552@cindex GNU mailutils MH
553
554If you don't have MH on your system already, you must install a
555variant of MH@. The Debian mh-e package does this for you
556automatically (@pxref{Getting MH-E}). Most people use
557@uref{https://www.nongnu.org/nmh/, nmh}, but you may be interested in
558trying out @uref{https://mailutils.org/, GNU mailutils MH}, which
559supports IMAP@. Your GNU/Linux distribution probably has packages for
560both of these.
561
562@cindex @command{install-mh}
563@cindex MH commands, @command{install-mh}
564@cindex MH book
565
566If you've never run MH before, you need to run @command{install-mh}
567from the shell before you continue. This sets up your personal MH
568environment@footnote{See the section
569@uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
570MH book.}. If you don't, you'll be greeted with the error message:
571@samp{Install MH and run install-mh before running MH-E}. This is all
572you need to know about MH to use MH-E, but the more you know about MH,
573the more you can leverage its power. See the
574@uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
575
576@cindex @samp{Path} MH profile component
577@cindex MH profile
578@cindex MH profile component
579@cindex MH profile component, @samp{Path}
580
581Your MH environment includes your @dfn{MH profile} which is found in
582the file @file{~/.mh_profile}, or the file named in the environment
583variable @samp{$MH}. This file contains a number of @dfn{MH
584profile components}. For example, the @samp{Path:} MH profile
585component contains the path to your mail directory, which is
586@file{~/Mail} by default.
587
588@cindex @command{mhparam}
589@cindex MH commands, @command{mhparam}
590@vindex exec-path
591@vindex mh-path
592@vindex mh-sys-path
593@vindex mh-variant
594@vindex mh-variant-in-use
595
596There are several options MH-E uses to interact with your MH
597installation. The option @code{mh-variant} specifies the variant used
598by MH-E (@pxref{Options}). The default setting of this option is
599@samp{Auto-detect} which means that MH-E will automatically choose the
600first of nmh, MH, or GNU mailutils MH that it finds in the directories
601listed in @code{mh-path} (which you can customize),
602@code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
603all, you may have to customize @code{mh-path} and add the directory in
604which the command @command{mhparam} is located. If, on the other hand,
605you have both nmh and GNU mailutils MH installed (for example) and
606@code{mh-variant-in-use} was initialized to nmh but you want to use
607GNU mailutils MH, then you can set @code{mh-variant} to
608@samp{gnu-mh}.
609
610@vindex mh-flists-present-flag
611@vindex mh-lib
612@vindex mh-lib-progs
613@vindex mh-progs
614
615When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
616@code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
617@code{mh-variant-in-use} accordingly.
618
619@cindex @file{.emacs}
620@cindex files, @file{.emacs}
621
622@sp 1
623@center @strong{NOTE}
624
625@quotation
626Prior to version 8, it was often necessary to set some of these
627variables in @file{~/.emacs}; now it is no longer necessary and can
628actually cause problems.
629@end quotation
630@sp 1
631
632@cindex MH profile component, @samp{Draft-Folder}
633@cindex MH profile component, @samp{Path}
634@cindex MH profile component, @samp{Previous-Sequence}
635@cindex MH profile component, @samp{Unseen-Sequence}
636@cindex @samp{Draft-Folder} MH profile component
637@cindex @samp{Path} MH profile component
638@cindex @samp{Previous-Sequence} MH profile component
639@cindex @samp{Unseen-Sequence} MH profile component
640@findex mh-find-path
641@vindex mh-draft-folder
642@vindex mh-find-path-hook
643@vindex mh-inbox
644@vindex mh-previous-seq
645@vindex mh-unseen-seq
646@vindex mh-user-path
647
648In addition to setting variables that point to MH itself, MH-E also
649sets a handful of variables that point to where you keep your mail.
650During initialization, the function @code{mh-find-path} sets
651@code{mh-user-path} from your @samp{Path:} MH profile component (but
652defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
653from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
654@samp{Unseen-Sequence:}, @code{mh-previous-seq} from
655@samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
656(defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
657after these variables have been set. This hook can be used the change
658the value of these variables if you need to run with different values
659between MH and MH-E.
660
661@node Tour Through MH-E, Using This Manual, Getting Started, Top
662@chapter Tour Through MH-E
663
664@cindex introduction
665@cindex tour
666@cindex tutorial
667
668This chapter introduces some of the terms you'll need to know and then
669takes you on a tour of MH-E@footnote{The keys mentioned in these
670chapters refer to the default key bindings. If you've changed the
671bindings, refer to the command summaries at the beginning of each
672chapter for a mapping between default key bindings and function
673names.}. When you're done, you'll be able to send, read, and file
674mail, which is all that a lot of people ever do. But if you're the
675curious or adventurous type, read the rest of the manual to be able to
676use all the features of MH-E@. I suggest you read this chapter first to
677get the big picture, and then you can read the manual as you wish.
678
679@menu
680* Sending Mail Tour::
681* Reading Mail Tour::
682* Processing Mail Tour::
683* Leaving MH-E::
684* More About MH-E::
685@end menu
686
687@node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
688@section Sending Mail
689
690@cindex MH-Letter mode
691@cindex mode
692@cindex modes, MH-Letter
693@cindex sending mail
694@findex mh-smail
695
696Let's start our tour by sending ourselves a message which we can later
697read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
698to send messages. Your message appears in an Emacs buffer whose
699mode@footnote{A @dfn{mode} changes Emacs to make it easier to edit a
700particular type of text.} is MH-Letter.
701
702Enter your login name in the @samp{To:} header field. Press the
703@key{TAB} twice to move the cursor past the @samp{Cc:} field, since no
704carbon copies are to be sent, and on to the @samp{Subject:} field.
705Enter @kbd{Test} or anything else that comes to mind.
706
707Press @key{TAB} again to move the cursor to the body of the message.
708Enter some text, using normal Emacs commands. You should now have
709something like this@footnote{If you're running Emacs under the X
710Window System, then you would also see a menu bar and a tool bar. I've
711left out the menu bar and tool bar in all of the example screens.}:
712
713@cartouche
714@smallexample
715
716
717
718
719
720
721--:--  *scratch*   All L1     (Lisp Interaction)-------------------------
722To: wohler
723cc:
724Subject: Test
725X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
726--------
727This is a test message to get the wheels churning...#
728
729
730--:**  @{draft@}   All L5     (MH-Letter)----------------------------------
731Type C-c C-c to send message, C-C ? for help
732@end smallexample
733@end cartouche
734@i{MH-E message composition window}
735
736Note the line of dashes that separates the header and the body of the
737message. It is essential that these dashes (or a blank line) are
738present or the body of your message will be considered to be part of
739the header.
740
741@cindex help
742@findex describe-mode
743@kindex C-c ?
744@kindex C-c C-c
745@kindex C-h m
746
747There are several commands specific to MH-Letter mode@footnote{You can
748get quick help for the commands used most often with @kbd{C-c ?} or
749more complete help with the @kbd{C-h m} (@code{describe-mode})
750command.}, but at this time we'll only use @kbd{C-c C-c} to send your
751message. Type @kbd{C-c C-c} now. That's all there is to it!
752
753@node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
754@section Receiving Mail
755
756@cindex @command{inc}
757@cindex @command{scan}
758@cindex MH commands, @command{inc}
759@cindex MH commands, @command{scan}
760@cindex MH-Folder mode
761@cindex modes, MH-Folder
762@cindex reading mail
763@findex mh-rmail
764
765To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
766This incorporates the new mail and puts the output from
767@command{inc}@footnote{See the section
768@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
769prev} in the MH book.} (called @dfn{scan lines} after the MH program
770@command{scan}@footnote{See the section
771@uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
772pick Ranges Sequences} in the MH book.} which prints a one-line
773summary of each message) into a buffer called @samp{+inbox} whose
774major mode is MH-Folder.
775
776@findex mh-rmail
777@kindex F r
778
779@sp 1
780@center @strong{NOTE}
781
782@quotation
783
784The @kbd{M-x mh-rmail} command will show you only new mail, not mail
785you have already read. If you were to run this tour again, you would
786use @kbd{F r} to pull all your messages into MH-E.
787@end quotation
788@sp 1
789
790@kindex RET
791@kindex n
792@kindex p
793
794You should see the scan line for your message, and perhaps others. Use
795@kbd{n} or @kbd{p} to move the cursor to your test message and type
796@key{RET} to read your message. You should see something like:
797
798@cartouche
799@smallexample
800  3 t08/24 root       received fax files on Wed Aug 24 11:00:13 PDT 1
801# 4+t08/24 To:wohler  Test<<This is a test message to get the wheels
802
803-:%%  @{+inbox/select@} 4 msgs (1-4)   Bot L4     (MH-Folder Show)---------
804To: wohler
805Subject: Test
806X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
807Date: Fri, 17 Mar 2006 10:49:11 -0800
808From: Bill Wohler <wohler@@stop.mail-abuse.org>
809
810This is a test message to get the wheels churning...
811
812
813
814--:--  @{show-+inbox@} 4   All L1     (MH-Show)----------------------------
815
816@end smallexample
817@end cartouche
818@i{After incorporating new messages}
819
820@kindex DEL
821@kindex SPC
822
823If you typed a long message, you can view subsequent pages with
824@key{SPC} and previous pages with @key{DEL}.
825
826@node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
827@section Processing Mail
828
829@cindex processing mail
830@kindex RET
831@kindex r
832
833The first thing we want to do is reply to the message that we sent
834ourselves. Ensure that the cursor is still on the same line as your
835test message and type @kbd{r}. You are prompted in the minibuffer with
836@samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
837to the original sender only, to the sender and primary recipients, or
838to the sender and all recipients. You can press @key{TAB} to see these
839choices. If you simply press @key{RET}, you'll reply only to the
840sender. Press @key{RET} now.
841
842You'll find yourself in an Emacs buffer similar to that when you were
843sending the original message, like this:
844
845@cartouche
846@smallexample
847To:
848cc:
849Subject: Re: Test
850In-Reply-To: <31054.1142621351@@stop.mail-abuse.org>
851References: <31054.1142621351@@stop.mail-abuse.org>
852Comments: In-Reply-To Bill Wohler <wohler@@stop.mail-abuse.org>
853   message dated "Fri, 17 Mar 2006 10:49:11 -0800."
854X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
855--------
856#
857
858--:--  @{draft@}  All L10     (MH-Letter)----------------------------------
859To: wohler
860Subject: Test
861X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
862Date: Fri, 17 Mar 2006 10:49:11 -0800
863From: Bill Wohler <wohler@@stop.mail-abuse.org>
864
865This is a test message to get the wheels churning...
866
867--:--  @{show-+inbox@} 4   All L1     (MH-Show)----------------------------
868Type C-c C-c to send message, C-c ? for help
869@end smallexample
870@end cartouche
871@i{Composition window during reply}
872
873@findex backward-char
874@findex forward-char
875@findex next-line
876@findex previous-line
877@kindex C-b
878@kindex C-c C-c
879@kindex C-c C-f C-t
880@kindex C-f
881@kindex C-n
882@kindex C-p
883@kindex BS
884
885By default, MH will not add you to the address list of your replies,
886so if you find that the @samp{To:} header field is missing, don't
887worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
888@samp{To:} field, where you can type your login name again. You can
889move around with the arrow keys or with @kbd{C-p}
890(@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
891(@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
892delete the previous character with @key{BS}. When you're finished
893editing your message, send it with @kbd{C-c C-c} as before.
894
895@cindex @command{refile}
896@cindex MH commands, @command{refile}
897@cindex folders
898@kindex SPC
899@kindex o
900
901You'll often want to save messages that were sent to you in an
902organized fashion. This is done with @dfn{folders}. You can use
903folders to keep messages from your friends, or messages related to a
904particular topic. With your cursor in the MH-Folder buffer and
905positioned on the message you sent to yourself, type @kbd{o} to output
906(@command{refile} in MH parlance) that message to a folder. Enter
907@kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
908(or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
909that a @samp{^} (caret) appears next to the message number, which
910means that the message has been marked for refiling but has not yet
911been refiled. We'll talk about how the refile is actually carried out
912in a moment.
913
914@cindex MH-Folder mode
915@cindex modes, MH-Folder
916@kindex d
917@kindex i
918@kindex RET
919@kindex n
920@kindex p
921@kindex x
922
923Your previous reply is now waiting in the system mailbox. You
924incorporate this mail into your MH-Folder buffer named @samp{+inbox}
925with the @kbd{i} command. Do this now. After the mail is incorporated,
926use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
927it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
928that a @samp{D} appears next to the message number. This means that
929the message is marked for deletion but is not yet deleted. To perform
930the deletion (and the refile we did previously), use the @kbd{x}
931command.
932
933@findex mh-smail
934@kindex m
935
936If you want to send another message you can use @kbd{m} instead of
937@kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
938
939@cindex help
940@cindex prefix characters
941@findex describe-mode
942@kindex ?
943@kindex C-h m
944@kindex F ?
945
946You can get a quick reminder about these commands by typing @kbd{?}.
947This lists several @dfn{prefix characters}. To list the commands
948available via the prefix characters, type the prefix character
949followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
950available with the @kbd{C-h m} (@code{describe-mode}) command.
951
952@node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
953@section Leaving MH-E
954
955@cindex Emacs, quitting
956@cindex quitting
957@kindex C-x C-c
958@kindex x
959
960You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
961to exit @command{emacs}. If you exited without running @kbd{x} in the
962@samp{+inbox} buffer, Emacs will offer to save it for you. Type
963@kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
964perform any refiles and deletes that you did there.
965
966@findex mh-rmail
967@kindex C-x b
968@kindex C-x k
969@kindex q
970
971If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
972the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
973later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
974
975@cindex @command{packf}
976@cindex MH commands, @command{packf}
977@cindex exporting folders
978@cindex folders, exporting
979@cindex mbox-style folder
980
981On the other hand, if you no longer want to use MH and MH-E, you can
982take your mail with you. You can copy all of your mail into a single
983file, mbox-style, by using the MH command @command{packf}. For
984example, to create a file called @file{msgbox} with the messages in
985your @samp{+inbox} folder, use @samp{packf +inbox}. The
986@command{packf} command will append the messages to the file if it
987already exists, so you can use @samp{folders -recurse -fast} in a
988script to copy all of your messages into a single file, or using the
989@samp{-file} argument, a file for each folder.
990
991@node More About MH-E,  , Leaving MH-E, Tour Through MH-E
992@section More About MH-E
993
994These are the basic commands to get you going, but there are plenty
995more. If you think that MH-E is for you, read the rest of the manual
996to find out how you can:
997
998@itemize @bullet
999@item
1000Print your messages (@pxref{Printing}).
1001@c -------------------------
1002@item
1003Edit messages and include your signature (@pxref{Editing Drafts}).
1004@c -------------------------
1005@item
1006Forward messages (@pxref{Forwarding}).
1007@c -------------------------
1008@item
1009Read digests (@pxref{Digests}).
1010@c -------------------------
1011@item
1012Edit bounced messages (@pxref{Editing Again}).
1013@c -------------------------
1014@item
1015Send multimedia messages (@pxref{Adding Attachments}).
1016@c -------------------------
1017@item
1018Read HTML messages (@pxref{HTML}).
1019@c -------------------------
1020@item
1021Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
1022@c -------------------------
1023@item
1024Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
1025@c -------------------------
1026@item
1027Deal with junk mail (@pxref{Junk}).
1028@c -------------------------
1029@item
1030Handle signed and encrypted messages (see @ref{Reading PGP},
1031@pxref{Sending PGP}).
1032@c -------------------------
1033@item
1034Process mail that was sent with @command{shar} or @command{uuencode}
1035(@pxref{Files and Pipes}).
1036@c -------------------------
1037@item
1038Use sequences conveniently (@pxref{Sequences}).
1039@c -------------------------
1040@item
1041Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
1042Bar}, @pxref{Menu Bar}).
1043@c -------------------------
1044@item
1045Show header fields in different fonts (@pxref{Reading Mail}).
1046@c -------------------------
1047@item
1048Find previously refiled messages (@pxref{Searching}).
1049@c -------------------------
1050@item
1051Place messages in a file (@pxref{Files and Pipes}).
1052@end itemize
1053
1054Remember that you can also use MH commands when you're not running
1055MH-E (and when you are!).
1056
1057@node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
1058@chapter Using This Manual
1059
1060This chapter begins the meat of the manual which goes into more detail
1061about every MH-E command and option.
1062
1063@cindex Emacs, info
1064@cindex Emacs, built-in help
1065@cindex info
1066@cindex built-in help
1067@findex describe-mode
1068@findex mh-help
1069@kindex ?
1070@kindex C-c ?
1071@kindex C-h C-h
1072@kindex C-h C-k i
1073@kindex C-h i
1074@kindex C-h m
1075
1076There are many commands, but don't get intimidated. There are command
1077summaries at the beginning of each chapter. In case you have or would
1078like to rebind the keys, the command summaries also list the
1079associated Emacs Lisp function. Furthermore, even if you're stranded
1080on a desert island with a laptop and are without your manuals, you can
1081get a summary of all these commands with GNU Emacs built-in help: use
1082@kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
1083@kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
1084help appears in a buffer called @file{*MH-E Help*}
1085(@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
1086i} to read this manual via Info. The built-in help is quite good; try
1087running @kbd{C-h C-h}. This brings up a list of available help topics,
1088one of which displays the documentation for a given key (like @kbd{C-h
1089k C-n}). Another useful help feature is to view the manual section
1090that describes a given key (such as @kbd{C-h K i}). In addition,
1091review @ref{Conventions}, if any of the GNU Emacs conventions are
1092strange to you.
1093
1094In addition to all of the commands, it is also possible to reconfigure
1095MH-E to fit the needs of even the most demanding user. The following
1096chapters also describe all of the options, show the defaults, and make
1097recommendations for customization.
1098
1099However, when customizing your mail environment, first try to change
1100what you want in MH, and only change MH-E if changing MH is not
1101possible. That way you will get the same behavior inside and outside
1102GNU Emacs. Note that MH-E does not provide hooks for customizations
1103that can be done in MH; this omission is intentional.
1104
1105@cindex Emacs Lisp Manual
1106@cindex Emacs, Emacs Lisp Manual
1107@cindex Emacs, info
1108@cindex Emacs, online help
1109@cindex info
1110@cindex online help
1111
1112I hope I've included enough examples here to get you well on your way.
1113If you want to explore Emacs Lisp further, a programming manual does
1114exist,
1115@c Yes, some of the stuff in the following sections is redundant, but
1116@c TeX barfs if the @ifs are inside the @footnote.
1117@iftex
1118@footnote{The @cite{GNU Emacs Lisp Reference Manual} should be available
1119via the Info system by typing @kbd{C-h i m Emacs Lisp
1120@key{RET}}. It is also available online at @*
1121@uref{https://www.gnu.org/software/emacs/manual/elisp.html}.}
1122@end iftex
1123@ifinfo
1124@footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1125Emacs Lisp Reference Manual}, which should be available via the
1126Info system. It is also available online at
1127@uref{https://www.gnu.org/software/emacs/manual/elisp.html}.}
1128@end ifinfo
1129@ifhtml
1130@footnote{The
1131@uref{https://www.gnu.org/software/emacs/manual/elisp.html,
1132The GNU Emacs Lisp Reference Manual} should be available via
1133the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}.}
1134@end ifhtml
1135and you can look at the code itself for examples. Look in the Emacs
1136Lisp directory on your system (such as
1137@file{/usr/local/share/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1138files there. When calling MH-E and other Emacs Lisp functions directly
1139from Emacs Lisp code, you'll need to know the correct arguments. Use
1140the built-in help for this. For example, try @kbd{C-h f
1141mh-execute-commands @key{RET}}. If you write your own functions,
1142please do not prefix your symbols (variables and functions) with
1143@samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1144conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1145your initials. (Unless, of course, your initials happen to be @emph{mh}!)
1146
1147@menu
1148* Options::
1149* Ranges::
1150* Folder Selection::
1151@end menu
1152
1153@node Options, Ranges, Using This Manual, Using This Manual
1154@section Options
1155
1156@cindex Emacs, customizing
1157@cindex Emacs, setting options
1158@cindex customizing MH-E
1159@cindex setting options
1160@findex customize-option
1161@vindex mh-lpr-command-format@r{, example}
1162
1163Many string or integer options are easy to modify using @kbd{M-x
1164customize-option}. For example, to modify the option that controls
1165printing, you would run @kbd{M-x customize-option @key{RET}
1166mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1167the string to the right of the variable. For example, you may change
1168the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1169use the @samp{State} combo box and select @samp{Save for Future
1170Sessions}. To read more about @code{mh-lpr-command-format}, see
1171@ref{Printing}.
1172
1173@cindex nil
1174@cindex off, option
1175@cindex on, option
1176@cindex option, turning on and off
1177@cindex t
1178@findex customize-option
1179@vindex mh-bury-show-buffer-flag@r{, example}
1180
1181Options can also hold boolean values. In Emacs Lisp, the boolean
1182values are @code{nil}, which means false, and @code{t}, which means
1183true. The @code{customize-option} function makes it easy to change
1184boolean values; simply click on the toggle button in the customize
1185buffer to switch between @samp{on} (@code{t}) and @samp{off}
1186(@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1187to @samp{off} to keep the MH-Show buffer at the top of the buffer
1188stack. Use the @samp{State} combo box and choose @samp{Set for Current
1189Session} to see how the option affects the show buffer. Then choose
1190the @samp{Erase Customization} menu item to reset the option to the
1191default, which places the MH-Show buffer at the bottom of the buffer
1192stack.
1193
1194@vindex mh-mhl-format-file@r{, example}
1195
1196The text usually says to turn on an option by setting it to a
1197@emph{non-@code{nil}} value, because sometimes values other than
1198@samp{on} are meaningful. An example of this is the variable
1199@code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
1200hooks, involve a little more Emacs Lisp programming expertise.
1201
1202@cindex customization group, @samp{mh}
1203@cindex @samp{mh} customization group
1204@findex customize-group
1205@findex mh-customize
1206
1207You can browse all of the MH-E options with the @code{customize-group}
1208function. Try entering @kbd{M-x customize-group @key{RET} mh
1209@key{RET}} to view the top-level options as well as buttons for all of
1210the MH-E customization groups. Another way to view the MH-E
1211customization group is to use @kbd{M-x mh-customize @key{RET}}.
1212
1213@node Ranges, Folder Selection, Options, Using This Manual
1214@section Ranges
1215
1216@c Sync with mh-folder-mode docstring.
1217
1218@cindex message abbreviations
1219@cindex message ranges
1220@cindex ranges
1221
1222Many commands that operate on individual messages, such as
1223@code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1224argument. This argument can be used in several ways.
1225
1226@kindex C-u@r{, with ranges}
1227
1228If you provide the prefix argument @kbd{C-u} to these commands, then
1229you will be prompted for the message range. This can be any valid MH
1230range which can include messages, sequences (@pxref{Sequences}), and
1231the abbreviations (described in the @command{mh}(1) man page):
1232
1233@table @samp
1234@item <num1>-<num2>
1235Indicates all messages in the range <num1> to <num2>, inclusive. The
1236range must be nonempty.
1237@c -------------------------
1238@item <num>:N
1239@itemx <num>:+N
1240@itemx <num>:-N
1241Up to N messages beginning with (or ending with) message num. Num may
1242be any of the predefined symbols: first, prev, cur, next or last.
1243@c -------------------------
1244@item first:N
1245@itemx prev:N
1246@itemx next:N
1247@itemx last:N
1248The first, previous, next or last messages, if they exist.
1249@c -------------------------
1250@item all
1251All of the messages.
1252@end table
1253
1254For example, a range that shows all of these things is @samp{1 2 3
12555-10 last:5 unseen}.
1256
1257@vindex transient-mark-mode
1258
1259If the option @code{transient-mark-mode} is turned on and you set a
1260region in the MH-Folder buffer, then the MH-E command will perform the
1261operation on all messages in that region.
1262
1263@cindex @samp{mh-range} customization group
1264@cindex customization group, @samp{mh-range}
1265
1266The @samp{mh-range} customization group contains a single option which
1267affects how ranges are interpreted.
1268
1269@vtable @code
1270@item mh-interpret-number-as-range-flag
1271On means interpret a number as a range (default: @samp{on}).
1272@end vtable
1273
1274@vindex mh-interpret-number-as-range-flag
1275
1276Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1277interpret input such as @samp{200} as @samp{last:200} if the
1278@code{mh-interpret-number-as-range-flag} option is on (which is the
1279default). If you need to scan just the message 200, then use the range
1280@samp{200:1} or @samp{200-200}.
1281
1282@node Folder Selection,  , Ranges, Using This Manual
1283@section Folder Selection
1284
1285@cindex completion, folders
1286@cindex folders, completion
1287@cindex folders, selecting
1288
1289When you choose a folder in MH-E via a command such as @kbd{o}
1290(@code{mh-refile-msg}), completion is used to enter the folder
1291@ifnothtml
1292(@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1293@end ifnothtml
1294@ifhtml
1295(see the section
1296@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
1297Completion} in @cite{The GNU Emacs Manual}).
1298@end ifhtml
1299In addition, MH-E has several ways of choosing a suitable default so
1300that the folder can often be selected with a single @key{RET} key.
1301
1302@cindex customization group, @samp{mh-folder-selection}
1303@cindex @samp{mh-folder-selection} customization group
1304
1305The @samp{mh-folder-selection} customization group contains some
1306options which are used to help with this.
1307
1308@vtable @code
1309@item mh-default-folder-for-message-function
1310Function to select a default folder for refiling or @samp{Fcc:}
1311(default: @code{nil}).
1312@c -------------------------
1313@item mh-default-folder-list
1314List of addresses and folders (default: @code{nil}).
1315@c -------------------------
1316@item mh-default-folder-must-exist-flag
1317On means guessed folder name must exist to be used (default:
1318@samp{on}).
1319@c -------------------------
1320@item mh-default-folder-prefix
1321Prefix used for folder names generated from aliases (default: @code{""}).
1322@end vtable
1323
1324@vindex mh-default-folder-for-message-function
1325
1326You can set the option @code{mh-default-folder-for-message-function}
1327to a function that provides a default folder for the message to be
1328refiled. When this function is called, the current buffer contains the
1329message being refiled and point is at the start of the message. This
1330function should return the default folder as a string with a leading
1331@samp{+} sign. It can also return @code{nil} so that the last folder
1332name is used as the default, or an empty string to suppress the
1333default entirely.
1334
1335Otherwise, the name of the destination folder is derived from the
1336sender as follows:
1337
1338@enumerate
1339@vindex mh-default-folder-list
1340@item
1341The folder name associated with the first address found in the list
1342@code{mh-default-folder-list} is used. Each element in this list
1343contains a @samp{Check Recipient} item. If this item is turned on,
1344then the address is checked against the recipient instead of the
1345sender. This is useful for mailing lists.
1346@c -------------------------
1347@vindex mh-default-folder-prefix
1348@item
1349An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1350the address is used. The prefix is used to prevent clutter in your
1351mail directory. @xref{Aliases}.
1352@end enumerate
1353
1354@vindex mh-default-folder-must-exist-flag
1355
1356If the derived folder does not exist, and
1357@code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1358folder name used is suggested. This is useful if you get mail from
1359various people for whom you have an alias, but file them all in the
1360same project folder.
1361
1362@node Incorporating Mail, Reading Mail, Using This Manual, Top
1363@chapter Incorporating Your Mail
1364
1365@cindex @samp{Folder} menu
1366@cindex incorporating
1367@cindex menu, @samp{Folder}
1368
1369This chapter talks about getting mail from your system mailbox into
1370your MH @samp{+inbox} folder. The following command accomplishes that
1371and is found in the @samp{Folder} menu.
1372
1373@table @kbd
1374@cindex @samp{Folder > Incorporate New Mail} menu item
1375@cindex menu item, @samp{Folder > Incorporate New Mail}
1376@findex mh-inc-folder
1377@kindex i
1378@item i
1379Incorporate new mail into a folder (@code{mh-inc-folder}).
1380@end table
1381
1382@cindex @samp{mh-inc} customization group
1383@cindex customization group, @samp{mh-inc}
1384
1385The following options in the @samp{mh-inc} customization group are
1386used.
1387
1388@vtable @code
1389@item mh-inc-prog
1390Program to incorporate mail (default: @code{"inc"}).
1391@c -------------------------
1392@item mh-inc-spool-list
1393Alternate spool files (default: @code{nil}).
1394@end vtable
1395
1396The following hook is available.
1397
1398@vtable @code
1399@findex mh-inc-folder
1400@item mh-inc-folder-hook
1401Hook run by @code{mh-inc-folder} after incorporating mail into a
1402folder (default: @code{nil}).
1403@end vtable
1404
1405@cindex @samp{+inbox}
1406@findex mh-inc-folder
1407@kindex i
1408
1409If at any time you receive new mail, incorporate the new mail into
1410your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1411that @kbd{i} will display the @samp{+inbox} buffer, even if there
1412isn't any new mail. You can incorporate mail from any file into the
1413current folder by specifying a prefix argument; you'll be prompted for
1414the name of the file to use as well as the destination folder (for
1415example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1416
1417@cindex @file{.emacs}
1418@cindex Emacs, notification of new mail
1419@cindex files, @file{.emacs}
1420@cindex new mail
1421@cindex notification of new mail
1422
1423Emacs can notify you when you have new mail by displaying @samp{Mail}
1424in the mode line. To enable this behavior, and to have a clock in the
1425mode line as well, add the following to @file{~/.emacs}:
1426
1427@findex display-time
1428
1429@smalllisp
1430(display-time)
1431@end smalllisp
1432
1433@cindex @command{inc}
1434@cindex incorporating
1435@cindex MH commands, @command{inc}
1436@vindex mh-inc-prog
1437@vindex mh-progs
1438
1439The name of the program that incorporates new mail is stored in
1440@code{mh-inc-prog}; it is @code{"inc"} by default. This program
1441generates a one-line summary for each of the new messages. Unless it
1442is an absolute pathname, the file is assumed to be in the
1443@code{mh-progs} directory (@pxref{Getting Started}). You may also link
1444a file to @command{inc} that uses a different format (see
1445@samp{mh-profile}(5), and sections
1446@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
1447prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
1448the MH book). You'll then need to modify several variables
1449appropriately (@pxref{Scan Line Formats}).
1450
1451@vindex mh-inc-spool-list
1452
1453You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1454retrieve mail from arbitrary spool files other than your system
1455mailbox, file it in folders other than your @samp{+inbox}, and assign
1456key bindings to incorporate this mail.
1457
1458@cindex @command{procmail}
1459@cindex @file{.procmailrc}
1460@cindex Unix commands, @command{procmail}
1461@cindex files, @file{.procmailrc}
1462
1463Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1464use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1465with the following recipe in @file{.procmailrc}:
1466
1467@smallexample
1468PATH=$PATH:/usr/bin/mh
1469MAILDIR=$HOME/`mhparam Path`
1470:0:
1471* ^From mh-e-devel-admin@@stop.mail-abuse.org
1472mh-e
1473@end smallexample
1474
1475@findex mh-inc-spool-*
1476@kindex I *
1477
1478In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1479@kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1480and click on the @samp{INS} button. Enter a @samp{Spool File} of
1481@samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1482Binding} of @samp{m}.
1483
1484@cindex @command{emacsclient}
1485@cindex @command{gnuclient}
1486@cindex @command{xbuffy}
1487@cindex @samp{gnuserv}
1488@cindex Unix commands, @command{emacsclient}
1489@cindex Unix commands, @command{gnuclient}
1490@cindex Unix commands, @command{xbuffy}
1491
1492You can use @command{xbuffy} to automate the incorporation of this
1493mail using the Emacs 23 command @command{emacsclient} as follows:
1494
1495@smallexample
1496box ~/mail/mh-e
1497    title mh-e
1498    origMode
1499    polltime 10
1500    headertime 0
1501    command emacsclient --eval '(mh-inc-spool-mh-e)'
1502@end smallexample
1503
1504In XEmacs, the command @command{gnuclient} is used in a similar
1505fashion.
1506
1507@findex mh-inc-folder
1508@kindex i
1509@vindex mh-inc-folder-hook
1510
1511You can set the hook @code{mh-inc-folder-hook}, which is called after
1512new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1513command. A good use of this hook is to rescan the whole folder either
1514after running @kbd{M-x mh-rmail} the first time or when you've changed
1515the message numbers from outside of MH-E.
1516
1517@findex mh-execute-commands
1518@findex mh-rescan-folder@r{, example}
1519@findex mh-show@r{, example}
1520@vindex mh-inc-folder-hook@r{, example}
1521
1522@smalllisp
1523@group
1524(defun my-mh-inc-folder-hook ()
1525  "Hook to rescan folder after incorporating mail."
1526  (if (buffer-modified-p)            ; @r{if outstanding refiles and deletes,}
1527      (mh-execute-commands))         ;   @r{carry them out}
1528  (mh-rescan-folder)                 ; @r{synchronize with +inbox}
1529  (mh-show))                         ; @r{show the current message}
1530
1531(add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1532
1533@i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1534
1535@end group
1536@end smalllisp
1537
1538@node Reading Mail, Folders, Incorporating Mail, Top
1539@chapter Reading Your Mail
1540
1541@cindex @samp{+inbox}
1542@cindex MH-Folder mode
1543@cindex MH-Show mode
1544@cindex modes, MH-Folder
1545@cindex modes, MH-Show
1546@cindex reading mail
1547@findex mh-rmail
1548@kindex F r
1549@kindex F v
1550
1551The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1552command incorporates your mail and creates a buffer called
1553@samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1554you only new mail, not mail you have already read@footnote{If you want
1555to see your old mail as well, use @kbd{F r} to pull all your messages
1556into MH-E@. Or, give a prefix argument to @code{mh-rmail} so it will
1557prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1558M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1559
1560@findex display-time
1561@vindex read-mail-command
1562
1563There are some commands that need to read mail, such as @kbd{mouse-2}
1564over the @samp{Mail} button that @code{display-time} adds to the mode
1565line. You can configure Emacs to have these commands use MH-E by
1566setting the option @code{read-mail-command} to @samp{mh-rmail}.
1567
1568@cindex @command{scan}
1569@cindex @samp{Message} menu
1570@cindex MH commands, @command{scan}
1571@cindex menu, @samp{Message}
1572@cindex scan lines
1573
1574The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1575summaries of each incorporated message. You can perform most MH
1576commands on these messages via one- or two-letter commands in either
1577the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1578See @command{scan}(1) for a description of the contents of the scan
1579lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1580
1581@table @kbd
1582@kindex ?
1583@findex mh-help
1584@item ?
1585Display cheat sheet for the MH-E commands (@code{mh-help}).
1586@c -------------------------
1587@cindex @samp{Message > Show Message} menu item
1588@cindex menu item, @samp{Message > Show Message}
1589@kindex RET
1590@findex mh-show
1591@item @key{RET}
1592Display message (@code{mh-show}).
1593@c -------------------------
1594@cindex @samp{Message > Show Message with Header} menu item
1595@cindex menu item, @samp{Message > Show Message with Header}
1596@kindex , @r{(comma)}
1597@findex mh-header-display
1598@item , (comma)
1599Display message with all header fields (@code{mh-header-display}).
1600@c -------------------------
1601@cindex @samp{Message > Show Message with Preferred Alternative} menu item
1602@cindex menu item, @samp{Message > Show Message with Preferred Alternative}
1603@kindex : @r{(colon)}
1604@findex mh-show-preferred-alternative
1605@item : (colon)
1606Display message with the default preferred alternative
1607(@code{mh-show-preferred-alternative}).
1608@c -------------------------
1609@kindex ; @r{(semicolon)}
1610@findex mh-toggle-mh-decode-mime-flag
1611@item ; (semicolon)
1612Toggle the value of @code{mh-decode-mime-flag}
1613(@code{mh-toggle-mh-decode-mime-flag}).
1614@c -------------------------
1615@kindex SPC
1616@findex mh-page-msg
1617@item @key{SPC}
1618Display next page in message (@code{mh-page-msg}).
1619@c -------------------------
1620@kindex BS
1621@findex mh-previous-page
1622@item @key{BS}
1623Display previous page in message (@code{mh-previous-page}).
1624@c -------------------------
1625@cindex @samp{Message > Write Message to File...} menu item
1626@cindex menu item, @samp{Message > Write Message to File...}
1627@kindex >
1628@findex mh-write-msg-to-file
1629@item >
1630Append message to end of file (@code{mh-write-msg-to-file}).
1631@c -------------------------
1632@cindex @samp{Message > Pipe Message to Command...} menu item
1633@cindex menu item, @samp{Message > Pipe Message to Command...}
1634@kindex |
1635@findex mh-pipe-msg
1636@item |
1637Pipe message through shell command (@code{mh-pipe-msg}).
1638@c -------------------------
1639@kindex C-d
1640@findex mh-delete-msg-no-motion
1641@item C-d
1642Delete range, don't move to next message
1643(@code{mh-delete-msg-no-motion}).
1644@c -------------------------
1645@cindex @samp{Message > Delete Message} menu item
1646@cindex menu item, @samp{Message > Delete Message}
1647@kindex d
1648@findex mh-delete-msg
1649@item d
1650Delete range (@code{mh-delete-msg}).
1651@c -------------------------
1652@kindex D ?
1653@findex mh-prefix-help
1654@item D ?
1655Display cheat sheet for the commands of the current prefix in
1656minibuffer (@code{mh-prefix-help}).
1657@c -------------------------
1658@kindex D SPC
1659@findex mh-page-digest
1660@item D @key{SPC}
1661Display next message in digest (@code{mh-page-digest}).
1662@c -------------------------
1663@kindex D BS
1664@findex mh-page-digest-backwards
1665@item D @key{BS}
1666Display previous message in digest (@code{mh-page-digest-backwards}).
1667@c -------------------------
1668@cindex @samp{Message > Burst Digest Message} menu item
1669@cindex menu item, @samp{Message > Burst Digest Message}
1670@kindex D b
1671@findex mh-burst-digest
1672@item D b
1673Break up digest into separate messages (@code{mh-burst-digest}).
1674@c -------------------------
1675@cindex @samp{Message > Go to Message by Number...} menu item
1676@cindex menu item, @samp{Message > Go to Message by Number...}
1677@kindex g
1678@findex mh-goto-msg
1679@item g
1680Go to a message (@code{mh-goto-msg}).
1681@c -------------------------
1682@kindex k
1683@findex mh-delete-subject-or-thread
1684@item k
1685Delete messages with same subject or thread
1686(@code{mh-delete-subject-or-thread}).
1687@c -------------------------
1688@kindex K ?
1689@findex mh-prefix-help
1690@item K ?
1691Display cheat sheet for the commands of the current prefix in
1692minibuffer (@code{mh-prefix-help}).
1693@c -------------------------
1694@kindex K TAB
1695@findex mh-next-button
1696@item K @key{TAB}
1697Go to the next button (@code{mh-next-button}).
1698@c -------------------------
1699@kindex K S-TAB
1700@findex mh-prev-button
1701@item K S-@key{TAB}
1702Go to the previous button (@code{mh-prev-button}).
1703@c -------------------------
1704@kindex K a
1705@findex mh-mime-save-parts
1706@item K a
1707Save attachments (@code{mh-mime-save-parts}).
1708@c -------------------------
1709@kindex K e
1710@findex mh-display-with-external-viewer
1711@item K e
1712View attachment externally (@code{mh-display-with-external-viewer}).
1713@c -------------------------
1714@kindex K i
1715@findex mh-folder-inline-mime-part
1716@item K i
1717Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1718@c -------------------------
1719@kindex K o
1720@findex mh-folder-save-mime-part
1721@item K o
1722Save (output) attachment (@code{mh-folder-save-mime-part}).
1723@c -------------------------
1724@kindex K t
1725@findex mh-toggle-mime-buttons
1726@item K t
1727Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1728(@code{mh-toggle-mime-buttons}).
1729@c -------------------------
1730@kindex K v
1731@findex mh-folder-toggle-mime-part
1732@item K v
1733View attachment (@code{mh-folder-toggle-mime-part}).
1734@c -------------------------
1735@cindex @samp{Message > Modify Message} menu item
1736@cindex menu item, @samp{Message > Modify Message}
1737@kindex M
1738@findex mh-modify
1739@item M
1740Edit message (@code{mh-modify}).
1741@c -------------------------
1742@cindex @samp{Message > Go to First Message} menu item
1743@cindex menu item, @samp{Message > Go to First Message}
1744@kindex M-<
1745@findex mh-first-msg
1746@item M-<
1747Display first message (@code{mh-first-msg}).
1748@c -------------------------
1749@cindex @samp{Message > Go to Last Message} menu item
1750@cindex menu item, @samp{Message > Go to Last Message}
1751@kindex M->
1752@findex mh-last-msg
1753@item M->
1754Display last message (@code{mh-last-msg}).
1755@c -------------------------
1756@kindex M-n
1757@findex mh-next-unread-msg
1758@item M-n
1759Display next unread message (@code{mh-next-unread-msg}).
1760@c -------------------------
1761@kindex M-p
1762@findex mh-previous-unread-msg
1763@item M-p
1764Display previous unread message (@code{mh-previous-unread-msg}).
1765@c -------------------------
1766@cindex @samp{Message > Next Message} menu item
1767@cindex menu item, @samp{Message > Next Message}
1768@kindex n
1769@findex mh-next-undeleted-msg
1770@item n
1771Display next message (@code{mh-next-undeleted-msg}).
1772@c -------------------------
1773@cindex @samp{Message > Previous Message} menu item
1774@cindex menu item, @samp{Message > Previous Message}
1775@kindex p
1776@findex mh-previous-undeleted-msg
1777@item p
1778Display previous message (@code{mh-previous-undeleted-msg}).
1779@c -------------------------
1780@kindex P ?
1781@findex mh-prefix-help
1782@item P ?
1783Display cheat sheet for the commands of the current prefix in
1784minibuffer (@code{mh-prefix-help}).
1785@c -------------------------
1786@kindex P C
1787@findex mh-ps-print-toggle-color
1788@item P C
1789Toggle whether color is used in printing messages
1790(@code{mh-ps-print-toggle-color}).
1791@c -------------------------
1792@kindex P F
1793@findex mh-ps-print-toggle-faces
1794@item P F
1795Toggle whether printing is done with faces or not
1796(@code{mh-ps-print-toggle-faces}).
1797@c -------------------------
1798@kindex P f
1799@findex mh-ps-print-msg-file
1800@item P f
1801Print range to file (@code{mh-ps-print-msg-file}).
1802@c -------------------------
1803@cindex @samp{Message > Print Message} menu item
1804@cindex menu item, @samp{Message > Print Message}
1805@kindex P l
1806@findex mh-print-msg
1807@item P l
1808Print range the old fashioned way
1809(@code{mh-print-msg}).
1810@c -------------------------
1811@kindex P p
1812@findex mh-ps-print-msg
1813@item P p
1814Print range (@code{mh-ps-print-msg}).
1815@c -------------------------
1816@kindex X ?
1817@findex mh-prefix-help
1818@item X ?
1819Display cheat sheet for the commands of the current prefix in
1820minibuffer (@code{mh-prefix-help}).
1821@c -------------------------
1822@cindex @samp{Message > Unpack Uuencoded Message...} menu item
1823@cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1824@kindex X s
1825@kindex X u
1826@findex mh-store-msg
1827@item X s
1828@itemx X u
1829Unpack message created with @command{uudecode} or @command{shar}
1830(@code{mh-store-msg}).
1831@c -------------------------
1832@kindex mouse-2
1833@findex mh-show-mouse
1834@item mouse-2
1835Move point to mouse event and show message (@code{mh-show-mouse}).
1836@end table
1837
1838Within the MH-Show buffer, the following command is defined.
1839
1840@table @kbd
1841@kindex RET
1842@kindex mouse-1
1843@kindex mouse-2
1844@findex mh-press-button
1845@item @key{RET}
1846@itemx mouse-1
1847@itemx mouse-2
1848View contents of button (@code{mh-press-button}).
1849@end table
1850
1851@cindex @samp{mh-show} customization group
1852@cindex customization group, @samp{mh-show}
1853
1854The following table lists options in the @samp{mh-show} customization
1855group that are used while reading mail.
1856
1857@vtable @code
1858@item mh-bury-show-buffer-flag
1859On means show buffer is buried (default: @samp{on}).
1860@c -------------------------
1861@item mh-clean-message-header-flag
1862On means remove extraneous header fields (default: @samp{on}).
1863@c -------------------------
1864@item mh-decode-mime-flag
1865On means attachments are handled (default: @samp{on} if the Gnus
1866@samp{mm-decode} package is present).
1867@c -------------------------
1868@item mh-display-buttons-for-alternatives-flag
1869On means display buttons for all alternative attachments (default:
1870@samp{off}).
1871@c -------------------------
1872@item mh-display-buttons-for-inline-parts-flag
1873On means display buttons for all inline attachments (default:
1874@samp{off}).
1875@c -------------------------
1876@item mh-do-not-confirm-flag
1877On means non-reversible commands do not prompt for confirmation
1878(default: @samp{off}).
1879@c -------------------------
1880@item mh-fetch-x-image-url
1881Control fetching of @samp{X-Image-URL:} header field image (default:
1882@samp{Never Fetch}).
1883@c -------------------------
1884@item mh-graphical-smileys-flag
1885On means graphical smileys are displayed (default: @samp{on}).
1886@c -------------------------
1887@item mh-graphical-emphasis-flag
1888On means graphical emphasis is displayed (default: @samp{on}).
1889@c -------------------------
1890@item mh-highlight-citation-style
1891Style for highlighting citations (default: @samp{Multicolor}).
1892@c -------------------------
1893@item mh-invisible-header-fields-default
1894List of hidden header fields (default: a checklist too long to list
1895here).
1896@c -------------------------
1897@item mh-invisible-header-fields
1898Additional header fields to hide (default: @code{nil}).
1899@c -------------------------
1900@item mh-lpr-command-format
1901Command used to print (default: @code{"lpr -J '%s'"}).
1902@c -------------------------
1903@item mh-max-inline-image-height
1904Maximum inline image height if @samp{Content-Disposition:} is not
1905present (default: 0).
1906@c -------------------------
1907@item mh-max-inline-image-width
1908Maximum inline image width if @samp{Content-Disposition:} is not
1909present(default: 0).
1910@c -------------------------
1911@item mh-mhl-format-file
1912Specifies the format file to pass to the @command{mhl} program
1913(default: @samp{Use Default mhl Format (Printing Only)}).
1914@c -------------------------
1915@item mh-mime-save-parts-default-directory
1916Default directory to use for @kbd{K a}.
1917@c -------------------------
1918@item mh-print-background-flag
1919On means messages should be printed in the background (default:
1920@samp{off}).
1921@c -------------------------
1922@item mh-show-buffer-mode-line-buffer-id
1923Format string to produce @code{mode-line-buffer-identification} for
1924show buffers (default: @code{"    @{show-%s@} %d"}).
1925@c -------------------------
1926@item mh-show-maximum-size
1927Maximum size of message (in bytes) to display automatically (default:
19280).
1929@c -------------------------
1930@item mh-show-use-xface-flag
1931On means display face images in MH-Show buffers (default: @samp{on}).
1932@c -------------------------
1933@item mh-store-default-directory
1934Default directory for @kbd{X s} (default: @samp{Current}).
1935@c -------------------------
1936@item mh-summary-height
1937Number of lines in MH-Folder buffer (including the mode line)
1938(default: depends on size of frame).
1939@end vtable
1940
1941The following hooks are available.
1942
1943@vtable @code
1944@item mh-delete-msg-hook
1945Hook run after marking each message for deletion (default: @code{nil}).
1946@c -------------------------
1947@item mh-show-hook
1948Hook run after @key{RET} shows a message (default: @code{nil}).
1949@c -------------------------
1950@item mh-show-mode-hook
1951Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1952@end vtable
1953
1954The following faces are available.
1955
1956@vtable @code
1957@item mh-show-cc
1958Face used to highlight @samp{cc:} header fields.
1959@c -------------------------
1960@item mh-show-date
1961Face used to highlight @samp{Date:} header fields.
1962@c -------------------------
1963@item mh-show-from
1964Face used to highlight @samp{From:} header fields.
1965@c -------------------------
1966@item mh-show-header
1967Face used to deemphasize less interesting header fields.
1968@c -------------------------
1969@item mh-show-pgg-bad
1970Bad PGG signature face.
1971@c -------------------------
1972@item mh-show-pgg-good
1973Good PGG signature face.
1974@c -------------------------
1975@item mh-show-pgg-unknown
1976Unknown or untrusted PGG signature face.
1977@c -------------------------
1978@item mh-show-signature
1979Signature face.
1980@c -------------------------
1981@item mh-show-subject
1982Face used to highlight @samp{Subject:} header fields.
1983@c -------------------------
1984@item mh-show-to
1985Face used to highlight @samp{To:} header fields.
1986@c -------------------------
1987@item mh-show-xface
1988X-Face image face.
1989@end vtable
1990
1991The functions and variables introduced here are explained in more
1992detail in the following sections.
1993
1994@menu
1995* Viewing::
1996* Viewing Attachments::
1997* HTML::
1998* Digests::
1999* Reading PGP::
2000* Printing::
2001* Files and Pipes::
2002* Navigating::
2003* Miscellaneous Commands and Options::
2004@end menu
2005
2006@node Viewing, Viewing Attachments, Reading Mail, Reading Mail
2007@section Viewing Your Mail
2008
2009@findex mh-header-display
2010@findex mh-page-msg
2011@findex mh-previous-page
2012@findex mh-show
2013@findex mh-show-mouse
2014@kindex , @r{(comma)}
2015@kindex . @r{(period)}
2016@kindex BS
2017@kindex RET
2018@kindex SPC
2019@kindex mouse-2
2020
2021The command @key{RET} (@code{mh-show}) displays the message that the
2022cursor is on while @kbd{mouse-2} (@code{mh-show-mouse}) displays the
2023message that the mouse cursor is on. If the message is already
2024displayed, it scrolls to the beginning of the message. Use @key{SPC}
2025(@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
2026forwards and backwards one page at a time through the message. You can
2027give either of these commands a prefix argument that specifies the
2028number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
2029command will also show the next undeleted message if it is used at the
2030bottom of a message. MH-E normally hides a lot of the superfluous
2031header fields that mailers add to a message, but if you wish to see
2032all of them, use the command @kbd{,} (comma;
2033@code{mh-header-display}).
2034
2035@vindex mh-show-maximum-size
2036
2037The option @code{mh-show-maximum-size} provides an opportunity to skip
2038over large messages which may be slow to load. The default value of 0
2039means that all message are shown regardless of size.
2040
2041A litany of options control what displayed messages look like.
2042
2043@vindex mh-show-cc
2044@vindex mh-show-date
2045@vindex mh-show-from
2046@vindex mh-show-header
2047@vindex mh-show-subject
2048@vindex mh-show-to
2049
2050First, the appearance of the header fields can be modified by
2051customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
2052@code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
2053The face @code{mh-show-header} is used to deemphasize the other, less
2054interesting, header fields.
2055
2056@cindex regular expressions, @code{mh-invisible-header-fields}
2057@vindex mh-clean-message-header-flag
2058@vindex mh-invisible-header-fields
2059@vindex mh-invisible-header-fields-default
2060
2061Normally messages are delivered with a handful of uninteresting header
2062fields. These are hidden by turning on the option
2063@code{mh-clean-message-header-flag} (which it is by default). The
2064header fields listed in the option
2065@code{mh-invisible-header-fields-default} are hidden, although you can
2066check off any field that you would like to see. Header fields that you
2067would like to hide that aren't listed can be added to the option
2068@code{mh-invisible-header-fields} with a couple of caveats. Regular
2069expressions are not allowed. Unique fields should have a @samp{:}
2070suffix; otherwise, the element can be used to render invisible an
2071entire class of fields that start with the same prefix. If you think a
2072header field should be generally ignored, please update
2073@uref{https://sourceforge.net/p/mh-e/bugs/245/, SF #245}.
2074
2075@cindex header field, @samp{Face}
2076@cindex header field, @samp{X-Face}
2077@cindex header field, @samp{X-Image-URL}
2078@cindex @samp{Face} header field
2079@cindex @samp{X-Face} header field
2080@cindex @samp{X-Image-URL} header field
2081@vindex mh-show-use-xface-flag
2082
2083MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
2084@samp{X-Image-URL:} header fields. If any of these fields occur in the
2085header of your message, the sender's face will appear in the
2086@samp{From:} header field. If more than one of these fields appear,
2087then the first field found in the order @samp{Face:}, @samp{X-Face:},
2088and @samp{X-Image-URL:} will be used. The option
2089@code{mh-show-use-xface-flag} is used to turn this feature on and off.
2090This feature will be turned on by default if your system supports it.
2091
2092The first header field used, if present, is the Gnus-specific
2093@samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
2094Emacs 21 and XEmacs. For more information, see
2095@uref{https://quimby.gnus.org/circus/face/}.}.
2096
2097@cindex @command{uncompface}
2098@cindex Emacs, packages, @samp{x-face}
2099@cindex Unix commands, @command{uncompface}
2100@cindex @samp{x-face} package
2101@vindex mh-show-xface
2102
2103@c FIXME: These URLs do not seem to work any more.
2104Next is the traditional @samp{X-Face:} header field@footnote{The
2105display of this field requires the
2106@uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
2107@command{uncompface} program}. Recent versions of XEmacs have internal
2108support for @samp{X-Face:} images. If your version of XEmacs does not,
2109then you'll need both @command{uncompface} and the
2110@uref{http://www.jpl.org/ftp/pub/elisp/, @samp{x-face} package}.}. MH-E
2111renders the foreground and background of the image using the
2112associated attributes of the face @code{mh-show-xface}.
2113
2114@cindex @command{convert}
2115@cindex @command{wget}
2116@cindex ImageMagick
2117@cindex Unix commands, @command{convert}
2118@cindex Unix commands, @command{wget}
2119@vindex mh-fetch-x-image-url
2120
2121Finally, MH-E will display images referenced by the
2122@samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
2123@samp{X-Face:} fields are present@footnote{The display of the images
2124requires the @uref{https://www.gnu.org/software/wget/wget.html,
2125@command{wget} program} to fetch the image and the @command{convert}
2126program from the @uref{https://www.imagemagick.org/script/index.php,
2127ImageMagick suite}.}. Of the three header fields this is the most
2128efficient in terms of network usage since the image doesn't need to be
2129transmitted with every single mail. The option
2130@code{mh-fetch-x-image-url} controls the fetching of the
2131@samp{X-Image-URL:} header field image with the following values:
2132
2133@table @samp
2134@item Ask Before Fetching
2135You are prompted before the image is fetched. MH-E will remember your
2136reply and will either use the already fetched image the next time the
2137same URL is encountered or silently skip it if you didn't fetch it the
2138first time. This is a good setting.
2139@c -------------------------
2140@item Never Fetch
2141Images are never fetched and only displayed if they are already
2142present in the cache. This is the default.
2143@end table
2144
2145There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
2146of service) reasons. For example, fetching a URL can tip off a spammer
2147that you've read his email (which is why you shouldn't blindly answer
2148yes if you've set this option to @samp{Ask Before Fetching}). Someone
2149may also flood your network and fill your disk drive by sending a
2150torrent of messages, each specifying a unique URL to a very large
2151file.
2152
2153@cindex @file{.mhe-x-image-cache}
2154@cindex files, @file{.mhe-x-image-cache}
2155
2156The cache of images is found in the directory
2157@file{.mhe-x-image-cache} within your MH directory. You can add your
2158own face to the @samp{From:} field too. @xref{Picture}.
2159
2160@cindex @command{mhl}
2161@cindex MH commands, @command{mhl}
2162@vindex mh-mhl-format-file
2163
2164Normally MH-E takes care of displaying messages itself (rather than
2165calling an MH program to do the work). If you'd rather have
2166@command{mhl} display the message (within MH-E), change the option
2167@code{mh-mhl-format-file} from its default value of @samp{Use Default
2168mhl Format (Printing Only)}. You can set this option to @samp{Use
2169Default mhl Format} to get the same output as you would get if you ran
2170@command{mhl} from the shell. If you have a format file that you want
2171MH-E to use, you can set this option to @samp{Specify an mhl Format
2172File} and enter the name of your format file (@command{mhl}(1) or
2173section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2174the MH book tells you how to write one). Your format file should
2175specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2176parse the header. Note that @command{mhl} is always used for printing
2177and forwarding; in this case, the value of @code{mh-mhl-format-file}
2178is consulted if you have specified a format file.
2179
2180@cindex citations, highlighting
2181@cindex highlighting citations
2182@vindex mh-highlight-citation-style
2183
2184If the sender of the message has cited other messages in his message,
2185then MH-E will highlight these citations to emphasize the sender's
2186actual response. The option @code{mh-highlight-citation-style} can be
2187customized to change the highlighting style. The @samp{Multicolor}
2188method uses a different color for each indentation while the
2189@samp{Monotone} method highlights all citations in red. To disable
2190highlighting of citations entirely, choose @samp{None}.
2191
2192@cindex URLs, highlighting
2193@cindex email addresses, highlighting
2194@cindex highlighting URLs
2195@cindex highlighting email addresses
2196@cindex links, following
2197@findex goto-address-at-point
2198@kindex C-c RET
2199@kindex mouse-2
2200@vindex goto-address-highlight-p
2201
2202Email addresses and URLs in the message are highlighted if the option
2203@code{goto-address-highlight-p} is on, which it is by default. To view
2204the web page for a highlighted URL or to send a message using a
2205highlighted email address, use @kbd{mouse-2} or @kbd{C-c @key{RET}}
2206(@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
2207configure Emacs to send the message using MH-E.
2208
2209@cindex boldface, showing
2210@cindex emphasis
2211@cindex italics, showing
2212@cindex smileys
2213@cindex typesetting
2214@cindex underline, showing
2215@vindex gnus-emphasis-alist
2216@vindex mh-decode-mime-flag
2217@vindex mh-graphical-emphasis-flag
2218@vindex mh-graphical-smileys-flag
2219
2220It is a long standing custom to inject body language using a
2221cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2222render these as graphical widgets if the option
2223@code{mh-graphical-smileys-flag} is turned on, which it is by default.
2224Smileys include patterns such as :-) and ;-). Similarly, a few
2225typesetting features are indicated in ASCII text with certain
2226characters. If your terminal supports it, MH-E can render these
2227typesetting directives naturally if the option
2228@code{mh-graphical-emphasis-flag} is turned on, which it is by
2229default. For example, _underline_ will be
2230@ifhtml
2231@html
2232<u>underlined</u>,
2233@end html
2234@end ifhtml
2235@ifnothtml
2236underlined,
2237@end ifnothtml
2238*bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2239and so on. See the option @code{gnus-emphasis-alist} for the whole
2240list. Both of these options are disabled if the option
2241@code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2242
2243@cindex signature separator
2244@cindex vCard
2245@vindex mh-show-signature
2246
2247MH-E normally renders signatures and vCards in italics so that the
2248body of the message stands out more. MH-E depends on the presence of
2249the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2250customize the face @code{mh-show-signature} so the appearance of the
2251signature block is more to your liking.
2252
2253@vindex mh-show-hook
2254@vindex mh-show-mode-hook
2255
2256Two hooks can be used to control how messages are displayed. The first
2257hook, @code{mh-show-mode-hook}, is called early on in the process of
2258the message display. It is usually used to perform some action on the
2259message's buffer. The second hook, @code{mh-show-hook}, is the last
2260thing called after messages are displayed. It's used to affect the
2261message's content, the behavior of MH-E in general, or when
2262@code{mh-show-mode-hook} is too early.
2263
2264@cindex MH-Show mode
2265@cindex modes, MH-Show
2266@vindex mh-show-buffer-mode-line-buffer-id
2267
2268For those who like to modify their mode lines, use
2269@code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2270the MH-Show buffers. Place the two escape strings @samp{%s} and
2271@samp{%d}, which will display the folder name and the message number,
2272respectively, somewhere in the string in that order. The default value
2273of @code{"@{show-%s@} %d"} yields a mode line of
2274
2275@smallexample
2276-----@{show-+inbox@} 4      (MH-Show)--Bot--------------------------------
2277@end smallexample
2278
2279@node Viewing Attachments, HTML, Viewing, Reading Mail
2280@section Viewing Attachments
2281
2282@cindex attachments
2283@cindex body parts
2284@cindex @command{mhshow}
2285@cindex @command{show}
2286@cindex MH commands, @command{mhshow}
2287@cindex MH commands, @command{show}
2288@cindex MIME
2289@cindex multimedia mail
2290
2291MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2292Mail Extensions) messages which are simply messages with additional
2293@dfn{body parts} or @dfn{attachments}. You can use the MH commands
2294@command{show}@footnote{See the section
2295@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2296prev} in the MH book.} or @command{mhshow}@footnote{See the section
2297@uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2298the MH book.} from the shell to read @sc{mime} messages@footnote{You
2299can call them directly from Emacs if you're running the X Window
2300System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2301leave out the @samp{xterm -e} if you use @command{mhlist} or
2302@command{mhstore}.}.
2303
2304@cindex Emacs, packages, @samp{mm-decode}
2305@cindex @samp{mm-decode} package
2306@findex mh-toggle-mh-decode-mime-flag
2307@kindex ; @r{(semicolon)}
2308@vindex mh-decode-mime-flag
2309
2310MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2311package is present. If so, the option @code{mh-decode-mime-flag} will
2312be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2313or attachments. There isn't much point in turning off the option
2314@code{mh-decode-mime-flag}; however, you can inspect it if it appears
2315that the body parts are not being interpreted correctly or toggle it
2316with the command @kbd{;} (semicolon;
2317@code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2318option also controls the display of quoted-printable messages and
2319other graphical widgets. @xref{Viewing}.
2320
2321@cindex buttons
2322
2323Attachments in MH-E are indicated by @dfn{buttons} like this:
2324
2325@smallexample
2326[1. image/jpeg; foo.jpg]...
2327@end smallexample
2328
2329@findex mh-next-button
2330@findex mh-press-button
2331@findex mh-prev-button
2332@kindex RET
2333@kindex K TAB
2334@kindex K S-TAB
2335@kindex mouse-1
2336@kindex mouse-2
2337
2338To view the contents of the button, use either @kbd{mouse-1} or
2339@kbd{mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2340the cursor is over the button. This command is a toggle so if you use
2341it again on the same attachment, it is hidden. If Emacs does not know
2342how to display the attachment, then Emacs offers to save the
2343attachment in a file. To move the cursor to the next button, use the
2344command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2345buffer is reached then the search wraps over to the start of the
2346buffer. To move the cursor to the previous button, use the command
2347@kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2348buffer is reached then the search wraps over to the end of the buffer.
2349
2350@cindex attachments, viewing
2351@cindex viewing attachments
2352@findex mh-folder-toggle-mime-part
2353@kindex K v
2354
2355Another way to view the contents of a button is to use the command
2356@kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2357(or hides) the attachment associated with the button under the cursor.
2358If the cursor is not located over a button, then the cursor first
2359moves to the next button, wrapping to the beginning of the message if
2360necessary. This command has the advantage over the previous commands
2361of working from the MH-Folder buffer. You can also provide a numeric
2362prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2363with that number. If Emacs does not know how to display the
2364attachment, then Emacs offers to save the attachment in a file.
2365
2366@cindex @file{/etc/mailcap}
2367@cindex files, @file{/etc/mailcap}
2368@findex mailcap-mime-info
2369@findex mh-display-with-external-viewer
2370@kindex K e
2371
2372If Emacs does not know how to view an attachment, you could save it
2373into a file and then run some program to open it. It is easier,
2374however, to launch the program directly from MH-E with the command
2375@kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2376likely use this to view spreadsheets and documents, it is also useful
2377to use your browser to view HTML attachments with higher fidelity than
2378what Emacs can provide. This command displays the attachment
2379associated with the button under the cursor. If the cursor is not
2380located over a button, then the cursor first moves to the next button,
2381wrapping to the beginning of the message if necessary. You can provide
2382a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2383labeled with that number. This command tries to provide a reasonable
2384default for the viewer by calling the Emacs function
2385@code{mailcap-mime-info}. This function usually reads the file
2386@file{/etc/mailcap}.
2387
2388@cindex attachments, saving
2389@cindex saving attachments
2390@findex mh-folder-save-mime-part
2391@kindex K o
2392
2393Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2394attachments (the mnemonic is ``output''). This command saves the
2395attachment associated with the button under the cursor. If the cursor
2396is not located over a button, then the cursor first moves to the next
2397button, wrapping to the beginning of the message if necessary. You can
2398also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2399attachment labeled with that number. This command prompts you for a
2400filename and suggests a specific name if it is available.
2401
2402@cindex @command{mhn}
2403@cindex @command{mhstore}
2404@cindex MH commands, @command{mhn}
2405@cindex MH commands, @command{mhstore}
2406@findex mh-mime-save-parts
2407@kindex K a
2408@vindex mh-mime-save-parts-default-directory
2409
2410You can save all of the attachments at once with the command @kbd{K a}
2411(@code{mh-mime-save-parts}). The attachments are saved in the
2412directory specified by the option
2413@code{mh-mime-save-parts-default-directory} unless you use a prefix
2414argument (as in @kbd{C-u K a}) in which case you are prompted for the
2415directory. These directories may be superseded by MH profile
2416components, since this function calls on @command{mhstore}
2417(@command{mhn}) to do the work.
2418
2419@vindex mh-mime-save-parts-default-directory
2420
2421The default value for the option
2422@code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2423that you are always prompted for the directory in which to save the
2424attachments. However, if you usually use the same directory within a
2425session, then you can set this option to @samp{Prompt the First Time}
2426to avoid the prompt each time. you can make this directory permanent
2427by choosing @samp{Directory} and entering the directory's name.
2428
2429@cindex attachments, inline
2430@cindex inline attachments
2431@findex mh-toggle-mime-buttons
2432@kindex K t
2433@vindex mh-display-buttons-for-inline-parts-flag
2434
2435The sender can request that attachments should be viewed inline so
2436that they do not really appear like an attachment at all to the
2437reader. Most of the time, this is desirable, so by default MH-E
2438suppresses the buttons for inline attachments. On the other hand, you
2439may receive code or HTML which the sender has added to his message as
2440inline attachments so that you can read them in MH-E@. In this case, it
2441is useful to see the buttons so that you know you don't have to cut
2442and paste the code into a file; you can simply save the attachment. If
2443you want to make the buttons visible for inline attachments, you can
2444use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2445the visibility of these buttons. You can turn on these buttons
2446permanently by turning on the option
2447@code{mh-display-buttons-for-inline-parts-flag}.
2448
2449MH-E cannot display all attachments inline however. It can display
2450text (including @sc{html}) and images.
2451
2452@cindex header field, @samp{Content-Disposition}
2453@cindex inline images
2454@cindex @samp{Content-Disposition} header field
2455@vindex mh-max-inline-image-height
2456@vindex mh-max-inline-image-width
2457
2458Some older mail programs do not insert the needed
2459plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2460header field.} to tell MH-E whether to display the attachments inline
2461or not. If this is the case, MH-E will display these images inline if
2462they are smaller than the window. However, you might want to allow
2463larger images to be displayed inline. To do this, you can change the
2464options @code{mh-max-inline-image-width} and
2465@code{mh-max-inline-image-height} from their default value of zero to
2466a large number. The size of your screen is a good choice for these
2467numbers.
2468
2469@cindex alternatives
2470@cindex attachments, alternatives
2471@vindex mh-display-buttons-for-alternatives-flag
2472
2473Sometimes, a mail program will produce multiple alternatives of an
2474attachment in increasing degree of faithfulness to the original
2475content. By default, only the preferred alternative is displayed. If
2476the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2477the preferred part is shown inline and buttons are shown for each of
2478the other alternatives.
2479
2480@vindex mm-discouraged-alternatives
2481
2482Many people prefer to see the @samp{text/plain} alternative rather
2483than the @samp{text/html} alternative. To do this in MH-E, customize
2484the option @code{mm-discouraged-alternatives}, and add
2485@samp{text/html}. The next best alternative, if any, will be shown.
2486
2487@findex mh-show-preferred-alternative
2488@kindex : @r{(colon)}
2489
2490Occasionally, though, you might want to see the preferred alternative.
2491The command @kbd{:} (@code{mh-show-preferred-alternative}) displays
2492the message with the default preferred alternative. This is as if
2493@code{mm-discouraged-alternatives} is set to @samp{nil}. Use the
2494command @key{RET} (@code{mh-show}) to show the message normally again.
2495
2496@kindex K i
2497@findex mh-folder-inline-mime-part
2498
2499You can view the raw contents of an attachment with the command @kbd{K
2500i} (@code{mh-folder-inline-mime-part}). This command displays (or
2501hides) the contents of the attachment associated with the button under
2502the cursor verbatim. If the cursor is not located over a button, then
2503the cursor first moves to the next button, wrapping to the beginning
2504of the message if necessary. You can also provide a numeric prefix
2505argument (as in @kbd{4 K i}) to view the attachment labeled with that
2506number.
2507
2508For additional information on buttons, see
2509@ifinfo
2510@ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2511@end ifinfo
2512@ifnotinfo
2513the chapters @uref{https://www.gnus.org/manual/gnus_101.html#SEC101,
2514Article Buttons} and
2515@uref{https://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2516in the @cite{The Gnus Manual}.
2517@end ifnotinfo
2518
2519@node HTML, Digests, Viewing Attachments, Reading Mail
2520@section HTML
2521
2522@cindex HTML
2523@cindex Gnus
2524
2525MH-E can display messages that have been sent in HTML. The
2526content of the message will appear in the MH-Show buffer as you would
2527expect if the entire message is HTML, or there is an inline HTML body
2528part. However, if there is an HTML body part that is an attachment,
2529then you'll see a button like this:
2530
2531@smallexample
2532[1. text/html; foo.html]...
2533@end smallexample
2534
2535To see how to read the contents of this body part, see @ref{Viewing
2536Attachments}.
2537
2538@vindex mm-text-html-renderer
2539
2540The browser that MH-E uses is determined by the option
2541@code{mm-text-html-renderer}. The default setting is set automatically
2542based upon the presence of a known browser on your system. If you wish
2543to use a different browser, then set this option accordingly. See the
2544documentation for the browser you use for additional information on
2545how to use it. In particular, find and disable the option to render
2546images, as displaying remote images can tip off spammers that the
2547email address they have used is valid.
2548
2549@vindex mm-text-html-renderer
2550
2551If you're confused about which @code{mm-text-html-renderer} to use,
2552here's a brief description of each, sorted by name.
2553
2554@table @asis
2555@cindex browser, @samp{gnus-w3m}
2556@cindex @samp{gnus-w3m}
2557@cindex browser, @samp{w3m}
2558@cindex @samp{w3m}
2559@item @samp{gnus-w3m}
2560The @samp{gnus-w3m} browser requires an external program. It's quick,
2561produces pretty nice output, and it highlights links. It renders
2562@samp{&ndash;} and @samp{&reg;} okay. It sometimes fails to wrap lines
2563properly. It always downloads remote images.
2564@c -------------------------
2565@cindex browser, @samp{html2text}
2566@cindex @samp{html2text}
2567@item @samp{html2text}
2568The @samp{html2text} browser requires an external program. Some users
2569have reported problems with it, such as filling the entire message as
2570if it were one paragraph, or displaying chunks of raw HTML.
2571@c -------------------------
2572@cindex browser, @samp{links}
2573@cindex @samp{links}
2574@item @samp{links}
2575The @samp{links} browser requires an external program. It's quick, and
2576produces nicer output than @samp{lynx} on single column mails in
2577tables. However, it doesn't show links and it doesn't do as nice a job
2578on multi-column tables as some lines wrap. It does do a good job of
2579fitting text within 80 columns. It appears to render special
2580characters using ASCII equivalents. For example, @samp{&reg;} appears
2581as (R). It does not download images.
2582@c -------------------------
2583@cindex browser, @samp{lynx}
2584@cindex @samp{lynx}
2585@item @samp{lynx}
2586The @samp{lynx} browser requires an external program. It's quick and
2587produces pretty decent output but it doesn't show links. It doesn't
2588seem to do multi-column tables which makes output much cleaner. It
2589centers the output and wraps long lines more than most. It does not
2590always handle special characters like @samp{&reg;} or @samp{&ndash;}.
2591It does not download images.
2592@c -------------------------
2593@item @samp{shr}
2594@cindex @samp{shr}
2595This choice does not require an external program, but it does require
2596that Emacs be configured at build time to use @samp{libxml2}. It is
2597fairly quick, it highlights links, and it supports HTML color
2598declarations. It renders @samp{&ndash;} and @samp{&reg;} okay. It
2599sometimes truncates text, particularly if the message tries to have
2600fancy text layout. By default it does not download images; this
2601behavior is controlled by the options @code{mm-html-blocked-images}
2602and @code{mm-html-inhibit-images}
2603@ifinfo
2604(@pxref{Display Customization,,,emacs-mime}).
2605@end ifinfo
2606@ifnotinfo
2607(see section @uref{https://www.gnus.org/manual/emacs-mime_6.html,
2608Display Customization} in the @cite{The Emacs MIME Manual}).
2609@end ifnotinfo
2610@c -------------------------
2611@cindex browser, @samp{w3m}
2612@cindex @samp{w3m}
2613@kindex mouse-2
2614@item @samp{w3m}
2615The @samp{w3m} browser requires an external program. It's quick,
2616produces pretty nice output, and it highlights links. These can be
2617clicked with @kbd{mouse-2} to view the content of the link in
2618@samp{w3m}. The @samp{w3m} browser handles tables well and actually
2619respects the table's width parameter (which can cause text to wrap if
2620the author didn't anticipate that the page would be viewed in Emacs).
2621It does not download images by default; this behavior is controlled by
2622the option @code{mm-w3m-safe-url-regexp}
2623@ifinfo
2624(@pxref{Display Customization,,,emacs-mime}).
2625@end ifinfo
2626@ifnotinfo
2627(see section @uref{https://www.gnus.org/manual/emacs-mime_6.html,
2628Display Customization} in the @cite{The Emacs MIME Manual}).
2629@end ifnotinfo
2630@c -------------------------
2631@cindex browser, @samp{w3m-standalone}
2632@cindex @samp{w3m-standalone}
2633@cindex browser, @samp{w3m}
2634@cindex @samp{w3m}
2635@item @samp{w3m-standalone}
2636This browser is quick, but does not show links. It handles simple
2637tables but some tables get rendered much wider than the Emacs frame.
2638This browser renders @samp{&ndash;} and @samp{&reg;} okay. It does not
2639download images.
2640@end table
2641
2642@vindex mm-text-html-renderer
2643
2644For a couple more sources of information about
2645@code{mm-text-html-renderer},
2646@ifinfo
2647@xref{Display Customization,,,emacs-mime}, and the documentation for
2648the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus}).
2649@end ifinfo
2650@ifnotinfo
2651see section @uref{https://www.gnus.org/manual/emacs-mime_6.html,
2652Display Customization} in the @cite{The Emacs MIME Manual} and the
2653documentation for the Gnus command @kbd{W h} (see section
2654@uref{https://www.gnus.org/manual/gnus_48.html#Article-Washing, Article
2655Washing} in the
2656@cite{The Gnus Manual}).
2657@end ifnotinfo
2658
2659@cindex @file{.emacs}
2660@cindex files, @file{.emacs}
2661@findex browse-url-at-mouse
2662@kindex S-mouse-2
2663
2664A useful key binding that you can add to @file{~/.emacs} is the
2665following which displays an HTML link or textual URL in an external
2666browser when clicked with @kbd{S-mouse-2}. This binding works in any
2667buffer, including HTML buffers.
2668
2669@smalllisp
2670(global-set-key [S-mouse-2] 'browse-url-at-mouse)
2671@end smalllisp
2672
2673@node Digests, Reading PGP, HTML, Reading Mail
2674@section Digests
2675
2676@cindex digests
2677@findex mh-page-digest
2678@findex mh-page-digest-backwards
2679@kindex D BS
2680@kindex D SPC
2681@kindex BS
2682@kindex SPC
2683
2684A digest is a message that contains other messages. Special MH-E
2685commands let you read digests conveniently. You can use @key{SPC} and
2686@key{BS} to page through the digest as if it were a normal message,
2687but if you wish to skip to the next message in the digest, use
2688@kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2689use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2690
2691@cindex @command{burst}
2692@cindex MH commands, @command{burst}
2693@cindex MH-Folder Show mode
2694@cindex modes, MH-Folder Show
2695@findex mh-burst-digest
2696@kindex d
2697@kindex D b
2698@kindex t
2699
2700Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2701command uses the MH command @command{burst}@footnote{See the section
2702@uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2703book.} to break out each message in the digest into its own message.
2704Using this command, you can quickly delete unwanted messages, like
2705this: Once the digest is split up, toggle out of MH-Folder Show mode
2706with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2707and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2708to quickly delete messages that you don't want to read (based on the
2709@samp{Subject:} header field). You can also burst the digest to reply
2710directly to the people who posted the messages in the digest. One
2711problem you may encounter is that the @samp{From:} header fields are
2712preceded with a @samp{>} so that your reply can't create the
2713@samp{To:} field correctly. In this case, you must correct the
2714@samp{To:} field yourself. This is described later (@pxref{Editing
2715Drafts}).
2716
2717@node Reading PGP, Printing, Digests, Reading Mail
2718@section Signed and Encrypted Messages
2719
2720@cindex GPG
2721@cindex GnuPG
2722@cindex Gnus
2723@cindex OpenPGP
2724@cindex PGP
2725@cindex RFC 3156
2726@cindex encrypted messages
2727@cindex security
2728@cindex signed messages
2729
2730You can read encrypted or signed PGP or GPG messages with
2731MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2732@cite{MIME Security with OpenPGP} is documented in
2733@uref{https://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2734MH-E can also decrypt old-style PGP messages that are not in MIME
2735format.}. This section assumes that you already have a good
2736understanding of GPG and have set up your keys appropriately.
2737
2738If someone sends you a signed message, here is what you'll see:
2739
2740@smallexample
2741@group
2742[[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2743This is a signed message.
2744
2745[[End of PGP Signed Part]]
2746@end group
2747@end smallexample
2748
2749@cindex keychain
2750@cindex key server
2751@cindex signed messages
2752
2753If the key for the given signature is not in your keychain, you'll be
2754given the opportunity to fetch the key from a key server and verify
2755the key. If the message is really large, the verification process can
2756take a long time. You can press @kbd{C-g} at any time to
2757cancel@footnote{Unfortunately in the current version, the validation
2758process doesn't display a message so it appears that MH-E has hung. We
2759hope that this will be fixed in the future.}.
2760
2761If the signature doesn't check out, you might see something like this:
2762
2763@smallexample
2764@group
2765[[PGP Signed Part:Failed]]
2766This is a signed message.
2767This is garbage added after the signature was made.
2768
2769[[End of PGP Signed Part]]
2770@end group
2771@end smallexample
2772
2773@cindex decrypting messages
2774
2775If someone sends you an encrypted message, MH-E will ask for your
2776passphrase to decrypt the message. You should see something like this:
2777
2778@smallexample
2779@group
2780[[PGP Encrypted Part:OK]]
2781
2782[[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2783This is the secret message.
2784
2785[[End of PGP Signed Part]]
2786
2787[[End of PGP Encrypted Part]]
2788@end group
2789@end smallexample
2790
2791If there is a problem decrypting the message, the button will say:
2792
2793@smallexample
2794[[PGP Encrypted Part:Failed]]
2795@end smallexample
2796
2797You can read the contents of this button using the methods described in
2798@ref{Viewing Attachments}. If the message were corrupted, you'd see
2799this:
2800
2801@smallexample
2802[[PGP Encrypted Part:Failed]
2803Invalid base64 data]
2804@end smallexample
2805
2806If your passphrase were incorrect, you'd see something like this:
2807
2808@smallexample
2809[GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2810[GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2811[GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2812[GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2813gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2814      "Bill Wohler <wohler@@stop.mail-abuse.org>"
2815gpg: public key decryption failed: bad passphrase
2816[GNUPG:] BEGIN_DECRYPTION
2817[GNUPG:] DECRYPTION_FAILED
2818gpg: decryption failed: secret key not available
2819[GNUPG:] END_DECRYPTION
2820
2821gpg exited abnormally: '2'
2822@end smallexample
2823
2824@vindex mh-show-pgg-bad
2825@vindex mh-show-pgg-good
2826@vindex mh-show-pgg-unknown
2827
2828The appearance of the buttons is controlled by the faces
2829@code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2830@code{mh-show-pgg-unknown} depending on the validity of the signature.
2831The latter is used whether the signature is unknown or untrusted.
2832
2833@cindex @samp{pgg} customization group
2834@cindex PGG
2835@cindex customization group, @samp{pgg}
2836
2837The @samp{pgg} customization group may have some settings which may
2838interest you.
2839@iftex
2840See @cite{The PGG Manual}.
2841@end iftex
2842@ifinfo
2843@xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2844@end ifinfo
2845@ifhtml
2846See
2847@uref{https://www.gnu.org/software/emacs/manual/pgg.html,
2848@cite{The PGG Manual}}.
2849@end ifhtml
2850
2851@node Printing, Files and Pipes, Reading PGP, Reading Mail
2852@section Printing Your Mail
2853
2854@cindex printing
2855@findex mh-ps-print-msg
2856@findex mh-ps-print-msg-file
2857@kindex P f
2858@kindex P p
2859@vindex mh-lpr-command-format
2860@vindex mh-print-background-flag
2861
2862To print messages in MH-E, use the command @kbd{P p}
2863(@code{mh-ps-print-msg}). You can print all the messages in a range
2864(as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2865@pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2866(@code{mh-ps-print-msg-file}). This command will print inline text
2867attachments but will not decrypt messages. However, when a message is
2868displayed in an MH-Show buffer, then that buffer is used verbatim for
2869printing with the caveat that only text attachments, if opened inline,
2870are printed. Therefore, encrypted messages can be printed by showing
2871and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2872use the options @code{mh-lpr-command-format} or
2873@code{mh-print-background-flag}, described below.
2874
2875@findex mh-ps-print-toggle-color
2876@kindex P C
2877@vindex ps-print-color-p
2878
2879Colors are emulated on black-and-white printers with shades of gray.
2880This might produce illegible output, even if your screen colors only
2881use shades of gray. If this is the case, try using the command @kbd{P
2882C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2883color, and a black and white representation of the colors and see
2884which works best. You change this setting permanently by customizing
2885the option @code{ps-print-color-p}.
2886
2887@findex mh-ps-print-toggle-faces
2888@kindex P F
2889
2890Another related function is the command @kbd{P F}
2891(@code{mh-ps-print-toggle-faces}). This command toggles between using
2892faces and not. When faces are enabled, the printed message will look
2893very similar to the message in the MH-Show buffer.
2894
2895@cindex @samp{ps-print} package
2896@cindex Emacs, packages, @samp{ps-print}
2897
2898MH-E uses the @samp{ps-print} package to do the printing, so you can
2899customize the printing further by going to the @samp{ps-print}
2900customization group.
2901
2902@cindex @command{lpr}
2903@cindex @command{mhl}
2904@cindex MH commands, @command{mhl}
2905@cindex Unix commands, @command{lpr}
2906@findex mh-print-msg
2907@kindex P l
2908
2909An alternative to using the @samp{ps-print} package is the command
2910@kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2911@i{l}pr). You can print all the messages in a range. The message is
2912formatted with @command{mhl}@footnote{See the section
2913@uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2914book.} and printed with the @command{lpr} command.
2915
2916@kindex P f
2917@kindex P l
2918@kindex P p
2919@vindex mh-lpr-command-format
2920@vindex mh-print-background-flag
2921
2922The command @kbd{P l} uses two options. The option
2923@code{mh-lpr-command-format} contains the Unix command line which
2924performs the actual printing. The string can contain one escape,
2925@samp{%s}, which is replaced by the name of the folder and the message
2926number and is useful for print job names. The default setting is
2927@code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2928-P"} which produces a nice header and adds a bit of margin so the text
2929fits within my printer's margins. Normally messages are printed in the
2930foreground. If this is slow on your system, you may elect to turn on
2931the option @code{mh-print-background-flag} to print in the background.
2932If you do this, do not delete the message until it is printed or else
2933the output may be truncated. These options are not used by the
2934commands @kbd{P p} or @kbd{P f}.
2935
2936@node Files and Pipes, Navigating, Printing, Reading Mail
2937@section Files and Pipes
2938
2939@cindex files
2940@cindex pipes
2941@findex mh-refile-or-write-again
2942@findex mh-write-msg-to-file
2943@kindex >
2944@kindex !
2945
2946MH-E does offer a couple of commands that are not a part of MH@. The
2947first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2948a file. You are prompted for the filename. If the file already exists,
2949the message is appended to it. You can also write the message to the
2950file without the header by specifying a prefix argument (such as
2951@kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2952can be made with the command @kbd{!}
2953(@code{mh-refile-or-write-again}).
2954
2955@findex mh-pipe-msg
2956@kindex |
2957@kindex l
2958
2959You can also pipe the message through a Unix shell command with the
2960command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2961command through which you wish to run your message. If you give a
2962prefix argument to this command, the message header is included in the
2963text passed to the command (the contrived example @kbd{C-u | lpr}
2964would be done with the @kbd{l} command instead).
2965
2966@cindex @command{shar}
2967@cindex @command{uuencode}
2968@cindex Unix commands, @command{shar}
2969@cindex Unix commands, @command{uuencode}
2970@findex mh-store-msg
2971@kindex X s
2972@vindex mh-store-default-directory
2973
2974If the message is a shell archive @command{shar} or has been run
2975through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2976extract the body of the message. The default directory for extraction
2977is the current directory; however, you have a chance to specify a
2978different extraction directory. The next time you use this command,
2979the default directory is the last directory you used. If you would
2980like to change the initial default directory, customize the option
2981@code{mh-store-default-directory}, change the value from
2982@samp{Current} to @samp{Directory}, and then enter the name of the
2983directory for storing the content of these messages.
2984
2985@findex mh-store-buffer
2986@kindex RET
2987@kindex X s
2988
2989By the way, @kbd{X s} calls the Emacs Lisp function
2990@code{mh-store-buffer}. I mention this because you can use it directly
2991if you're editing a buffer that contains a file that has been run
2992through @command{uuencode} or @command{shar}. For example, you can
2993extract the contents of the current buffer in your home directory by
2994typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
2995
2996@node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
2997@section Navigating
2998
2999@cindex moving between messages
3000@cindex navigation
3001@findex mh-first-msg
3002@findex mh-goto-msg
3003@findex mh-last-msg
3004@findex mh-next-undeleted-msg
3005@findex mh-next-unread-msg
3006@findex mh-previous-undeleted-msg
3007@findex mh-previous-unread-msg
3008@kindex g
3009@kindex M-<
3010@kindex M->
3011@kindex M-n
3012@kindex M-p
3013@kindex n
3014@kindex p
3015
3016To move on to the next message, use the command @kbd{n}
3017(@code{mh-next-undeleted-msg}); use @kbd{p}
3018(@code{mh-previous-undeleted-msg}) to read the previous message. To
3019move to the next unread message, use @kbd{M-n}
3020(@code{mh-next-unread-msg}); use @kbd{M-p}
3021(@code{mh-previous-unread-msg}) to move to the previous unread
3022message. These commands can be given a prefix argument to specify how
3023many messages to skip (for example, @kbd{5 n}). You can also move to a
3024specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
3025message number either before or after typing @kbd{g}. In the latter
3026case, Emacs prompts you. Finally, you can go to the first or last
3027message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
3028(@code{mh-last-msg}) respectively.
3029
3030@cindex MH-Folder mode
3031@cindex modes, MH-Folder
3032@findex next-line
3033@findex previous-line
3034@kindex C-n
3035@kindex C-p
3036@kindex RET
3037
3038You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
3039and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
3040the MH-Folder window. These commands can be used in conjunction with
3041@key{RET} to look at deleted or refiled messages.
3042
3043@cindex deleting messages
3044@findex mh-delete-msg
3045@kindex d
3046@kindex n
3047@kindex p
3048
3049To mark a message for deletion, use the command @kbd{d}
3050(@code{mh-delete-msg}). A @samp{D} is placed by the message in the
3051scan window, and the next undeleted message is displayed. If the
3052previous command had been @kbd{p}, then the next message displayed is
3053the first undeleted message previous to the message just deleted. Use
3054@kbd{n} to force subsequent @kbd{d} commands to move forward to the
3055next undeleted message after deleting the message under the cursor.
3056You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
3057frombob @key{RET}}, @pxref{Ranges}).
3058
3059@findex mh-delete-msg-no-motion
3060@kindex C-d
3061
3062The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
3063message (or messages in range) for deletion but leaves the cursor at
3064the current message in case you wish to perform other operations on
3065the message.
3066
3067@findex mh-delete-subject
3068@findex mh-delete-subject-or-thread
3069@findex mh-thread-delete
3070@findex mh-undo
3071@kindex k
3072@kindex T d
3073@kindex u
3074
3075And to delete more messages faster, you can use @kbd{k}
3076(@code{mh-delete-subject-or-thread}) to delete all the messages with
3077the same subject as the current message. This command puts these
3078messages in a sequence named @samp{subject}. You can undo this action
3079by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
3080specifying the @samp{subject} sequence. However, if the buffer is
3081displaying a threaded view of the folder then @kbd{k} behaves like
3082@kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
3083
3084@findex mh-execute-commands
3085@kindex x
3086
3087However you mark a message for deletion, the command @kbd{x}
3088(@code{mh-execute-commands}) actually carries out the deletion
3089(@pxref{Folders}).
3090
3091@vindex mh-delete-msg-hook
3092
3093The hook @code{mh-delete-msg-hook} is called after you mark a message
3094for deletion. For example, a past maintainer of MH-E used this once
3095when he kept statistics on his mail usage.
3096
3097@node Miscellaneous Commands and Options,  , Navigating, Reading Mail
3098@section Miscellaneous Commands and Options
3099
3100This section contains a few more miscellaneous commands and options.
3101
3102@cindex editing message
3103@findex mh-modify
3104@kindex M
3105
3106There are times when you need to edit a message. For example, you may
3107need to fix a broken Content-Type header field. You can do this with
3108the command @kbd{M} (@code{mh-modify}). It displays the raw message in
3109an editable buffer. When you are done editing, save and kill the
3110buffer as you would any other.
3111
3112@findex mh-kill-folder
3113@findex mh-pack-folder
3114@vindex mh-do-not-confirm-flag
3115
3116Commands such as @code{mh-pack-folder} prompt to confirm whether to
3117process outstanding moves and deletes or not before continuing.
3118Turning on the option @code{mh-do-not-confirm-flag} means that these
3119actions will be performed---which is usually desired but cannot be
3120retracted---without question@footnote{In previous versions of MH-E,
3121this option suppressed the confirmation in @code{mh-kill-folder}.
3122Since this kept most users from setting this option,
3123@code{mh-kill-folder} was modified in version 6.0 to always ask for
3124confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
3125@xref{Folders}.}.
3126
3127@cindex MH-Folder mode
3128@cindex modes, MH-Folder
3129@vindex mh-summary-height
3130
3131The option @code{mh-summary-height} controls the number of scan lines
3132displayed in the MH-Folder window, including the mode line. The
3133default value of this option is @samp{Automatic} which means that the
3134MH-Folder buffer will maintain the same proportional size if the frame
3135is resized. If you'd prefer a fixed height, then choose the
3136@samp{Fixed Size} option and enter the number of lines you'd like to
3137see.
3138
3139@vindex mh-bury-show-buffer-flag
3140
3141Normally the buffer for displaying messages is buried at the bottom at
3142the buffer stack. You may wish to disable this feature by turning off
3143the option @code{mh-bury-show-buffer-flag}. One advantage of not
3144burying the show buffer is that one can delete the show buffer more
3145easily in an electric buffer list because of its proximity to its
3146associated MH-Folder buffer. Try running @kbd{M-x
3147electric-buffer-list} to see what I mean.
3148
3149@cindex @file{.emacs}
3150@cindex files, @file{.emacs}
3151@cindex reading mail
3152
3153Before we leave this section, I'll include a function that I use as a
3154front end to MH-E@footnote{Stephen Gildea's favorite binding is
3155@kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
3156working window configuration, which may be quite involved---windows
3157filled with source, compilation output, man pages, and other
3158documentation---and your MH-E window configuration. Like the rest of
3159the customization described in this section, simply add the following
3160code to @file{~/.emacs}.
3161
3162@iftex
3163@filbreak
3164@end iftex
3165
3166@findex mh-rmail@r{, example}
3167
3168@smalllisp
3169@group
3170(defvar my-mh-screen-saved nil
3171  "Set to non-nil when MH-E window configuration shown.")
3172(defvar my-normal-screen nil "Normal window configuration.")
3173(defvar my-mh-screen nil "MH-E window configuration.")
3174
3175(defun my-mh-rmail (&optional arg)
3176  "Toggle between MH-E and normal screen configurations.
3177With non-nil or prefix argument, include mailbox as well
3178when going into mail."
3179  (interactive "P")                 ; @r{user callable function, P=prefix arg}
3180  (setq my-mh-screen-saved          ; @r{save state}
3181        (cond
3182         ;; @r{Bring up MH-E screen if arg or normal window configuration.}
3183         ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
3184         ((or arg (null my-mh-screen-saved))
3185          (setq my-normal-screen (current-window-configuration))
3186          (if (or arg (null (get-buffer "+inbox")))
3187              (mh-rmail)
3188            (set-window-configuration my-mh-screen))
3189          t)                        ; @r{set my-mh-screen-saved to @code{t}}
3190         ;; @r{Otherwise, save MH-E screen and restore normal screen.}
3191         (t
3192          (setq my-mh-screen (current-window-configuration))
3193          (set-window-configuration my-normal-screen)
3194          nil))))                   ; @r{set my-mh-screen-saved to nil}
3195
3196(global-set-key "\C-x\r" 'my-mh-rmail)  ;@r{ call with C-x @key{RET}}
3197
3198@i{Starting MH-E}
3199
3200@end group
3201@end smalllisp
3202
3203If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
3204@code{nil} (meaning a non-MH-E window configuration), the current
3205window configuration is saved, either the @samp{+inbox} buffer is
3206displayed or @code{mh-rmail} is run, and the MH-E window configuration
3207is shown. Otherwise, the MH-E window configuration is saved and the
3208original configuration is displayed.
3209
3210@node Folders, Sending Mail, Reading Mail, Top
3211@chapter Organizing Your Mail with Folders
3212
3213@cindex @samp{Folder} menu
3214@cindex @samp{Message} menu
3215@cindex folders
3216@cindex menu, @samp{Folder}
3217@cindex menu, @samp{Message}
3218@cindex using folders
3219
3220This chapter discusses the things you can do with folders within MH-E@.
3221The commands in this chapter are also found in the @samp{Folder} and
3222@samp{Message} menus.
3223
3224@table @kbd
3225@kindex ?
3226@findex mh-help
3227@item ?
3228Display cheat sheet for the MH-E commands (@code{mh-help}).
3229@c -------------------------
3230@kindex !
3231@findex mh-refile-or-write-again
3232@item !
3233Repeat last output command (@code{mh-refile-or-write-again}).
3234@c -------------------------
3235@cindex @samp{Message > Copy Message to Folder...} menu item
3236@cindex menu item, @samp{Message > Copy Message to Folder...}
3237@kindex c
3238@findex mh-copy-msg
3239@item c
3240Copy range to folder (@code{mh-copy-msg}).
3241@c -------------------------
3242@kindex F ?
3243@findex mh-prefix-help
3244@item F ?
3245Display cheat sheet for the commands of the current prefix in
3246minibuffer (@code{mh-prefix-help}).
3247@c -------------------------
3248@kindex F '
3249@findex mh-index-ticked-messages
3250@item F '
3251Display ticked messages (@code{mh-index-ticked-messages}).
3252@c -------------------------
3253@kindex F c
3254@findex mh-catchup
3255@item F c
3256Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3257@c -------------------------
3258@kindex F k
3259@findex mh-kill-folder
3260@item F k
3261Remove folder (@code{mh-kill-folder}).
3262@c -------------------------
3263@cindex @samp{Folder > List Folders} menu item
3264@cindex menu item, @samp{Folder > List Folders}
3265@kindex F l
3266@findex mh-list-folders
3267@item F l
3268List all folders (@code{mh-list-folders}).
3269@c -------------------------
3270@cindex @samp{Folder > View New Messages} menu item
3271@cindex menu item, @samp{Folder > View New Messages}
3272@kindex F n
3273@findex mh-index-new-messages
3274@item F n
3275Display unseen messages (@code{mh-index-new-messages}).
3276@c -------------------------
3277@cindex @samp{Folder > Pack Folder} menu item
3278@cindex menu item, @samp{Folder > Pack Folder}
3279@kindex F p
3280@findex mh-pack-folder
3281@item F p
3282Pack folder (@code{mh-pack-folder}).
3283@c -------------------------
3284@kindex F q
3285@findex mh-index-sequenced-messages
3286@item F q
3287Display messages in any sequence (@code{mh-index-sequenced-messages}).
3288@c -------------------------
3289@cindex @samp{Folder > Rescan Folder} menu item
3290@cindex menu item, @samp{Folder > Rescan Folder}
3291@kindex F r
3292@findex mh-rescan-folder
3293@item F r
3294Rescan folder (@code{mh-rescan-folder}).
3295@c -------------------------
3296@cindex @samp{Folder > Search...} menu item
3297@cindex menu item, @samp{Folder > Search...}
3298@kindex F s
3299@findex mh-search
3300@item F s
3301Search your MH mail (@code{mh-search}).
3302@c -------------------------
3303@cindex @samp{Folder > Sort Folder} menu item
3304@cindex menu item, @samp{Folder > Sort Folder}
3305@kindex F S
3306@findex mh-sort-folder
3307@item F S
3308Sort folder (@code{mh-sort-folder}).
3309@c -------------------------
3310@kindex F u
3311@findex mh-undo-folder
3312@item F u
3313Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3314@c -------------------------
3315@cindex @samp{Folder > Visit a Folder...} menu item
3316@cindex menu item, @samp{Folder > Visit a Folder...}
3317@kindex F v
3318@findex mh-visit-folder
3319@item F v
3320Visit folder (@code{mh-visit-folder}).
3321@c -------------------------
3322@cindex @samp{Message > Refile Message} menu item
3323@cindex menu item, @samp{Message > Refile Message}
3324@kindex o
3325@findex mh-refile-msg
3326@item o
3327Refile (output) range into folder (@code{mh-refile-msg}).
3328@c -------------------------
3329@cindex @samp{Folder > Quit MH-E} menu item
3330@cindex menu item, @samp{Folder > Quit MH-E}
3331@kindex q
3332@findex mh-quit
3333@item q
3334Quit the current MH-E folder (@code{mh-quit}).
3335@c -------------------------
3336@cindex @samp{Folder > Toggle Show/Folder} menu item
3337@cindex menu item, @samp{Folder > Toggle Show/Folder}
3338@kindex t
3339@findex mh-toggle-showing
3340@item t
3341Toggle between MH-Folder and MH-Folder Show modes
3342(@code{mh-toggle-showing}).
3343@c -------------------------
3344@cindex @samp{Message > Undo Delete/Refile} menu item
3345@cindex menu item, @samp{Message > Undo Delete/Refile}
3346@kindex u
3347@findex mh-undo
3348@item u
3349Undo pending deletes or refiles in range (@code{mh-undo}).
3350@c -------------------------
3351@cindex @samp{Message > Execute Delete/Refile} menu item
3352@cindex menu item, @samp{Message > Execute Delete/Refile}
3353@kindex x
3354@findex mh-execute-commands
3355@item x
3356Process outstanding delete and refile requests
3357(@code{mh-execute-commands}).
3358@end table
3359
3360@cindex @samp{mh-folder} customization group
3361@cindex customization group, @samp{mh-folder}
3362
3363The @samp{mh-folder} customization group is used to tune these
3364commands.
3365
3366@vtable @code
3367@item mh-new-messages-folders
3368Folders searched for the @samp{unseen} sequence (default:
3369@code{Inbox}).
3370@c -------------------------
3371@item mh-ticked-messages-folders
3372Folders searched for @code{mh-tick-seq} (default: @code{t}).
3373@c -------------------------
3374@item mh-large-folder
3375The number of messages that indicates a large folder (default: 200).
3376@c -------------------------
3377@item mh-recenter-summary-flag
3378On means to recenter the summary window (default: @samp{off}).
3379@c -------------------------
3380@item mh-recursive-folders-flag
3381On means that commands which operate on folders do so recursively
3382(default: @samp{off}).
3383@c -------------------------
3384@item mh-sortm-args
3385Additional arguments for @command{sortm} (default: @code{nil}).
3386@end vtable
3387
3388The following hooks are available.
3389
3390@vtable @code
3391@item mh-after-commands-processed-hook
3392Hook run by @kbd{x} after performing outstanding refile and delete
3393requests (default: @code{nil}).
3394@c -------------------------
3395@item mh-before-commands-processed-hook
3396Hook run by @kbd{x} before performing outstanding refile and delete
3397requests (default: @code{nil}).
3398@c -------------------------
3399@item mh-before-quit-hook
3400Hook run by q before quitting MH-E (default: @code{nil}).
3401@c -------------------------
3402@item mh-folder-mode-hook
3403Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3404@code{nil}).
3405@c -------------------------
3406@item mh-kill-folder-suppress-prompt-hook
3407Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3408@code{'mh-search-p}).
3409@c -------------------------
3410@item mh-pack-folder-hook
3411Hook run by @code{mh-pack-folder} after renumbering the messages
3412(default: @code{nil}).
3413@c -------------------------
3414@item mh-quit-hook
3415Hook run by q after quitting MH-E (default: @code{nil}).
3416@c -------------------------
3417@item mh-refile-msg-hook
3418Hook run by o after marking each message for refiling (default:
3419@code{nil}).
3420@end vtable
3421
3422The following faces are available for customizing the appearance of
3423the MH-Folder buffer. @xref{Scan Line Formats}.
3424
3425@vtable @code
3426@item mh-folder-address
3427Recipient face.
3428@c -------------------------
3429@item mh-folder-body
3430Body text face.
3431@c -------------------------
3432@item mh-folder-cur-msg-number
3433Current message number face.
3434@c -------------------------
3435@item mh-folder-date
3436Date face.
3437@c -------------------------
3438@item mh-folder-deleted
3439Deleted message face.
3440@c -------------------------
3441@item mh-folder-followup
3442@samp{Re:} face.
3443@c -------------------------
3444@item mh-folder-msg-number
3445Message number face.
3446@c -------------------------
3447@item mh-folder-refiled
3448Refiled message face.
3449@c -------------------------
3450@vindex mh-scan-format-nmh
3451@vindex mh-scan-sent-to-me-sender-regexp
3452@item mh-folder-sent-to-me-hint
3453Fontification hint face in messages sent directly to us. The detection
3454of messages sent to us is governed by the scan format
3455@code{mh-scan-format-nmh} and regular expression
3456@code{mh-scan-sent-to-me-sender-regexp}.
3457@c -------------------------
3458@vindex mh-scan-format-nmh
3459@vindex mh-scan-sent-to-me-sender-regexp
3460@item mh-folder-scan-format
3461Sender face in messages sent directly to us. The detection of messages
3462sent to us is governed by the scan format @code{mh-scan-format-nmh}
3463and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3464@c -------------------------
3465@item mh-folder-subject
3466Subject face.
3467@c -------------------------
3468@item mh-folder-tick
3469Ticked message face.
3470@c -------------------------
3471@item mh-folder-to
3472@samp{To:} face.
3473@end vtable
3474
3475@vindex mh-folder-mode-hook
3476
3477The hook @code{mh-folder-mode-hook} is called when visiting a new
3478folder in MH-Folder mode. This could be used to set your own key
3479bindings, for example:
3480
3481@vindex mh-folder-mode-hook@r{, example}
3482
3483@smalllisp
3484@group
3485(defvar my-mh-init-done nil
3486  "Non-nil when one-time MH-E settings made.")
3487
3488(defun my-mh-folder-mode-hook ()
3489  "Hook to set key bindings in MH-Folder mode."
3490  (if (not my-mh-init-done)             ; @r{only need to bind the keys once }
3491      (progn
3492        (local-set-key "//" 'my-search-msg)
3493        (local-set-key "b" 'mh-burst-digest)    ; @r{better use of @kbd{b}}
3494        (setq my-mh-init-done t))))
3495
3496(add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3497
3498(defun my-search-msg ()
3499  "Search for a regexp in the current message."
3500  (interactive)                         ; @r{user function}
3501  (save-window-excursion
3502    (other-window 1)                    ; @r{go to next window}
3503    (isearch-forward-regexp)))          ; @r{string search; hit return}
3504                                        ; @r{  when done}
3505
3506@i{Create additional key bindings via mh-folder-mode-hook}
3507
3508@end group
3509@end smalllisp
3510
3511@cindex @command{folder}
3512@cindex @command{refile}
3513@cindex MH commands, @command{folder}
3514@cindex MH commands, @command{refile}
3515@findex mh-refile-msg
3516@kindex o
3517@vindex mh-refile-msg-hook
3518
3519MH-E has analogies for each of the MH @command{folder} and
3520@command{refile} commands@footnote{See the sections
3521@uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3522folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3523Linking Messages: refile} in the MH book.}. To refile a message in
3524another folder, use the command @kbd{o} (@code{mh-refile-msg})
3525(mnemonic: ``output''). You are prompted for the folder name
3526(@pxref{Folder Selection}). Note that this command can also be used to
3527create folders. If you specify a folder that does not exist, you will
3528be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3529after a message is marked to be refiled.
3530
3531@findex mh-write-msg-to-file
3532@kindex !
3533
3534If you are refiling several messages into the same folder, you can use
3535the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3536last refile or write (for the description of @kbd{>}
3537(@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3538range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3539@key{RET}}, @pxref{Ranges}).
3540
3541@cindex expunging refiles and deletes
3542@cindex undoing refiles and deletes
3543@findex mh-undo
3544@kindex u
3545
3546If you've deleted a message or refiled it, but changed your mind, you
3547can cancel the action before you've executed it. Use @kbd{u}
3548(@code{mh-undo}) to undo a refile on or deletion of a single message.
3549You can also undo refiles and deletes for messages that are found in a
3550given range (@pxref{Ranges}).
3551
3552@findex mh-undo-folder
3553@kindex F u
3554
3555Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3556all refiles and deletes in the current folder.
3557
3558@findex mh-execute-commands
3559@kindex x
3560
3561If you've marked messages to be deleted or refiled and you want to go
3562ahead and delete or refile the messages, use @kbd{x}
3563(@code{mh-execute-commands}). Many MH-E commands that may affect the
3564numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3565you want to process refiles or deletes first and then either run
3566@kbd{x} for you or undo the pending refiles and deletes.
3567
3568@kindex x
3569@vindex mh-after-commands-processed-hook
3570@vindex mh-before-commands-processed-hook
3571@vindex mh-current-folder
3572
3573The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3574before the commands are processed and
3575@code{mh-after-commands-processed-hook} after the commands are
3576processed. Variables that are useful with the former hook include
3577@code{mh-delete-list} and @code{mh-refile-list} which can be used to
3578see which changes will be made to the current folder,
3579@code{mh-current-folder}. Variables that are useful with the latter
3580hook include @code{mh-folders-changed}, which lists which folders were
3581affected by deletes and refiles. This list will always include the
3582current folder @code{mh-current-folder}.
3583
3584@findex mh-copy-msg
3585@kindex c
3586@kindex o
3587
3588If you wish to copy a message to another folder, you can use the
3589command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3590to @command{refile}(1)). Like the command @kbd{o}, this command
3591prompts you for the name of the target folder and you can specify a
3592range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3593takes place immediately. The original copy remains in the current
3594folder.
3595
3596@cindex junk mail
3597@cindex MH-Folder mode
3598@cindex MH-Folder Show mode
3599@cindex modes, MH-Folder
3600@cindex modes, MH-Folder Show
3601@cindex spam
3602@findex mh-toggle-showing
3603@kindex t
3604
3605The command @kbd{t} (@code{mh-toggle-showing}) switches between
3606MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3607this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3608the associated show buffer so that you can perform operations on the
3609messages quickly without reading them. This is an excellent way to
3610prune out your junk mail or to refile a group of messages to another
3611folder for later examination.
3612
3613@cindex MH-Folder mode
3614@cindex MH-Show mode
3615@cindex modes, MH-Folder
3616@cindex modes, MH-Show
3617@cindex moving between messages
3618@kindex t
3619@vindex mh-recenter-summary-flag
3620
3621When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder
3622mode, the MH-Show buffer is hidden and the MH-Folder buffer is left
3623alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil}
3624value causes the toggle to display as many scan lines as possible,
3625with the cursor at the middle. The effect of
3626@code{mh-recenter-summary-flag} is rather useful, but it can be
3627annoying on a slow network connection.
3628
3629@findex mh-visit-folder
3630@kindex F v
3631@vindex mh-large-folder
3632
3633When you want to read the messages that you have refiled into folders,
3634use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3635folder. You are prompted for the folder name. The folder buffer will
3636show just unseen messages if there are any; otherwise, it will show
3637all the messages in the buffer as long there are fewer than
3638@code{mh-large-folder} messages. If there are more, then you are
3639prompted for a range of messages to scan. You can provide a prefix
3640argument in order to specify a range of messages to show when you
3641visit the folder (@pxref{Ranges}). In this case, regions are not used
3642to specify the range and @code{mh-large-folder} is ignored. Note that
3643this command can also be used to create folders. If you specify a
3644folder that does not exist, you will be prompted to create it.
3645
3646@findex mh-search
3647@kindex F s
3648
3649If you forget where you've refiled your messages, you can find them
3650using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3651
3652@cindex @command{procmail}
3653@cindex @samp{unseen} sequence
3654@cindex sequence, @samp{unseen}
3655@cindex Unix commands, @command{procmail}
3656@cindex unseen messages, viewing
3657@findex mh-index-new-messages
3658@kindex F n
3659@vindex mh-new-messages-folders
3660
3661If you use a program such as @command{procmail} to file your incoming
3662mail automatically, you can display new, unseen, messages using the
3663command @kbd{F n} (@code{mh-index-new-messages}). All messages in the
3664@samp{unseen} sequence from the folders in
3665@code{mh-new-messages-folders} are listed. However, this list of
3666folders can be overridden with a prefix argument: with a prefix
3667argument, enter a space-separated list of folders, or nothing to
3668search all folders.
3669
3670@cindex @samp{tick} sequence
3671@cindex sequence, @samp{tick}
3672@cindex ticked messages, viewing
3673@findex mh-index-ticked-messages
3674@kindex F '
3675@vindex mh-ticked-messages-folders
3676
3677If you have ticked messages (@pxref{Sequences}), you can display them
3678using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3679messages in the @samp{tick} sequence from the folders in
3680@code{mh-ticked-messages-folders} are listed. With a prefix argument,
3681enter a space-separated list of folders, or nothing to search all
3682folders.
3683
3684@findex mh-index-sequenced-messages
3685@kindex F q
3686@vindex mh-new-messages-folders
3687
3688You can display messages in any sequence with the command @kbd{F q}
3689(@code{mh-index-sequenced-messages}). All messages from the folders in
3690@code{mh-new-messages-folders} in the sequence you provide are listed.
3691With a prefix argument, enter a space-separated list of folders at the
3692prompt, or nothing to search all folders.
3693
3694@vindex mh-new-messages-folders
3695@vindex mh-recursive-folders-flag
3696@vindex mh-ticked-messages-folders
3697
3698Set the options @code{mh-new-messages-folders} and
3699@code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3700@samp{+inbox} folder or @samp{All} to search all of the top level
3701folders. Otherwise, list the folders that should be searched with the
3702@samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3703
3704@cindex buffers, @file{*MH-E Folders*}
3705@cindex @file{*MH-E Folders*}
3706@findex mh-kill-folder
3707@findex mh-list-folders
3708@findex mh-pack-folder
3709@findex mh-rescan-folder
3710@findex mh-sort-folder
3711@kindex F k
3712@kindex F l
3713@kindex F p
3714@kindex F r
3715@kindex F S
3716
3717Other commands you can perform on folders include: @kbd{F l}
3718(@code{mh-list-folders}), to place a listing of all the folders in
3719your mail directory in a buffer called @file{*MH-E Folders*}
3720(@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3721a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3722date (see @command{sortm}(1) to see how to sort by other criteria);
3723@kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3724from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3725to rescan the folder, which is useful to grab all messages in your
3726@samp{+inbox} after processing your new mail for the first time. If
3727you don't want to rescan the entire folder, the commands @kbd{F r} or
3728@kbd{F p} will accept a range (@pxref{Ranges}).
3729
3730@kindex F p
3731@vindex mh-pack-folder-hook
3732
3733The command @kbd{F p} runs @code{mh-pack-folder-hook} after
3734renumbering the messages. A variable that is useful with this hook
3735is @code{mh-current-folder}.
3736
3737@kindex TAB
3738@vindex mh-recursive-folders-flag
3739
3740By default, operations on folders work only one level at a time. Set
3741@code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3742folders. This mostly means that you'll be able to see all your folders
3743when you press @key{TAB} when prompted for a folder name.
3744
3745@findex mh-search-p
3746@kindex k
3747@vindex mh-kill-folder-suppress-prompt-functions
3748
3749The hook @code{mh-kill-folder-suppress-prompt-functions} is an abnormal
3750hook run at the beginning of the command @kbd{k}. The hook functions
3751are called with no arguments and should return a non-@code{nil} value to
3752suppress the normal prompt when you remove a folder. This is useful
3753for folders that are easily regenerated. The default value of
3754@code{mh-search-p} suppresses the prompt on folders generated by
3755searching.
3756
3757@sp 1
3758@center @strong{NOTE}
3759
3760@quotation
3761Use this hook with care. If there is a bug in your hook which returns
3762@code{t} on @samp{+inbox} and you press @kbd{k} by accident in the
3763@code{+inbox} folder, you will not be happy.
3764@end quotation
3765@sp 1
3766
3767@cindex @command{sortm}
3768@cindex @file{.mh_profile}
3769@cindex files, @file{.mh_profile}
3770@cindex MH commands, @command{sortm}
3771@cindex MH profile component, @samp{sortm}
3772@cindex @samp{sortm} MH profile component
3773@kindex F S
3774@vindex mh-sortm-args
3775
3776The option @code{mh-sortm-args} holds extra arguments to pass on to
3777the command @command{sortm}@footnote{See the section
3778@uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3779MH book.} when a prefix argument is used with @kbd{F S}. Normally
3780default arguments to @command{sortm} are specified in the MH profile.
3781This option may be used to provide an alternate view. For example,
3782@samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3783
3784@cindex exiting
3785@cindex quitting
3786@findex mh-quit
3787@kindex q
3788
3789When you want to quit using MH-E and go back to editing, you can use
3790the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3791current MH-E folder and restores the buffers that were present when
3792you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3793buffers whose name begins with @samp{ *mh-} or @file{*MH-E }
3794(@pxref{Miscellaneous}). You can later restore your MH-E session by
3795selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3796again.
3797
3798@findex mh-execute-commands
3799@kindex q
3800@vindex mh-before-quit-hook
3801@vindex mh-before-quit-hook@r{, example}
3802@vindex mh-quit-hook
3803@vindex mh-quit-hook@r{, example}
3804
3805The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3806called by @kbd{q}. The former one is called before the quit occurs, so
3807you might use it to perform any MH-E operations; you could perform
3808some query and abort the quit or call @code{mh-execute-commands}, for
3809example. The latter is not run in an MH-E context, so you might use it
3810to modify the window setup. If you find that @kbd{q} buries a lot of
3811buffers that you would rather remove, you can use both
3812@code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
3813
3814@smalllisp
3815@group
3816(defvar my-mh-folder-buffer-to-delete nil
3817  "Folder buffer that is being quit.")
3818
3819(defun my-mh-before-quit-hook ()
3820  "Save folder buffer that is to be deleted."
3821  (setq my-mh-folder-buffer-to-delete (current-buffer)))
3822
3823(defun my-mh-quit-hook ()
3824  "Kill folder buffer rather than just bury it."
3825  (set-buffer my-mh-folder-buffer-to-delete)
3826  (if (get-buffer mh-show-buffer)
3827      (kill-buffer mh-show-buffer))
3828  (kill-buffer (current-buffer)))
3829
3830@i{Kill MH-Folder buffer instead of burying it}
3831@end group
3832@end smalllisp
3833
3834@cindex folders, renaming
3835@cindex renaming folders
3836@findex dired
3837@findex dired-do-rename
3838
3839You can use dired to manipulate the folders themselves. For example, I
3840renamed my @samp{+out} folder to the more common @samp{+outbox} by
3841running dired on my mail directory (@kbd{M-x dired @key{RET} ~/Mail
3842@key{RET}}), moving my cursor to @samp{out} and using the command
3843@kbd{R} (@code{dired-do-rename}).
3844
3845@node Sending Mail, Editing Drafts, Folders, Top
3846@chapter Sending Mail
3847
3848@cindex sending mail
3849@findex mh-smail
3850
3851You can send a mail message in several ways. You can call @kbd{M-x
3852mh-smail} directly, or from the command line like this:
3853
3854@cindex starting from command line
3855
3856@smallexample
3857$ @kbd{emacs -f mh-smail}
3858@end smallexample
3859
3860@findex goto-address-at-point
3861@vindex mail-user-agent
3862
3863There are some commands that need to send a mail message, such as
3864@code{goto-address-at-point}. You can configure Emacs to have these
3865commands use MH-E by setting the option @code{mail-user-agent} to
3866@samp{Emacs interface to MH}.
3867
3868@cindex @samp{Message} menu
3869@cindex menu, @samp{Message}
3870
3871From within MH-E's MH-Folder mode, other methods of sending mail are
3872available as well. These can also be found in the @samp{Message} menu.
3873
3874@table @kbd
3875@cindex @samp{Message > Edit Message Again} menu item
3876@cindex menu item, @samp{Message > Edit Message Again}
3877@kindex e
3878@findex mh-edit-again
3879@item e
3880Edit a message to send it again (@code{mh-edit-again}).
3881@c -------------------------
3882@cindex @samp{Message > Re-edit a Bounced Message} menu item
3883@cindex menu item, @samp{Message > Re-edit a Bounced Message}
3884@kindex E
3885@findex mh-extract-rejected-mail
3886@item E
3887Edit a message that was returned by the mail system
3888(@code{mh-extract-rejected-mail}).
3889@c -------------------------
3890@cindex @samp{Message > Forward Message...} menu item
3891@cindex menu item, @samp{Message > Forward Message...}
3892@kindex f
3893@findex mh-forward
3894@item f
3895Forward message (@code{mh-forward}).
3896@c -------------------------
3897@cindex @samp{Message > Reply to Message...} menu item
3898@cindex menu item, @samp{Message > Reply to Message...}
3899@kindex r
3900@findex mh-reply
3901@item r
3902Reply to a message (@code{mh-reply}).
3903@c -------------------------
3904@cindex @samp{Message > Compose a New Message} menu item
3905@cindex menu item, @samp{Message > Compose a New Message}
3906@kindex s
3907@findex mh-send
3908@item s
3909Compose a message (@code{mh-send}).
3910@c -------------------------
3911@cindex @samp{Message > Redistribute Message...} menu item
3912@cindex menu item, @samp{Message > Redistribute Message...}
3913@kindex M-d
3914@findex mh-redistribute
3915@item M-d
3916Redistribute a message (@code{mh-redistribute}).
3917@c -------------------------
3918@findex mh-smail
3919@item M-x mh-smail
3920Compose a message with the MH mail system.
3921@c -------------------------
3922@findex mh-smail-other-window
3923@item M-x mh-smail-other-window
3924Compose a message with the MH mail system in other window.
3925@end table
3926
3927@cindex @samp{mh-sending-mail} customization group
3928@cindex customization group, @samp{mh-sending-mail}
3929
3930In addition, several options from the @samp{mh-sending-mail}
3931customization group are useful when sending mail or replying to mail.
3932They are summarized in the following table.
3933
3934@vtable @code
3935@item mh-compose-forward-as-mime-flag
3936On means that messages are forwarded as attachments (default:
3937@samp{on}).
3938@c -------------------------
3939@item mh-compose-letter-function
3940Hook run when starting a new draft (default: @code{nil}).
3941@c -------------------------
3942@item mh-compose-prompt-flag
3943On means prompt for header fields when composing a new draft (default:
3944@samp{off}).
3945@c -------------------------
3946@item mh-forward-subject-format
3947Format string for forwarded message subject (default: @code{"%s:
3948%s"}).
3949@c -------------------------
3950@item mh-insert-x-mailer-flag
3951On means append an @samp{X-Mailer:} header field to the header
3952(default: @samp{on}).
3953@c -------------------------
3954@item mh-redist-full-contents-flag
3955On means the @command{dist} command needs entire letter for
3956redistribution (default: @samp{off}).
3957@c -------------------------
3958@item mh-reply-default-reply-to
3959Sets the person or persons to whom a reply will be sent (default:
3960@samp{Prompt}).
3961@c -------------------------
3962@item mh-reply-show-message-flag
3963On means the MH-Show buffer is displayed using @kbd{r}
3964(@code{mh-reply}) (default: @samp{on}).
3965@end vtable
3966
3967The following hooks are available.
3968
3969@vtable @code
3970@item mh-annotate-msg-hook
3971Hook run by @code{mh-annotate-msg} after annotation (default:
3972@code{nil}).
3973@c -------------------------
3974@item mh-forward-hook
3975Hook run by @code{mh-forward} on a forwarded letter (default:
3976@code{nil}).
3977@c -------------------------
3978@item mh-letter-mode-hook
3979Hook run by @code{mh-letter-mode} on a new letter (default:
3980@code{nil}).
3981@end vtable
3982
3983@findex mh-annotate-msg
3984@vindex mh-annotate-list
3985@vindex mh-annotate-msg-hook
3986@vindex mh-current-folder
3987
3988A hook that is called whenever a message is sent and after the scan
3989lines and message are annotated is @code{mh-annotate-msg-hook}. Hook
3990functions can access the current folder name with
3991@code{mh-current-folder} and obtain the message numbers of the
3992annotated messages with @code{mh-annotate-list}.
3993
3994The rest of the functions and options introduced here are explained in
3995more detail in the following sections.
3996
3997@menu
3998* Composing::
3999* Replying::
4000* Forwarding::
4001* Redistributing::
4002* Editing Again::
4003@end menu
4004
4005@node Composing, Replying, Sending Mail, Sending Mail
4006@section Composing
4007
4008@cindex @file{.emacs}
4009@cindex MH-Folder mode
4010@cindex composing mail
4011@cindex draft
4012@cindex files, @file{.emacs}
4013@cindex modes, MH-Folder
4014@cindex sending mail
4015@findex mh-smail
4016@findex mh-smail-other-window
4017
4018Outside of an MH-Folder buffer, you must call either @kbd{M-x
4019mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
4020The former command always creates a two-window layout with the current
4021buffer on top and the draft on the bottom. Use the latter command if
4022you would rather preserve the window layout. You may find adding the
4023following key bindings to @file{~/.emacs} useful:
4024
4025@smalllisp
4026(global-set-key "\C-xm" 'mh-smail)
4027(global-set-key "\C-x4m" 'mh-smail-other-window)
4028@end smalllisp
4029
4030@cindex draft folder
4031@cindex MH-Letter mode
4032@cindex modes, MH-Letter
4033@findex mh-send
4034@kindex m
4035
4036From within a MH-Folder buffer, you can simply use the command @kbd{m}
4037(@code{mh-send}). However you invoke @code{mh-send}, your letter
4038appears in an Emacs buffer whose mode is MH-Letter (to see what the
4039buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
4040you to edit your message, to check the validity of the recipients, to
4041insert attachments and other messages into your message, and to send
4042the message. We'll go more into depth about editing a
4043@dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
4044folder} so that you can edit several drafts in parallel. To do so,
4045create a folder named @samp{+drafts} for example, and add the profile
4046component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
4047message you're composing) in just a moment (@pxref{Editing Drafts}).
4048
4049@vindex mh-compose-prompt-flag
4050
4051If you prefer to be prompted for the recipient and subject fields
4052before the MH-Letter buffer appears, turn on the option
4053@code{mh-compose-prompt-flag}.
4054
4055@cindex header field, @samp{X-Mailer}
4056@cindex @samp{X-Mailer} header field
4057@vindex mh-insert-x-mailer-flag
4058
4059MH-E adds an @samp{X-Mailer:} header field to the header that includes
4060the version of MH-E and Emacs that you are using. If you don't want to
4061participate in our marketing, you can turn off the option
4062@code{mh-insert-x-mailer-flag}.
4063
4064@cindex @command{repl}
4065@cindex @file{components}
4066@cindex MH commands, @command{repl}
4067@cindex MH-Letter mode
4068@cindex Mail mode
4069@cindex files, @file{components}
4070@cindex modes, MH-Letter
4071@cindex modes, Mail
4072@vindex mail-mode-hook
4073@vindex mh-letter-mode-hook
4074@vindex text-mode-hook
4075
4076Two hooks are provided to run commands on your freshly created draft.
4077The first hook, @code{mh-letter-mode-hook}, allows you to do some
4078processing before editing a letter@footnote{Actually, because
4079MH-Letter mode inherits from Mail mode, the hooks
4080@code{text-mode-hook} and @code{mail-mode-hook} are run (in that
4081order) before @code{mh-letter-mode-hook}.}. For example, you may wish
4082to modify the header after @command{repl} has done its work, or you
4083may have a complicated @file{components} file and need to tell MH-E
4084where the cursor should go. Here's an example of how you would use
4085this hook.
4086
4087@findex mh-insert-signature@r{, example}
4088
4089@smalllisp
4090@group
4091(defvar letter-mode-init-done-flag nil
4092  "Non-nil means one-time MH-E settings have been made.")
4093
4094(defun my-mh-letter-mode-hook ()
4095  "Prepare letter for editing."
4096  (when (not letter-mode-init-done)     ; @r{only need to bind the keys once}
4097    (local-set-key "\C-ctb" 'add-enriched-text)
4098    (local-set-key "\C-cti" 'add-enriched-text)
4099    (local-set-key "\C-ctf" 'add-enriched-text)
4100    (local-set-key "\C-cts" 'add-enriched-text)
4101    (local-set-key "\C-ctB" 'add-enriched-text)
4102    (local-set-key "\C-ctu" 'add-enriched-text)
4103    (local-set-key "\C-ctc" 'add-enriched-text)
4104    (setq letter-mode-init-done t))
4105  (save-excursion
4106    (goto-char (point-max))             ; @r{go to end of message to}
4107    (mh-insert-signature)))             ;   @r{insert signature}
4108
4109@i{Prepare draft for editing via mh-letter-mode-hook}
4110
4111@end group
4112@end smalllisp
4113
4114The function, @code{add-enriched-text} is defined in the example in
4115@ref{Adding Attachments}.
4116
4117@vindex mh-compose-letter-function
4118@vindex mh-letter-mode-hook
4119
4120The second hook, a function really, is
4121@code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
4122is called just before editing a new message; however, it is the last
4123function called before you edit your message. The consequence of this
4124is that you can write a function to write and send the message for
4125you. This function is passed three arguments: the contents of the
4126@samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
4127
4128@node Replying, Forwarding, Composing, Sending Mail
4129@section Replying to Mail
4130
4131@cindex @command{mhl}
4132@cindex @file{mhl.reply}
4133@cindex MH commands, @command{mhl}
4134@cindex files, @file{mhl.reply}
4135@cindex replying
4136@findex mh-reply
4137@kindex r
4138
4139To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
4140command.
4141
4142When you reply to a message, you are first prompted with @samp{Reply
4143to whom?}. You have several choices here.
4144
4145@quotation
4146@multitable @columnfractions .20 .80
4147@c @headitem Response @tab Reply Goes To
4148@c XXX @headitem not yet supported by SourceForge's texi2pdf.
4149@item @b{Response} @tab @b{Reply Goes To}
4150@c -------------------------
4151@item @kbd{from}
4152@tab
4153The person who sent the message. This is the default, so @key{RET} is
4154sufficient.
4155@c -------------------------
4156@item @kbd{to}
4157@tab
4158Replies to the sender, plus all recipients in the @samp{To:} header field.
4159@c -------------------------
4160@item @kbd{cc}@*@kbd{all}
4161@tab
4162Forms a reply to the addresses in the @samp{Mail-Followup-To:} header
4163field if one exists; otherwise forms a reply to the sender, plus all
4164recipients.
4165@end multitable
4166@end quotation
4167
4168@cindex @command{repl}
4169@cindex MH commands, @command{repl}
4170@vindex mh-reply-default-reply-to
4171
4172Depending on your answer, @command{repl}@footnote{See the section
4173@uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4174the MH book.} is given a different argument to form your reply.
4175Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4176-nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
4177either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}. If you
4178find that most of the time you specify one of these choices when you
4179reply to a message, you can change the option
4180@code{mh-reply-default-reply-to} from its default value of
4181@samp{Prompt} to one of the choices listed above. You can always edit
4182the recipients in the draft.
4183
4184@cindex @samp{repl} MH profile component
4185@cindex MH profile component, @samp{repl}
4186@cindex MH-Letter mode
4187@cindex MH-Show mode
4188@cindex draft
4189@cindex modes, MH-Letter
4190@cindex modes, MH-Show
4191
4192Two windows are then created. One window contains the message to which
4193you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
4194(@pxref{Editing Drafts}), is in the other window. If the reply draft
4195was not one that you expected, check the things that affect the
4196behavior of @command{repl} which include the @samp{repl:} profile
4197component and the @file{replcomps} and @file{replgroupcomps} files.
4198
4199If you supply a prefix argument (as in @kbd{C-u r}), the message you
4200are replying to is inserted in your reply after having first been run
4201through @command{mhl} with the format file @file{mhl.reply}. See
4202@command{mhl}(1) or the section
4203@uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4204book to see how you can modify the default @file{mhl.reply} file.
4205
4206@vindex mh-yank-behavior
4207
4208Alternatively, you can customize the option @code{mh-yank-behavior}
4209and choose one of its @samp{Automatically} variants to do the same
4210thing. @xref{Inserting Letter}. If you do so, the prefix argument has
4211no effect.
4212
4213Another way to include the message automatically in your draft is to
4214use @samp{repl: -filter repl.filter} in your MH profile.
4215
4216@vindex mh-reply-show-message-flag
4217
4218If you include the message automatically, you can hide the MH-Show
4219buffer by turning off the option @code{mh-reply-show-message-flag}.
4220
4221If you wish to customize the header or other parts of the reply draft,
4222please see @command{repl}(1) and @code{mh-format}(5).
4223
4224@node Forwarding, Redistributing, Replying, Sending Mail
4225@section Forwarding Mail
4226
4227@cindex @command{forw}
4228@cindex draft
4229@cindex forwarding
4230@cindex MH commands, @command{forw}
4231@findex mh-forward
4232@kindex f
4233@vindex mh-forward-hook
4234
4235To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4236are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4237given a draft to edit that looks like it would if you had run the MH
4238command @command{forw}@footnote{See the section
4239@uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4240the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4241You can forward several messages by using a range (@pxref{Ranges}).
4242All of the messages in the range are inserted into your draft. The
4243hook @code{mh-forward-hook} is called on the draft.
4244
4245@cindex @file{.mh_profile}
4246@cindex files, @file{.mh_profile}
4247@cindex MH profile component, @samp{forw}
4248@cindex @samp{forw} MH profile component
4249@vindex mh-compose-forward-as-mime-flag
4250
4251By default, the option @code{mh-compose-forward-as-mime-flag} is on
4252which means that the forwarded messages are included as attachments.
4253These are inline attachments so the forwarded message should appear in
4254the body of your recipient's mail program. If you would prefer to
4255forward your messages verbatim (as text, inline), then turn off this
4256option. Forwarding messages verbatim works well for short, textual
4257messages, but your recipient won't be able to view any non-textual
4258attachments that were in the forwarded message. Be aware that if you
4259have @samp{forw: -mime} in your MH profile, then forwarded messages
4260will always be included as attachments regardless of the settings of
4261@code{mh-compose-forward-as-mime-flag}.
4262
4263@vindex mh-forward-subject-format
4264
4265The format of the @samp{Subject:} header field for forwarded messages
4266is controlled by the option @code{mh-forward-subject-format}. This
4267option is a string which includes two escapes (@samp{%s}). The first
4268@samp{%s} is replaced with the sender of the original message, and the
4269second one is replaced with the original @samp{Subject:}. The default
4270value of @code{"%s: %s"} takes a message with the header:
4271
4272@smallexample
4273@group
4274To: Bill Wohler <wohler@@stop.mail-abuse.org>
4275Subject: Re: 49er football
4276From: Greg DesBrisay <gd@@stop.mail-abuse.org>
4277@end group
4278@end smallexample
4279
4280and creates a subject header field of:
4281
4282@smallexample
4283Subject: Greg DesBrisay: Re: 49er football
4284@end smallexample
4285
4286@node Redistributing, Editing Again, Forwarding, Sending Mail
4287@section Redistributing Your Mail
4288
4289@cindex @command{dist}
4290@cindex MH commands, @command{dist}
4291@cindex redistributing
4292@findex mh-redistribute
4293@kindex M-d
4294
4295The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
4296to forwarding mail, but it does not allow you to edit the message, nor
4297does it add your name to the @samp{From:} header field. It appears to
4298the recipient as if the message had come from the original sender.
4299When you run this command, you are prompted for the recipients.
4300
4301@findex mh-edit-again
4302@kindex e
4303
4304For more information on redistributing messages, see
4305@command{dist}(1). Also investigate the command @kbd{e}
4306(@code{mh-edit-again}) for another way to redistribute messages
4307(@pxref{Editing Again}).
4308
4309@cindex @command{send}
4310@cindex MH commands, @command{send}
4311@vindex mh-redist-full-contents-flag
4312
4313The option @code{mh-redist-full-contents-flag} must be turned on if
4314@command{dist}@footnote{See the section
4315@uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4316dist} in the MH book.} requires the whole letter for redistribution,
4317which is the case if @command{send}@footnote{See the section
4318@uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4319in the MH book.} is compiled with the @sc{berk} option (which many
4320people abhor). If you find that MH will not allow you to redistribute
4321a message that has been redistributed before, turn off this option.
4322
4323The hook @code{mh-annotate-msg-hook} is run after annotating the
4324message and scan line (@pxref{Sending Mail}).
4325
4326@node Editing Again,  , Redistributing, Sending Mail
4327@section Editing Old Drafts and Bounced Messages
4328
4329@cindex @file{draft}
4330@cindex files, @file{draft}
4331@cindex re-editing drafts
4332@findex mh-edit-again
4333@kindex F v drafts
4334@kindex e
4335@kindex n
4336
4337If you don't complete a draft for one reason or another, and if the
4338draft buffer is no longer available, you can pick your draft up again
4339with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
4340folder, your last @file{draft} file will be used. If you use draft
4341folders, you'll need to visit the draft folder with @kbd{F v drafts
4342@key{RET}}, use @kbd{n} to move to the appropriate message, and then
4343use @kbd{e} to prepare the message for editing.
4344
4345@kindex e
4346
4347The @kbd{e} command can also be used to take messages that were sent
4348to you and to send them to more people.
4349
4350@cindex Mailer-Daemon
4351@findex mh-extract-rejected-mail
4352@kindex C-c C-c
4353@kindex E
4354
4355Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4356complained that your mail wasn't posted for some reason or another. In
4357this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4358the message for editing by removing the @i{Mailer-Daemon} envelope and
4359unneeded header fields. Fix whatever addressing problem you had, and
4360send the message again with @kbd{C-c C-c}.
4361
4362@node Editing Drafts, Aliases, Sending Mail, Top
4363@chapter Editing a Draft
4364
4365@cindex @samp{Letter} menu
4366@cindex MH-Letter mode
4367@cindex draft
4368@cindex editing draft
4369@cindex menu, @samp{Letter}
4370@cindex modes, MH-Letter
4371
4372When you edit a message that you want to send (called a @dfn{draft} in
4373this case), the mode used is MH-Letter. This mode provides several
4374commands in addition to the normal Emacs editing commands to help you
4375edit your draft. These can also be found in the @samp{Letter} menu.
4376
4377@table @kbd
4378@kindex SPC
4379@findex mh-letter-complete-or-space
4380@item @key{SPC}
4381Perform completion or insert space (@code{mh-letter-complete-or-space}).
4382@c -------------------------
4383@kindex M-TAB
4384@findex mh-letter-complete
4385@item M-@key{TAB}
4386Perform completion on header field or word preceding point
4387(@code{mh-letter-complete}).
4388@c -------------------------
4389@kindex , @r{(comma)}
4390@findex mh-letter-confirm-address
4391@item , (comma)
4392Flash alias expansion (@code{mh-letter-confirm-address}).
4393@c -------------------------
4394@kindex TAB
4395@findex mh-letter-next-header-field-or-indent
4396@item @key{TAB}
4397Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4398@c -------------------------
4399@kindex S-TAB
4400@findex mh-letter-previous-header-field
4401@item S-@key{TAB}
4402Cycle to the previous header field
4403(@code{mh-letter-previous-header-field}).
4404@c -------------------------
4405@kindex C-c ?
4406@findex mh-help
4407@item C-c ?
4408Display cheat sheet for the MH-E commands (@code{mh-help}).
4409@c -------------------------
4410@cindex @samp{Letter > Send This Draft} menu item
4411@cindex menu item, @samp{Letter > Send This Draft}
4412@kindex C-c C-c
4413@findex mh-send-letter
4414@item C-c C-c
4415Save draft and send message (@code{mh-send-letter}).
4416@c -------------------------
4417@kindex C-c C-d
4418@findex mh-insert-identity
4419@item C-c C-d
4420Insert fields specified by the given identity
4421(@code{mh-insert-identity}). @xref{Identities}.
4422@c -------------------------
4423@cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4424@cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4425@kindex C-c C-e
4426@findex mh-mh-to-mime
4427@item C-c C-e
4428Compose @sc{mime} message from MH-style directives
4429(@code{mh-mh-to-mime}).
4430@c -------------------------
4431@kindex C-c C-f C-a
4432@kindex C-c C-f a
4433@findex mh-to-field
4434@item C-c C-f C-a
4435@itemx C-c C-f a
4436Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4437@c -------------------------
4438@kindex C-c C-f C-b
4439@kindex C-c C-f b
4440@item C-c C-f C-b
4441@itemx C-c C-f b
4442Move to @samp{Bcc:} header field (@code{mh-to-field}).
4443@c -------------------------
4444@kindex C-c C-f C-c
4445@kindex C-c C-f c
4446@item C-c C-f C-c
4447@itemx C-c C-f c
4448Move to @samp{Cc:} header field (@code{mh-to-field}).
4449@c -------------------------
4450@kindex C-c C-f C-d
4451@kindex C-c C-f d
4452@item C-c C-f C-d
4453@itemx C-c C-f d
4454Move to @samp{Dcc:} header field (@code{mh-to-field}).
4455@c -------------------------
4456@kindex C-c C-f C-f
4457@kindex C-c C-f f
4458@findex mh-to-fcc
4459@item C-c C-f C-f
4460@itemx C-c C-f f
4461Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4462@c -------------------------
4463@kindex C-c C-f C-l
4464@kindex C-c C-f l
4465@item C-c C-f C-l
4466@itemx C-c C-f l
4467Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4468@c -------------------------
4469@kindex C-c C-f C-m
4470@kindex C-c C-f m
4471@item C-c C-f C-m
4472@itemx C-c C-f m
4473Move to @samp{From:} header field (@code{mh-to-field}).
4474@c -------------------------
4475@kindex C-c C-f C-r
4476@kindex C-c C-f r
4477@item C-c C-f C-r
4478@itemx C-c C-f r
4479Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4480@c -------------------------
4481@kindex C-c C-f C-s
4482@kindex C-c C-f s
4483@item C-c C-f C-s
4484@itemx C-c C-f s
4485Move to @samp{Subject:} header field (@code{mh-to-field}).
4486@c -------------------------
4487@kindex C-c C-f C-t
4488@kindex C-c C-f t
4489@item C-c C-f C-t
4490@itemx C-c C-f t
4491Move to @samp{To:} header field (@code{mh-to-field}).
4492@c -------------------------
4493@cindex @samp{Letter > Insert a Message...} menu item
4494@cindex menu item, @samp{Letter > Insert a Message...}
4495@kindex C-c C-i
4496@findex mh-insert-letter
4497@item C-c C-i
4498Insert a message (@code{mh-insert-letter}).
4499@c -------------------------
4500@kindex C-c C-m C-e
4501@findex mh-mml-secure-message-encrypt
4502@item C-c C-m C-e
4503Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4504@c -------------------------
4505@cindex @samp{Letter > Compose Forward...} menu item
4506@cindex menu item, @samp{Letter > Compose Forward...}
4507@kindex C-c C-m C-f
4508@kindex C-c C-m f
4509@findex mh-compose-forward
4510@item C-c C-m C-f
4511@itemx C-c C-m f
4512Add tag to forward a message (@code{mh-compose-forward}).
4513@c -------------------------
4514@cindex @samp{Letter > Compose Get File (MH)...} menu item
4515@cindex menu item, @samp{Letter > Compose Get File (MH)...}
4516@kindex C-c C-m C-g
4517@kindex C-c C-m g
4518@findex mh-mh-compose-anon-ftp
4519@item C-c C-m C-g
4520@itemx C-c C-m g
4521Add tag to include anonymous ftp reference to a file
4522(@code{mh-mh-compose-anon-ftp}).
4523@c -------------------------
4524@cindex @samp{Letter > Compose Insertion...} menu item
4525@cindex menu item, @samp{Letter > Compose Insertion...}
4526@kindex C-c C-m C-i
4527@kindex C-c C-m i
4528@findex mh-compose-insertion
4529@item C-c C-m C-i
4530@itemx C-c C-m i
4531Add tag to include a file such as an image or sound
4532(@code{mh-compose-insertion}).
4533@c -------------------------
4534@cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4535@cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4536@kindex C-c C-m C-m
4537@kindex C-c C-m m
4538@findex mh-mml-to-mime
4539@item C-c C-m C-m
4540@itemx C-c C-m m
4541Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4542@c -------------------------
4543@kindex C-c C-m C-n
4544@kindex C-c C-m n
4545@findex mh-mml-unsecure-message
4546@item C-c C-m C-n
4547@itemx C-c C-m n
4548Remove any secure message tags (@code{mh-mml-unsecure-message}).
4549@c -------------------------
4550@kindex C-c C-m C-s
4551@findex mh-mml-secure-message-sign
4552@item C-c C-m C-s
4553Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4554@c -------------------------
4555@cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4556@cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4557@kindex C-c C-m C-t
4558@kindex C-c C-m t
4559@findex mh-mh-compose-external-compressed-tar
4560@item C-c C-m C-t
4561@itemx C-c C-m t
4562Add tag to include anonymous ftp reference to a compressed tar file
4563(@code{mh-mh-compose-external-compressed-tar}).
4564@c -------------------------
4565@cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4566@cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4567@kindex C-c C-m C-u
4568@kindex C-c C-m u
4569@findex mh-mh-to-mime-undo
4570@item C-c C-m C-u
4571@itemx C-c C-m u
4572Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4573@c -------------------------
4574@kindex C-c C-m C-x
4575@kindex C-c C-m x
4576@findex mh-mh-compose-external-type
4577@item C-c C-m C-x
4578@itemx C-c C-m x
4579Add tag to refer to a remote file
4580(@code{mh-mh-compose-external-type}).
4581@c -------------------------
4582@kindex C-c C-m e e
4583@findex mh-mml-secure-message-encrypt
4584@item C-c C-m e e
4585Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4586@c -------------------------
4587@kindex C-c C-m e s
4588@findex mh-mml-secure-message-signencrypt
4589@item C-c C-m e s
4590Add tag to encrypt and sign the message@*
4591(@code{mh-mml-secure-message-signencrypt}).
4592@c -------------------------
4593@kindex C-c C-m s e
4594@findex mh-mml-secure-message-signencrypt
4595@item C-c C-m s e
4596Add tag to encrypt and sign the message@*
4597(@code{mh-mml-secure-message-signencrypt}).
4598@c -------------------------
4599@kindex C-c C-m s s
4600@findex mh-mml-secure-message-sign
4601@item C-c C-m s s
4602Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4603@c -------------------------
4604@cindex @samp{Letter > Split Current Line} menu item
4605@cindex menu item, @samp{Letter > Split Current Line}
4606@kindex C-c C-o
4607@findex mh-open-line
4608@item C-c C-o
4609Insert a newline and leave point before it (@code{mh-open-line}).
4610@c -------------------------
4611@cindex @samp{Letter > Kill This Draft} menu item
4612@cindex menu item, @samp{Letter > Kill This Draft}
4613@kindex C-c C-q
4614@findex mh-fully-kill-draft
4615@item C-c C-q
4616Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4617@c -------------------------
4618@cindex @samp{Letter > Insert Signature} menu item
4619@cindex menu item, @samp{Letter > Insert Signature}
4620@kindex C-c C-s
4621@findex mh-insert-signature
4622@item C-c C-s
4623Insert signature in message (@code{mh-insert-signature}).
4624@c -------------------------
4625@kindex C-c C-t
4626@findex mh-letter-toggle-header-field-display
4627@item C-c C-t
4628Toggle display of header field at point
4629(@code{mh-letter-toggle-header-field-display}).
4630@c -------------------------
4631@cindex @samp{Letter > Check Recipient} menu item
4632@cindex menu item, @samp{Letter > Check Recipient}
4633@kindex C-c C-w
4634@findex mh-check-whom
4635@item C-c C-w
4636Verify recipients, showing expansion of any aliases
4637(@code{mh-check-whom}).
4638@c -------------------------
4639@cindex @samp{Letter > Yank Current Message} menu item
4640@cindex menu item, @samp{Letter > Yank Current Message}
4641@kindex C-c C-y
4642@findex mh-yank-cur-msg
4643@item C-c C-y
4644Insert the current message into the draft buffer
4645(@code{mh-yank-cur-msg}).
4646@c -------------------------
4647@kindex C-c M-d
4648@findex mh-insert-auto-fields
4649@item C-c M-d
4650Insert custom fields if recipient is found in
4651@code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4652@xref{Identities}.
4653@end table
4654
4655@cindex @samp{mh-letter} customization group
4656@cindex customization group, @samp{mh-letter}
4657
4658Several options from the @samp{mh-letter} customization group are used
4659while editing a draft.
4660
4661@vtable @code
4662@item mh-compose-insertion
4663Type of @sc{mime} message tags in messages (default: @samp{MML} if
4664available; otherwise @samp{MH}).
4665@c -------------------------
4666@item mh-compose-skipped-header-fields
4667List of header fields to skip over when navigating in draft (default:
4668@code{'("From"} @code{"Organization"} @code{"References"}
4669@code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4670@code{"X-Image-URL"} @code{"X-Mailer")}.
4671@c -------------------------
4672@item mh-compose-space-does-completion-flag
4673On means @key{SPC} does completion in message header (default:
4674@samp{off}).
4675@c -------------------------
4676@item mh-delete-yanked-msg-window-flag
4677On means delete any window displaying the message (default: @samp{off}).
4678@c -------------------------
4679@item mh-extract-from-attribution-verb
4680Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4681(default: @code{"wrote:"}).
4682@c -------------------------
4683@item mh-ins-buf-prefix
4684String to put before each line of a yanked or inserted message
4685(default: @code{"> "}).
4686@c -------------------------
4687@item mh-letter-complete-function
4688Function to call when completing outside of address or folder fields
4689(default: @code{ispell-complete-word}).
4690@c -------------------------
4691@item mh-letter-fill-column
4692Fill column to use in MH-Letter mode (default: 72).
4693@c -------------------------
4694@item mh-mml-method-default
4695Default method to use in security tags (default: @samp{PGP (MIME)} if
4696support for it is available; otherwise @samp{None}).
4697@c -------------------------
4698@item mh-signature-file-name
4699Source of user's signature (default: @code{"~/.signature"}).
4700@c -------------------------
4701@item mh-signature-separator-flag
4702On means a signature separator should be inserted (default:
4703@samp{on}).
4704@c -------------------------
4705@item mh-x-face-file
4706File containing X-Face or Face header field to insert in outgoing mail.
4707(default: @code{"~/.face"}).
4708@c -------------------------
4709@item mh-yank-behavior
4710Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4711@samp{Body With Attribution}).
4712@end vtable
4713
4714The following hooks are available.
4715
4716@vtable @code
4717@item mail-citation-hook
4718Hook for modifying a citation just inserted in the mail buffer
4719(default: @code{nil}).
4720@c -------------------------
4721@item mh-before-send-letter-hook
4722Hook run at the beginning of the @kbd{C-c C-c} command (default:
4723@samp{nil}).
4724@c -------------------------
4725@item mh-mh-to-mime-hook
4726Hook run on the formatted letter by @kbd{C-c C-e} (default:
4727@samp{nil}).
4728@c -------------------------
4729@item mh-insert-signature-hook
4730Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4731@code{nil}).
4732@end vtable
4733
4734The following face is available.
4735
4736@vtable @code
4737@item mh-letter-header-field
4738Editable header field value face in draft buffers.
4739@end vtable
4740
4741The commands and options introduced here are explained in more
4742detail in the following sections.
4743
4744@menu
4745* Editing Message::
4746* Inserting Letter::
4747* Inserting Messages::
4748* Signature::
4749* Picture::
4750* Adding Attachments::
4751* Sending PGP::
4752* Checking Recipients::
4753* Sending Message::
4754* Killing Draft::
4755@end menu
4756
4757@node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4758@section Editing the Message
4759
4760@cindex @samp{Bcc} header field
4761@cindex @samp{Cc} header field
4762@cindex @samp{Dcc} header field
4763@cindex @samp{From} header field
4764@cindex @samp{Mail-Followup-To} header field
4765@cindex @samp{Mail-Reply-To} header field
4766@cindex @samp{Reply-To} header field
4767@cindex @samp{Subject} header field
4768@cindex @samp{To} header field
4769@cindex editing header
4770@cindex header field, @samp{Bcc}
4771@cindex header field, @samp{Cc}
4772@cindex header field, @samp{Dcc}
4773@cindex header field, @samp{From}
4774@cindex header field, @samp{Mail-Followup-To}
4775@cindex header field, @samp{Mail-Reply-To}
4776@cindex header field, @samp{Reply-To}
4777@cindex header field, @samp{Subject}
4778@cindex header field, @samp{To}
4779@findex mh-to-field
4780@kindex C-c C-f C-t
4781@kindex C-c C-f t
4782
4783Because the header is part of the message, you can edit the header
4784fields as you wish. However, several convenience commands exist to
4785help you create and edit them. For example, the command @kbd{C-c C-f
4786C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4787cursor to the @samp{To:} header field, creating it if necessary. The
4788commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4789@samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4790@samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4791
4792@findex mh-to-fcc
4793@kindex C-c C-f C-f
4794@kindex C-c C-f f
4795
4796One command behaves differently from the others, namely, @kbd{C-c C-f
4797C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4798will prompt you for the folder name in which to file a copy of the
4799draft. @xref{Folder Selection}.
4800
4801@findex indent-relative
4802@findex mh-letter-next-header-field-or-indent
4803@findex mh-letter-previous-header-field
4804@kindex TAB
4805@kindex S-TAB
4806@vindex mh-compose-skipped-header-fields
4807@vindex mh-letter-header-field
4808
4809Within the header of the message, the command@* @key{TAB}
4810(@code{mh-letter-next-header-field-or-indent}) moves between fields
4811that are highlighted with the face @code{mh-letter-header-field},
4812skipping those fields listed in
4813@code{mh-compose-skipped-header-fields}. After the last field, this
4814command then moves point to the message body before cycling back to
4815the first field. If point is already past the first line of the
4816message body, then this command indents by calling
4817@code{indent-relative} with the given prefix argument. The command
4818@kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4819backwards between the fields and cycles to the body of the message
4820after the first field. Unlike the command @key{TAB}, it will always
4821take point to the last field from anywhere in the body.
4822
4823@cindex alias completion
4824@cindex completion
4825@cindex spell check
4826@findex ispell-complete-word
4827@findex mh-letter-complete
4828@findex mh-letter-complete-or-space
4829@findex mh-letter-confirm-address
4830@kindex , @r{(comma)}
4831@kindex SPC
4832@kindex M-TAB
4833@vindex mh-alias-flash-on-comma
4834@vindex mh-compose-space-does-completion-flag
4835@vindex mh-letter-complete-function
4836
4837If the field contains addresses (for example, @samp{To:} or
4838@samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4839@kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4840completion (@pxref{Aliases}). In the body of the message,
4841@kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4842which is set to @samp{'ispell-complete-word} by default. The command
4843@kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4844that is passed to the @code{mh-letter-complete-function}. In addition,
4845turn on the option @code{mh-compose-space-does-completion-flag} to use
4846the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4847completion in the header as well; use a prefix argument to specify
4848more than one space. Addresses are separated by a comma; when you
4849press the comma, the command @code{mh-letter-confirm-address} flashes
4850the alias expansion in the minibuffer if
4851@code{mh-alias-flash-on-comma} is turned on.
4852
4853@c XXX Document the replacement for the inaccessible 'long argument.
4854
4855@findex mh-letter-toggle-header-field-display
4856@kindex C-c C-t
4857
4858Use the command @kbd{C-c C-t}
4859@code{mh-letter-toggle-header-field-display} to display truncated
4860header fields. This command is a toggle so entering it again will hide
4861the field. This command takes a prefix argument: if negative then the
4862field is hidden, if positive then the field is displayed (for example,
4863@kbd{C-u C-c C-t}).
4864
4865Be sure to leave a row of dashes or a blank line between the header
4866and the body of the message.
4867
4868@vindex mh-letter-fill-column
4869
4870The body of the message is edited as you would edit any Emacs buffer
4871although there are a few commands and options to assist you. You can
4872change the fill column in MH-Letter mode with the option
4873@code{mh-letter-fill-column}. By default, this option is 72 to allow
4874others to quote your message without line wrapping.
4875
4876@cindex filling paragraphs
4877@cindex paragraphs, filling
4878@findex fill-paragraph
4879@kindex M-q
4880@vindex mh-ins-buf-prefix
4881
4882You'll often include messages that were sent from user agents that
4883haven't yet realized that paragraphs consist of more than a single
4884line. This makes for long lines that wrap in an ugly fashion. You'll
4885find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4886quoted messages, even if they are nested, just as long as all of the
4887quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4888Letter}). For example, let's assume you have the following in your
4889draft:
4890
4891@smallexample
4892@group
4893> Hopefully this gives you an idea of what I'm currently doing. I'm \
4894not sure yet whether I'm completely satisfied with my setup, but    \
4895it's worked okay for me so far.
4896@end group
4897@end smallexample
4898
4899Running @kbd{M-q} on this paragraph produces:
4900
4901@smallexample
4902@group
4903> Hopefully this gives you an idea of what I'm currently doing. I'm not
4904> sure yet whether I'm completely satisfied with my setup, but it's
4905> worked okay for me so far.
4906@end group
4907@end smallexample
4908
4909@findex mh-open-line
4910@findex open-line
4911@kindex C-c C-o
4912@kindex C-o
4913
4914The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4915command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4916after point. It differs in that it also inserts the right number of
4917quoting characters and spaces so that the next line begins in the same
4918column as it was. This is useful when breaking up paragraphs in
4919replies. For example, if this command was used when point was after
4920the first period in the paragraph above, the result would be this:
4921
4922@smallexample
4923@group
4924> Hopefully this gives you an idea of what I'm currently doing.
4925
4926>                                                               I'm not
4927> sure yet whether I'm completely satisfied with my setup, but it's
4928> worked okay for me so far.
4929@end group
4930@end smallexample
4931
4932@node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4933@section Inserting Letter to Which You're Replying
4934
4935@cindex inserting messages
4936@cindex replying to messages
4937@cindex yanking messages
4938@findex mh-yank-cur-msg
4939@kindex C-c C-y
4940@vindex mh-ins-buf-prefix
4941
4942It is often useful to insert a snippet of text from a letter that
4943someone mailed to provide some context for your reply. The command
4944@kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4945attribution, yanking a portion of text from the message to which
4946you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4947before each line.
4948
4949@smallexample
4950@group
4951Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4952
4953> Hopefully this gives you an idea of what I'm currently doing. I'm not
4954> sure yet whether I'm completely satisfied with my setup, but it's
4955> worked okay for me so far.
4956@end group
4957@end smallexample
4958
4959@vindex mh-extract-from-attribution-verb
4960
4961The attribution consists of the sender's name and email address
4962followed by the content of the option
4963@code{mh-extract-from-attribution-verb}. This option can be set to
4964@samp{wrote:}, @samp{a écrit:}, and @samp{schrieb:}. You can also use
4965the @samp{Custom String} menu item to enter your own verb.
4966
4967@vindex mail-citation-hook
4968@vindex mh-ins-buf-prefix
4969@vindex mh-yank-behavior
4970
4971The prefix @code{"> "} is the default setting for the option
4972@code{mh-ins-buf-prefix}. I suggest that you not modify this option
4973since it is used by many mailers and news readers: messages are far
4974easier to read if several included messages have all been indented by
4975the same string. This prefix is not inserted if you use one of the
4976supercite flavors of @code{mh-yank-behavior} or you have added a
4977@code{mail-citation-hook} as described below.
4978
4979@vindex mh-delete-yanked-msg-window-flag
4980
4981You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4982option to delete the window containing the original message after
4983yanking it to make more room on your screen for your reply.
4984
4985@cindex Emacs, packages, @samp{supercite}
4986@cindex @samp{supercite} package
4987@kindex r
4988@vindex mail-citation-hook
4989@vindex mh-yank-behavior
4990
4991You can control how the message to which you are replying is yanked
4992into your reply using @code{mh-yank-behavior}. To include the entire
4993message, including the entire header, use @samp{Body and
4994Header}@footnote{If you'd rather have the header cleaned up, use
4995@kbd{C-u r} instead of @kbd{r} when replying
4996(@pxref{Replying}).}@footnote{In the past you would use this setting
4997and set @code{mail-citation-hook} to @samp{supercite}, but this usage
4998is now deprecated in favor of the @samp{Invoke supercite} setting.}.
4999Use @samp{Body} to yank just the body without the header. To yank only
5000the portion of the message following the point, set this option to
5001@samp{Below Point}.
5002
5003Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
5004full-bodied, full-featured, citation package that comes standard with
5005Emacs.} to pass the entire message and header through supercite.
5006
5007@vindex mh-extract-from-attribution-verb
5008
5009If the @samp{Body With Attribution} setting is used, then the message
5010minus the header is yanked and a simple attribution line is added at
5011the top using the value of the option
5012@code{mh-extract-from-attribution-verb}. This is the default.
5013
5014@kindex C-c C-y
5015@vindex mh-delete-yanked-msg-window-flag
5016
5017If the @samp{Invoke supercite} or @samp{Body With Attribution}
5018settings are used, the @samp{-noformat} argument is passed to the
5019@command{repl} program to override a @samp{-filter} or @samp{-format}
5020argument. These settings also have @samp{Automatically} variants that
5021perform the action automatically when you reply so that you don't need
5022to use @kbd{C-c C-y} at all. Note that this automatic action is only
5023performed if the show buffer matches the message being replied to.
5024People who use the automatic variants tend to turn on the option
5025@code{mh-delete-yanked-msg-window-flag} as well so that the show
5026window is never displayed.
5027
5028@vindex mh-yank-behavior
5029
5030If the show buffer has a region, the option @code{mh-yank-behavior} is
5031ignored unless its value is one of @samp{Attribution} variants in
5032which case the attribution is added to the yanked region.
5033
5034@findex trivial-cite
5035@vindex mail-citation-hook
5036@vindex mh-ins-buf-prefix
5037@vindex mh-yank-behavior
5038
5039If this isn't enough, you can gain full control over the appearance of
5040the included text by setting @code{mail-citation-hook} to a function
5041that modifies it. This hook is ignored if the option
5042@code{mh-yank-behavior} is set to one of the supercite flavors.
5043Otherwise, this option controls how much of the message is passed to
5044the hook. The function can find the citation between point and mark
5045and it should leave point and mark around the modified citation text
5046for the next hook function. The standard prefix
5047@code{mh-ins-buf-prefix} is not added if this hook is set.
5048
5049@cindex Emacs, packages, @samp{trivial-cite}
5050@cindex @samp{trivial-cite} package
5051@vindex mh-yank-behavior
5052
5053For example, if you use the hook function
5054@uref{https://www.emacswiki.org/emacs/TrivialCite,
5055@code{trivial-cite}} (which is NOT part of Emacs), set
5056@code{mh-yank-behavior} to @samp{Body and Header}.
5057
5058@node Inserting Messages, Signature, Inserting Letter, Editing Drafts
5059@section Inserting Messages
5060
5061@cindex inserting messages
5062@findex mh-insert-letter
5063@findex mh-yank-behavior
5064@kindex C-c C-i
5065@vindex mh-ins-buf-prefix
5066@vindex mh-invisible-header-fields-compiled
5067@vindex mh-yank-behavior
5068
5069Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
5070This command prompts you for the folder and message number, which
5071defaults to the current message in that folder. It then inserts the
5072messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
5073@code{mh-yank-behavior} is set to one of the supercite flavors in
5074which case supercite is used to format the message. Certain
5075undesirable header fields (see
5076@code{mh-invisible-header-fields-compiled}) are removed before
5077insertion.
5078
5079If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
5080left intact, the message is not indented, and @samp{> } is not
5081inserted before each line. This command leaves the mark before the
5082letter and point after it.
5083
5084@node Signature, Picture, Inserting Messages, Editing Drafts
5085@section Inserting Your Signature
5086
5087@cindex signature
5088@findex mh-insert-signature
5089@kindex C-c C-s
5090
5091You can insert your signature at the current cursor location with the
5092command @kbd{C-c C-s} (@code{mh-insert-signature}).
5093
5094@cindex files, @file{.signature}
5095@cindex @file{.signature}
5096@cindex vCard
5097@vindex mh-signature-file-name
5098
5099By default, the text of your signature is taken from the file
5100@file{~/.signature}. You can read from other sources by changing the
5101option @code{mh-signature-file-name}. This file may contain a
5102@dfn{vCard} in which case an attachment is added with the vCard.
5103
5104@findex mh-signature-separator-p
5105@vindex mh-signature-file-name
5106@vindex mh-signature-separator
5107@vindex mh-signature-separator-regexp
5108
5109The option @code{mh-signature-file-name} may also be a symbol, in
5110which case that function is called. You may not want a signature
5111separator to be added for you; instead you may want to insert one
5112yourself. Options that you may find useful to do this include
5113@code{mh-signature-separator} (when inserting a signature separator)
5114and @code{mh-signature-separator-regexp} (for finding said separator).
5115The function @code{mh-signature-separator-p}, which reports @code{t}
5116if the buffer contains a separator, may be useful as well.
5117
5118@cindex signature separator
5119@vindex mh-signature-separator-flag
5120
5121A signature separator (@code{"-- "}) will be added if the signature
5122block does not contain one and @code{mh-signature-separator-flag} is
5123on. It is not recommended that you change this option since various
5124mail user agents, including MH-E, use the separator to present the
5125signature differently, and to suppress the signature when replying or
5126yanking a letter into a draft.
5127
5128@vindex mh-insert-signature-hook
5129@vindex mh-signature-file-name
5130
5131The hook @code{mh-insert-signature-hook} is run after the signature is
5132inserted. Hook functions may access the actual name of the file or the
5133function used to insert the signature with
5134@code{mh-signature-file-name}.
5135
5136The signature can also be inserted using Identities.
5137@xref{Identities}.
5138
5139@node Picture, Adding Attachments, Signature, Editing Drafts
5140@section Inserting Your Picture
5141
5142@cindex @file{.face}
5143@cindex files, @file{.face}
5144@vindex mh-x-face-file
5145
5146You can insert your picture in the header of your mail message so that
5147recipients see your face in the @samp{From:} header field if their
5148mail user agent is sophisticated enough. In MH-E, this is done by
5149placing your image in the file named by the option
5150@code{mh-x-face-file} which is @file{~/.face} by default.
5151
5152@cindex @samp{Face} header field
5153@cindex @samp{X-Face} header field
5154@cindex @samp{X-Image-URL} header field
5155@cindex header field, @samp{Face}
5156@cindex header field, @samp{X-Face}
5157@cindex header field, @samp{X-Image-URL}
5158
5159If the file starts with either of the strings @samp{X-Face:},
5160@samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
5161message header verbatim. Otherwise it is assumed that the file
5162contains the value of the @samp{X-Face:} header field.
5163
5164@cindex @command{compface}
5165@cindex Unix commands, @command{compface}
5166
5167The @samp{X-Face:} header field, which is a low-resolution, black and
5168white image, can be generated using the
5169@uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
5170@command{compface}} command. The @uref{https://www.dairiki.org/xface/,
5171@cite{Online X-Face Converter}} is a useful resource for quick
5172conversion of images into @samp{X-Face:} header fields.
5173
5174Use the @uref{https://quimby.gnus.org/circus/face/make-face,
5175@command{make-face}} script to convert a JPEG image to the higher
5176resolution, color, @samp{Face:} header field.
5177
5178The URL of any image can be used for the @samp{X-Image-URL:} field and
5179no processing of the image is required.
5180
5181@vindex mh-x-face-file
5182
5183To prevent the setting of any of these header fields, either set
5184@code{mh-x-face-file} to @code{nil}, or simply ensure that the file
5185defined by this option doesn't exist.
5186
5187@xref{Viewing}, to see how these header fields are displayed in MH-E.
5188
5189@node Adding Attachments, Sending PGP, Picture, Editing Drafts
5190@section Adding Attachments
5191
5192@cindex @command{mhbuild}
5193@cindex @command{mhn}
5194@cindex MH commands, @command{mhbuild}
5195@cindex MH commands, @command{mhn}
5196@cindex MIME
5197@cindex multimedia mail
5198
5199MH-E has the capability to create multimedia messages. It uses the
5200@sc{mime} (Multipurpose Internet Mail Extensions)
5201protocol@footnote{@sc{mime} is defined in
5202@uref{https://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
5203@sc{mime} protocol allows you to incorporate images, sound, video,
5204binary files, and even commands that fetch a file with @samp{ftp} when
5205your recipient reads the message!
5206
5207@kindex C-c C-m
5208
5209If you were to create a multimedia message with plain MH commands, you
5210would insert @command{mhbuild} or @command{mhn} directives (henceforth
5211called @dfn{MH-style directives} into your draft and use the
5212@command{mhbuild} command in nmh or @command{mhn} command in MH and
5213GNU mailutils to expand them. MH-E works in much the same way,
5214although it provides a handful of commands prefixed with @kbd{C-c C-m}
5215to insert the directives so you don't need to remember the syntax of
5216them. Remember: you can always add MH-style directives by
5217hand@footnote{See the section
5218@uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5219the MH book.}.
5220
5221@cindex MIME Meta Language (MML)
5222@cindex MML
5223@vindex mh-compose-insertion
5224
5225In addition to MH-style directives, MH-E also supports MML (@sc{mime}
5226Meta Language) tags@footnote{
5227@ifinfo
5228@c Although the third argument should default to the
5229@c first, makeinfo goes to the wrong Info file without it being
5230@c different--it seems to be getting our own Composing node.
5231@xref{Composing,,Composing with MML,emacs-mime}.
5232@end ifinfo
5233@ifnotinfo
5234See the section Composing in
5235@uref{https://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
5236Manual}}.
5237@end ifnotinfo
5238}. The option @code{mh-compose-insertion} can be used to choose
5239between them. By default, this option is set to @samp{MML} if it is
5240supported since it provides a lot more functionality. This option can
5241also be set to @samp{MH} if MH-style directives are preferred.
5242
5243@cindex media types
5244@cindex MIME, media types
5245
5246The MH-E @sc{mime} commands require a @dfn{media type} for each body
5247part or attachment. For example, a PDF document is of type
5248@samp{application/pdf} and an HTML document is of type
5249@samp{text/html}. Some commands fill in the media type for you,
5250whereas others require you to enter one.
5251
5252@cindex @command{file}
5253@cindex @file{/etc/mime.types}
5254@cindex files, @file{/etc/mime.types}
5255@cindex Unix commands, @command{file}
5256@findex mailcap-mime-types
5257
5258In the cases where MH-E can do so, it will determine the media type
5259automatically. It uses the @command{file} command to do this. Failing
5260that, the Emacs function @code{mailcap-mime-types} is used to provide
5261a list from which to choose. This function usually reads the file
5262@file{/etc/mime.types}.
5263
5264Whether the media type is chosen automatically, or you choose it from
5265a list, use the type that seems to match best the file that you are
5266including. In the case of binaries, the media type
5267@samp{application/x-executable} can be useful. If you can't find an
5268appropriate media type, use @samp{text/plain} for text messages and
5269@samp{application/octet-stream} for everything else.
5270
5271@cindex content description
5272@cindex MIME, content description
5273
5274You are also sometimes asked for a @dfn{content description}. This is
5275simply an optional brief phrase, in your own words, that describes the
5276object. If you don't care to enter a content description, just press
5277return and none will be included; however, a reader may skip over
5278multimedia fields unless the content description is compelling.
5279
5280You can also create your own @sc{mime} body parts. In the following
5281example, I describe how you can create and edit a @samp{text/enriched}
5282body part to liven up your plain text messages with boldface,
5283underlining, and italics. I include an Emacs function which inserts
5284enriched text tags.
5285
5286@smalllisp
5287@group
5288(defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
5289                              ("u" . "underline")
5290                              ("s" . "smaller") ("B" . "bigger")
5291                              ("f" . "fixed")
5292                              ("c" . "center"))
5293  "Alist of (final-character . tag) choices for add-enriched-text.
5294Additional types can be found in RFC 1563.")
5295
5296(defun add-enriched-text (begin end)
5297  "Add enriched text tags around region.
5298The tag used comes from the list enriched-text-types and is
5299specified by the last keystroke of the command.  When called from Lisp,
5300arguments are BEGIN and END@."
5301  (interactive "r")
5302  ;; @r{Set type to the tag indicated by the last keystroke.}
5303  (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
5304                          enriched-text-types))))
5305    (save-restriction               ; @r{restores state from narrow-to-region}
5306      (narrow-to-region begin end)      ; @r{narrow view to region}
5307      (goto-char (point-min))           ; @r{move to beginning of text}
5308      (insert "<" type ">")             ; @r{insert beginning tag}
5309      (goto-char (point-max))           ; @r{move to end of text}
5310      (insert "</" type ">"))))         ; @r{insert terminating tag}
5311@i{Emacs function for entering enriched text}
5312
5313@end group
5314@end smalllisp
5315
5316To use the function @code{add-enriched-text}, first add it to
5317@file{~/.emacs} and create key bindings for it (@pxref{Composing}).
5318
5319Then, in your plain text message, set the mark with @kbd{C-@@} or
5320@kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
5321b}. This adds @samp{<bold>} where you set the mark and adds
5322@samp{</bold>} at the location of your cursor, giving you something
5323like: @samp{You should be <bold>very</bold>}.
5324
5325Before sending this message, use @kbd{C-c C-m C-m}
5326(@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
5327(@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
5328MIME header fields. Then replace @samp{text/plain} with
5329@samp{text/enriched} in the @samp{Content-Type:} header field.
5330
5331You may also be interested in investigating @code{sgml-mode}.
5332
5333@subheading Including Files
5334
5335@cindex attachments, inserting
5336@cindex images
5337@cindex MIME, images
5338@cindex MIME, sound
5339@cindex MIME, video
5340@cindex sound
5341@cindex video
5342@findex mh-compose-insertion
5343@kindex C-c C-m C-i
5344@kindex C-c C-m i
5345@vindex mh-compose-insertion
5346
5347Binaries, images, sound, and video can be inserted in your message
5348with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
5349are prompted for the filename containing the object, the media type if
5350it cannot be determined automatically, and a content description. If
5351you're using MH-style directives, you will also be prompted for
5352additional attributes.
5353
5354@subheading Forwarding Multimedia Messages
5355
5356@findex mh-compose-forward
5357@kindex C-c C-m C-f
5358@kindex C-c C-m f
5359
5360Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
5361C-f} (@code{mh-compose-forward}). You are prompted for a content
5362description, the name of the folder in which the messages to forward
5363are located, and a range of messages, which defaults to the current
5364message in that folder. @xref{Ranges}.
5365
5366@subheading Including an FTP Reference
5367
5368@cindex @command{ftp}
5369@cindex MIME, @command{ftp}
5370@cindex Unix commands, @command{ftp}
5371@findex mh-mh-compose-anon-ftp
5372@kindex C-c C-m C-g
5373@kindex C-c C-m g
5374
5375You can have your message initiate an @command{ftp} transfer when the
5376recipient reads the message. To do this, use the command @kbd{C-c C-m
5377C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
5378host and filename, the media type, and the content description.
5379
5380@subheading Including tar Files
5381
5382@cindex @command{ftp}
5383@cindex @command{tar}
5384@cindex MIME, @command{ftp}
5385@cindex MIME, @command{tar}
5386@cindex Unix commands, @command{ftp}
5387@cindex Unix commands, @command{tar}
5388@findex mh-mh-compose-anon-ftp
5389@findex mh-mh-compose-external-compressed-tar
5390@kindex C-c C-m C-g
5391@kindex C-c C-m C-t
5392@kindex C-c C-m t
5393
5394If the remote file is a compressed tar file, you can use @kbd{C-c C-m
5395C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
5396to retrieving the file via anonymous @emph{ftp} as per the command
5397@kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
5398be uncompressed and untarred. You are prompted for the remote host and
5399filename and the content description.
5400
5401@subheading Including Other External Files
5402
5403@findex mh-mh-compose-external-type
5404@kindex C-c C-m C-x
5405@kindex C-c C-m x
5406
5407The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5408a general utility for referencing external files. In fact, all of the
5409other commands that insert tags to access external files call this
5410command. You are prompted for the access type, remote host and
5411filename, and content type. If you provide a prefix argument, you are
5412also prompted for a content description, attributes, parameters, and a
5413comment.
5414
5415@subheading Previewing Multimedia Messages
5416
5417When you are finished editing a @sc{mime} message, it might look like this:
5418
5419@cartouche
5420@smallexample
54213 t08/24  root               received fax files on Wed Aug 24 11:00:
54224+t08/24  To:wohler          Test<<This is a test message to get the
5423
5424
5425
5426
5427
5428--:%%  @{+inbox@} 4 msgs (1-4)   Bot L4     (MH-Folder Show)---------------
5429To: wohler
5430cc:
5431Subject: Test of MIME
5432--------
5433Here is the SETI@@Home logo:
5434
5435<#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5436disposition=inline description="SETI@@home logo">
5437<#/part>
5438--:**  @{draft@}   All L8     (MH-Letter)----------------------------------
5439
5440@end smallexample
5441@end cartouche
5442@i{MH-E @sc{mime} draft}
5443
5444@findex mh-mml-to-mime
5445@kindex C-c C-m C-m
5446@kindex C-c C-m m
5447
5448Typically, you send a message with attachments just like any other
5449message (@pxref{Sending Message}).
5450
5451@findex mh-mml-to-mime
5452@kindex C-c C-m C-m
5453
5454However, you may take a sneak preview of the @sc{mime} encoding if you
5455wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5456The following screen shows the @sc{mime} encoding specified by the
5457tags. You can see why mail user agents are usually built to hide these
5458details from the user.
5459
5460@cartouche
5461@smallexample
5462To: wohler
5463cc:
5464Subject: Test of MIME
5465X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
5466MIME-Version: 1.0
5467Content-Type: multipart/mixed; boundary="=-=-="
5468--------
5469--=-=-=
5470
5471Here is the SETI@@Home logo:
5472
5473
5474--=-=-=
5475Content-Type: image/x-xpm
5476Content-Disposition: inline; filename=setiathome.xpm
5477Content-Transfer-Encoding: base64
5478Content-Description: SETI@@home logo
5479
5480LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2N
5481--:--  @{draft@}   Top L1     (MH-Letter)----------------------------------
5482
5483@end smallexample
5484@end cartouche
5485@i{MH-E @sc{mime} draft ready to send}
5486
5487@cindex undo effects of @code{mh-mml-to-mime}
5488
5489This action can be undone by running @kbd{C-_} (@code{undo}).
5490
5491@cindex @command{mhbuild}
5492@cindex @command{mhn}
5493@cindex MH commands, @command{mhbuild}
5494@cindex MH commands, @command{mhn}
5495@cindex undo effects of @code{mh-mh-to-mime}
5496@findex mh-mh-to-mime
5497@findex mh-mh-to-mime-undo
5498@kindex C-c C-e
5499@kindex C-c C-m C-m
5500@kindex C-c C-m C-u
5501@kindex C-c C-m u
5502
5503If you're using MH-style directives, use @kbd{C-c C-e}
5504(@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5505command @command{mhbuild} (@command{mhn}) on the message which expands
5506the tags@footnote{See the section
5507@uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5508the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5509(@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5510file. You are prompted to confirm this action, but you can avoid the
5511confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5512C-u}).
5513
5514@kindex C-c C-e
5515@vindex mh-mh-to-mime-args
5516
5517If you wish to pass additional arguments to @command{mhbuild}
5518(@command{mhn}) to affect how it builds your message, use the option
5519@code{mh-mh-to-mime-args}. For example, you can build a consistency
5520check into the message by setting @code{mh-mh-to-mime-args} to
5521@samp{-check}. The recipient of your message can then run
5522@samp{mhbuild -check} on the message---@command{mhbuild}
5523(@command{mhn}) will complain if the message has been corrupted on the
5524way. The command @kbd{C-c C-e} only consults this option when given a
5525prefix argument (as in @kbd{C-u C-c C-e}).
5526
5527@kindex C-c C-e
5528@vindex mh-mh-to-mime-hook
5529
5530The hook @code{mh-mh-to-mime-hook} is called after the message has
5531been formatted by @kbd{C-c C-e}.
5532
5533@node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5534@section Signing and Encrypting Messages
5535
5536@cindex signing messages
5537@cindex encrypting messages
5538@cindex RFC 3156
5539
5540MH-E can sign and encrypt messages as defined in
5541@uref{https://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5542should choose to sign or encrypt your message, use one of the
5543following commands to do so any time before sending your message.
5544
5545@findex mh-mml-secure-message-encrypt
5546@findex mh-mml-secure-message-sign
5547@findex mh-mml-secure-message-signencrypt
5548@kindex C-c C-m C-e
5549@kindex C-c C-m C-s
5550@kindex C-c C-m e e
5551@kindex C-c C-m e s
5552@kindex C-c C-m s e
5553@kindex C-c C-m s s
5554
5555The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5556inserts the following tag:
5557
5558@smallexample
5559<#secure method=pgpmime mode=sign>
5560@end smallexample
5561
5562This is used to sign your message digitally. Likewise, the command
5563@kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5564following tag:
5565
5566@smallexample
5567<#secure method=pgpmime mode=encrypt>
5568@end smallexample
5569
5570This is used to encrypt your message. Finally, the command @kbd{C-c
5571C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5572following tag:
5573
5574@smallexample
5575<#secure method=pgpmime mode=signencrypt>
5576@end smallexample
5577
5578@findex mh-mml-unsecure-message
5579@kindex C-c C-m C-n
5580@kindex C-c C-m n
5581@vindex mh-mml-method-default
5582
5583This is used to sign and encrypt your message. In each of these cases,
5584a proper multipart message is created for you when you send the
5585message. Use the command @kbd{C-c C-m C-n}
5586(@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5587argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5588possible security methods (see @code{mh-mml-method-default}).
5589
5590@vindex mh-mml-method-default
5591
5592The option @code{mh-mml-method-default} is used to select between a
5593variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5594if it is supported; otherwise, the default is @samp{None}. Other
5595mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5596
5597@cindex @samp{pgg} customization group
5598@cindex PGG
5599@cindex customization group, @samp{pgg}
5600
5601The @samp{pgg} customization group may have some settings which may
5602interest you.
5603@iftex
5604See @cite{The PGG Manual}.
5605@end iftex
5606@ifinfo
5607@xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5608@end ifinfo
5609@ifhtml
5610See
5611@uref{https://www.gnu.org/software/emacs/manual/pgg.html,
5612@cite{The PGG Manual}}.
5613@end ifhtml
5614
5615@cindex header field, @samp{Fcc}
5616@cindex @samp{Fcc} header field
5617@vindex pgg-encrypt-for-me
5618
5619In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5620all messages I encrypt are encrypted with my public key as well. If
5621you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5622field, this setting is vital so that you can read the mail you write!
5623
5624@node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5625@section Checking Recipients
5626
5627@cindex @file{*MH-E Recipients*}
5628@cindex @command{whom}
5629@cindex MH commands, @command{whom}
5630@cindex buffers, @file{*MH-E Recipients*}
5631@cindex checking recipients
5632@cindex recipients, checking
5633@findex mh-check-whom
5634@kindex C-c C-w
5635
5636The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5637you can check the actual address(es) in the alias. A new buffer named
5638@file{*MH-E Recipients*} is created with the output of @command{whom}
5639(@pxref{Miscellaneous})@footnote{See the section
5640@uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now?---and the
5641whatnow Program} in the MH book.}.
5642
5643@node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5644@section Sending a Message
5645
5646@cindex buffers, @file{*MH-E Mail Delivery*}
5647@cindex @file{*MH-E Mail Delivery*}
5648@cindex sending mail
5649@findex mh-send-letter
5650@kindex C-c C-c
5651
5652When you are all through editing a message, you send it with the
5653command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5654argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5655delivery; this output can be found in a buffer called @file{*MH-E Mail
5656Delivery*} (@pxref{Miscellaneous}).
5657
5658@cindex sending mail
5659@cindex spell check
5660@findex ispell-message
5661@kindex C-c C-c
5662@vindex mh-before-send-letter-hook
5663
5664The hook @code{mh-before-send-letter-hook} is run at the beginning of
5665the command @kbd{C-c C-c}. For example, if you want to check your
5666spelling in your message before sending, add the function
5667@code{ispell-message}.
5668
5669@cindex @command{send}
5670@cindex MH commands, @command{send}
5671@vindex mh-send-prog
5672
5673In case the MH @command{send} program@footnote{See the section
5674@uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
5675in the MH book.} is installed under a different name, use
5676@code{mh-send-prog} to tell MH-E the name.
5677
5678The hook @code{mh-annotate-msg-hook} is run after annotating the
5679message and scan line (@pxref{Sending Mail}).
5680
5681@node Killing Draft,  , Sending Message, Editing Drafts
5682@section Killing the Draft
5683
5684@cindex killing draft
5685@findex kill-buffer
5686@findex mh-fully-kill-draft
5687@kindex C-c C-q
5688@kindex C-x k
5689
5690If for some reason you are not happy with the draft, you can use the
5691command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5692buffer and delete the draft message. Use the command @kbd{C-x k}
5693(@code{kill-buffer}) if you don't want to delete the draft message.
5694
5695@node Aliases, Identities, Editing Drafts, Top
5696@chapter Aliases
5697
5698@cindex aliases
5699
5700MH aliases are used in the same way in MH-E as they are in MH@. Any
5701alias listed as a recipient will be expanded when the message is sent.
5702This chapter discusses other things you can do with aliases in MH-E.
5703
5704@cindex MH-Letter mode
5705@cindex modes, MH-Letter
5706
5707The following commands are available in MH-Letter mode with the
5708exception of @code{mh-alias-reload} which can be called from anywhere.
5709
5710@table @kbd
5711@kindex SPC
5712@findex mh-letter-complete-or-space
5713@item @key{SPC}
5714Perform completion or insert space (@code{mh-letter-complete-or-space}).
5715@c -------------------------
5716@kindex M-TAB
5717@findex mh-letter-complete
5718@item M-@key{TAB}
5719Perform completion on header field or word preceding point
5720(@code{mh-letter-complete}).
5721@c -------------------------
5722@findex mh-alias-apropos
5723@item mh-alias-apropos
5724Show all aliases or addresses that match a regular expression.
5725@c -------------------------
5726@findex mh-alias-grab-from-field
5727@item mh-alias-grab-from-field
5728Add alias for the sender of the current message
5729@c -------------------------
5730@findex mh-alias-reload
5731@item mh-alias-reload
5732Reload MH aliases.
5733@end table
5734
5735@cindex @samp{mh-alias} customization group
5736@cindex customization group, @samp{mh-alias}
5737
5738The @samp{mh-alias} customization group contains options associated
5739with aliases.
5740
5741@vtable @code
5742@item mh-alias-completion-ignore-case-flag
5743On means don't consider case significant in MH alias completion
5744(default: @samp{on}).
5745@c -------------------------
5746@item mh-alias-expand-aliases-flag
5747On means to expand aliases entered in the minibuffer (default:
5748@samp{off}).
5749@c -------------------------
5750@item mh-alias-flash-on-comma
5751Specify whether to flash address or warn on translation (default: @samp{Flash
5752but Don't Warn If No Alias}).
5753@c -------------------------
5754@item mh-alias-insert-file
5755Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5756Profile Component}).
5757@c -------------------------
5758@item mh-alias-insertion-location
5759Specifies where new aliases are entered in alias files (default:
5760@samp{Alphabetical}).
5761@c -------------------------
5762@item mh-alias-local-users
5763If @samp{on}, local users are added to alias completion (default:
5764@samp{on}).
5765@c -------------------------
5766@item mh-alias-local-users-prefix
5767String prefixed to the real names of users from the password file
5768(default: @code{"local."}.
5769@c -------------------------
5770@item mh-alias-passwd-gecos-comma-separator-flag
5771On means the GECOS field in the password file uses a comma separator
5772(default: @samp{on}).
5773@end vtable
5774
5775The following hook is available.
5776
5777@vtable @code
5778@item mh-alias-reloaded-hook
5779Hook run by @code{mh-alias-reload} after loading aliases (default:
5780@code{nil}).
5781@end vtable
5782
5783@subheading Adding Addresses to Draft
5784
5785You can use aliases when you are adding recipients to a message.
5786
5787@findex minibuffer-complete
5788@kindex TAB
5789@vindex mh-alias-expand-aliases-flag
5790@vindex mh-compose-prompt-flag
5791
5792In order to use minibuffer prompting for recipients and the subject
5793line in the minibuffer, turn on the option
5794@code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5795@key{TAB} (@code{minibuffer-complete}) command to complete aliases
5796(and optionally local logins) when prompted for the recipients. Turn
5797on the option @code{mh-alias-expand-aliases-flag} if you want these
5798aliases to be expanded to their respective addresses in the draft.
5799
5800@findex mh-letter-complete
5801@findex mh-letter-complete-or-space
5802@kindex SPC
5803@kindex M-TAB
5804
5805Otherwise, you can complete aliases in the header of the draft with
5806@kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5807(@code{mh-letter-complete-or-space}).
5808
5809@vindex mh-alias-completion-ignore-case-flag
5810
5811As MH ignores case in the aliases, so too does MH-E@. However, you may
5812turn off the option @code{mh-alias-completion-ignore-case-flag} to
5813make case significant which can be used to segregate completion of
5814your aliases. You might use uppercase for mailing lists and lowercase
5815for people. For example, you might have:
5816
5817@smallexample
5818mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5819MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5820@end smallexample
5821
5822When this option is turned off, if you were to type @kbd{M} in the
5823@samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5824if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5825you'd get Mark's address. Note that this option affects completion
5826only. If you were to enter @kbd{Mark.Baushke}, it would still be
5827identified with your @samp{mark.baushke} alias.
5828
5829@findex mh-alias-minibuffer-confirm-address
5830@findex mh-letter-confirm-address
5831@vindex mh-alias-flash-on-comma
5832@vindex mh-compose-prompt-flag
5833
5834To verify that the alias you've entered is valid, the alias will be
5835displayed in the minibuffer when you type a comma
5836(@code{mh-letter-confirm-address} or
5837@code{mh-alias-minibuffer-confirm-address} if the option
5838@code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5839behavior can be controlled with the option
5840@code{mh-alias-flash-on-comma} which provides three choices:
5841@samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5842Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5843
5844For another way to verify the alias expansion, see @ref{Checking
5845Recipients}.
5846
5847@subheading Loading Aliases
5848
5849@cindex @command{ali}
5850@cindex @file{/etc/nmh/MailAliases}
5851@cindex @samp{Aliasfile} MH profile component
5852@cindex MH commands, @command{ali}
5853@cindex MH profile component, @samp{Aliasfile}
5854@cindex files, @file{/etc/nmh/MailAliases}
5855
5856MH-E loads aliases for completion and folder name hints from various
5857places. It uses the MH command @command{ali}@footnote{See the section
5858@uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
5859read aliases from the files listed in the profile component
5860@samp{Aliasfile:} as well as system-wide aliases (for example,
5861@file{/etc/nmh/MailAliases}).
5862
5863@cindex @file{/etc/passwd}
5864@cindex files, @file{/etc/passwd}
5865
5866In addition, aliases are created from @file{/etc/passwd} entries with
5867a user ID larger than a magical number, typically 200. This can be a
5868handy tool on a machine where you and co-workers exchange messages.
5869These aliases have the form @samp{local.@var{first.last}} if a real
5870name is present in the password file. Otherwise, the alias will have
5871the form @samp{local.@var{login}}.
5872
5873@vindex mh-alias-local-users-prefix
5874
5875The prefix @samp{local.} can be modified via the option
5876@code{mh-alias-local-users-prefix}. This option can also be set to
5877@samp{Use Login}.
5878
5879For example, consider the following password file entry:
5880
5881@smallexample
5882psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5883@end smallexample
5884
5885@vindex mh-alias-local-users-prefix
5886
5887The following settings of option @code{mh-alias-local-users-prefix}
5888will produce the associated aliases:
5889
5890@table @code
5891@item "local."
5892local.peter.galbraith
5893@c -------------------------
5894@item ""
5895peter.galbraith
5896@c -------------------------
5897@item Use Login
5898psg
5899@end table
5900
5901@vindex mh-alias-passwd-gecos-comma-separator-flag
5902
5903In the example above, commas are used to separate different values
5904within the so-called GECOS field. This is a fairly common usage.
5905However, in the rare case that the GECOS field in your password file
5906is not separated by commas and whose contents may contain commas, you
5907can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5908off.
5909
5910@cindex NIS, obtaining local aliases from
5911@cindex @samp{ypcat passwd}
5912@vindex mh-alias-local-users
5913
5914If you're on a system with thousands of users you don't know, and the
5915loading of local aliases slows MH-E down noticeably, then the local
5916alias feature can be disabled by turning off the option
5917@code{mh-alias-local-users}. This option also takes a string which is
5918executed to generate the password file. For example, use @samp{ypcat
5919passwd} to obtain the NIS password file.
5920
5921@findex mh-alias-reload
5922@vindex mh-alias-reloaded-hook
5923
5924Since aliases are updated frequently, MH-E reloads aliases
5925automatically whenever an alias lookup occurs if an alias source has
5926changed. However, you can reload your aliases manually by calling the
5927command @kbd{M-x mh-alias-reload} directly. This command runs
5928@code{mh-alias-reloaded-hook} after the aliases have been loaded.
5929
5930@subheading Adding Aliases
5931
5932In the past, you have manually added aliases to your alias file(s)
5933listed in your @samp{Aliasfile:} profile component. MH-E provides
5934other methods for maintaining your alias file(s).
5935
5936@findex mh-alias-add-alias
5937
5938You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5939you for the alias and address that you would like to add. If the alias
5940exists already, you will have the choice of inserting the new alias
5941before or after the old alias. In the former case, this alias will be
5942used when sending mail to this alias. In the latter case, the alias
5943serves as an additional folder name hint when filing messages
5944(@pxref{Folder Selection}).
5945
5946Earlier, the alias prefix @samp{local} was presented. You can use
5947other prefixes to organize your aliases or disambiguate entries. You
5948might use prefixes for locales, jobs, or activities. For example, I
5949have:
5950
5951@smallexample
5952@group
5953; Work
5954attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5955isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5956...
5957; Sport
5958diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5959sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5960...
5961; Personal
5962ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5963...
5964@end group
5965@end smallexample
5966
5967Using prefixes instead of postfixes helps you explore aliases during
5968completion. If you forget the name of an old dive buddy, you can enter
5969@samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5970
5971@findex mh-alias-add-address-under-point
5972@findex mh-alias-grab-from-field
5973
5974An alias for the sender of the current message is added automatically
5975by clicking on the @samp{Grab From alias} tool bar button or by running
5976the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5977recipients of the current message are added by placing your cursor
5978over the desired recipient and giving the @kbd{M-x
5979mh-alias-add-address-under-point} command.
5980
5981@vindex mh-alias-insert-file
5982@vindex mh-alias-insertion-location
5983
5984The options @code{mh-alias-insert-file} and
5985@code{mh-alias-insertion-location} controls how and where these aliases
5986are inserted.
5987
5988@vindex mh-alias-insert-file
5989
5990The default setting of option @code{mh-alias-insert-file} is @samp{Use
5991Aliasfile Profile Component}. This option can also hold the name of a
5992file or a list a file names. If this option is set to a list of file
5993names, or the @samp{Aliasfile:} profile component contains more than
5994one file name, MH-E will prompt for one of them.
5995
5996@vindex mh-alias-insertion-location
5997
5998The option @code{mh-alias-insertion-location} is set to
5999@samp{Alphabetical} by default. If you organize your alias file in
6000other ways, then the settings @samp{Top} and @samp{Bottom} might be
6001more appropriate.
6002
6003@subheading Querying Aliases
6004
6005@cindex regular expressions, @code{mh-alias-apropos}
6006@findex mh-alias-apropos
6007
6008If you can't quite remember an alias, you can use @kbd{M-x
6009mh-alias-apropos} to show all aliases or addresses that match a
6010regular expression
6011@ifnothtml
6012(@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6013GNU Emacs Manual}).
6014@end ifnothtml
6015@ifhtml
6016(see the section
6017@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6018Syntax of Regular Expressions} in
6019@cite{The GNU Emacs Manual}).
6020@end ifhtml
6021
6022@node Identities, Speedbar, Aliases, Top
6023@chapter Identities
6024
6025@cindex identities
6026@cindex multiple personalities
6027
6028MH-E supports the concept of multiple personalities or identities.
6029This means that you can easily have a different header and signature
6030at home and at work.
6031
6032@cindex @samp{Identity} menu
6033@cindex menu, @samp{Identity}
6034
6035A couple of commands are used to insert identities in MH-Letter mode
6036which are also found in the @samp{Identity} menu.
6037
6038@table @kbd
6039@kindex C-c C-d
6040@findex mh-insert-identity
6041@item C-c C-d
6042Insert fields specified by given identity (@code{mh-insert-identity}).
6043@c -------------------------
6044@cindex @samp{Identity > Insert Auto Fields} menu item
6045@cindex menu item, @samp{Identity > Insert Auto Fields}
6046@kindex C-c M-d
6047@findex mh-insert-auto-fields
6048@item C-c M-d
6049Insert custom fields if recipient found in @code{mh-auto-fields-list}
6050(@code{mh-insert-auto-fields}).
6051@end table
6052
6053@cindex @samp{mh-identity} customization group
6054@cindex customization group, @samp{mh-identity}
6055
6056The @samp{mh-identity} customization group contains the following
6057options.
6058
6059@vtable @code
6060@item mh-auto-fields-list
6061List of recipients for which header lines are automatically inserted
6062(default: @code{nil}).
6063@c -------------------------
6064@item mh-auto-fields-prompt-flag
6065On means to prompt before sending if fields inserted (default:
6066@samp{on})
6067@c -------------------------
6068@item mh-identity-default
6069Default identity to use when @code{mh-letter-mode} is called (default:
6070@samp{None}).
6071@c -------------------------
6072@item mh-identity-handlers
6073Handler functions for fields in @code{mh-identity-list}.
6074@c -------------------------
6075@item mh-identity-list
6076List of identities (default: @code{nil}).
6077@end vtable
6078
6079Some of the common header fields that people change depending on the
6080context are the @samp{From:} and @samp{Organization:} fields, as well
6081as the signature.
6082
6083@vindex mh-identity-list
6084
6085This is done by customizing the option @code{mh-identity-list}. In the
6086customization buffer for this option, click on the @samp{INS} button
6087and enter a label such as @samp{Home} or @samp{Work}. Then click on
6088the @samp{INS} button with the label @samp{Add at least one item
6089below}. The @samp{Value Menu} has the following menu items:
6090
6091@table @samp
6092@cindex header field, @samp{From}
6093@cindex @samp{From} header field
6094@item From Field
6095Specify an alternate @samp{From:} header field. You must include a
6096valid email address. A standard format is @samp{First Last
6097<login@@host.domain>}. If you use an initial with a period, then you
6098must quote your name as in @samp{"First I. Last"
6099<login@@host.domain>}.
6100@c -------------------------
6101@cindex header field, @samp{Organization}
6102@cindex @samp{Organization} header field
6103@item Organization Field
6104People usually list the name of the company where they work here.
6105@c -------------------------
6106@item Other Field
6107Set any arbitrary header field and value here. Unless the header field
6108is a standard one, precede the name of your field's label with
6109@samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
6110@c -------------------------
6111@item Attribution Verb
6112This value overrides the setting of
6113@code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
6114@c -------------------------
6115@cindex signature
6116@vindex mh-signature-file-name
6117@item Signature
6118Set your signature with this item. You can specify the contents of
6119@code{mh-signature-file-name}, a file, or a function.
6120@xref{Signature}.
6121@c -------------------------
6122@item GPG Key ID
6123Specify a different key to sign or encrypt messages.
6124@end table
6125
6126@cindex Identity menu
6127@cindex menu, Identity
6128@findex mh-insert-identity
6129@kindex C-c C-d
6130
6131You can select the identities you have added via the menu called
6132@samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
6133C-d} (@code{mh-insert-identity}). To clear the fields and signature
6134added by the identity, select the @samp{None} identity.
6135
6136@cindex menu item, @samp{Identity > Customize Identities}
6137@cindex menu item, @samp{Identity > Save as Default}
6138@cindex menu item, @samp{Identity > Set Default for Session}
6139@cindex @samp{Identity > Customize Identities} menu item
6140@cindex @samp{Identity > Save as Default} menu item
6141@cindex @samp{Identity > Set Default for Session} menu item
6142@vindex mh-identity-default
6143
6144The @samp{Identity} menu contains two other items to save you from
6145having to set the identity on every message. The menu item @samp{Set
6146Default for Session} can be used to set the default identity to the
6147current identity until you exit Emacs. The menu item @samp{Save as
6148Default} sets the option @code{mh-identity-default} to the current
6149identity setting. You can also customize the option
6150@code{mh-identity-default} in the usual fashion. If you find that you
6151need to add another identity, the menu item @samp{Customize
6152Identities} is available for your convenience.
6153
6154@cindex regular expressions, @code{mh-auto-fields-list}
6155@vindex mh-auto-fields-list
6156
6157The option @code{mh-auto-fields-list} can also be used to set the
6158identity depending on the recipient to provide even more control. To
6159customize @code{mh-auto-fields-list}, click on the @samp{INS} button
6160and enter a regular expression for the recipient's address
6161@ifnothtml
6162(@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6163GNU Emacs Manual}).
6164@end ifnothtml
6165@ifhtml
6166(see the section
6167@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6168Syntax of Regular Expressions} in
6169@cite{The GNU Emacs Manual}).
6170@end ifhtml
6171Click on the @samp{INS} button with the @samp{Add at least one item
6172below} label. The @samp{Value Menu} contains the following menu items:
6173
6174@table @samp
6175@item Identity
6176Select an identity from those configured in @code{mh-identity-list}.
6177All of the information for that identity will be added if the
6178recipient matches.
6179@c -------------------------
6180@cindex @samp{Fcc} header field
6181@cindex header field, @samp{Fcc}
6182@item Fcc Field
6183Insert an @samp{Fcc:} header field with the folder you provide. When
6184you send the message, MH will put a copy of your message in this
6185folder.
6186@c -------------------------
6187@cindex @samp{Mail-Followup-To} header field
6188@cindex header field, @samp{Mail-Followup-To}
6189@item Mail-Followup-To Field
6190Insert an @samp{Mail-Followup-To:} header field with the recipients
6191you provide. If the recipient's mail user agent supports this header
6192field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
6193their replies will go to the addresses listed. This is useful if their
6194replies go both to the list and to you and you don't have a mechanism
6195to suppress duplicates. If you reply to someone not on the list, you
6196must either remove the @samp{Mail-Followup-To:} field, or ensure the
6197recipient is also listed there so that he receives replies to your
6198reply.
6199@c -------------------------
6200@item Other Field
6201Other header fields may be added using this menu item.
6202@end table
6203
6204@findex mh-insert-auto-fields
6205@kindex C-c M-d
6206@vindex mh-auto-fields-prompt-flag
6207
6208These fields can only be added after the recipient is known. Because
6209you can continue to add recipients as you edit the draft, MH-E waits
6210until the message is sent to perform the auto-insertions. This seems
6211strange at first, but you'll get used to it. There are two ways to
6212help you feel that the desired fields are added. The first is the
6213action when the message is sent: if any fields are added
6214automatically, you are given a chance to see and to confirm these
6215fields before the message is actually sent. You can do away with this
6216confirmation by turning off the option
6217@code{mh-auto-fields-prompt-flag}. The second method is manual: once
6218the header contains one or more recipients, you may run the command
6219@kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
6220@samp{Identity -> Insert Auto Fields} menu item to insert these fields
6221manually. However, if you use this command, the automatic insertion
6222when the message is sent is disabled.
6223
6224@vindex mh-auto-fields-list
6225@vindex mh-identity-list
6226
6227You should avoid using the same header field in
6228@code{mh-auto-fields-list} and @code{mh-identity-list} definitions
6229that may apply to the same message as the result is undefined.
6230
6231@vindex mh-identity-handlers
6232@vindex mh-identity-list
6233
6234The option @code{mh-identity-handlers} is used to change the way that
6235fields, signatures, and attributions in @code{mh-identity-list} are
6236added. To customize @code{mh-identity-handlers}, replace the name of
6237an existing handler function associated with the field you want to
6238change with the name of a function you have written. You can also
6239click on an @samp{INS} button and insert a field of your choice and
6240the name of the function you have written to handle it.
6241
6242@vindex mh-identity-list
6243
6244The @samp{Field} field can be any field that you've used in your
6245@code{mh-identity-list}. The special fields @samp{:attribution-verb},
6246@samp{:signature}, or @samp{:pgg-default-user-id} are used for the
6247@code{mh-identity-list} choices @samp{Attribution Verb},
6248@samp{Signature}, and @samp{GPG Key ID} respectively.
6249
6250The handler associated with the @samp{:default} field is used when no
6251other field matches.
6252
6253The handler functions are passed two or three arguments: the field
6254itself (for example, @samp{From}), or one of the special fields (for
6255example, @samp{:signature}), and the action @samp{'remove} or
6256@samp{'add}. If the action is @samp{'add}, an additional argument
6257containing the value for the field is given.
6258
6259@node Speedbar, Menu Bar, Identities, Top
6260@chapter The Speedbar
6261
6262@cindex folder navigation
6263@cindex speedbar
6264@findex mh-visit-folder
6265@findex speedbar
6266@kindex F v
6267@kindex mouse-2
6268
6269You can also use the speedbar
6270@ifnothtml
6271(@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
6272@end ifnothtml
6273@ifhtml
6274(see the section
6275@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Speedbar.html,
6276Speedbar Frames} in @cite{The GNU Emacs Manual})
6277@end ifhtml
6278to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
6279@key{RET}}. You will see a new frame appear with all of your MH
6280folders. Folders with unseen messages appear in boldface. Click on a
6281folder name with @kbd{mouse-2} to visit that folder in a similar
6282fashion to the command @kbd{F v} (@code{mh-visit-folder})
6283(@pxref{Folders}). Click on the @samp{+} icon to expand and view the
6284sub-folders of that folder.
6285
6286The speedbar can be manipulated with the keyboard as well. Use the
6287Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
6288the cursor over the desired folder and then use the shortcuts for the
6289menu items listed in the table below.
6290
6291@table @asis
6292@findex mh-speed-view
6293@item @samp{Visit Folder} (@key{RET})
6294Visits the selected folder just as if you had used @kbd{F v}
6295(@code{mh-speed-view}).
6296@c -------------------------
6297@findex mh-speed-expand-folder
6298@item @samp{Expand Nested Folders} (@kbd{+})
6299Expands the selected folder in the speedbar, exposing the children
6300folders inside it (@code{mh-speed-expand-folder}).
6301@c -------------------------
6302@findex mh-speed-contract-folder
6303@item @samp{Contract Nested Folders} (@kbd{-})
6304Contracts or collapses the selected folder in the speedbar, hiding the
6305children folders inside it (@code{mh-speed-contract-folder}).
6306@c -------------------------
6307@findex mh-speed-refresh
6308@item @samp{Refresh Speedbar} (@kbd{r})
6309Regenerates the list of folders in the speedbar. Run this command if
6310you've added or deleted a folder, or want to update the unseen message
6311count before the next automatic update (@code{mh-speed-refresh}).
6312@end table
6313
6314@findex delete-frame
6315@kindex C-x 5 0
6316@kindex mouse-3
6317
6318You can click on @kbd{mouse-3} to bring up a context menu that
6319contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
6320(@code{delete-frame}).
6321
6322@cindex @command{flists}
6323@cindex MH commands, @command{flists}
6324@cindex @samp{mh-speedbar} customization group
6325@cindex customization group, @samp{mh-speedbar}
6326
6327The MH-E speedbar uses the MH command @command{flists}@footnote{See
6328the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
6329Sequences with flist} in the MH book.} to generate the list of
6330folders. The @samp{mh-speedbar} customization group contains the
6331following option which controls how often the speedbar calls
6332@command{flists}.
6333
6334@vtable @code
6335@item mh-speed-update-interval
6336Time between speedbar updates in seconds (default: 60). Set to 0 to
6337disable automatic update.
6338@end vtable
6339
6340You can modify the appearance of the folders in the speedbar by
6341customizing the following faces.
6342
6343@vtable @code
6344@item mh-speedbar-folder
6345Basic folder face.
6346@c -------------------------
6347@item mh-speedbar-folder-with-unseen-messages
6348Folder face when folder contains unread messages.
6349@c -------------------------
6350@item mh-speedbar-selected-folder
6351Selected folder face.
6352@c -------------------------
6353@item mh-speedbar-selected-folder-with-unseen-messages
6354Selected folder face when folder contains unread messages.
6355@end vtable
6356
6357@node Menu Bar, Tool Bar, Speedbar, Top
6358@chapter The Menu Bar
6359
6360@cindex @samp{Folder} menu
6361@cindex @samp{Identity} menu
6362@cindex @samp{Letter} menu
6363@cindex @samp{Message} menu
6364@cindex @samp{Search} menu
6365@cindex @samp{Sequence} menu
6366@cindex Folder menu
6367@cindex Identity menu
6368@cindex Letter menu
6369@cindex MH-Folder mode
6370@cindex MH-Letter mode
6371@cindex MH-Search mode
6372@cindex Message menu
6373@cindex Search menu
6374@cindex Sequence menu
6375@cindex menu bar
6376@cindex menu, Folder
6377@cindex menu, Identity
6378@cindex menu, Letter
6379@cindex menu, Message
6380@cindex menu, Search
6381@cindex menu, Sequence
6382@cindex menu, @samp{Folder}
6383@cindex menu, @samp{Identity}
6384@cindex menu, @samp{Letter}
6385@cindex menu, @samp{Message}
6386@cindex menu, @samp{Search}
6387@cindex menu, @samp{Sequence}
6388@cindex modes, MH-Folder
6389@cindex modes, MH-Letter
6390@cindex modes, MH-Search
6391
6392For those of you who prefer to mouse and menu instead of using the
6393meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
6394functions. The MH-Folder buffer adds the @samp{Folder},
6395@samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
6396the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
6397the @samp{Search} menu. There's no need to list the actual items here,
6398as you can more easily see them for yourself, and the functions are
6399already described elsewhere in this manual.
6400
6401For a description of the menu bar, please
6402@ifnothtml
6403@xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
6404@end ifnothtml
6405@ifhtml
6406see the section
6407@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bar.html,
6408The Menu Bar} in @cite{The GNU Emacs Manual}.
6409@end ifhtml
6410
6411The Emacs manual describes how to get help for a particular
6412menu item. You can also look up a menu item in the index of this
6413manual in two ways: all of the menu items are listed alphabetically,
6414and you can also browse all of the items under the index entry
6415@samp{menu item}.
6416
6417@node Tool Bar, Searching, Menu Bar, Top
6418@chapter The Tool Bar
6419
6420@cindex tool bar
6421
6422Emacs also provides a graphical tool bar. For a description of the
6423tool bar, please
6424@ifnothtml
6425@xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
6426@end ifnothtml
6427@ifhtml
6428see the section
6429@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Tool-Bars.html,
6430Tool Bars} in @cite{The GNU Emacs Manual}.
6431@end ifhtml
6432
6433@cindex @samp{mh-tool-bar} customization group
6434@cindex customization group, @samp{mh-tool-bar}
6435
6436MH-E adds several icons to this tool bar; you can modify the MH-E
6437aspects of the tool bar via the @samp{mh-tool-bar} customization group.
6438
6439@vtable @code
6440@item mh-tool-bar-folder-buttons
6441List of buttons to include in MH-Folder tool bar (default: a checklist
6442too long to list here).
6443@c -------------------------
6444@item mh-tool-bar-letter-buttons
6445List of buttons to include in MH-Letter tool bar (default: a checklist
6446too long to list here).
6447@c -------------------------
6448@item mh-tool-bar-search-function
6449Function called by the tool bar search button (default:
6450@code{mh-search}).
6451@c -------------------------
6452@item mh-xemacs-tool-bar-position
6453Tool bar location (default: @samp{Same As Default Tool Bar}).
6454@c -------------------------
6455@item mh-xemacs-use-tool-bar-flag
6456If @samp{on}, use tool bar (default: @samp{on}, if supported).
6457@end vtable
6458
6459In GNU Emacs, icons for some of MH-E's functions are added to the tool
6460bar. In XEmacs, you have the opportunity to create a separate tool bar for
6461the MH-E icons.
6462
6463@vindex mh-tool-bar-folder-buttons
6464@vindex mh-tool-bar-letter-buttons
6465
6466In either case, you can select which of these functions you'd like to
6467see by customizing the options @code{mh-tool-bar-folder-buttons} and
6468@code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
6469customizes the tool bar in MH-Folder mode and the latter in MH-Letter
6470mode. Both of these options present you with a list of functions;
6471check the functions whose icons you want to see and clear the check
6472boxes for those you don't.
6473
6474@findex mh-search
6475@vindex mh-tool-bar-search-function
6476
6477The function associated with the searching icon can be set via the
6478option @code{mh-tool-bar-search-function}. By default, this is set to
6479@code{mh-search}. @xref{Searching}. You can also choose @samp{Other
6480Function} from the @samp{Value Menu} and enter a function of your own
6481choosing.
6482
6483@vindex mh-xemacs-use-tool-bar-flag
6484
6485XEmacs provides a couple of extra options. The first,
6486@code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
6487icons at all. By default, this option is turned on if the window
6488system supports tool bars. If your system doesn't support tool bars,
6489then you won't be able to turn on this option.
6490
6491@vindex mh-xemacs-tool-bar-position
6492
6493The second extra option is @code{mh-xemacs-tool-bar-position} which
6494controls the placement of the tool bar along the four edges of the
6495frame. You can choose from one of @samp{Same As Default Tool Bar},
6496@samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
6497variable is set to anything other than @samp{Same As Default Tool Bar}
6498and the default tool bar is in a different location, then two tool
6499bars will be displayed: the MH-E tool bar and the default tool bar.
6500
6501@node Searching, Threading, Tool Bar, Top
6502@chapter Searching Through Messages
6503
6504@cindex @samp{Search} menu
6505@cindex menu, @samp{Search}
6506@cindex searching
6507@findex mh-search
6508@kindex F s
6509
6510Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6511helps you find messages that lie buried in your folders
6512(@pxref{Folders}). This chapter covers this command in more detail.
6513Several commands are used to compose the search criteria and to start
6514searching. A couple of them can be found in the @samp{Search} menu.
6515
6516@table @kbd
6517@kindex C-c ?
6518@findex mh-help
6519@item C-c ?
6520Display cheat sheet for the MH-E commands (@code{mh-help}).
6521@c -------------------------
6522@cindex @samp{Search > Perform Search} menu item
6523@cindex menu item, @samp{Search > Perform Search}
6524@kindex C-c C-c
6525@findex mh-index-do-search
6526@item C-c C-c
6527Find messages using @code{mh-search-program}
6528(@code{mh-index-do-search}).
6529@c -------------------------
6530@cindex @samp{Search > Search with pick} menu item
6531@cindex menu item, @samp{Search > Search with pick}
6532@kindex C-c C-p
6533@findex mh-pick-do-search
6534@item C-c C-p
6535Find messages using @command{pick} (@code{mh-pick-do-search}).
6536@c -------------------------
6537@kindex C-c ?
6538@findex mh-help
6539@item C-c ?
6540Display cheat sheet for the MH-E commands (@code{mh-help}).
6541@c -------------------------
6542@kindex C-c C-f C-a
6543@kindex C-c C-f a
6544@findex mh-to-field
6545@item C-c C-f a
6546@itemx C-c C-f C-a
6547Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6548@c -------------------------
6549@kindex C-c C-f C-b
6550@kindex C-c C-f b
6551@item C-c C-f b
6552@itemx C-c C-f C-b
6553Move to @samp{Bcc:} header field (@code{mh-to-field}).
6554@c -------------------------
6555@kindex C-c C-f C-c
6556@kindex C-c C-f c
6557@item C-c C-f c
6558@itemx C-c C-f C-c
6559Move to @samp{Cc:} header field (@code{mh-to-field}).
6560@c -------------------------
6561@kindex C-c C-f C-d
6562@kindex C-c C-f d
6563@item C-c C-f d
6564@itemx C-c C-f C-d
6565Move to @samp{Dcc:} header field (@code{mh-to-field}).
6566@c -------------------------
6567@kindex C-c C-f C-f
6568@kindex C-c C-f f
6569@item C-c C-f f
6570@itemx C-c C-f C-f
6571Move to @samp{Fcc:} header field (@code{mh-to-field}).
6572@c -------------------------
6573@kindex C-c C-f C-l
6574@kindex C-c C-f l
6575@item C-c C-f l
6576@itemx C-c C-f C-l
6577Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6578@c -------------------------
6579@kindex C-c C-f C-m
6580@kindex C-c C-f m
6581@item C-c C-f m
6582@itemx C-c C-f C-m
6583Move to @samp{From:} header field (@code{mh-to-field}).
6584@c -------------------------
6585@kindex C-c C-f C-r
6586@kindex C-c C-f r
6587@item C-c C-f r
6588@itemx C-c C-f C-r
6589Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6590@c -------------------------
6591@kindex C-c C-f C-s
6592@kindex C-c C-f s
6593@item C-c C-f s
6594@itemx C-c C-f C-s
6595Move to @samp{Subject:} header field (@code{mh-to-field}).
6596@c -------------------------
6597@kindex C-c C-f C-t
6598@kindex C-c C-f t
6599@item C-c C-f t
6600@itemx C-c C-f C-t
6601Move to @samp{To:} header field (@code{mh-to-field}).
6602@end table
6603
6604Another few commands are available in the MH-Folder buffer resulting
6605from a search.
6606
6607@table @kbd
6608@kindex TAB
6609@findex mh-index-next-folder
6610@item @key{TAB}
6611Jump to the next folder marker (@code{mh-index-next-folder}).
6612@c -------------------------
6613@kindex S-TAB
6614@findex mh-index-previous-folder
6615@item S-@key{TAB}
6616Jump to the previous folder marker (@code{mh-index-previous-folder}).
6617@c -------------------------
6618@kindex v
6619@findex mh-index-visit-folder
6620@item v
6621Visit original folder from where the message at point was found
6622(@code{mh-index-visit-folder}).
6623@end table
6624
6625@cindex @samp{mh-search} customization group
6626@cindex customization group, @samp{mh-search}
6627
6628There is one option from the @samp{mh-search} customization group used
6629in searching.
6630
6631@vtable @code
6632@item mh-search-program
6633Search program that MH-E shall use (default: @samp{Auto-detect}).
6634@end vtable
6635
6636The following hook is available.
6637
6638@vtable @code
6639@item mh-search-mode-hook
6640Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6641@end vtable
6642
6643The following face is available.
6644
6645@vtable @code
6646@item mh-search-folder
6647Folder heading face in MH-Folder buffers created by searches.
6648@end vtable
6649
6650@findex mh-search-folder
6651@kindex F s
6652
6653The command @kbd{F s} (@code{mh-search-folder}) helps you find
6654messages in your entire corpus of mail. You can search for messages to
6655or from a particular person or about a particular subject. In fact,
6656you can also search for messages containing selected strings in any
6657arbitrary header field or any string found within the messages.
6658
6659@cindex @command{pick}
6660@cindex MH commands, @command{pick}
6661
6662Out of the box, MH-E uses @command{pick} to find messages. With a
6663little extra effort, you can set an indexing program which rewards you
6664with extremely quick results. The drawback is that sometimes the index
6665does not contain the words you're looking for. You can still use
6666@command{pick} in these situations.
6667
6668You are prompted for the folder to search. This can be @samp{all} to
6669search all folders. Note that the search works recursively on the
6670listed folder.
6671
6672@cindex MH-Search mode
6673@cindex modes, MH-Search
6674
6675Next, an MH-Search buffer appears where you can enter search criteria.
6676
6677@cartouche
6678@smallexample
6679From:
6680To:
6681Cc:
6682Date:
6683Subject:
6684--------
6685#
6686
6687
6688
6689
6690
6691
6692
6693
6694--:**  search-pattern   All L7     (MH-Search)---------------------------
6695Type C-c C-c to search messages, C-c C-p to use pick, C-c ? for help
6696@end smallexample
6697@end cartouche
6698@i{Search window}
6699
6700@cindex @command{pick}
6701@cindex MH commands, @command{pick}
6702
6703Edit this template by entering your search criteria in an appropriate
6704header field that is already there, or create a new field yourself. If
6705the string you're looking for could be anywhere in a message, then
6706place the string underneath the row of dashes.
6707
6708As an example, let's say that we want to find messages from Ginnean
6709about horseback riding in the Kosciusko National Park (Australia)
6710during January, 1994. Normally we would start with a broad search and
6711narrow it down if necessary to produce a manageable amount of data,
6712but we'll cut to the chase and create a fairly restrictive set of
6713criteria as follows:
6714
6715@smallexample
6716@group
6717From: ginnean
6718To:
6719Cc:
6720Date: Jan 1994
6721Subject:
6722--------
6723horse
6724kosciusko
6725@end group
6726@end smallexample
6727
6728@findex mh-to-field
6729@kindex C-c C-f C-t
6730
6731As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6732C-t} (@code{mh-to-field}) to help you fill in the blanks.
6733@xref{Editing Message}.
6734
6735@kindex F s
6736@vindex mh-search-mode-hook
6737
6738If you find that you do the same thing over and over when editing the
6739search template, you may wish to bind some shortcuts to keys. This can
6740be done with the variable @code{mh-search-mode-hook}, which is called
6741when @kbd{F s} is run on a new pattern.
6742
6743@findex mh-index-do-search
6744@findex mh-pick-do-search
6745@kindex C-c C-c
6746@kindex C-c C-p
6747
6748To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6749Sometimes you're searching for text that is either not indexed, or
6750hasn't been indexed yet. In this case you can override the default
6751method with the pick method by running the command @kbd{C-c C-p}
6752(@code{mh-pick-do-search}).
6753
6754@cindex folders, @samp{+mhe-index}
6755@cindex @samp{+mhe-index}
6756@findex mh-index-next-folder
6757@findex mh-index-previous-folder
6758@kindex TAB
6759@kindex S-TAB
6760@vindex mh-search-folder
6761
6762The messages that are found are put in a temporary sub-folder of
6763@samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6764buffer is special because it displays messages from multiple folders;
6765each set of messages from a given folder has a heading with the folder
6766name. The appearance of the heading can be modified by customizing the
6767face @code{mh-search-folder}. You can jump back and forth between the
6768headings using the commands @kbd{@key{TAB}}
6769(@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6770(@code{mh-index-previous-folder}).
6771
6772@findex mh-index-visit-folder
6773@findex mh-rescan-folder
6774@kindex F r
6775@kindex v
6776
6777In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6778used to visit the folder of the message at point. Initially, only the
6779messages that matched the search criteria are displayed in the folder.
6780While the temporary buffer has its own set of message numbers, the
6781actual messages numbers are shown in the visited folder. Thus, the
6782command @kbd{v} is useful to find the actual message number of an
6783interesting message, or to view surrounding messages with the command
6784@kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6785
6786@findex mh-kill-folder
6787@kindex F k
6788
6789Because this folder is temporary, you'll probably get in the habit of
6790killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6791@xref{Folders}.
6792
6793@kindex F s
6794
6795You can regenerate the results by running @kbd{F s} with a prefix
6796argument.
6797
6798@cindex @command{procmail}
6799@cindex Unix commands, @command{procmail}
6800@cindex @samp{X-MHE-Checksum} header field
6801@cindex header field, @samp{X-MHE-Checksum}
6802
6803Note: This command uses an @samp{X-MHE-Checksum:} header field to
6804cache the MD5 checksum of a message. This means that if an incoming
6805message already contains an @samp{X-MHE-Checksum:} field, that message
6806might not be found by this command. The following @command{procmail}
6807recipe avoids this problem by renaming the existing header field:
6808
6809@smallexample
6810@group
6811:0 wf
6812| formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6813@end group
6814@end smallexample
6815
6816@xref{Limits}, for an alternative interface to searching.
6817
6818@section Configuring Indexed Searches
6819
6820@cindex @command{grep}
6821@cindex @command{mairix}
6822@cindex @command{namazu}
6823@cindex @command{pick}
6824@cindex @command{swish++}
6825@cindex @command{swish-e}
6826@cindex Unix commands, @command{grep}
6827@cindex Unix commands, @command{mairix}
6828@cindex Unix commands, @command{namazu}
6829@cindex Unix commands, @command{pick}
6830@cindex Unix commands, @command{swish++}
6831@cindex Unix commands, @command{swish-e}
6832@findex mh-search
6833@kindex F s
6834@vindex mh-search-program
6835
6836The command @kbd{F s} (@code{mh-search}) runs the command defined by
6837the option @code{mh-search-program}. The default value is
6838@samp{Auto-detect} which means that MH-E will automatically choose one
6839of @command{swish++}, @command{swish-e}, @command{mairix},
6840@command{namazu}, @command{pick} and @command{grep} in that order. If,
6841for example, you have both @command{swish++} and @command{mairix}
6842installed and you want to use @command{mairix}, then you can set this
6843option to @samp{mairix}.
6844
6845The following sub-sections describe how to set up the various indexing
6846programs to use with MH-E.
6847
6848@subsection swish++
6849
6850@cindex @command{swish++}
6851@cindex Unix commands, @command{swish++}
6852
6853In the examples below, replace @file{/home/user/Mail} with the path to
6854your MH directory.
6855
6856First create the directory @file{/home/user/Mail/.swish++}. Then
6857create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6858following contents:
6859
6860@smallexample
6861@group
6862IncludeMeta         Bcc Cc Comments Content-Description From Keywords
6863IncludeMeta         Newsgroups Resent-To Subject To
6864IncludeMeta         Message-Id References In-Reply-To
6865IncludeFile         Mail    *
6866IndexFile           /home/user/Mail/.swish++/swish++.index
6867@end group
6868@end smallexample
6869
6870Use the following command line to generate the swish index. Run this
6871daily from cron:
6872
6873@smallexample
6874@group
6875find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6876                     -o -path /home/user/Mail/.swish++ -prune \
6877                     -o -name "[0-9]*" -print \
6878    | index -c /home/user/Mail/.swish++/swish++.conf -
6879@end group
6880@end smallexample
6881
6882This command does not index the folders that hold the results of your
6883searches in @samp{+mhe-index} since they tend to be ephemeral and the
6884original messages are indexed anyway.
6885
6886@cindex @command{index}
6887@cindex Unix commands, @command{index}
6888@cindex @command{index++}
6889@cindex Unix commands, @command{index++}
6890
6891On some systems (Debian GNU/Linux, for example), use @command{index++}
6892instead of @command{index}.
6893
6894@subsection swish
6895
6896@cindex @command{swish-e}
6897@cindex Unix commands, @command{swish-e}
6898
6899In the examples below, replace @file{/home/user/Mail} with the path to
6900your MH directory.
6901
6902First create the directory @file{/home/user/Mail/.swish}. Then create
6903the file @file{/home/user/Mail/.swish/config} with the following
6904contents:
6905
6906@smallexample
6907@group
6908DefaultContents TXT*
6909IndexDir /home/user/Mail
6910IndexFile /home/user/Mail/.swish/index
6911IndexName "Mail Index"
6912IndexDescription "Mail Index"
6913IndexPointer "https://nowhere"
6914IndexAdmin "nobody"
6915#MetaNames automatic
6916IndexReport 3
6917FollowSymLinks no
6918UseStemming no
6919IgnoreTotalWordCountWhenRanking yes
6920WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6921BeginCharacters abcdefghijklmnopqrstuvwxyz
6922EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6923IgnoreLimit 50 1000
6924IndexComments 0
6925FileRules filename contains \D
6926FileRules pathname contains /home/user/Mail/.swish
6927FileRules pathname contains /home/user/Mail/mhe-index
6928FileRules filename is index
6929@end group
6930@end smallexample
6931
6932This configuration does not index the folders that hold the results of
6933your searches in @samp{+mhe-index} since they tend to be ephemeral and
6934the original messages are indexed anyway.
6935
6936If there are any directories you would like to ignore, append lines
6937like the following to @file{config}:
6938
6939@smallexample
6940FileRules pathname contains /home/user/Mail/scripts
6941@end smallexample
6942
6943@cindex @command{swish-e}
6944@cindex Unix commands, @command{swish-e}
6945
6946Use the following command line to generate the swish index. Run this
6947daily from cron:
6948
6949@smallexample
6950swish-e -c /home/user/Mail/.swish/config
6951@end smallexample
6952
6953@subsection mairix
6954
6955@cindex @command{mairix}
6956@cindex Unix commands, @command{mairix}
6957
6958In the examples below, replace @file{~/Mail} with the path to your MH
6959directory.
6960
6961First create the directory @file{~/Mail/.mairix}. Then create the file
6962@file{~/Mail/.mairix/config} with the following contents:
6963
6964@smallexample
6965@group
6966base=~/Mail
6967
6968# List of folders that should be indexed. 3 dots at the end means there
6969# are subfolders within the folder
6970mh=archive...:inbox:drafts:news:sent:trash
6971
6972mformat=mh
6973database=~/Mail/.mairix/database
6974@end group
6975@end smallexample
6976
6977Use the following command line to generate the mairix index. Run this daily
6978from cron:
6979
6980@smallexample
6981mairix -f ~/Mail/.mairix/config
6982@end smallexample
6983
6984@subsection namazu
6985
6986@cindex @command{namazu}
6987@cindex Unix commands, @command{namazu}
6988
6989In the examples below, replace @file{/home/user/Mail} with the path to
6990your MH directory.
6991
6992First create the directory @file{/home/user/Mail/.namazu}. Then create
6993the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
6994contents:
6995
6996@smallexample
6997@group
6998package conf;  # Don't remove this line!
6999$ADDRESS = 'user@@localhost';
7000$ALLOW_FILE = "[0-9]*";
7001$EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
7002@end group
7003@end smallexample
7004
7005This configuration does not index the folders that hold the results of
7006your searches in @samp{+mhe-index} since they tend to be ephemeral and
7007the original messages are indexed anyway.
7008
7009Use the following command line to generate the namazu index. Run this
7010daily from cron:
7011
7012@smallexample
7013mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
7014      -q /home/user/Mail
7015@end smallexample
7016
7017@subsection pick
7018
7019@cindex @command{pick}
7020@cindex MH commands, @command{pick}
7021
7022This search method does not require any setup.
7023
7024Read @command{pick}(1) or the section
7025@uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7026the MH book to find out more about how to enter the criteria.
7027
7028@subsection grep
7029
7030@cindex @command{grep}
7031@cindex Unix commands, @command{grep}
7032
7033This search method does not require any setup.
7034
7035Unlike the other search methods, this method does not use the
7036MH-Search buffer. Instead, you simply enter a regular expression in
7037the minibuffer. For help in constructing regular expressions, see your
7038man page for @command{grep}.
7039
7040@node Threading, Limits, Searching, Top
7041@chapter Viewing Message Threads
7042
7043@cindex threading
7044
7045MH-E groups messages by @dfn{threads} which are messages that are part
7046of the same discussion and usually all have the same @samp{Subject:}
7047header field. Other ways to organize messages in a folder include
7048limiting (@pxref{Limits}) or using full-text indexed searches
7049(@pxref{Searching}).
7050
7051@cindex root, in threads
7052@cindex siblings, in threads
7053@cindex ancestor, in threads
7054
7055A thread begins with a single message called a @dfn{root}. All replies
7056to the same message are @dfn{siblings} of each other. Any message that
7057has replies to it is an @dfn{ancestor} of those replies.
7058
7059There are several commands that you can use to navigate and operate on
7060threads.
7061
7062@table @kbd
7063@kindex T ?
7064@findex mh-prefix-help
7065@item T ?
7066Display cheat sheet for the commands of the current prefix in
7067minibuffer (@code{mh-prefix-help}).
7068@c -------------------------
7069@kindex T o
7070@findex mh-thread-refile
7071@item T o
7072Refile (output) thread into folder (@code{mh-thread-refile}).
7073@c -------------------------
7074@kindex T d
7075@findex mh-thread-delete
7076@item T d
7077Delete thread (@code{mh-thread-delete}).
7078@c -------------------------
7079@kindex T t
7080@findex mh-toggle-threads
7081@item T t
7082Toggle threaded view of folder (@code{mh-toggle-threads}).
7083@c -------------------------
7084@kindex T n
7085@findex mh-thread-next-sibling
7086@item T n
7087Display next sibling (@code{mh-thread-next-sibling}).
7088@c -------------------------
7089@kindex T p
7090@findex mh-thread-previous-sibling
7091@item T p
7092Display previous sibling (@code{mh-thread-previous-sibling}).
7093@c -------------------------
7094@kindex T u
7095@findex mh-thread-ancestor
7096@item T u
7097Display ancestor of current message (@code{mh-thread-ancestor}).
7098@end table
7099
7100@cindex @samp{mh-thread} customization group
7101@cindex customization group, @samp{mh-thread}
7102
7103The @samp{mh-thread} customization group contains one option.
7104
7105@vtable @code
7106@item mh-show-threads-flag
7107On means new folders start in threaded mode (default: @samp{off}).
7108@end vtable
7109
7110@findex mh-toggle-threads
7111@kindex T t
7112@vindex mh-large-folder
7113@vindex mh-show-threads-flag
7114
7115Threading large number of messages can be time consuming so the option
7116@code{mh-show-threads-flag} is turned off by default. If you turn on
7117this option, then threading will be done only if the number of
7118messages being threaded is less than @code{mh-large-folder}. In any
7119event, threading can be turned on (and off) with the command @kbd{T t}
7120(@code{mh-toggle-threads}).
7121
7122@findex mh-thread-ancestor
7123@findex mh-thread-next-sibling
7124@findex mh-thread-previous-sibling
7125@kindex T n
7126@kindex T p
7127@kindex T u
7128
7129There are a few commands to help you navigate threads. If you do not
7130care for the way a particular thread has turned, you can move up the
7131chain of messages with the command @kbd{T u}
7132(@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
7133(@code{mh-thread-next-sibling} or @kbd{T p}
7134(@code{mh-thread-previous-sibling}) to jump to the next or previous
7135sibling, skipping the sub-threads. The command @kbd{T u} can also take
7136a prefix argument to jump to the message that started everything.
7137
7138@findex mh-delete-subject-or-thread
7139@findex mh-thread-delete
7140@findex mh-thread-refile
7141@kindex k
7142@kindex T d
7143@kindex T o
7144
7145There are threaded equivalents for the commands that delete and refile
7146messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
7147current message and all its children. Similarly, the command @kbd{T d}
7148(@code{mh-thread-delete}) deletes the current message and all its
7149children. These commands do not refile or delete sibling messages.
7150@xref{Navigating}, for a description of the similar command @kbd{k}
7151(@code{mh-delete-subject-or-thread}).
7152
7153@vindex mh-large-folder
7154
7155If you find that threading is too slow, it may be that you have
7156@code{mh-large-folder} set too high. Also, threading is one of the few
7157features of MH-E that really benefits from compiling. If you haven't
7158compiled MH-E, I encourage you to do so@footnote{If you're not sure if
7159MH-E has been byte-compiled, you could try running @samp{locate
7160mh-thread.elc} or otherwise find MH-E on your system and ensure that
7161@file{mh-thread.elc} exists. If you have multiple versions and you
7162find that one is compiled but the other is not, then go into your
7163@file{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
7164ensure that the byte-compiled version appears first in the
7165@code{load-path}. If you find that MH-E is not compiled and you
7166installed MH-E yourself, please refer to the installation directions
7167in the file @file{README} in the distribution.}.
7168
7169@node Limits, Sequences, Threading, Top
7170@chapter Limiting Display
7171
7172@cindex limits
7173@cindex filters
7174
7175Another way to organize messages in a folder besides threading
7176(@pxref{Threading}) or using full-text indexed searches
7177(@pxref{Searching}) is by limiting the folder display to messages that
7178are similar to the current message.
7179
7180@table @kbd
7181@kindex / ?
7182@findex mh-prefix-help
7183@item / ?
7184Display cheat sheet for the commands of the current prefix in
7185minibuffer (@code{mh-prefix-help}).
7186@c -------------------------
7187@cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7188@cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7189@kindex / '
7190@findex mh-narrow-to-tick
7191@item / '
7192Limit to messages in the @samp{tick} sequence
7193(@code{mh-narrow-to-tick}).
7194@c -------------------------
7195@kindex / c
7196@findex mh-narrow-to-cc
7197@item / c
7198Limit to messages with the same @samp{Cc:} field
7199(@code{mh-narrow-to-cc}).
7200@c -------------------------
7201@kindex / m
7202@findex mh-narrow-to-from
7203@item / m
7204Limit to messages with the same @samp{From:} field
7205(@code{mh-narrow-to-from}).
7206@c -------------------------
7207@kindex / g
7208@findex mh-narrow-to-range
7209@item / g
7210Limit to range (@code{mh-narrow-to-range}).
7211@c -------------------------
7212@cindex @samp{Sequence > Narrow to Subject Sequence} menu item
7213@cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
7214@kindex / s
7215@findex mh-narrow-to-subject
7216@item / s
7217Limit to messages with the same @samp{Subject:} field
7218(@code{mh-narrow-to-subject}).
7219@c -------------------------
7220@kindex / t
7221@findex mh-narrow-to-to
7222@item / t
7223Limit to messages with the same @samp{To:} field
7224(@code{mh-narrow-to-to}).
7225@c -------------------------
7226@cindex @samp{Sequence > Widen from Sequence} menu item
7227@cindex menu item, @samp{Sequence > Widen from Sequence}
7228@kindex / w
7229@findex mh-widen
7230@item / w
7231Remove last restriction (@code{mh-widen}).
7232@end table
7233
7234All of the limiting commands above refine the display in some way.
7235
7236@cindex @command{pick}
7237@cindex MH commands, @command{pick}
7238@findex mh-narrow-to-cc
7239@findex mh-narrow-to-from
7240@findex mh-narrow-to-subject
7241@findex mh-narrow-to-to
7242@kindex / c
7243@kindex / m
7244@kindex / s
7245@kindex / t
7246
7247The commands @kbd{/ c} (@code{mh-narrow-to-cc}), @kbd{/ m}
7248(@code{mh-narrow-to-from}), @kbd{/ s} (@code{mh-narrow-to-subject}),
7249and @kbd{/ t} (@code{mh-narrow-to-to}) restrict the display to
7250messages matching the content of the respective field in the current
7251message. However, you can give any of these a prefix argument to edit
7252the @command{pick} expression used to narrow the view@footnote{See
7253@command{pick}(1) or the section
7254@uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7255the MH book.}.
7256
7257@cindex @samp{tick} sequence
7258@cindex sequence, @samp{tick}
7259@cindex ticked messages, viewing
7260@findex mh-narrow-to-range
7261@findex mh-narrow-to-tick
7262@kindex / '
7263@kindex / g
7264
7265You can also limit the display to messages in the @samp{tick} sequence
7266with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
7267@xref{Sequences}, for information on putting message into the
7268@samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
7269command to limit the display to messages in a range (@pxref{Ranges}).
7270
7271@findex mh-widen
7272@kindex / w
7273
7274Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
7275command. Give this command a prefix argument to remove all limits.
7276
7277@node Sequences, Junk, Limits, Top
7278@chapter Using Sequences
7279
7280@cindex @samp{Sequence} menu
7281@cindex menu, @samp{Sequence}
7282@cindex sequences
7283
7284For the whole scoop on MH sequences, refer to
7285@samp{mh-sequence}(5)@footnote{See the section
7286@uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
7287book.}. As you've read, several of the MH-E commands can operate on a
7288sequence, which is a shorthand for a range or group of messages. For
7289example, you might want to forward several messages to a friend or
7290colleague. Here's how to manipulate sequences. These commands are also
7291available in the @samp{Sequence} menu.
7292
7293@table @kbd
7294@cindex @samp{Sequence > Toggle Tick Mark} menu item
7295@cindex menu item, @samp{Sequence > Toggle Tick Mark}
7296@kindex '
7297@findex mh-toggle-tick
7298@item '
7299Toggle tick mark of range (@code{mh-toggle-tick}).
7300@c -------------------------
7301@kindex S ?
7302@findex mh-prefix-help
7303@item S ?
7304Display cheat sheet for the commands of the current prefix in
7305minibuffer (@code{mh-prefix-help}).
7306@c -------------------------
7307@cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7308@cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7309@kindex S '
7310@findex mh-narrow-to-tick
7311@item S '
7312Limit to ticked messages (@code{mh-narrow-to-tick}).
7313@c -------------------------
7314@cindex @samp{Sequence > Delete Message from Sequence...} menu item
7315@cindex menu item, @samp{Sequence > Delete Message from Sequence...}
7316@kindex S d
7317@findex mh-delete-msg-from-seq
7318@item S d
7319Delete range from sequence (@code{mh-delete-msg-from-seq}).
7320@c -------------------------
7321@cindex @samp{Sequence > Delete Sequence...} menu item
7322@cindex menu item, @samp{Sequence > Delete Sequence...}
7323@kindex S k
7324@findex mh-delete-seq
7325@item S k
7326Delete sequence (@code{mh-delete-seq}).
7327@c -------------------------
7328@cindex @samp{Sequence > List Sequences in Folder...} menu item
7329@cindex menu item, @samp{Sequence > List Sequences in Folder...}
7330@kindex S l
7331@findex mh-list-sequences
7332@item S l
7333List all sequences in folder (@code{mh-list-sequences}).
7334@c -------------------------
7335@cindex @samp{Sequence > Narrow to Sequence...} menu item
7336@cindex menu item, @samp{Sequence > Narrow to Sequence...}
7337@kindex S n
7338@findex mh-narrow-to-seq
7339@item S n
7340Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
7341@c -------------------------
7342@cindex @samp{Sequence > Add Message to Sequence...} menu item
7343@cindex menu item, @samp{Sequence > Add Message to Sequence...}
7344@kindex S p
7345@findex mh-put-msg-in-seq
7346@item S p
7347Add range to sequence (@code{mh-put-msg-in-seq}).
7348@c -------------------------
7349@cindex @samp{Sequence > List Sequences for Message} menu item
7350@cindex menu item, @samp{Sequence > List Sequences for Message}
7351@kindex S s
7352@findex mh-msg-is-in-seq
7353@item S s
7354Display the sequences in which the current message appears
7355(@code{mh-msg-is-in-seq}).
7356@c -------------------------
7357@cindex @samp{Sequence > Widen from Sequence} menu item
7358@cindex menu item, @samp{Sequence > Widen from Sequence}
7359@kindex S w
7360@findex mh-widen
7361@item S w
7362Remove last restriction (@code{mh-widen}).
7363@c -------------------------
7364@findex mh-update-sequences
7365@item M-x mh-update-sequences
7366Flush MH-E's state out to MH@.
7367@end table
7368
7369@cindex @samp{mh-sequences} customization group
7370@cindex customization group, @samp{mh-sequences}
7371
7372The @samp{mh-sequences} customization group contains the options
7373associated with sequences.
7374
7375@vtable @code
7376@item mh-refile-preserves-sequences-flag
7377On means that sequences are preserved when messages are refiled
7378(default: @samp{on}).
7379@c -------------------------
7380@item mh-tick-seq
7381The name of the MH sequence for ticked messages (default: @samp{'tick}).
7382@c -------------------------
7383@item mh-update-sequences-after-mh-show-flag
7384On means flush MH sequences to disk after message is shown (default:
7385@samp{on}).
7386@item mh-whitelist-preserves-sequences-flag
7387On means that sequences are preserved when messages are whitelisted
7388(default: @samp{on}).
7389@end vtable
7390
7391The following hook is available.
7392
7393@vtable @code
7394@item mh-unseen-updated-hook
7395Hook run after the unseen sequence has been updated (default: @code{nil}).
7396@end vtable
7397
7398@cindex @command{pick}
7399@cindex MH commands, @command{pick}
7400@findex mh-put-msg-in-seq
7401@kindex S p
7402
7403To place a message in a sequence, use @kbd{S p}
7404(@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
7405the messages in a sequence to another sequence (for example, @kbd{C-u
7406S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
7407
7408@cindex @samp{tick} sequence
7409@cindex sequence, @samp{tick}
7410@cindex ticking messages
7411@findex mh-index-ticked-messages
7412@findex mh-toggle-tick
7413@kindex '
7414@kindex F '
7415@kindex S p
7416
7417One specific use of the @kbd{S p} command is @kbd{'}
7418(@code{mh-toggle-tick}) which adds messages to the @samp{tick}
7419sequence. This sequence can be viewed later with the @kbd{F '}
7420(@code{mh-index-ticked-messages}) command (@pxref{Folders}).
7421
7422@vindex mh-tick-seq
7423
7424You can customize the option @code{mh-tick-seq} if you already use the
7425@samp{tick} sequence for your own use. You can also disable all of the
7426ticking functions by choosing the @samp{Disable Ticking} item but
7427there isn't much advantage to that.
7428
7429@cindex MH-Folder mode
7430@cindex modes, MH-Folder
7431@findex mh-narrow-to-seq
7432@findex mh-narrow-to-tick
7433@findex mh-widen
7434@kindex S '
7435@kindex S n
7436@kindex S w
7437
7438Once you've placed some messages in a sequence, you may wish to narrow
7439the field of view to just those messages in the sequence you've
7440created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
7441prompted for the name of the sequence. What this does is show only
7442those messages that are in the selected sequence in the MH-Folder
7443buffer. In addition, it limits further MH-E searches to just those
7444messages. To narrow the view to the messages in the @samp{tick}
7445sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
7446widen the view to all your messages again, use @kbd{S w}
7447(@code{mh-widen}).
7448
7449@cindex buffers, @file{*MH-E Sequences*}
7450@cindex @file{*MH-E Sequences*}
7451@findex mh-list-sequences
7452@findex mh-msg-is-in-seq
7453@kindex S l
7454@kindex S s
7455
7456You can see which sequences in which a message appears with the
7457command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
7458display the sequences in which another message appears (as in @kbd{C-u
745942 S s @key{RET}}). Or, you can list all sequences in a selected
7460folder (default is current folder) with @kbd{S l}
7461(@code{mh-list-sequences}). The list appears in a buffer named
7462@file{*MH-E Sequences*} (@pxref{Miscellaneous}).
7463
7464@cindex MH profile component, @samp{Previous-Sequence}
7465@cindex @samp{cur} sequence
7466@cindex @samp{Previous-Sequence} MH profile component
7467@cindex sequence, @samp{cur}
7468@cindex sequence, @samp{Previous-Sequence}
7469@vindex mh-refile-preserves-sequences-flag
7470
7471If a message is in any sequence (except
7472@samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
7473@samp{cur}) when it is refiled, then it will still be in those
7474sequences in the destination folder. If this behavior is not desired,
7475then turn off the option @code{mh-refile-preserves-sequences-flag}.
7476
7477@findex mh-delete-msg-from-seq
7478@findex mh-delete-seq
7479@kindex d
7480@kindex S d
7481@kindex S k
7482
7483If you want to remove a message (or range, @pxref{Ranges}) from a
7484sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
7485to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
7486the latter case you are prompted for the sequence to delete. Note that
7487this deletes only the sequence, not the messages in the sequence. If
7488you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
7489Mail}).
7490
7491@cindex @samp{Unseen-Sequence} MH profile component
7492@cindex @samp{cur} sequence
7493@cindex @samp{tick} sequence
7494@cindex MH profile component, @samp{Unseen-Sequence}
7495@cindex sequence, @samp{Unseen-Sequence}
7496@cindex sequence, @samp{cur}
7497@cindex sequence, @samp{tick}
7498@findex mh-update-sequences
7499@kindex q
7500@kindex x
7501@vindex mh-tick-seq
7502@vindex mh-update-sequences-after-mh-show-flag
7503
7504Three sequences are maintained internally by MH-E and pushed out to MH
7505when a message is shown. They include the sequence specified by your
7506@samp{Unseen-Sequence:} profile component, @samp{cur}, and the
7507sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
7508by default. If you do not like this behavior, turn off the option
7509@code{mh-update-sequences-after-mh-show-flag}. You can then update the
7510state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
7511mh-update-sequences} commands.
7512
7513@vindex mh-seen-list
7514@vindex mh-unseen-updated-hook
7515
7516The hook @code{mh-unseen-updated-hook} is run after the unseen
7517sequence has been updated. The variable @code{mh-seen-list} can be
7518used by this hook to obtain the list of messages which were removed
7519from the unseen sequence.
7520
7521@cindex @command{mark}
7522@cindex MH commands, @command{mark}
7523@kindex S n
7524@kindex S w
7525
7526With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
7527command dealing with sequences is @command{mark}@footnote{See the
7528section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
7529with mark} in the MH book.}.
7530
7531@node Junk, Miscellaneous, Sequences, Top
7532@chapter Dealing With Junk Mail
7533
7534@cindex Marshall Rose
7535@cindex junk mail
7536@cindex spam
7537
7538Marshall Rose once wrote a paper on MH entitled, @cite{How to process
7539200 messages a day and still get some real work done}. This chapter
7540could be entitled, @cite{How to process 1000 spams a day and still get
7541some real work done}.
7542
7543@cindex blacklisting
7544@cindex ham
7545@cindex viruses
7546@cindex whitelisting
7547@cindex worms
7548
7549We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
7550any unwanted message which includes spam, @dfn{viruses}, and
7551@dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
7552a sender as one who sends junk mail is called @dfn{blacklisting}; the
7553opposite is called @dfn{whitelisting}.
7554
7555@table @kbd
7556@kindex J ?
7557@findex mh-prefix-help
7558@item J ?
7559Display cheat sheet for the commands of the current prefix in
7560minibuffer (@code{mh-prefix-help}).
7561@c -------------------------
7562@kindex J b
7563@findex mh-junk-blacklist
7564@item J b
7565Blacklist range as spam (@code{mh-junk-blacklist}).
7566@c -------------------------
7567@kindex J w
7568@findex mh-junk-whitelist
7569@item J w
7570Whitelist range as ham (@code{mh-junk-whitelist}).
7571@c -------------------------
7572@item @code{mh-spamassassin-identify-spammers}
7573Identify spammers who are repeat offenders.
7574@end table
7575
7576@cindex @samp{mh-junk} customization group
7577@cindex customization group, @samp{mh-junk}
7578
7579The following table lists the options from the @samp{mh-junk}
7580customization group.
7581
7582@vtable @code
7583@item mh-junk-background
7584If on, spam programs are run in background (default: @samp{off}).
7585@c -------------------------
7586@item mh-junk-disposition
7587Disposition of junk mail (default: @samp{Delete Spam}).
7588@c -------------------------
7589@item mh-junk-program
7590Spam program that MH-E should use (default: @samp{Auto-detect}).
7591@end vtable
7592
7593@cindex @samp{mh-sequences} customization group
7594@cindex customization group, @samp{mh-sequences}
7595
7596The following option in the @samp{mh-sequences} customization group is
7597also available.
7598
7599@vtable @code
7600@item mh-whitelist-preserves-sequences-flag
7601On means that sequences are preserved when messages are whitelisted
7602(default: @samp{on}).
7603@end vtable
7604
7605The following hooks are available.
7606
7607@vtable @code
7608@item mh-blacklist-msg-hook
7609Hook run by @kbd{J b} (@code{mh-junk-blacklist}) after marking each
7610message for blacklisting (default: @code{nil}).
7611@c -------------------------
7612@item mh-whitelist-msg-hook
7613Hook run by @kbd{J w} (@code{mh-junk-whitelist}) after marking each
7614message for whitelisting (default @samp{nil}).
7615@end vtable
7616
7617The following faces are available.
7618
7619@vtable @code
7620@item mh-folder-blacklisted
7621Blacklisted message face.
7622@c -------------------------
7623@item mh-folder-whitelisted
7624Whitelisted message face
7625@end vtable
7626
7627@cindex SpamProbe
7628@cindex SpamAssassin
7629@cindex bogofilter
7630@cindex spam filters, SpamProbe
7631@cindex spam filters, SpamAssassin
7632@cindex spam filters, bogofilter
7633
7634MH-E depends on @uref{https://spamassassin.apache.org/, SpamAssassin},
7635@uref{http://bogofilter.sourceforge.net/, bogofilter}, or
7636@uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
7637away. This chapter describes briefly how to configure these programs
7638to work well with MH-E and how to use MH-E's interface that provides
7639continuing education for these programs.
7640
7641@vindex mh-junk-program
7642
7643The default setting of the option @code{mh-junk-program} is
7644@samp{Auto-detect} which means that MH-E will automatically choose one
7645of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
7646example, you have both SpamAssassin and bogofilter installed and you
7647want to use bogofilter, then you can set this option to
7648@samp{Bogofilter}.
7649
7650@findex mh-junk-blacklist
7651@kindex J b
7652@vindex mh-junk-disposition
7653
7654The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7655program in use with the content of the range (@pxref{Ranges}) and then
7656handles the message(s) as specified by the option
7657@code{mh-junk-disposition}. By default, this option is set to
7658@samp{Delete Spam} but you can also specify the name of the folder
7659which is useful for building a corpus of spam for training purposes.
7660
7661@findex mh-junk-whitelist
7662@kindex J w
7663
7664In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7665reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7666incorrectly classified as spam. It then refiles the message into the
7667@file{+inbox} folder.
7668
7669@cindex MH profile component, @samp{Previous-Sequence}
7670@cindex @samp{cur} sequence
7671@cindex @samp{Previous-Sequence} MH profile component
7672@cindex sequence, @samp{cur}
7673@cindex sequence, @samp{Previous-Sequence}
7674@vindex mh-whitelist-preserves-sequences-flag
7675
7676If a message is in any sequence (except @samp{Previous-Sequence:} and
7677@samp{cur}) when it is whitelisted, then it will still be in those
7678sequences in the destination folder. If this behavior is not desired,
7679then turn off the option @code{mh-whitelist-preserves-sequences-flag}.
7680
7681@cindex @file{*MH-E Log*}
7682@cindex buffers, @file{*MH-E Log*}
7683@findex call-process
7684@vindex mh-junk-background
7685
7686By default, the programs are run in the foreground, but this can be
7687slow when junking large numbers of messages. If you have enough memory
7688or don't junk that many messages at the same time, you might try
7689turning on the option @code{mh-junk-background}. @footnote{Note that
7690the option @code{mh-junk-background} is used as the @code{display}
7691argument in the call to @code{call-process}. Therefore, turning on
7692this option means setting its value to @samp{0}. You can also set its
7693value to @samp{t} to direct the programs' output to the @file{*MH-E
7694Log*} buffer; this may be useful for debugging.}
7695
7696The following sections discuss the various counter-spam measures that
7697MH-E can work with.
7698
7699@cindex @file{.procmailrc}
7700@cindex files, @file{.procmailrc}
7701
7702@subheading SpamAssassin
7703
7704@cindex SpamAssassin
7705@cindex spam filters, SpamAssassin
7706
7707SpamAssassin is one of the more popular spam filtering programs. Get
7708it from your local distribution or from the
7709@uref{https://spamassassin.apache.org/, SpamAssassin web site}.
7710
7711To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7712
7713@cindex @command{spamc}
7714@cindex @samp{X-Spam-Level} header field
7715@cindex @samp{X-Spam-Status} header field
7716@cindex header field, @samp{X-Spam-Level}
7717@cindex header field, @samp{X-Spam-Status}
7718
7719@smallexample
7720PATH=$PATH:/usr/bin/mh
7721MAILDIR=$HOME/`mhparam Path`
7722
7723# Fight spam with SpamAssassin.
7724:0fw
7725| spamc
7726
7727# Anything with a spam level of 10 or more is junked immediately.
7728:0:
7729* ^X-Spam-Level: ..........
7730/dev/null
7731
7732:0:
7733* ^X-Spam-Status: Yes
7734spam/.
7735@end smallexample
7736
7737If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7738
7739Note that one of the recipes above throws away messages with a score
7740greater than or equal to 10. Here's how you can determine a value that
7741works best for you.
7742
7743First, run @samp{spamassassin -t} on every mail message in your
7744archive and use @command{gnumeric} to verify that the average plus the
7745standard deviation of good mail is under 5, the SpamAssassin default
7746for ``spam''.
7747
7748Using @command{gnumeric}, sort the messages by score and view the
7749messages with the highest score. Determine the score which encompasses
7750all of your interesting messages and add a couple of points to be
7751conservative. Add that many dots to the @samp{X-Spam-Level:} header
7752field above to send messages with that score down the drain.
7753
7754In the example above, messages with a score of 5--9 are set aside in
7755the @samp{+spam} folder for later review. The major weakness of
7756rules-based filters is a plethora of false positives so it is
7757worthwhile to check.
7758
7759@findex mh-junk-blacklist
7760@findex mh-junk-whitelist
7761@kindex J b
7762@kindex J w
7763
7764If SpamAssassin classifies a message incorrectly, or is unsure, you can
7765use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7766@kbd{J w} (@code{mh-junk-whitelist}).
7767
7768@cindex @command{sa-learn}
7769@cindex @file{.spamassassin/user_prefs}
7770@cindex files, @file{.spamassassin/user_prefs}
7771
7772The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7773@samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7774deletes the message, and sends the message to the Razor, so that
7775others might not see this spam. If the @command{sa-learn} command is
7776available, the message is also recategorized as spam.
7777
7778The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7779@samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7780the @command{sa-learn} command is available, the message is also
7781recategorized as ham.
7782
7783Over time, you'll observe that the same host or domain occurs
7784repeatedly in the @samp{blacklist_from} entries, so you might think
7785that you could avoid future spam by blacklisting all mail from a
7786particular domain. The utility function
7787@code{mh-spamassassin-identify-spammers} helps you do precisely that.
7788This function displays a frequency count of the hosts and domains in
7789the @samp{blacklist_from} entries from the last blank line in
7790@file{~/.spamassassin/user_prefs} to the end of the file. This
7791information can be used so that you can replace multiple
7792@samp{blacklist_from} entries with a single wildcard entry such as:
7793
7794@smallexample
7795blacklist_from *@@*amazingoffersdirect2u.com
7796@end smallexample
7797
7798In versions of SpamAssassin (2.50 and on) that support a Bayesian
7799classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7800@command{sa-learn} to recategorize the message as spam. Neither MH-E,
7801nor SpamAssassin, rebuilds the database after adding words, so you
7802will need to run @samp{sa-learn --rebuild} periodically. This can be
7803done by adding the following to your @file{crontab}:
7804
7805@smallexample
78060 * * * *       sa-learn --rebuild > /dev/null 2>&1
7807@end smallexample
7808
7809@subheading Bogofilter
7810
7811@cindex bogofilter
7812@cindex spam filters, bogofilter
7813
7814Bogofilter is a Bayesian spam filtering program. Get it from your
7815local distribution or from the
7816@uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7817
7818Bogofilter is taught by running:
7819
7820@smallexample
7821bogofilter -n < good-message
7822@end smallexample
7823
7824on every good message, and
7825
7826@smallexample
7827bogofilter -s < spam-message
7828@end smallexample
7829
7830@cindex full training
7831
7832on every spam message. This is called a @dfn{full training}; three
7833other training methods are described in the FAQ that is distributed
7834with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7835each type of message to start doing a good job.
7836
7837To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7838
7839@cindex @samp{X-Bogosity} header field
7840@cindex header field, @samp{X-Bogosity}
7841
7842@smallexample
7843PATH=$PATH:/usr/bin/mh
7844MAILDIR=$HOME/`mhparam Path`
7845
7846# Fight spam with Bogofilter.
7847:0fw
7848| bogofilter -3 -e -p
7849
7850:0:
7851* ^X-Bogosity: Yes, tests=bogofilter
7852spam/.
7853
7854:0:
7855* ^X-Bogosity: Unsure, tests=bogofilter
7856spam/unsure/.
7857@end smallexample
7858
7859@findex mh-junk-blacklist
7860@findex mh-junk-whitelist
7861@kindex J b
7862@kindex J w
7863
7864If bogofilter classifies a message incorrectly, or is unsure, you can
7865use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7866w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7867
7868The @cite{Bogofilter FAQ} suggests that you run the following
7869occasionally to shrink the database:
7870
7871@smallexample
7872bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7873mv wordlist.db wordlist.db.prv
7874mv wordlist.db.new wordlist.db
7875@end smallexample
7876
7877The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7878bogofilter.
7879
7880@subheading SpamProbe
7881
7882@cindex SpamProbe
7883@cindex spam filters, SpamProbe
7884
7885SpamProbe is a Bayesian spam filtering program. Get it from your local
7886distribution or from the @uref{http://spamprobe.sourceforge.net,
7887SpamProbe web site}.
7888
7889To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7890
7891@cindex @command{formail}
7892@cindex @samp{X-SpamProbe} header field
7893@cindex header field, @samp{X-SpamProbe}
7894
7895@smallexample
7896PATH=$PATH:/usr/bin/mh
7897MAILDIR=$HOME/`mhparam Path`
7898
7899# Fight spam with SpamProbe.
7900:0
7901SCORE=| spamprobe receive
7902
7903:0 wf
7904| formail -I "X-SpamProbe: $SCORE"
7905
7906:0:
7907*^X-SpamProbe: SPAM
7908spam/.
7909@end smallexample
7910
7911@findex mh-junk-blacklist
7912@findex mh-junk-whitelist
7913@kindex J b
7914@kindex J w
7915
7916If SpamProbe classifies a message incorrectly, you can use the MH-E
7917commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7918(@code{mh-junk-whitelist}) to update SpamProbe's training.
7919
7920@subheading Other Things You Can Do
7921
7922There are a couple of things that you can add to @file{~/.procmailrc}
7923in order to filter out a lot of spam and viruses. The first is to
7924eliminate any message with a Windows executable (which is most likely
7925a virus). The second is to eliminate mail in character sets that you
7926can't read.
7927
7928@cindex @samp{Content-Transfer-Encoding} header field
7929@cindex @samp{Content-Type} header field
7930@cindex @samp{Subject} header field
7931@cindex header field, @samp{Content-Transfer-Encoding}
7932@cindex header field, @samp{Content-Type}
7933@cindex header field, @samp{Subject}
7934
7935@smallexample
7936PATH=$PATH:/usr/bin/mh
7937MAILDIR=$HOME/`mhparam Path`
7938
7939#
7940# Filter messages with w32 executables/virii.
7941#
7942# These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7943# pattern. The string "this program cannot be run in MS-DOS mode"
7944# encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7945# positives (Roland Smith via Pete from the bogofilter mailing list).
7946#
7947:0 B:
7948* ^Content-Transfer-Encoding:.*base64
7949* ^TVqQAAMAAAAEAAAA//8AALg
7950* 4fug4AtAnNIbg
7951spam/exe/.
7952
7953#
7954# Filter mail in unreadable character sets (from the Bogofilter FAQ).
7955#
7956UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7957
7958:0:
7959* 1^0 $ ^Subject:.*=\?($UNREADABLE)
7960* 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7961spam/unreadable/.
7962
7963:0:
7964* ^Content-Type:.*multipart
7965* B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7966spam/unreadable/.
7967@end smallexample
7968
7969@node Miscellaneous, Scan Line Formats, Junk, Top
7970@chapter Miscellaneous Commands, Variables, and Buffers
7971
7972This chapter covers the following command and the various MH-E
7973buffers,
7974
7975@ftable @code
7976@item mh-version
7977Display version information about MH-E and the MH mail handling
7978system.
7979@end ftable
7980
7981@cindex buffers, @file{*MH-E Info*}
7982@cindex MH-E version
7983@cindex @file{*MH-E Info*}
7984@cindex version
7985@findex mh-version
7986
7987One command worth noting is @kbd{M-x mh-version}. You can compare the
7988version this command prints to the latest release (@pxref{Getting
7989MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
7990@file{*MH-E Info*}, should usually be included with any bug report you
7991submit (@pxref{Bug Reports}).
7992
7993@subheading MH-E Buffers
7994
7995Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
7996several other buffers. They are:
7997
7998@table @samp
7999@cindex @file{*MH-E Folders*}
8000@cindex buffers, @file{*MH-E Folders*}
8001@findex mh-list-folders
8002@item *MH-E Folders*
8003@kindex F l
8004This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
8005@xref{Folders}.
8006@c -------------------------
8007@cindex @file{*MH-E Help*}
8008@cindex buffers, @file{*MH-E Help*}
8009@findex mh-help
8010@item *MH-E Help*
8011@kindex ?
8012@kindex C-c ?
8013This buffer contains the output of @kbd{?} (@code{mh-help}) and
8014@kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
8015@c -------------------------
8016@cindex @file{*MH-E Info*}
8017@cindex buffers, @file{*MH-E Info*}
8018@item *MH-E Info*
8019This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
8020@c -------------------------
8021@cindex @file{*MH-E Log*}
8022@cindex buffers, @file{*MH-E Log*}
8023@item *MH-E Log*
8024This buffer contains the last 100 lines of the output of the various
8025MH commands.
8026@c -------------------------
8027@cindex @file{*MH-E Mail Delivery*}
8028@cindex buffers, @file{*MH-E Mail Delivery*}
8029@item *MH-E Mail Delivery*
8030This buffer contains the transcript of a mail delivery. @xref{Sending
8031Message}.
8032@c -------------------------
8033@cindex @file{*MH-E Recipients*}
8034@cindex buffers, @file{*MH-E Recipients*}
8035@findex mh-check-whom
8036@item *MH-E Recipients*
8037@kindex C-c C-w
8038This buffer contains the output of @kbd{C-c C-w}
8039(@code{mh-check-whom}) and is killed when draft is sent.
8040@xref{Checking Recipients}.
8041@c -------------------------
8042@cindex @file{*MH-E Sequences*}
8043@cindex buffers, @file{*MH-E Sequences*}
8044@item *MH-E Sequences*
8045This buffer contains the output of @kbd{S l}
8046(@code{mh-list-sequences}). @xref{Sequences}.
8047@c -------------------------
8048@cindex @file{*mh-temp*}
8049@cindex buffers, @file{*mh-temp*}
8050@item *mh-temp*
8051This is a scratch, ephemeral, buffer used by MH-E functions. Note that
8052it is hidden because the first character in the name is a space.
8053You'll generally not have any need for this buffer.
8054@end table
8055
8056@node Scan Line Formats, Procmail, Miscellaneous, Top
8057@appendix Scan Line Formats
8058
8059@cindex scan line formats
8060
8061This appendix discusses how MH-E creates, parses, and manipulates scan
8062lines. If you have your own MH scan or inc format files, you
8063@strong{can} teach MH-E how to handle them, but it isn't easy as
8064you'll see.
8065
8066@cindex @samp{mh-scan-line-formats} customization group
8067@cindex customization group, @samp{mh-scan-line-formats}
8068
8069This table lists the options in the @samp{mh-scan-line-formats}
8070customization group.
8071
8072@vtable @code
8073@item mh-adaptive-cmd-note-flag
8074On means that the message number width is determined dynamically
8075(default: @samp{on}).
8076@c -------------------------
8077@item mh-scan-format-file
8078Specifies the format file to pass to the scan program (default:
8079@samp{Use MH-E scan Format}).
8080@c -------------------------
8081@item mh-scan-prog
8082Program used to scan messages (default: @code{"scan"}).
8083@end vtable
8084
8085@vindex mh-adaptive-cmd-note-flag
8086
8087There are a couple of caveats when creating your own scan format file.
8088First, MH-E will not work if your scan lines do not include message
8089numbers. It will work poorly if you don't dedicate a column for
8090showing the current message and notations. It is also best to keep the
8091first column empty to make room for the cursor and so that text isn't
8092obscured by the current message's overlay arrow when running in a
8093terminal. You won't be able to use the option
8094@code{mh-adaptive-cmd-note-flag} or the threading features
8095(@pxref{Threading}).
8096
8097@cindex message numbers
8098@findex mh-set-cmd-note
8099@vindex mh-adaptive-cmd-note-flag
8100@vindex mh-scan-format-file
8101
8102If you've created your own format to handle long message numbers,
8103you'll be pleased to know you no longer need it since MH-E adapts its
8104internal format based upon the largest message number if
8105@code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
8106fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
8107and call @code{mh-set-cmd-note} with the width specified by your
8108format file (see @code{mh-scan-format-file}). For example, the default
8109width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
8110
8111@vindex mh-adaptive-cmd-note-flag
8112@vindex mh-scan-format-file
8113@vindex mh-scan-format-mh
8114@vindex mh-scan-format-nmh
8115
8116The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
8117scan Format}. This means that the format string will be taken from the
8118either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
8119on whether MH or nmh (or GNU mailutils MH) is in use. This setting
8120also enables you to turn on the option
8121@code{mh-adaptive-cmd-note-flag}. You can also set this option to
8122@samp{Use Default scan Format} to get the same output as you would get
8123if you ran @command{scan} from the shell. If you have a format file
8124that you want MH-E to use but not MH, you can set this option to
8125@samp{Specify a scan Format File} and enter the name of your format
8126file.
8127
8128@vindex mh-scan-format-file
8129@vindex mh-scan-format-mh
8130@vindex mh-scan-format-nmh
8131
8132The scan format that MH-E uses when @code{mh-scan-format-file} is set
8133to its default of @samp{Use MH-E scan Format} is held in the variables
8134@code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
8135whether you are using nmh (or GNU mailutils MH) or not. Typically, you
8136create your own format files rather than modifying these variables.
8137The value of @code{mh-scan-format-nmh} is:
8138
8139@smallexample
8140(concat
8141 "%4(msg)"
8142 "%<(cur)+%| %>"
8143 "%<@{replied@}-"
8144 "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
8145 "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
8146 "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
8147 "%?(nonnull(comp@{newsgroups@}))n%>"
8148 "%<(zero) %>"
8149 "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
8150 "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
8151 "%<(zero)%17(decode(friendly@{from@}))%>  "
8152 "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
8153@end smallexample
8154
8155@cindex decoding RFC 2047
8156@cindex RFC 2047, decoding
8157@vindex mh-scan-format-mh
8158
8159The setting for @code{mh-scan-format-mh} is similar, except that MH
8160doesn't have the function @code{decode} (which is used to decode RFC
81612047 encodings).
8162
8163@cindex notations, scan line
8164@cindex scan line notations
8165
8166These strings are passed to the @command{scan} program via the
8167@option{-format} argument. The formats are identical to the defaults
8168except that additional hints for fontification have been added to the
8169existing notations in the fifth column (remember that in Emacs, the
8170columns start at 0). The values of the fifth column, in priority
8171order, are: @samp{-} if the message has been replied to, @samp{t} if
8172an address in the @samp{To:} field matches one of the mailboxes of the
8173current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
8174the @samp{Bcc:} field matches, and @samp{n} if a non-empty
8175@samp{Newsgroups:} field is present.
8176
8177@cindex @command{scan}
8178@cindex MH commands, @command{scan}
8179@vindex mh-progs
8180@vindex mh-scan-prog
8181
8182The name of the program that generates a listing of one line per
8183message is held in @code{mh-scan-prog} (default: @code{"scan"}).
8184Unless this variable contains an absolute pathname, it is assumed to
8185be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
8186link another program to @command{scan} (see @samp{mh-profile}(5)) to
8187produce a different type of listing@footnote{See the section
8188@uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
8189pick Ranges Sequences} in the MH book.}.
8190
8191@cindex regular expressions, scan line formats
8192@findex mh-set-cmd-note
8193@findex setq
8194
8195If you change the format of the scan lines you'll need to tell MH-E
8196how to parse the new format. As you will see, quite a lot of variables
8197are involved to do that. Use @kbd{M-x apropos @key{RET}
8198mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
8199will also have to call @code{mh-set-cmd-note} if your notations are
8200not in column 4 (columns in Emacs start with 0). Note that unlike most
8201of the user options described in this manual, these are variables and
8202must be set with @code{setq} instead of in a customization buffer. For
8203help with regular expressions, see
8204@ifnothtml
8205@ref{Regexps, , Syntax of Regular Expressions, emacs, The
8206GNU Emacs Manual}.
8207@end ifnothtml
8208@ifhtml
8209section
8210@uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
8211Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
8212@end ifhtml
8213
8214The first variable has to do with pruning out garbage.
8215
8216@vtable @code
8217@cindex @command{inc}
8218@cindex MH commands, @command{inc}
8219@cindex @command{scan}
8220@cindex MH commands, @command{scan}
8221@item mh-scan-valid-regexp
8222This regular expression describes a valid scan line. This is used to
8223eliminate error messages that are occasionally produced by
8224@command{inc}@footnote{See the section
8225@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
8226prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
8227@end vtable
8228
8229Next, many variables control how the scan lines are parsed.
8230
8231@vtable @code
8232@vindex mh-folder-body
8233@vindex mh-folder-font-lock-keywords
8234@item mh-scan-body-regexp
8235This regular expression matches the message body fragment. Note that
8236the default setting of @code{mh-folder-font-lock-keywords} expects
8237this expression to contain at least one parenthesized expression which
8238matches the body text as in the default of
8239@code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
8240correct, the body fragment will not be highlighted with the face
8241@code{mh-folder-body}.
8242@c -------------------------
8243@vindex mh-folder-cur-msg-number
8244@vindex mh-folder-font-lock-keywords
8245@vindex mh-note-cur
8246@item mh-scan-cur-msg-number-regexp
8247This regular expression matches the current message. It must match
8248from the beginning of the line. Note that the default setting of
8249@code{mh-folder-font-lock-keywords} expects this expression to contain
8250at least one parenthesized expression which matches the message number
8251as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
8252expression includes the leading space and current message marker
8253@samp{+} within the parenthesis since it looks better to highlight
8254these items as well. The highlighting is done with the face
8255@code{mh-folder-cur-msg-number}. This regular expression should be
8256correct as it is needed by non-fontification functions. See also
8257@code{mh-note-cur}.
8258@c -------------------------
8259@vindex mh-folder-date
8260@vindex mh-folder-font-lock-keywords
8261@vindex mh-scan-sent-to-me-sender-regexp
8262@item mh-scan-date-regexp
8263This regular expression matches a valid date. It must @strong{not} be
8264anchored to the beginning or the end of the line. Note that the
8265default setting of @code{mh-folder-font-lock-keywords} expects this
8266expression to contain only one parenthesized expression which matches
8267the date field as in the default of
8268@code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
8269not correct, the date will not be highlighted with the face
8270@code{mh-folder-date}.
8271@c -------------------------
8272@vindex mh-folder-deleted
8273@vindex mh-folder-font-lock-keywords
8274@vindex mh-note-deleted
8275@item mh-scan-deleted-msg-regexp
8276This regular expression matches deleted messages. It must match from
8277the beginning of the line. Note that the default setting of
8278@code{mh-folder-font-lock-keywords} expects this expression to contain
8279at least one parenthesized expression which matches the message number
8280as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
8281includes the leading space within the parenthesis since it looks
8282better to highlight it as well. The highlighting is done with the face
8283@code{mh-folder-deleted}. This regular expression should be correct as
8284it is needed by non-fontification functions. See also
8285@code{mh-note-deleted}.
8286@c -------------------------
8287@vindex mh-folder-font-lock-keywords
8288@vindex mh-folder-msg-number
8289@item mh-scan-good-msg-regexp
8290This regular expression matches ``good'' messages. It must match from
8291the beginning of the line. Note that the default setting of
8292@code{mh-folder-font-lock-keywords} expects this expression to contain
8293at least one parenthesized expression which matches the message number
8294as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
8295expression includes the leading space within the parenthesis since it
8296looks better to highlight it as well. The highlighting is done with
8297the face @code{mh-folder-msg-number}. This regular expression should
8298be correct as it is needed by non-fontification functions.
8299@c -------------------------
8300@vindex mh-scan-format-file
8301@item mh-scan-msg-format-regexp
8302This regular expression finds the message number width in a scan
8303format. Note that the message number must be placed in a parenthesized
8304expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
8305variable is only consulted if @code{mh-scan-format-file} is set to
8306@samp{Use MH-E scan Format}.
8307@c -------------------------
8308@vindex mh-scan-format-file
8309@item mh-scan-msg-format-string
8310This is a format string for the width of the message number in a scan
8311format. Use @samp{0%d} for zero-filled message numbers. This variable
8312is only consulted if @code{mh-scan-format-file} is set to @samp{Use
8313MH-E scan Format} (default: @code{"%d"}).
8314@c -------------------------
8315@item mh-scan-msg-number-regexp
8316This regular expression extracts the message number. It must match
8317from the beginning of the line. Note that the message number must be
8318placed in a parenthesized expression as in the default of @w{@code{"^
8319*\\([0-9]+\\)"}}.
8320@c -------------------------
8321@item mh-scan-msg-overflow-regexp
8322This regular expression matches overflowed message numbers (default:
8323@code{"^[?0-9][0-9]"}).
8324@c -------------------------
8325@item mh-scan-msg-search-regexp
8326This regular expression matches a particular message. It is a format
8327string; use @samp{%d} to represent the location of the message number
8328within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
8329@c -------------------------
8330@vindex mh-folder-address
8331@vindex mh-folder-font-lock-keywords
8332@vindex mh-folder-to
8333@item mh-scan-rcpt-regexp
8334This regular expression specifies the recipient in messages you sent.
8335Note that the default setting of @code{mh-folder-font-lock-keywords}
8336expects this expression to contain two parenthesized expressions. The
8337first is expected to match the @samp{To:} that the default scan format
8338file generates. The second is expected to match the recipient's name
8339as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
8340regular expression is not correct, the @samp{To:} string will not be
8341highlighted with the face @code{mh-folder-to} and the recipient will not be
8342highlighted with the face @code{mh-folder-address}.
8343@c -------------------------
8344@vindex mh-folder-font-lock-keywords
8345@vindex mh-folder-refiled
8346@vindex mh-note-refiled
8347@item mh-scan-refiled-msg-regexp
8348This regular expression matches refiled messages. It must match from
8349the beginning of the line. Note that the default setting of
8350@code{mh-folder-font-lock-keywords} expects this expression to contain
8351at least one parenthesized expression which matches the message number
8352as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
8353includes the leading space within the parenthesis since it looks
8354better to highlight it as well. The highlighting is done with the face
8355@code{mh-folder-refiled}. This regular expression should be correct as
8356it is needed by non-fontification functions. See also
8357@code{mh-note-refiled}.
8358@c -------------------------
8359@vindex mh-folder-font-lock-keywords
8360@vindex mh-folder-sent-to-me-sender
8361@vindex mh-mh-folder-sent-to-me-hint
8362@vindex mh-scan-format-nmh
8363@item mh-scan-sent-to-me-sender-regexp
8364This regular expression matches messages sent to us. Note that the
8365default setting of @code{mh-folder-font-lock-keywords} expects this
8366expression to contain at least two parenthesized expressions. The
8367first should match the fontification hint (see
8368@code{mh-scan-format-nmh}) and the second should match the user name
8369as in the default of
8370@w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
8371If this regular expression is not correct, the notation hints will not
8372be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
8373the sender will not be highlighted with the face
8374@code{mh-folder-sent-to-me-sender}.
8375@c -------------------------
8376@vindex mh-folder-followup
8377@vindex mh-folder-font-lock-keywords
8378@vindex mh-folder-subject
8379@item mh-scan-subject-regexp
8380This regular expression matches the subject. It must match from the
8381beginning of the line. Note that the default setting of
8382@samp{mh-folder-font-lock-keywords} expects this expression to contain
8383at least three parenthesized expressions. The first is expected to
8384match the @samp{Re:} string, if any, and is highlighted with the face
8385@code{mh-folder-followup}. The second matches an optional bracketed
8386number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
8387sub-expression of the first expression). The third is expected to
8388match the subject line itself which is highlighted with the face
8389@code{mh-folder-subject}. For example, the default is
8390@w{@code{"^ *[0-9]+........[ ]*...................}}@*
8391@w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
8392This regular expression should be correct as it is needed by
8393non-fontification functions. Note that this example is broken up on
8394two lines for readability, but is actually a single string.
8395@end vtable
8396
8397Finally, there are a slew of variables that control how MH-E annotates
8398the scan lines.
8399
8400@vtable @code
8401@findex mh-set-cmd-note
8402@vindex mh-adaptive-cmd-note-flag
8403@item mh-cmd-note
8404Column for notations (default: 4). This variable should be set with
8405the function @code{mh-set-cmd-note}. This variable may be updated
8406dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
8407variables contain the notational characters. Note that columns in
8408Emacs start with 0.
8409@c -------------------------
8410@item mh-note-copied
8411Messages that have been copied are marked by this character (default:
8412@code{?C}).
8413@c -------------------------
8414@vindex mh-scan-cur-msg-number-regexp
8415@item mh-note-cur
8416The current message (in MH, not in MH-E) is marked by this character
8417(default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
8418@c -------------------------
8419@vindex mh-scan-deleted-msg-regexp
8420@item mh-note-deleted
8421Messages that have been deleted are marked by this character (default:
8422@code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
8423@c -------------------------
8424@item mh-note-dist
8425Messages that have been redistributed are marked by this character
8426(default: @code{?R}).
8427@c -------------------------
8428@item mh-note-forw
8429Messages that have been forwarded are marked by this character
8430(default: @code{?F}).
8431@c -------------------------
8432@item mh-note-printed
8433Messages that have been printed are marked by this character (default:
8434@code{?P}).
8435@c -------------------------
8436@vindex mh-scan-refiled-msg-regexp
8437@item mh-note-refiled
8438Messages that have been refiled are marked by this character (default:
8439@code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
8440@c -------------------------
8441@item mh-note-repl
8442Messages that have been replied to are marked by this character
8443(default: @code{?-}).
8444@c -------------------------
8445@item mh-note-seq
8446Messages in a user-defined sequence are marked by this character
8447(default: @code{?%}). Messages in the @samp{search} sequence are
8448marked by this character as well.
8449@end vtable
8450
8451For example, let's say I have the following in @file{scan.format}
8452which displays the sender, the subject, and the message number. This
8453format places a @samp{+} after the message number for the current
8454message according to MH; it also uses that column for notations.
8455
8456@smallexample
8457%20(decode(friendly@{from@})) %50(decode@{subject@})  %4(msg)%<(cur)+%| %>
8458@end smallexample
8459
8460@vindex mh-adaptive-cmd-note-flag
8461@vindex mh-scan-format-file
8462@vindex mh-scan-format-file@r{, example}
8463
8464The first thing you have to do is tell MH-E to use this file.
8465Customize @code{mh-scan-format-file} and set its value to @samp{Use
8466Default scan Format}. If you didn't get already turn off
8467@code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
8468
8469Next, tell MH-E what a valid scan line looks like so that you can at
8470least display the output of scan in your MH-Folder buffer.
8471
8472@vindex mh-scan-valid-regexp@r{, example}
8473
8474@smalllisp
8475(setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
8476@end smalllisp
8477
8478Now, in order to get rid of the @samp{Cursor not pointing to message}
8479message, you need to tell MH-E how to access the message number. You
8480should also see why MH-E requires that you include a message number in
8481the first place.
8482
8483@vindex mh-scan-msg-number-regexp@r{, example}
8484@vindex mh-scan-msg-search-regexp@r{, example}
8485
8486@smalllisp
8487(setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8488(setq mh-scan-msg-search-regexp " %d[+D^ ]$")
8489@end smalllisp
8490
8491In order to get the next and previous commands working, add this.
8492
8493@vindex mh-scan-good-msg-regexp@r{, example}
8494
8495@smalllisp
8496(setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8497@end smalllisp
8498
8499Note that the current message isn't marked with a @samp{+} when moving
8500between the next and previous messages. Here is the code required to
8501get this working.
8502
8503@vindex set-mh-cmd-note@r{, example}
8504@vindex mh-scan-cur-msg-number-regexp@r{, example}
8505
8506@smalllisp
8507(set-mh-cmd-note 76)
8508(setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
8509@end smalllisp
8510
8511Finally, add the following to delete and refile messages.
8512
8513@vindex mh-scan-deleted-msg-regexp@r{, example}
8514@vindex mh-scan-refiled-msg-regexp@r{, example}
8515
8516@smalllisp
8517(setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
8518(setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
8519@end smalllisp
8520
8521This is just a bare minimum; it's best to adjust all of the regular
8522expressions to ensure that MH-E and highlighting perform well.
8523
8524@node Procmail, Odds and Ends, Scan Line Formats, Top
8525@appendix Reading Mailing Lists Effectively
8526
8527@cindex @command{procmail}
8528@cindex @command{slocal}
8529@cindex Gnus
8530@cindex MH commands, @command{slocal}
8531@cindex Unix commands, @command{procmail}
8532@cindex mailing lists, reading
8533
8534This appendix explains how to use procmail, which can
8535file mail from mailing lists into folders which can then
8536be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
8537can be used as well, but procmail was more flexible and more packages
8538exist for procmail than for slocal.}. Unfortunately, procmail is no
8539longer recommended due to its security vulnerabilities.
8540Some mailing lists have such
8541high traffic that Gnus must be used and I discuss how to use Gnus
8542side-by-side with MH-E.
8543
8544@cindex @file{.procmailrc}
8545@cindex files, @file{.procmailrc}
8546
8547First, I'll describe how to put mail from your mailing lists directly
8548into an MH folder using @command{procmail}. First, add the following
8549to @file{~/.procmailrc}. While the logging variables aren't strictly
8550necessary, they are extremely useful.
8551
8552@smallexample
8553[1]  # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
8554[2]  PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
8555[3]
8556[4]  # Point LOGFILE at the actual log file.
8557[5]  LOGFILE=$HOME/.procmail.log
8558[6]
8559[7]  # This setting provides just the right amount of information.
8560[8]  LOGABSTRACT=all
8561[9]
8562[10] # Uncomment the following line to see how your patterns match.
8563[11] #VERBOSE=yes
8564[12]
8565[13] # Place mail sent to any MH-E mailing list in +mh-e.
8566[14] :0 w: mh-e$LOCKEXT
8567[15] * ^TO.*mh-e-.*@@.*sourceforge.net
8568[16] | myrcvstore -create +mh-e
8569@end smallexample
8570
8571@cindex @command{rcvstore}
8572@cindex MH commands, @command{rcvstore}
8573
8574Line 14 creates a lock file in your mail directory based upon the name
8575of the folder. This is done because @command{rcvstore} does not
8576perform locking. While this lock file will prevent @command{procmail}
8577from writing to a folder concurrently, there is a slight chance that
8578you might lose a message if you're performing operations on a folder
8579at the same time @command{rcvstore} is placing a message there. You
8580have been warned. Now that that disclaimer is out of the way, note
8581that I've been using this set-up for over a decade and haven't lost
8582anything to my knowledge@footnote{See
8583@uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
8584Savannah issue #4361} to see if @command{rcvstore} locking is still an
8585issue.}.
8586
8587@cindex @samp{Unseen-Sequence} MH profile component
8588@cindex MH profile component, @samp{Unseen-Sequence}
8589
8590Line 16 uses the following script, @code{myrcvstore}, to massage the
8591message as described in the comment and file the message in the given
8592folder@footnote{The @samp{-create} argument wasn't always the default
8593to @command{rcvstore}.}.
8594
8595@smallexample
8596#! /bin/sh
8597
8598# Accepts a message on standard input and passes it through rcvstore
8599# after first passing it through any filters. All arguments are passed
8600# on to rcvstore.
8601
8602# Force the "From user date" to become part of header. One reason this
8603# is done is because the presence of the From field confuses dist so
8604# that dist adds a new header, rather than using the existing header.
8605# Note that this should not be done for any message that goes into a
8606# Gnus incoming file (Gnus will thrown an error) nor should it be
8607# applied to any message that goes to the system mailbox because the
8608# entire mailbox will be incorporated as a single message.
8609formail -c -z -R 'From ' X-Envelope-From: |
8610rcvstore $@@
8611@end smallexample
8612
8613If your version of @command{rcvstore} doesn't add messages to the
8614@samp{unseen} sequence by default, add the following line to your MH
8615profile:
8616
8617@smallexample
8618Unseen-Sequence: unseen
8619@end smallexample
8620
8621Now view your new messages with the speedbar (@pxref{Speedbar}) or with
8622@kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
8623
8624If you're on a mailing list that is so voluminous that it is
8625impossible to read every message, it usually better to read the
8626mailing list like a newsgroup in a news reader. Emacs has a built-in
8627newsreader called Gnus. The remainder of this appendix talks about how
8628to use Gnus with an MH message store. The version of Gnus that was
8629used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
8630work but versions prior to 5.8 use different options.
8631
8632This table contains a list of Gnus options that you will have to
8633modify. Note that for them to become accessible, you'll have to load
8634@file{nnml.el} first. This can be done with @kbd{M-x load-library
8635@key{RET} nnml @key{RET}}.
8636
8637@vtable @code
8638@item gnus-secondary-select-methods
8639Select the @samp{nnml} value. This select method uses directories for
8640folders and individual files for messages, just like MH@. You do not
8641have to set an address.
8642@c -------------------------
8643@item mail-sources
8644Select the @samp{Several files in a directory} value, check the
8645@samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
8646your mail.
8647@c -------------------------
8648@vindex mail-user-agent
8649@item message-mail-user-agent
8650In order to send mail within Gnus using MH-E, set this option to
8651@samp{mail-user-agent} and set the @code{mail-user-agent} option to
8652@samp{Emacs interface to MH}.
8653@c -------------------------
8654@item nnmail-keep-last-article
8655Since Gnus keeps track of which messages you have read, it would be
8656bad if Gnus expired the last message, for example, message 100, and
8657@command{rcvstore} gave the next new message number 1. Gnus would then
8658ignore it since it thinks that you've read messages 1--100. Turning on
8659this option ensures that the last message is never removed thereby
8660eliminating this problem.
8661@end vtable
8662
8663Next add the following to @file{~/.procmailrc}. If you don't subscribe
8664to the GnuCash mailing list, substitute one to which you are
8665subscribed.
8666
8667@smallexample
8668PATH=$PATH:/usr/bin/mh
8669MAILDIR=$HOME/`mhparam Path`
8670# Place mail sent to the GnuCash mailing list in gnucash.spool, where
8671# Gnus will pick it up.
8672:0:
8673* ^TO.*gnucash.*@@.*gnucash.org
8674gnucash.spool
8675@end smallexample
8676
8677Wait for some messages to appear in @file{gnucash.spool} and run Gnus
8678with @kbd{M-x gnus @key{RET}}. To view the folder created in the
8679example above, you would tell Gnus about it the first time only with
8680@kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
8681known as @samp{+gnucash}.
8682
8683@node Odds and Ends, History, Procmail, Top
8684@appendix Odds and Ends
8685
8686This appendix covers a few topics that don't fit elsewhere. Here I
8687tell you how to report bugs and how to get on the MH-E mailing lists.
8688I also point out some additional sources of information.
8689
8690@menu
8691* Bug Reports::
8692* Mailing Lists::
8693* MH FAQ and Support::
8694* Getting MH-E::
8695@end menu
8696
8697@node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
8698@appendixsec Bug Reports
8699
8700@cindex bugs
8701@cindex SourceForge
8702@findex mh-version
8703
8704Bug reports should be filed at
8705@uref{https://sourceforge.net/p/mh-e/bugs/, SourceForge}. You need to
8706be a SourceForge user to submit bug reports, but this is easy enough
8707to do that it shouldn't be a restriction for you. Please include the
8708output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in any bug
8709report you send unless you're 110% positive we won't ask for it.
8710
8711@node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
8712@appendixsec MH-E Mailing Lists
8713
8714@cindex SourceForge
8715@cindex mailing lists
8716
8717There are several mailing lists for MH-E@. They are @i{mh-e-users at
8718lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
8719and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
8720the archives at @uref{https://sourceforge.net/p/mh-e/mailman/,
8721SourceForge}. Do not report bugs on these lists; please submit them
8722via SourceForge (@pxref{Bug Reports}).
8723
8724@node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
8725@appendixsec MH FAQ and Support
8726
8727@cindex FAQ
8728@cindex MH FAQ
8729
8730The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8731Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8732@samp{comp.mail.mh}. While very little is there that deals with MH-E
8733specifically, there is an incredible wealth of material about MH
8734itself which you will find useful.
8735
8736@cindex support
8737
8738You can find FAQs on MH-E by searching for @i{labels:support} on the
8739@uref{https://sourceforge.net/p/mh-e/bugs/search/?q=labels%3Asupport,
8740Tickets} page on SourceForge. If you don't find the answer to your
8741question, file a ticket and your question will become a new FAQ!
8742
8743@node Getting MH-E,  , MH FAQ and Support, Odds and Ends
8744@appendixsec Getting MH-E
8745
8746@cindex MH-E, obtaining
8747@cindex getting MH-E
8748@cindex obtaining MH-E
8749
8750Because MH-E is undergoing a phase of sustained growth, the version of
8751MH-E in your Emacs is likely to be out of date although it is most
8752likely to be more up to date than the copy that comes with the MH
8753distribution in @file{miscellany/mh-e}.
8754
8755@cindex change log
8756@cindex release notes
8757
8758New MH-E releases are always available for downloading at
8759@uref{https://sourceforge.net/projects/mh-e/files/, SourceForge}
8760before they appear in an Emacs release. You can read the release notes
8761on that page to determine if the given release of MH-E is already
8762installed in your version of Emacs. You can also read the change log
8763to see if you are interested in what the given release of MH-E has to
8764offer (although we have no doubt that you will be extremely interested
8765in all new releases).
8766
8767@cindex Debian
8768
8769If you use Debian, you can install the Debian
8770@uref{https://packages.debian.org/unstable/mail/mh-e, mh-e package}
8771instead.
8772
8773@cindex files, @samp{MH-E-NEWS}
8774@cindex files, @samp{README}
8775@cindex news
8776@cindex @samp{MH-E-NEWS}
8777@cindex @samp{README}
8778@findex mh-version
8779
8780After you download and extract the MH-E tarball, read the
8781@file{README} file and @file{MH-E-NEWS}. These correspond to the
8782release notes and change log mentioned above. The file @file{README}
8783contains instructions on installing MH-E@. If you're already running
8784Emacs, please quit that session and start again to load in the new
8785MH-E@. Check that you're running the new version with the command
8786@kbd{M-x mh-version}.
8787
8788@cindex contributed software
8789@cindex manual
8790@cindex documentation
8791
8792In addition to the mh-e package, the
8793@uref{https://sourceforge.net/projects/mh-e/files/, SourceForge} site
8794also contains doc and contrib packages. The former is the latest
8795release of this manual, and the latter contains a few contributed
8796packages you might find useful.
8797
8798@node History, GFDL, Odds and Ends, Top
8799@appendix History of MH-E
8800
8801@cindex Bill Wohler
8802@cindex Brian Reid
8803@cindex Gildea, Stephen
8804@cindex Jim Larus
8805@cindex Larus, Jim
8806@cindex MH-E, versions
8807@cindex Reid, Brian
8808@cindex SourceForge
8809@cindex Stephen Gildea
8810@cindex Wohler, Bill
8811@cindex history of MH-E
8812@cindex versions of MH-E
8813
8814MH-E was originally written by Brian Reid in 1983 and has changed
8815hands several times since then. Jim Larus wanted to do something
8816similar for GNU Emacs, and ended up completely rewriting it that same
8817year. In 1989, Stephen Gildea picked it up and added many
8818improvements. Bill Wohler then took over in 2000 and moved its
8819development to @uref{https://sourceforge.net/, SourceForge} where it
8820lives today.
8821
8822@menu
8823* From Brian Reid::
8824* From Jim Larus::
8825* From Stephen Gildea::
8826* From Bill Wohler::
8827@end menu
8828
8829@node From Brian Reid, From Jim Larus, History, History
8830@appendixsec From Brian Reid
8831
8832@cindex Brian Reid
8833@cindex Reid, Brian
8834
8835One day in 1983 I got the flu and had to stay home from work for three
8836days with nothing to do. I used that time to write MHE@. The
8837fundamental idea behind MHE was that it was a ``puppeteer'' driving
8838the MH programs underneath it. MH had a model that the editor was
8839supposed to run as a sub-process of the mailer, which seemed to me at
8840the time to be the tail wagging the dog. So I turned it around and
8841made the editor drive the MH programs. I made sure that the UCI people
8842(who were maintaining MH at the time) took in my changes and made them
8843stick.
8844
8845Today, I still use my own version of MHE because I don't at all like
8846the way that GNU MH-E works and I've never gotten to be good enough at
8847hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8848version of MHE and the GNU Emacs version of MH-E have almost nothing
8849in common except similar names. They work differently, have different
8850conceptual models, and have different key bindings@footnote{After
8851reading this article, I questioned Brian about his version of MHE, and
8852received some great ideas for improving MH-E such as a dired-like
8853method of selecting folders; and removing the prompting when sending
8854mail, filling in the blanks in the draft buffer instead. I passed them
8855on to Stephen Gildea, the current maintainer, and he was excited about
8856the ideas as well. Perhaps one day, MH-E will again resemble MHE
8857(draft form editing was introduced in version 7.4).}.
8858
8859Brian Reid, June 1994
8860
8861@node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8862@appendixsec From Jim Larus
8863
8864@cindex Jim Larus
8865@cindex Larus, Jim
8866
8867Brian Reid, while at CMU or shortly after going to Stanford wrote a
8868mail reading program called MHE for Gosling Emacs. It had much the
8869same structure as MH-E (i.e., invoked MH programs), though it was
8870simpler and the commands were slightly different. Unfortunately, I no
8871longer have a copy so the differences are lost in the mists of time.
8872
8873In '82--83, I was working at BBN and wrote a lot of mlisp code in
8874Gosling Emacs to make it look more like Tennex Emacs. One of the
8875packages that I picked up and improved was Reid's mail system. In '83,
8876I went back to Berkeley. About that time, Stallman's first version of
8877GNU Emacs came out and people started to move to it from Gosling Emacs
8878(as I recall, the transition took a year or two). I decided to port
8879Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8880GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8881bit the bullet and rewrote the code by hand (it was a lot smaller and
8882simpler then, so it took only a day or two).
8883
8884Soon after that, MH-E became part of the standard Emacs distribution
8885and suggestions kept dribbling in for improvements. MH-E soon reached
8886sufficient functionality to keep me happy, but I kept on improving it
8887because I was a graduate student with plenty of time on my hands and
8888it was more fun than my dissertation. In retrospect, the one thing
8889that I regret is not writing any documentation, which seriously
8890limited the use and appeal of the package.
8891
8892@cindex @command{xmh}, in MH-E history
8893
8894In '89, I came to Wisconsin as a professor and decided not to work on
8895MH-E@. It was stable, except for minor bugs, and had enough
8896functionality, so I let it be for a few years. Stephen Gildea of BBN
8897began to pester me about the bugs, but I ignored them. In 1990, he
8898went off to the X Consortium, said good bye, and said that he would
8899now be using @command{xmh}. A few months later, he came back and said
8900that he couldn't stand @command{xmh} and could I put a few more bug fixes
8901into MH-E@. At that point, I had no interest in fixing MH-E, so I gave
8902the responsibility of maintenance to him and he has done a fine job
8903since then.
8904
8905Jim Larus, June 1994
8906
8907@node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8908@appendixsec From Stephen Gildea
8909
8910@cindex Gildea, Stephen
8911@cindex Stephen Gildea
8912
8913In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8914me. In my previous job, I had been using RMAIL, but as my folders tend
8915to run large, I was frustrated with the speed of RMAIL@. However, I
8916stuck with it because I wanted the GNU Emacs interface. I am very
8917familiar and comfortable with the Emacs interface (with just a few
8918modifications of my own) and dislike having to use applications with
8919embedded editors; they never live up to Emacs.
8920
8921MH is the mail reader of choice at BBN, so I converted to it. Since I
8922didn't want to give up using an Emacs interface, I started using MH-E@.
8923As is my wont, I started hacking on it almost immediately. I first
8924used version 3.4m. One of the first features I added was to treat the
8925folder buffer as a file-visiting buffer: you could lock it, save it,
8926and be warned of unsaved changes when killing it. I also worked to
8927bring its functionality a little closer to RMAIL@. Jim Larus was very
8928cooperative about merging in my changes, and my efforts first appeared
8929in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8930MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8931with Emacs 18.56 in 1990, was noticeably faster.
8932
8933When I moved to the X Consortium I became the first person there to
8934not use xmh. (There is now one other engineer there using MH-E@.) About
8935this point I took over maintenance of MH-E from Jim and was finally
8936able to add some features Jim hadn't accepted, such as the backward
8937searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8938
8939Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8940Version 4.0 added many new features, including background folder
8941collection and support for composing @sc{mime} messages. (Reading
8942@sc{mime} messages remains to be done, alas.) While writing this book,
8943Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8944and inconsistencies that required a new major version to fix, and so
8945version 5 was released.
8946
8947Stephen Gildea, June 1994
8948
8949@node From Bill Wohler,  , From Stephen Gildea, History
8950@appendixsec From Bill Wohler
8951
8952@cindex Wohler, Bill
8953@cindex Bill Wohler
8954
8955The preface originally included the following text which I use to
8956begin my story:
8957
8958@quotation
8959But it's important to note a brief history of MH-E.
8960
8961@w{Version 3} was prevalent through the @w{Emacs 18} and early
8962@w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8963which introduced several new and changed commands. Next, @w{Version
89645.0} was released, which fixed some bugs and incompatibilities, and
8965was incorporated into @w{Emacs 19.29}.
8966@end quotation
8967
8968After a long break, Stephen handed the reins over to me in 2000. I
8969moved the project to a new site called SourceForge and organized a
8970great team of developers. Our first release in late 2001 was version
89716. It appeared around the time of Emacs 21.2 and had menus and tool
8972bar buttons.
8973
8974Then, indexed searches, improved MIME handling, a speedbar, multiple
8975identities, alias completion, an index view of unseen messages, spam
8976software support, Face and X-Image-URL header field support, Fcc
8977completion, arbitrary range handling, and draft form editing were
8978introduced in the version 7 series around the time of Emacs 21.4
8979(2004). Still, Emacs itself contained version 5 of MH-E released back
8980in 1994.
8981
8982Version 8 development was mostly driven by the rewrite of the manual.
8983It also brought GNU mailutils MH support, S/MIME support, picon
8984support, and an improved interface for hiding header fields. The CVS
8985repository was migrated from SourceForge to Savannah (only for those
8986files that were already part of Emacs) and the software was completely
8987reorganized to push back two decades of entropy. Version 8 appeared in
8988Emacs 22.1 in 2006.
8989
8990Development was then quiet for a couple of years. Emacs 23.1, which is
8991due out in 2009, will contain version 8.1. This version includes a few
8992new features and several bug fixes.
8993
8994Bill Wohler, August 2008
8995
8996@node GFDL, GPL, History, Top
8997@appendix GNU Free Documentation License
8998@include doclicense.texi
8999
9000@node GPL, Key Index, GFDL, Top
9001@appendix GNU General Public License
9002@include gpl.texi
9003
9004@node Key Index, Command Index, GPL, Top
9005@unnumbered Key (Character) Index
9006@printindex ky
9007
9008@node Command Index, Option Index, Key Index, Top
9009@unnumbered Command Index
9010@printindex fn
9011
9012@node Option Index, Concept Index, Command Index, Top
9013@unnumbered Option (Variable) Index
9014@printindex vr
9015
9016@node Concept Index,  , Option Index, Top
9017@unnumbered Concept Index
9018@printindex cp
9019
9020@bye
9021
9022@c Ispell Helpers
9023@c
9024@c The following are words that ispell should ignore that would not
9025@c normally be in a dictionary (global or personal). Be careful not to
9026@c include words here that could potentially be typos of other words
9027@c (such as url, elisp, or MHE).
9028@c
9029@c LocalWords: CTRL ESC SPC f's
9030@c LocalWords: addr Aliasfile alist
9031@c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
9032@c LocalWords: cmd CMU contrib cron
9033@c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
9034@c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
9035@c LocalWords: ImageMagick inbox ispell keychain
9036@c LocalWords: Larus licensor LocalWords lookup lpr
9037@c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
9038@c LocalWords: MML msg multipart
9039@c LocalWords: Namazu NIS nenscript nnml num
9040@c LocalWords: packmbox passphrase pathname prev procmail prog repl
9041@c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
9042@c LocalWords: sublicense supercite speedbar
9043@c LocalWords: Tennex texi texinfo Thelen thelenm
9044@c LocalWords: UCI undeleted whatnow wohler xmh ypcat
9045@c
9046@c See https://oreillymedia.github.io/production-resources/styleguide/.
9047@c See https://en.wikipedia.org/.
9048@c
9049@c Note the lowercase mh which is needed to avoid hits in the
9050@c functions and variables. Occasionally, check for accidental
9051@c inclusion of mh in text by uncommenting the following and executing
9052@c it with C-x C-e. You want to see "Search failed"
9053@c   (let ((case-fold-search nil))
9054@c        (goto-char (point-min))
9055@c        (search-forward-regexp "^mh\\( \\|$\\)"))
9056@c
9057@c An extremely useful setting for texinfo-mode-hook is:
9058@c   (add-to-list
9059@c    'ispell-skip-region-alist
9060@c    (list
9061@c     (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9062@c             "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9063@c             "@[@{}.]\\|"
9064@c             "[^@]\\|"
9065@c             "@\\(end \\)?group\\|"
9066@c             "@\\(end \\)?cartouche\\)+"
9067@c             "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9068@c             "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9069@c             "^@end [a-z]+$\\|"
9070@c             "^@\\([fv]\\|print\\)index .*$\\|"
9071@c             "@uref{[^,]+,\\|"
9072@c             "@[a-z]+\\|"
9073@c             "/[a-z.]+[/}]\\)")))))
9074@c
9075@c Cross References
9076@c
9077@c See existing cross-references to the Emacs manual and the Emacs
9078@c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9079@c Emacs Lisp Reference Manual'' respectively).
9080
9081@c @ftable Sorting
9082@c
9083@c As per index (sort of): Punctuation, keyboard characters (such as
9084@c RET and BS) upper and lowercase mixed (lower comes before
9085@c uppercase), control characters go with uppercase C, meta characters
9086@c go with uppercase M.
9087@c In some cases, the sort isn't strictly ASCII.
9088@c For example, SPC (mh-page-msg) reads better before BS
9089@c (mh-previous-page) and . (mh-show) is better before ,
9090@c (mh-header-display).
9091
9092@c @vtable Sorting
9093@c
9094@c Alphabetical, pull hooks into their own table.
9095
9096@c Local Variables:
9097@c sentence-end-double-space: nil
9098@c End:
9099