6a9367e1e91bcf5adbd5e3672abf62f4c5342334
[mmh] / man / repl.man
1 .TH REPL %manext1% "July 1, 2012" "%nmhversion%"
2 .\"
3 .\" %nmhwarning%
4 .\"
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 .IR 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, unless you specify
127 another forms file on the command line or in your profile.
128 .PP
129 The default group reply template \*(lqreplgroupcomps\*(rq will direct
130 .B repl
131 to construct the reply message draft as follows:
132 .PP
133 .RS 5
134 .nf
135 To: <Mail\-Followup\-To>
136 Subject: Re: <Subject>
137 In\-Reply\-To: Message from <From> of <Date>.
138 .ti +\w'In\-Reply\-To: 'u
139 <Message\-Id>
140 --------
141 .fi
142 .RE
143 .PP
144 or if the field <Mail\-Followup\-To> is not available:
145 .PP
146 .RS 5
147 .nf
148 To: <Mail\-Reply\-To> or <Reply\-To> or <From>
149 cc: <To> and <cc> and <personal address>
150 Subject: Re: <Subject>
151 In\-Reply\-To: Message from <From> of <Date>.
152 .ti +\w'In\-Reply\-To: 'u
153 <Message\-Id>
154 --------
155 .fi
156 .RE
157 .PP
158 By default, the \*(lqcc:\*(rq contains all the addresses shown.  You may
159 selectively remove addresses from this default with the
160 .B \-nocc
161 .I type
162 switch.
163 This switch takes an argument (
164 .IR all / to / cc / me )
165 which specifies who gets removed
166 from the default \*(lqcc:\*(rq list of the reply.  You may give this switch
167 multiple times (with different arguments) if you wish to remove multiple types
168 of addresses.
169 .PP
170 In any case, you may specify an alternate forms file with the switch
171 .B \-form
172 .IR formfile .
173 .PP
174 The
175 .B \-query
176 switch modifies the action of
177 .B \-nocc
178 .I type
179 switch by
180 interactively asking you if each address that normally would be placed in
181 the \*(lqTo:\*(rq and \*(lqcc:\*(rq list should actually be sent a copy.
182 This is useful for special\-purpose replies.  Note that the position of
183 the
184 .B \-cc
185 and
186 .B \-nocc
187 switches, like all other switches which take a
188 positive and negative form, is important.
189 .PP
190 Lines beginning with the fields \*(lqTo:\*(rq, \*(lqcc:\*(rq, and
191 \*(rqBcc:\*(rq will be standardized and have duplicate addresses removed.
192 In addition, the
193 .B \-width
194 .I columns
195 switch will guide
196 .BR repl 's
197 formatting of these fields.
198 .PP
199 If the draft already exists,
200 .B repl
201 will ask you as to the disposition
202 of the draft.  A reply of
203 .B quit
204 will abort
205 .BR repl ,
206 leaving the
207 draft intact;
208 .B replace
209 will replace the existing draft with a blank
210 skeleton; and
211 .B list
212 will display the draft.
213 .PP
214 See
215 .IR comp (1)
216 for a description of the
217 .B \-editor
218 and
219 .B \-noedit
220 switches.  Note that while in the editor, the message being replied
221 to is available through a link named \*(lq@\*(rq (assuming the default
222 .IR whatnowproc ).
223 In addition, the actual pathname of the message is
224 stored in the environment variable
225 .BR $editalt ,
226 and the pathname of
227 the folder containing the message is stored in the environment variable
228 .BR $mhfolder .
229 The creation of the \*(lq@\*(rq file and associated environment variables
230 can be controlled via the
231 .B \-atfile
232 and
233 .B \-noatfile
234 options.
235 .PP
236 Although
237 .B repl
238 uses a forms file to direct it how to construct
239 the beginning of the draft, it uses a message filter file to direct
240 it as to how the message to which you are replying should be filtered
241 (re\-formatted) in the body of the draft.  The filter file for
242 .B repl
243 should be a standard form file for
244 .BR mhl ,
245 as
246 .B repl
247 will invoke
248 .B mhl
249 to format the message to which you are replying.
250 .PP
251 The switches
252 .BR \-noformat ,
253 .BR \-format ,
254 and
255 .B \-filter
256 .I filterfile
257 specify
258 which message filter file to use.
259 .PP
260 If the switch
261 .B \-noformat
262 is given (it is the default), then the message
263 to which you are replying is not included in the body of the draft.
264 .PP
265 If the switch
266 .B \-format
267 is given, then a default message filter file
268 is used.  This default message filter should be adequate for most users.
269 This default filter
270 .RI \*(lq mhl.reply \*(rq
271 is:
272 .PP
273 .RS 5
274 .nf
275 %mhl_reply%
276 .fi
277 .RE
278 .PP
279 which outputs each line of the body of the message prefaced with the
280 \*(lq>\*(rq character and a space.
281 .PP
282 If a file named
283 .RI \*(lq mhl.reply \*(rq
284 exists in the user's
285 .B nmh
286 directory,
287 it will be used instead of this form.  You may specify an alternate
288 message filter file with the switch
289 .B \-filter
290 .IR filterfile .
291 .PP
292 Other reply filters are commonly used, such as:
293 .PP
294 .RS 5
295 .nf
296 :
297 body:nocomponent,compwidth=9,offset=9
298 .fi
299 .RE
300 .PP
301 which says to output a blank line and then the body of the message
302 being replied\-to, indented by one tab\-stop.  Another popular format
303 is:
304 .PP
305 .RS 5
306 .nf
307 message-id:nocomponent,\|nonewline,\\
308 formatfield=\*(lqIn message %{text},\ \*(rq
309 from:nocomponent,\|formatfield=\*(lq%(decode(friendly{text})) writes:\*(rq
310 body:component=\*(lq>\*(rq,\|overflowtext=\*(lq>\*(rq,\|overflowoffset=0
311 .fi
312 .RE
313 .PP
314 This message filter file cites the Message-ID and author of the message
315 being replied\-to, and then outputs each line of the body prefaced with
316 the \*(lq>\*(rq character.
317 .PP
318 You can also use an external format program to format the message body.
319 The format program is specified by the
320 .IR formatproc
321 profile entry, and is enabled by the \*(lqformat\*(rq flag.  A message
322 filter using an external format program would look like this:
323 .PP
324 .RS 5
325 .nf
326 body:component=\*(lq>\*(rq,\|nowrap,\|format
327 .fi
328 .RE
329 .PP
330 See the
331 .IR mhl(1)
332 documentation for more information.  The format program can be changed by
333 the
334 .B \-fmtproc
335 .I program
336 and
337 .B \-nofmtproc
338 switches.
339 .PP
340 To use the MIME rules for encapsulation, specify the
341 .B \-mime
342 switch.
343 This directs
344 .B repl
345 to generate an
346 .B mhbuild
347 composition file.
348 Note that
349 .B nmh
350 will not invoke
351 .B mhbuild
352 automatically, unless you
353 add this line to your
354 .I \&.mh\(ruprofile
355 file:
356 .PP
357 .RS 5
358 automimeproc: 1
359 .RE
360 .PP
361 Otherwise, you must specifically give the command
362 .PP
363 .RS 5
364 What now? mime
365 .RE
366 .PP
367 prior to sending the draft.
368 .PP
369 If the
370 .B \-annotate
371 switch is given, the message being replied\-to will
372 be annotated with the lines
373 .PP
374 .RS 5
375 Replied:\ date
376 Replied:\ addrs
377 .RE
378 .PP
379 where the address list contains one line for each addressee.
380 The annotation will be done only if the message is sent directly from
381 .BR repl .
382 If the message is not sent immediately from
383 .BR repl ,
384 .RB \*(lq "comp\ \-use" \*(rq
385 may be used to re\-edit and send the constructed
386 message, but the annotations won't take place.  Normally annotations are
387 done inplace in order to preserve any links to the message.  You may use
388 the
389 .B \-noinplace
390 switch to change this.
391 .PP
392 Although the default template specifies that a copy of the reply will be
393 put in
394 the folder 'outbox',
395 if the
396 .B \-fcc
397 .I +folder
398 switch is given it will override the default value.
399 More than one folder, each preceded by
400 .B \-fcc
401 can
402 be named.
403 .PP
404 In addition to the standard
405 .IR mh\-format (5)
406 escapes,
407 .B repl
408 also recognizes the following additional
409 .I component
410 escape:
411 .PP
412 .RS 5
413 .nf
414 .ta \w'Escape  'u +\w'Returns  'u
415 .I "Escape      Returns Description"
416 fcc     string  Any folders specified with `\-fcc\ folder'
417 .fi
418 .RE
419 .PP
420 To avoid reiteration,
421 .B repl
422 strips any leading `Re: ' strings from
423 the
424 .I subject
425 component.
426 .PP
427 The
428 .B \-draftfolder
429 .I +folder
430 and
431 .B \-draftmessage
432 .I msg
433 switches invoke
434 the
435 .B nmh
436 draft folder facility.  This is an advanced (and highly
437 useful) feature.  Consult the
438 .IR mh-draft (5)
439 man page for more
440 information.
441 .PP
442 Upon exiting from the editor,
443 .B repl
444 will invoke the
445 .B whatnow
446 program.  See
447 .IR whatnow (1)
448 for a discussion of available
449 options.  The invocation of this program can be inhibited by using the
450 .B \-nowhatnowproc
451 switch.  (In truth of fact, it is the
452 .B whatnow
453 program which starts the initial edit.  Hence,
454 .B \-nowhatnowproc
455 will
456 prevent any edit from occurring.)
457 .PP
458 The
459 .B \-build
460 switch is intended to be used by the Emacs mh-e interface
461 to
462 .BR nmh .
463 It implies
464 .BR \-nowhatnowproc .
465 It causes a file
466 .I <mh\-dir>/reply
467 to be created, containing the draft message that would normally be presented
468 to the user for editing.
469 No mail is actually sent.
470 .PP
471 The
472 .B \-file
473 .I msgfile
474 switch specifies the message to be replied to as an 
475 exact filename rather than as an
476 .B nmh
477 folder and message number. It is 
478 intended to be used by the
479 .B msh
480 interface to
481 .BR nmh . 
482 The same caveats apply to this option as to the
483 .B \-build
484 switch.
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 .SH "PROFILE COMPONENTS"
499 .fc ^ ~
500 .nf
501 .ta 2.4i
502 .ta \w'ExtraBigProfileName  'u
503 ^Path:~^To determine the user's nmh directory
504 ^Alternate\-Mailboxes:~^To determine the user's mailboxes
505 ^Current\-Folder:~^To find the default current folder
506 ^Draft\-Folder:~^To find the default draft\-folder
507 ^Editor:~^To override the default editor
508 ^Msg\-Protect:~^To set mode when creating a new message (draft)
509 ^fileproc:~^Program to refile the message
510 ^mhlproc:~^Program to filter message being replied\-to
511 ^whatnowproc:~^Program to ask the \*(lqWhat now?\*(rq questions
512 .fi
513 .SH "SEE ALSO"
514 .IR comp (1),
515 .IR forw (1),
516 .IR mhbuild (1),
517 .IR send (1),
518 .IR whatnow (1),
519 .IR mh\-format (5)
520 .SH DEFAULTS
521 .nf
522 .RB ` +folder "' defaults to the current folder"
523 .RB ` msg "' defaults to cur"
524 .RB ` \-nogroup '
525 .RB ` "\-nocc\ all" "' with `\-nogroup', `\-cc\ all' with `\-group'"
526 .RB ` \-noannotate '
527 .RB ` \-nodraftfolder '
528 .RB ` \-noformat '
529 .RB ` \-inplace '
530 .RB ` \-nomime '
531 .RB ` \-noquery '
532 .RB ` \-noatfile '
533 .RB ` "\-width\ 72" '
534 .fi
535 .SH CONTEXT
536 If a folder is given, it will become the current folder.  The message
537 replied\-to will become the current message.
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.