Add support for -fmtproc and -nofmtproc switches to repl.
[mmh] / man / repl.man
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH REPL %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 repl \- reply to a message
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B repl
11 .RI [ +folder ]
12 .RI [ msgs ]
13 .RB [ \-annotate " | " \-noannotate ] 
14 .RB [ \-group " | " \-nogroup ]
15 .RB [ \-cc
16 all/to/cc/me]
17 .RB [ \-nocc
18 all/to/cc/me]
19 .RB [ \-query " | " \-noquery ]
20 .RB [ \-form
21 .IR formfile ]
22 .RB [ \-format " | " \-noformat ]
23 .RB [ \-filter
24 .IR filterfile ]
25 .RB [ \-inplace " | " \-noinplace ]
26 .RB [ \-mime " | " \-nomime ]
27 .RB [ \-fcc
28 .IR +folder ]
29 .RB [ \-width
30 .IR columns ]
31 .RB [ \-draftfolder
32 .IR +folder ]
33 .RB [ \-draftmessage
34 .IR msg ]
35 .RB [ \-nodraftfolder ]
36 .RB [ \-editor
37 .IR editor ]
38 .RB [ \-noedit ]
39 .RB [ \-whatnowproc
40 .IR program ]
41 .RB [ \-nowhatnowproc ]
42 .RB [ \-atfile ]
43 .RB [ \-noatfile ]
44 .RB [ \-fmtproc
45 .IR program ]
46 .RB [ \-nofmtproc ]
47 .RB [ \-build ]
48 .RB [ \-file
49 .IR msgfile ]
50 .RB [ \-version ]
51 .RB [ \-help ]
52 .ad
53 .SH DESCRIPTION
54 .B Repl
55 may be used to produce a reply to an existing message.
56 .PP
57 In its simplest form (with no arguments),
58 .B repl
59 will set up a
60 message\-form skeleton in reply to the current message in the current
61 folder, and invoke the whatnow shell.
62 .PP
63 In order to construct the message draft of the reply,
64 .B repl
65 uses
66 a reply template to guide its actions.  A reply template is simply a
67 .B mhl
68 format file (see
69 .BR mh\-format (5)
70 for details).
71 .PP
72 If the switch
73 .B \-nogroup
74 is given (it is on by default), then
75 .B repl
76 will use the standard forms file \*(lqreplcomps\*(rq.  This will construct
77 a draft message that is intended to be sent only to the author of the
78 message to which you are replying.  If a file named \*(lqreplcomps\*(rq
79 exists in the user's
80 .B nmh
81 directory, it will be used instead of this
82 default forms file.
83 .PP
84 The default reply template \*(lqreplcomps\*(rq will direct
85 .B repl
86 to construct the reply message draft as follows:
87 .PP
88 .RS 5
89 .nf
90 To: <Mail\-Reply\-To> or <Reply\-To> or <From>
91 cc: <To> and <cc> and <personal address>
92 Fcc: {fcc switch} or +outbox
93 Subject: Re: <Subject>
94 In\-Reply\-To: <Message\-Id>
95 References: <Message\-Id>
96 Comments: In\-Reply\-To <From> or <apparently from> or <Sender>
97 .ti +3 
98 message dated <date>
99 --------
100 .fi
101 .RE
102 .PP
103 where field names enclosed in angle brackets (<\ >) indicate the
104 contents of the named field from the message to which the reply is
105 being made.
106 .PP
107 By default, the \*(lqcc:\*(rq field is empty.  You may selectively add
108 addresses to this default with the
109 .B \-cc
110 .I type
111 switch.  This switch takes an
112 argument (
113 .IR all / to / cc / me )
114 which specifies who gets added to the default
115 \*(lqcc:\*(rq list of the reply.  You may give this switch multiple times (with
116 different arguments) if you wish to add multiple types of addresses.
117 .PP
118 If the switch
119 .B \-group
120 is given, then
121 .B repl
122 will use the the
123 standard forms file \*(lqreplgroupcomps\*(rq.  This will construct a
124 draft message that is intended as a group or followup reply.  If a file
125 named \*(lqreplgroupcomps\*(rq exists in the user's nmh directory, it
126 will be used instead of this default forms file.
127 .PP
128 The default group reply template \*(lqreplgroupcomps\*(rq will direct
129 .B repl
130 to construct the reply message draft as follows:
131 .PP
132 .RS 5
133 .nf
134 To: <Mail\-Followup\-To>
135 Subject: Re: <Subject>
136 In\-Reply\-To: Message from <From> of <Date>.
137 .ti +\w'In\-Reply\-To: 'u
138 <Message\-Id>
139 --------
140 .fi
141 .RE
142 .PP
143 or if the field <Mail\-Followup\-To> is not available:
144 .PP
145 .RS 5
146 .nf
147 To: <Mail\-Reply\-To> or <Reply\-To> or <From>
148 cc: <To> and <cc> and <personal address>
149 Subject: Re: <Subject>
150 In\-Reply\-To: Message from <From> of <Date>.
151 .ti +\w'In\-Reply\-To: 'u
152 <Message\-Id>
153 --------
154 .fi
155 .RE
156 .PP
157 By default, the \*(lqcc:\*(rq contains all the addresses shown.  You may
158 selectively remove addresses from this default with the
159 .B \-nocc
160 .I type
161 switch.
162 This switch takes an argument (
163 .IR all / to / cc / me )
164 which specifies who gets removed
165 from the default \*(lqcc:\*(rq list of the reply.  You may give this switch
166 multiple times (with different arguments) if you wish to remove multiple types
167 of addresses.
168 .PP
169 In any case, you may specify an alternate forms file with the switch
170 .B \-form
171 .IR formfile .
172 .PP
173 The
174 .B \-query
175 switch modifies the action of
176 .B \-nocc
177 .I type
178 switch by
179 interactively asking you if each address that normally would be placed in
180 the \*(lqTo:\*(rq and \*(lqcc:\*(rq list should actually be sent a copy.
181 This is useful for special\-purpose replies.  Note that the position of
182 the
183 .B \-cc
184 and
185 .B \-nocc
186 switches, like all other switches which take a
187 positive and negative form, is important.
188 .PP
189 Lines beginning with the fields \*(lqTo:\*(rq, \*(lqcc:\*(rq, and
190 \*(rqBcc:\*(rq will be standardized and have duplicate addresses removed.
191 In addition, the
192 .B \-width
193 .I columns
194 switch will guide
195 .BR repl 's
196 formatting of these fields.
197 .PP
198 If the draft already exists,
199 .B repl
200 will ask you as to the disposition
201 of the draft.  A reply of
202 .B quit
203 will abort
204 .BR repl ,
205 leaving the
206 draft intact;
207 .B replace
208 will replace the existing draft with a blank
209 skeleton; and
210 .B list
211 will display the draft.
212 .PP
213 See
214 .BR comp (1)
215 for a description of the
216 .B \-editor
217 and
218 .B \-noedit
219 switches.  Note that while in the editor, the message being replied
220 to is available through a link named \*(lq@\*(rq (assuming the default
221 .IR whatnowproc ).
222 In addition, the actual pathname of the message is
223 stored in the environment variable
224 .BR $editalt ,
225 and the pathname of
226 the folder containing the message is stored in the environment variable
227 .BR $mhfolder .
228 The creation of the \*(lq@\*(rq file and associated environment variables
229 can be controlled via the
230 .B \-atfile
231 and
232 .B \-noatfile
233 options.
234 .PP
235 Although
236 .B repl
237 uses a forms file to direct it how to construct
238 the beginning of the draft, it uses a message filter file to direct
239 it as to how the message to which you are replying should be filtered
240 (re\-formatted) in the body of the draft.  The filter file for
241 .B repl
242 should be a standard form file for
243 .BR mhl ,
244 as
245 .B repl
246 will invoke
247 .B mhl
248 to format the message to which you are replying.
249 .PP
250 The switches
251 .BR \-noformat ,
252 .BR \-format ,
253 and
254 .B \-filter
255 .I filterfile
256 specify
257 which message filter file to use.
258 .PP
259 If the switch
260 .B \-noformat
261 is given (it is the default), then the message
262 to which you are replying is not included in the body of the draft.
263 .PP
264 If the switch
265 .B \-format
266 is given, then a default message filter file
267 is used.  This default message filter should be adequate for most users.
268 This default filter
269 .RI \*(lq mhl.reply \*(rq
270 is:
271 .PP
272 .RS 5
273 .nf
274 %mhl_reply%
275 .fi
276 .RE
277 .PP
278 which outputs each line of the body of the message prefaced with the
279 \*(lq>\*(rq character and a space.
280 .PP
281 If a file named
282 .RI \*(lq mhl.reply \*(rq
283 exists in the user's
284 .B nmh
285 directory,
286 it will be used instead of this form.  You may specify an alternate
287 message filter file with the switch
288 .B \-filter
289 .IR filterfile .
290 .PP
291 Other reply filters are commonly used, such as:
292 .PP
293 .RS 5
294 .nf
295 :
296 body:nocomponent,compwidth=9,offset=9
297 .fi
298 .RE
299 .PP
300 which says to output a blank line and then the body of the message
301 being replied\-to, indented by one tab\-stop.  Another popular format
302 is:
303 .PP
304 .RS 5
305 .nf
306 message-id:nocomponent,\|nonewline,\\
307 formatfield=\*(lqIn message %{text},\ \*(rq
308 from:nocomponent,\|formatfield=\*(lq%(decode(friendly{text})) writes:\*(rq
309 body:component=\*(lq>\*(rq,\|overflowtext=\*(lq>\*(rq,\|overflowoffset=0
310 .fi
311 .RE
312 .PP
313 This message filter file cites the Message-ID and author of the message
314 being replied\-to, and then outputs each line of the body prefaced with
315 the \*(lq>\*(rq character.
316 .PP
317 You can also use an external format program to format the message body.
318 The format program is specified by the
319 .IR formatproc
320 profile entry, and is enabled by the \*(lqformat\*(rq flag.  A message
321 filter using an external format program would look like this:
322 .PP
323 .RS 5
324 .nf
325 body:component=\*(lq>\*(rq,\|nowrap,\|format
326 .fi
327 .RE
328 .PP
329 See the
330 .BR mhl(1)
331 documentation for more information.  The format program can be changed by
332 the
333 .B \-fmtproc
334 .I program
335 and
336 .B \-nofmtproc
337 switches.
338 .PP
339 To use the MIME rules for encapsulation, specify the
340 .B \-mime
341 switch.
342 This directs
343 .B repl
344 to generate an
345 .B mhbuild
346 composition file.
347 Note that
348 .B nmh
349 will not invoke
350 .B mhbuild
351 automatically, unless you
352 add this line to your
353 .I \&.mh\(ruprofile
354 file:
355 .PP
356 .RS 5
357 automimeproc: 1
358 .RE
359 .PP
360 Otherwise, you must specifically give the command
361 .PP
362 .RS 5
363 What now? mime
364 .RE
365 .PP
366 prior to sending the draft.
367 .PP
368 If the
369 .B \-annotate
370 switch is given, the message being replied\-to will
371 be annotated with the lines
372 .PP
373 .RS 5
374 Replied:\ date
375 Replied:\ addrs
376 .RE
377 .PP
378 where the address list contains one line for each addressee.
379 The annotation will be done only if the message is sent directly from
380 .BR repl .
381 If the message is not sent immediately from
382 .BR repl ,
383 .RB \*(lq "comp\ \-use" \*(rq
384 may be used to re\-edit and send the constructed
385 message, but the annotations won't take place.  Normally annotations are
386 done inplace in order to preserve any links to the message.  You may use
387 the
388 .B \-noinplace
389 switch to change this.
390 .PP
391 Although the default template specifies that a copy of the reply will be
392 put in
393 the folder 'outbox',
394 if the
395 .B \-fcc
396 .I +folder
397 switch is given it will override the default value.
398 More than one folder, each preceded by
399 .B \-fcc
400 can
401 be named.
402 .PP
403 In addition to the standard
404 .BR mh\-format (5)
405 escapes,
406 .B repl
407 also recognizes the following additional
408 .I component
409 escape:
410 .PP
411 .RS 5
412 .nf
413 .ta \w'Escape  'u +\w'Returns  'u
414 .I "Escape      Returns Description"
415 fcc     string  Any folders specified with `\-fcc\ folder'
416 .fi
417 .RE
418 .PP
419 To avoid reiteration,
420 .B repl
421 strips any leading `Re: ' strings from
422 the
423 .I subject
424 component.
425 .PP
426 The
427 .B \-draftfolder
428 .I +folder
429 and
430 .B \-draftmessage
431 .I msg
432 switches invoke
433 the
434 .B nmh
435 draft folder facility.  This is an advanced (and highly
436 useful) feature.  Consult the
437 .BR mh-draft (5)
438 man page for more
439 information.
440 .PP
441 Upon exiting from the editor,
442 .B repl
443 will invoke the
444 .B whatnow
445 program.  See
446 .BR whatnow (1)
447 for a discussion of available
448 options.  The invocation of this program can be inhibited by using the
449 .B \-nowhatnowproc
450 switch.  (In truth of fact, it is the
451 .B whatnow
452 program which starts the initial edit.  Hence,
453 .B \-nowhatnowproc
454 will
455 prevent any edit from occurring.)
456 .PP
457 The
458 .B \-build
459 switch is intended to be used by the Emacs mh-e interface
460 to
461 .BR nmh .
462 It implies
463 .BR \-nowhatnowproc .
464 It causes a file
465 .I <mh\-dir>/reply
466 to be created, containing the draft message that would normally be presented
467 to the user for editing.
468 No mail is actually sent.
469 .PP
470 The
471 .B \-file
472 .I msgfile
473 switch specifies the message to be replied to as an 
474 exact filename rather than as an
475 .B nmh
476 folder and message number. It is 
477 intended to be used by the
478 .B msh
479 interface to
480 .BR nmh . 
481 The same caveats apply to this option as to the
482 .B \-build
483 switch.
484
485 .SH FILES
486 .fc ^ ~
487 .nf
488 .ta \w'%etcdir%/ExtraBigFileName  'u
489 ^%etcdir%/replcomps~^The standard reply template
490 ^or <mh\-dir>/replcomps~^Rather than the standard template
491 ^%etcdir%/replgroupcomps~^The standard `reply -group' template
492 ^or <mh\-dir>/replgroupcomps~^Rather than the standard template
493 ^%etcdir%/mhl.reply~^The standard message filter
494 ^or <mh\-dir>/mhl.reply~^Rather than the standard filter
495 ^$HOME/\&.mh\(ruprofile~^The user profile
496 ^<mh\-dir>/draft~^The draft file
497 .fi
498
499 .SH "PROFILE COMPONENTS"
500 .fc ^ ~
501 .nf
502 .ta 2.4i
503 .ta \w'ExtraBigProfileName  'u
504 ^Path:~^To determine the user's nmh directory
505 ^Alternate\-Mailboxes:~^To determine the user's mailboxes
506 ^Current\-Folder:~^To find the default current folder
507 ^Draft\-Folder:~^To find the default draft\-folder
508 ^Editor:~^To override the default editor
509 ^Msg\-Protect:~^To set mode when creating a new message (draft)
510 ^fileproc:~^Program to refile the message
511 ^mhlproc:~^Program to filter message being replied\-to
512 ^whatnowproc:~^Program to ask the \*(lqWhat now?\*(rq questions
513 .fi
514
515 .SH "SEE ALSO"
516 mhbuild(1), comp(1), forw(1), send(1), whatnow(1), mh\-format(5)
517
518 .SH DEFAULTS
519 .nf
520 .RB ` +folder "' defaults to the current folder"
521 .RB ` msg "' defaults to cur"
522 .RB ` \-nogroup '
523 .RB ` "\-nocc\ all" "' with `\-nogroup', `\-cc\ all' with `\-group'"
524 .RB ` \-noannotate '
525 .RB ` \-nodraftfolder '
526 .RB ` \-noformat '
527 .RB ` \-inplace '
528 .RB ` \-nomime '
529 .RB ` \-noquery '
530 .RB ` \-atfile '
531 .RB ` "\-width\ 72" '
532 .fi
533
534 .SH CONTEXT
535 If a folder is given, it will become the current folder.  The message
536 replied\-to will become the current message.
537
538 .SH BUGS
539 If any addresses occur in the reply template, addresses in the template
540 that do not contain hosts are defaulted incorrectly.  Instead of using
541 the localhost for the default,
542 .B repl
543 uses the sender's host.
544 Moral of the story: if you're going to include addresses in a reply
545 template, include the host portion of the address.
546 .PP
547 The
548 .B \-width
549 .I columns
550 switch is only used to do address-folding; other
551 headers are not line\-wrapped.
552 .PP
553 If
554 .I whatnowproc
555 is
556 .BR whatnow ,
557 then
558 .B repl
559 uses a built\-in
560 .BR whatnow ,
561 it does not actually run the
562 .B whatnow
563 program.
564 Hence, if you define your own
565 .IR whatnowproc ,
566 don't call it
567 .B whatnow
568 since
569 .B repl
570 won't run it.
571 .PP
572 If your current working directory is not writable, the link named
573 \*(lq@\*(rq is not available.