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