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