]> diplodocus.org Git - nmh/blob - man/repl.man
Compare character with EOF using signed comparison because
[nmh] / man / repl.man
1 .TH REPL %manext1% "April 9, 2013" "%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 .RI ( 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
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, with
221 .B \-atfile
222 and if the current directory is writable, the message being replied
223 to is available through a link named \*(lq@\*(rq (assuming the default
224 .IR whatnowproc ).
225 In addition, the actual pathname of the message is
226 stored in the environment variable
227 .BR $editalt ,
228 and the pathname of
229 the folder containing the message is stored in the environment variable
230 .BR $mhfolder .
231 The creation of the \*(lq@\*(rq file is controlled via the
232 .B \-atfile
233 and
234 .B \-noatfile
235 options.
236 .PP
237 Although
238 .B repl
239 uses a forms file to direct it how to construct
240 the beginning of the draft, it uses a message filter file to direct
241 it as to how the message to which you are replying should be filtered
242 (re\-formatted) in the body of the draft. The filter file for
243 .B repl
244 should be a standard form file for
245 .BR mhl ,
246 as
247 .B repl
248 will invoke
249 .B mhl
250 to format the message to which you are replying.
251 .PP
252 The switches
253 .BR \-noformat ,
254 .BR \-format ,
255 and
256 .B \-filter
257 .I filterfile
258 specify
259 which message filter file to use.
260 .PP
261 If the switch
262 .B \-noformat
263 is given (it is the default), then the message
264 to which you are replying is not included in the body of the draft.
265 .PP
266 If the switch
267 .B \-format
268 is given, then a default message filter file
269 is used. This default message filter should be adequate for most users.
270 This default filter
271 .RI \*(lq mhl.reply \*(rq
272 is:
273 .PP
274 .RS 5
275 .nf
276 %mhl_reply%
277 .fi
278 .RE
279 .PP
280 which outputs each line of the body of the message prefaced with the
281 \*(lq>\*(rq character and a space.
282 .PP
283 If a file named
284 .RI \*(lq mhl.reply \*(rq
285 exists in the user's
286 .B nmh
287 directory,
288 it will be used instead of this form. You may specify an alternate
289 message filter file with the switch
290 .B \-filter
291 .IR filterfile .
292 .PP
293 Other reply filters are commonly used, such as:
294 .PP
295 .RS 5
296 .nf
297 :
298 body:nocomponent,compwidth=9,offset=9
299 .fi
300 .RE
301 .PP
302 which says to output a blank line and then the body of the message
303 being replied\-to, indented by one tab\-stop. Another popular format
304 is:
305 .PP
306 .RS 5
307 .nf
308 message-id:nocomponent,\|nonewline,\\
309 formatfield=\*(lqIn message %{text},\ \*(rq
310 from:nocomponent,\|formatfield=\*(lq%(decode(friendly{text})) writes:\*(rq
311 body:component=\*(lq>\*(rq,\|overflowtext=\*(lq>\*(rq,\|overflowoffset=0
312 .fi
313 .RE
314 .PP
315 This message filter file cites the Message-ID and author of the message
316 being replied\-to, and then outputs each line of the body prefaced with
317 the \*(lq>\*(rq character.
318 .PP
319 You can also use an external format program to format the message body.
320 The format program is specified by the
321 .IR formatproc
322 profile entry, and is enabled by the \*(lqformat\*(rq flag. A message
323 filter using an external format program would look like this:
324 .PP
325 .RS 5
326 .nf
327 body:component=\*(lq>\*(rq,\|nowrap,\|format
328 .fi
329 .RE
330 .PP
331 See the
332 .IR mhl(1)
333 documentation for more information. The format program can be changed by
334 the
335 .B \-fmtproc
336 .I program
337 and
338 .B \-nofmtproc
339 switches.
340 .PP
341 To use the MIME rules for encapsulation, specify the
342 .B \-mime
343 switch.
344 This directs
345 .B repl
346 to generate an
347 .B mhbuild
348 composition file.
349 Note that
350 .B nmh
351 will not invoke
352 .B mhbuild
353 automatically; you must specifically give the command
354 .PP
355 .RS 5
356 What now? mime
357 .RE
358 .PP
359 prior to sending the draft.
360 .PP
361 If the
362 .B \-annotate
363 switch is given, the message being replied\-to will
364 be annotated with the lines
365 .PP
366 .RS 5
367 Replied:\ date
368 Replied:\ addrs
369 .RE
370 .PP
371 where the address list contains one line for each addressee.
372 The annotation will be done only if the message is sent directly from
373 .BR repl .
374 If the message is not sent immediately from
375 .BR repl ,
376 .RB \*(lq "comp\ \-use" \*(rq
377 may be used to re\-edit and send the constructed
378 message, but the annotations won't take place. Normally annotations are
379 done inplace in order to preserve any links to the message. You may use
380 the
381 .B \-noinplace
382 switch to change this.
383 .PP
384 Although the default template specifies that a copy of the reply will be
385 put in
386 the folder 'outbox',
387 if the
388 .B \-fcc
389 .I +folder
390 switch is given it will override the default value.
391 More than one folder, each preceded by
392 .B \-fcc
393 can
394 be named.
395 .PP
396 In addition to the standard
397 .IR mh\-format (5)
398 escapes,
399 .B repl
400 also recognizes the following additional
401 .I component
402 escape:
403 .PP
404 .RS 5
405 .nf
406 .ta \w'Escape 'u +\w'Returns 'u
407 .I "Escape Returns Description"
408 fcc string Any folders specified with `\-fcc\ folder'
409 .fi
410 .RE
411 .PP
412 To avoid reiteration,
413 .B repl
414 strips any leading `Re: ' strings from
415 the
416 .I subject
417 component.
418 .PP
419 The
420 .B \-draftfolder
421 .I +folder
422 and
423 .B \-draftmessage
424 .I msg
425 switches invoke
426 the
427 .B nmh
428 draft folder facility. This is an advanced (and highly
429 useful) feature. Consult the
430 .IR mh-draft (5)
431 man page for more
432 information.
433 .PP
434 Upon exiting from the editor,
435 .B repl
436 will invoke the
437 .B whatnow
438 program. See
439 .IR whatnow (1)
440 for a discussion of available
441 options. The invocation of this program can be inhibited by using the
442 .B \-nowhatnowproc
443 switch. (In truth of fact, it is the
444 .B whatnow
445 program which starts the initial edit. Hence,
446 .B \-nowhatnowproc
447 will
448 prevent any edit from occurring.)
449 .PP
450 The
451 .B \-build
452 switch is intended to be used by the Emacs mh-e interface
453 to
454 .BR nmh .
455 It implies
456 .BR \-nowhatnowproc .
457 It causes a file
458 .I <mh\-dir>/reply
459 to be created, containing the draft message that would normally be presented
460 to the user for editing.
461 No mail is actually sent.
462 .PP
463 The
464 .B \-file
465 .I msgfile
466 switch specifies the message to be replied to as an
467 exact filename rather than as an
468 .B nmh
469 folder and message number. It is
470 intended to be used by the
471 .B msh
472 interface to
473 .BR nmh .
474 The same caveats apply to this option as to the
475 .B \-build
476 switch.
477 .SH FILES
478 .B repl
479 looks for all format, filter and template files in multiple locations:
480 absolute pathnames are accessed directly, tilde expansion is done on
481 usernames, and files are searched for in the user's
482 .I Mail
483 directory as specified in their profile. If not found there, the directory
484 .RI \*(lq %etcdir% \*(rq
485 is checked.
486 .PP
487 .fc ^ ~
488 .nf
489 .ta \w'%etcdir%/ExtraBigFileName 'u
490 ^%etcdir%/replcomps~^The standard reply template
491 ^or <mh\-dir>/replcomps~^Rather than the standard template
492 ^%etcdir%/replgroupcomps~^The standard `reply -group' template
493 ^or <mh\-dir>/replgroupcomps~^Rather than the standard template
494 ^%etcdir%/mhl.reply~^The standard message filter
495 ^or <mh\-dir>/mhl.reply~^Rather than the standard filter
496 ^$HOME/\&.mh\(ruprofile~^The user profile
497 ^<mh\-dir>/draft~^The draft file
498 .fi
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 .SH "SEE ALSO"
515 .IR comp (1),
516 .IR forw (1),
517 .IR mhbuild (1),
518 .IR send (1),
519 .IR whatnow (1),
520 .IR mh\-format (5)
521 .SH DEFAULTS
522 .nf
523 .RB ` +folder "' defaults to the current folder"
524 .RB ` msg "' defaults to cur"
525 .RB ` \-nogroup '
526 .RB ` "\-nocc\ all" "' with `\-nogroup', `\-cc\ all' with `\-group'"
527 .RB ` \-noannotate '
528 .RB ` \-nodraftfolder '
529 .RB ` \-noformat '
530 .RB ` \-inplace '
531 .RB ` \-nomime '
532 .RB ` \-noquery '
533 .RB ` \-noatfile '
534 .RB ` "\-width\ 72" '
535 .fi
536 .SH CONTEXT
537 If a folder is given, it will become the current folder. The message
538 replied\-to will become the current message.
539 .SH BUGS
540 If any addresses occur in the reply template, addresses in the template
541 that do not contain hosts are defaulted incorrectly. Instead of using
542 the localhost for the default,
543 .B repl
544 uses the sender's host.
545 Moral of the story: if you're going to include addresses in a reply
546 template, include the host portion of the address.
547 .PP
548 The
549 .B \-width
550 .I columns
551 switch is only used to do address-folding; other
552 headers are not line\-wrapped.
553 .PP
554 If
555 .I whatnowproc
556 is
557 .BR whatnow ,
558 then
559 .B repl
560 uses a built\-in
561 .BR whatnow ,
562 it does not actually run the
563 .B whatnow
564 program.
565 Hence, if you define your own
566 .IR whatnowproc ,
567 don't call it
568 .B whatnow
569 since
570 .B repl
571 won't run it.