File: reprep-2.html

package info (click to toggle)
mh-book 200605-2
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 6,356 kB
  • ctags: 2,059
  • sloc: sh: 1,449; perl: 642; ansic: 279; php: 58; makefile: 39; csh: 8
file content (493 lines) | stat: -rw-r--r-- 18,236 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
<!-- $Id: reprep-2.html 600 2006-05-31 22:13:43Z wohler $ -->
<html>
  <head>
    <meta name="Author" content="Jerry Peek">
    <title>Replying to Mail with repl: MH &amp; nmh: Email for Users & Programmers</title>
    <?$book = '..'?>
    <link rel="stylesheet" href="<?=$book?>/mh.css" type="text/css">
  </head>

  <body>
    <?
      include "$book/mh.php";
      includeHeader('thecom.html', 'forfor-2.html');
    ?>

    <a name="index1"></a>
    <h1>Replying to Mail with repl</h1>

    <p>
    The <i>repl</i> command is flexible -- there are a lot of great
    features that weren't covered in
    <a href="reprep.html">the introduction</a>.

    <p>
    You don't have to reply to everyone who got the original message,
    and
    <i>repl -query</i> makes it easy to choose who gets your reply.
    The <i>-nocc</i> and <i>-cc</i> switches give you another way to
    choose. This section covers several different ways to include the
    original message in your reply. The original message can be marked
    automatically when you reply to it. And there's more.
    <a name="index2"></a>

    <h2><a name="Selque">Selective Replies with -query</a></h2>

    <p>By default, when you reply to a message, <i>repl</i> will send
    a copy of your reply to everyone who got the original message --
    that includes the author, you, and all addresses in
    the <tt>To:</tt> and <tt>cc:</tt> fields. If you don't want that
    to happen all the time, <i>repl</i> can ask you. Just
    start <i>repl</i> with its <i>-query</i> switch. You can type it
    on the command line, just for particular messages:

    <pre>
    % <b>repl -query</b>
    </pre>

    Or, if you like <i>-query</i> enough to use it most of the time,
    you can add it to your MH profile -- then, whenever you don't want
    <i>-query</i>, you can use <i>-noquery</i> on the command line:

    <pre>
    % <b>repl -noquery</b>
    </pre>

    Now, for a demonstration of <i>-query</i>. First, show part of the
    message. Then, start <tt>repl -query</tt> and send copies of the
    reply only to a couple of people. Compare the addresses in the
    original message with the header of the reply:

    <a name="index3"></a>
    <pre>
    % <b>show last</b>
    (Message mh-users:8)
    Date:  13 Nov 89 00:28:18 GMT
    From:  Al Bok &lt;al@phlabs.ph.com&gt;
    To:  mh-users@ics.uci.edu
    cc: auser@quack.phlabs.ph.com, aguru@mt.top.ph.com
    Subject:  Query about "repl -query"

    I have a question about repl -query...
        ...
    % <b>repl -query</b>
    Reply to Al Bok &lt;al@phlabs.ph.com&gt;? <b>y</b>
    Reply to mh-users@ics.uci.edu? <b>n</b>
    Reply to auser@quack.phlabs.ph.com? <b>n</b>
    Reply to aguru@mt.top.ph.com? <b>y</b>
    Reply to auser? <b>n</b>

    To: Al Bok &lt;al@phlabs.ph.com&gt;
    cc: aguru@mt.top.ph.com
    Subject: Re: Query about "repl -query"
    In-reply-to: Your message of "13 Nov 89 00:28:18 +0000."
    --------
    <b>Al, I think this is the answer.  Guru, am I right?</b>
        ...
    </pre>

    If you hadn't used <i>-query</i>, your reply would have been
    addressed to all the original recipients.

    <p>
    (Notice the last query <tt>Reply to auser?</tt>. This happened
    because <i>repl</i> will automatically send a copy to you
    (<i>auser</i>) at your local address if your <i>replcomps</i> file
    tells it to. Even though <i>auser</i>'s complete address
    (<i>auser@quack.phlabs.ph.com</i>) was already in the header,
    <i>repl</i> couldn't tell the difference, so it asked again. There
    are ways around these problems besides <i>-query</i>. See the
    Sections
    <a href="#Sel">Selective Replies with -nocc and -cc</a>
    and <a href="defmai.html">Defining Alternate Mailboxes</a>.)

    <p>
    If you press your interrupt key (like CTRL-C) while <i>-query</i>
    is asking for addresses, <i>repl</i> will leave an empty draft
    message file. If you aren't using a draft folder, you'll get the
    prompt "Draft exists: disposition?" when you try again;
    just <i>replace</i> the empty draft. If you use a draft folder, it
    will fill up with empty drafts;
    a <a href="pccewca.html"><i>cron</i> job</a> that runs <tt>find
    -size 0 -name '[1-9]*'</tt> in the draft folder can remove those
    empty files.

    <p>
    A quick note to programmers: <i>-query</i> works with the
    <a name="mhstr.html#MfFuEs3"><i>(formataddr)</i> function
    escape</a> in your <i>repl</i> components file (like
    <a href="reprep-2.html#Cha"><i>replcomps</i></a>). If the format
    string doesn't use <i>(formataddr)</i>, then the
    <i>-query</i> switch won't work.
    <a name="index4"></a>

    <h2><a name="Sel">Selective Replies with -nocc and -cc</a></h2>

    <p>You can also tell <i>repl</i> to ignore certain fields in the
    message you're replying to -- that is, not to send copies to
    anyone in those field(s). Here are examples:

    <ol>

      <li>
      If you started with message 8 in the previous section again, the
      command:

      <pre>
      % <b>repl -nocc to -nocc cc</b>
      </pre>

      would have sent the reply only to Al Bok and you. You might ask:
      why you? (Let's assume you're <i>auser</i>.) Didn't you
      use <tt>-nocc cc</tt> to ignore the <tt>cc:</tt> field? Yes,
      but <i>repl</i> always sends a copy to you, by default --
      unless, that is, you use the <i>-nocc me</i> switch.

      <li>
      To send a reply to only the <tt>From:</tt> field, you could
      type:

      <pre>
      % <b>repl -nocc to -nocc cc -nocc me</b>
      </pre>

      That's getting pretty long. Using <i>-nocc all</i> or <i>-cc
      all</i> lets you exclude or include <tt>cc:</tt>'s to everyone
      listed in the original message. You could do the same thing as
      the command above with:

      <pre>
      % <b>repl -nocc all</b>
      </pre>

      <li>
      You can use the <i>-nocc</i> and <i>-cc</i> switches together.
      The order of the switches on the command line matters. The last
      switch on the command line takes precedence. So to send a reply
      to only the <tt>To:</tt> addresses (not <tt>cc:</tt> or
      <tt>me</tt>), the first command below would work -- but the
      second one would not work:

      <pre>
      % <b>repl -nocc all -cc to</b>
      % <b>repl -cc to -nocc all</b>
      </pre>

      The first one works (sends a copy to the <tt>To:</tt> addresses)
      because
      <tt>-cc to</tt> comes last on the command line and thus undoes
      part of the <tt>-nocc all</tt>.

      <li>
      You can also put your <i>-nocc</i> switches in your MH profile
      like this:

      <pre>
      repl: -nocc cc -nocc me
      </pre>

      Then, for example, you can use the <i>-cc</i> switch when you
      want to include one of the header fields (overriding
      the <i>-nocc</i> switches in your MH profile):

      <pre>
      % <b>repl -cc cc</b>
      </pre>

    </ol>

    <a name="index5"></a>

    <h2><a name="Cha">Changing the Message Header with
    replcomps</a></h2>

    <p>As you've seen, <i>comp</i> has a <i>components</i> file to
    control the header, and <i>repl</i> has its <i>replcomps</i> file.
    The <i>replcomps</i> file is different, though, because it not
    only controls which lines are included in the header of the reply
    but also controls what is filled into each field and how it's
    formatted. This is good to understand because the
    default <i>replcomps</i> ignores some of the addresses that you
    might want to reply to!

    <p>
    For more information, see the Section
    <a href="drafil.html#TherepFi">The replcomps File</a>.
    <a name="index6"></a>

    <h2><a name="ReaEdi">Reading Original Message with an
    Editor</a></h2>

    <p>When you reply to a message, you may want to include parts of
    the original message in your reply. That's especially true if
    someone besides the original readers gets a copy of your reply or
    if there's something controversial or important that should be
    seen exactly as written.

    <p>
    One way to do that is by editing your reply with a text editor
    like
    <i>vi</i> which can read other files.
    <i>repl</i> lets you read the original message file through a link
    named <i>@</i> (at sign). (On systems that use an at sign
    (<tt>@</tt>) as the line-delete character, type <tt>\@</tt>.) For
    example, with <i>vi</i>, just move to the bottom of the draft
    reply and type:

    <pre>
    <b>:read @</b>
    </pre>

    If it doesn't work, check to see whether you started <i>repl</i>
    from a read-only directory or if your current directory is on a
    different filesystem than the original message. In those cases,
    UNIX can't make a link to the original message.
    <a href="chanam.html#replpop">This Section</a> has an alias
    for <i>repl</i> that pops you back to the filesystem where the
    links can be made. Also, many versions of Emacs change their
    current directory to the directory where the draft is; if your
    editor does that, reading <i>@</i> will be a pain.

    <p>
    Depending on your editor, you may also be able to read the
    original message by using the <i>editalt</i> environment variable.
    In <i>vi</i>, for instance, type:

    <pre>
    <b>:read $editalt</b>
    </pre>

    <a name="index7"></a> If neither of those works, the <i>mhpath</i>
    command can find the pathname for you. For example, you can always
    read the original message by typing the command in backquotes
    (<tt>`</tt>). For example, in <i>vi</i>, enter:

    <pre>
    <b>:read `mhpath cur`</b>
    </pre>

    The Section <a href="comsub.html">Shell Command Substitution</a>
    covers backquoting. You'll also want to know
    about <a href="thecom-2.html">The mhpath Command</a>.

    <p>
    Another way to add the original message is with a program like
    <a href="sencom.html#Addapp"><i>append</i></a> -- you use it at
    the <tt>What now?</tt> prompt.

    <p>
    Finally, the Section
    <a href="#Inc">Including the Original Message with -filter</a> has
    what might be the best way of all.
    <a name="index8"></a>

    <h2><a name="Inc">Including the Original Message with
    -filter</a></h2>

    <p>Another way to include the original message in your reply is by
    using a
    <i>filter file</i> and the <i>repl -filter</i> command. A filter
    file uses <i>mhl</i> message-formatting instructions to control
    which lines of the original message are included in the reply and
    how they're formatted.

    <p>
    This isn't the place to explain <i>mhl</i> in depth. If you're
    interested, look at the Section <a href="hl.html">mhl</a>.
    Otherwise, here's some "cookbook" help.

    <p>
    For instance, to make a filter file that includes the original
    message in your reply, indented by eight characters, put the
    following two lines into a file named something
    like <i>replfilt</i> (the exact name doesn't matter) in your
    MH <i>Mail</i> directory:

    <pre>
    :
    body:nocomponent,compwidth=9,offset=9
    </pre>

    Be sure that there's no space between
    <tt>body:</tt> and <tt>nocomponent</tt>. Then, reply to the
    message this way (use the original message number and other
    switches, as well, if you need to):

    <pre>
    % <b>repl -filter replfilt</b>
    </pre>

    <a name="index9"></a> A lot of people like to include the original
    message with the right angle bracket (<tt>&gt;</tt>) and a space
    before every line of the original, like this:

    <a name="index10"></a>
    <pre>
    % <b>repl -filter replfilt</b>
    To: Al Bok &lt;al@phlabs.ph.com&gt;
    cc: aguru@mt.top.ph.com
    Subject: Re: Query about "repl -query"
    In-reply-to: Your message of "13 Nov 89 00:28:18 +0000."
    --------
    &gt; I have a question about repl -query.
    &gt; Why does it ask twice if I want a copy of my reply?

    <b>Al, that's because repl automatically sends a copy</b>
        ...
    </pre>

    To do that, make your <i>replfilt</i> file look like this:

    <pre>
    body:component="&gt; ",compwidth=0
    </pre>

    Note that the right angle bracket has a space (blank) after it
    (<tt>&gt; </tt>). The blank(s) are optional; depending on how you
    want the original message indented, you can use no, one, or
    several blanks. Also note that some earlier versions of MH would
    either put the right angle bracket (<tt>&gt;</tt>) only before
    the <i>first</i> line of the included reply or insert a &gt; in
    the middle of some lines of text. <!-- DON'T UPDATE REF TO 6.7 IN
    NEXT LINE TO 6.7.2, 6.7.3, ETC: --> If your version of MH does
    either of these, you'll need a newer version of MH, such as MH
    6.7.

    <p>
    You can make that the default by adding <i>-filter replfilt</i> to
    a
    <tt>repl:</tt> entry in your MH profile. There's a problem with
    adding that entry to your MH profile, though: after you do that,
    it will be hard to reply to a message without that
    <i>replfilt</i> formatting. (<i>repl</i> doesn't have
    a <i>-nofilter</i> switch.) The
    Section <a href="verrep.html">Versions of repl</a> shows some ways
    to make all of this easier. For instance, you can fix your own
    mail environment so that you can type
    <i>replx</i> to use your filter file or <i>repl</i> to reply
    without including the original message. To add text to the end of
    each reply, see the Section
    <a href="autmes.html">Automatic Signature on End of Messages</a>.
    <a name="index11"></a>

    <h2><a name="DisMes">Displaying the Original Message</a></h2>

    <p>At a <tt>What now?</tt> prompt, you can type <tt>display</tt>
    or just <tt>d</tt> to show the original message on your screen.
    (This is different than <tt>list</tt>, which shows the draft
    reply.)
    <a name="index12"></a>

    <h2><a name="AnnOrMes">Annotating the Original Message</a></h2>

    <p>If you use the <i>-annotate</i> switch -- on the <i>repl</i>
    command line or in your MH profile -- the message you reply to
    will have fields like these added to its header:

    <a name="index13"></a>
    <pre>
    Replied: Mon, 09 Jan 1995 18:28:46 -0500 Replied: Al Bok
    &lt;al@phlabs.ph.com&gt; Replied: aguru@mt.top.ph.com
    </pre>

    This lets you know that you've sent a reply -- a useful feature
    for busy or absent-minded people.

    <p>
    By default, <i>scan</i> looks for these <tt>Replied:</tt> fields
    in messages. It marks these messages with a dash (<tt>-</tt>) in
    the listing. For example, here are two messages; you've replied to
    the second one:

    <pre>
       5  01/09 Al Bok             The next project...&lt;&lt;...is going to be
      11 -01/10 Donna Lewis        About the next project...&lt;&lt;Al, I'm won
    </pre>

    <h2><a name="ReMewiMI">Replying to Messages with MIME</a></h2>

    <p>If you get a single-part message and you want to send a
    multipart MIME reply, this section shows an easy way: Add
    a <tt>#forw</tt> directive that includes the original message. If
    you want to edit the included message, edit the draft
    with <i>mhn</i> or <i>mhbuild</i>, then start a text editor to
    clean up the included part.

    <pre>
    % <b>repl 86</b>
    Reply to "Emma H. User" &lt;ehuser@x.y.com&gt;? <b>y</b>
    From: Jerry Peek &lt;jpeek@jpeek.com&gt;
    X-Mailer: MH 6.8.3
    To: "Emma H. User" &lt;ehuser@x.y.com&gt;
    Fcc: <b>inbox</b>
    Subject: Re: Reviewers needed for book chapters about MIME under MH 
    In-reply-to: Message from "Emma H. User" &lt;ehuser@x.y.com&gt; 
       of "Mon, 09 Jan 1995 12:22:47 -0800." &lt;1995Jan09.122251pst.7395@x.y.com&gt; 
    --------
    <b>#forw
    #&lt;text/enriched [my reply]
    Emma, it would be &lt;bold&gt;great&lt;/bold&gt; if you have time to</b>
    <i>...omitted...</i>
    <b>#text/x-sgml [X User Tools article] /u/jerry/mh-book/xpt_article/2021.sgm
    #image/x-xwd [overall view] /u/jerry/mh-book/xpt_article/exmh.allwin.xwd
    #image/x-xwd [folders] /u/jerry/mh-book/xpt_article/exmh.folders.xwd
    #text/plain [Xhibition article] /u/jerry/mh-book/exmh.Xhibition/article

    CTRL-D</b>
    --------
    What now? <b>e mhn</b>    (<i>...or, in nmh, <b>mime</b>...</i>)

    What now? <b>e vi</b>
        <i>...edit first part (original message excerpt)...</i>
    What now? <b>p</b>
    %
    </pre>

    <a name="index14"></a> MH 6.8.4 and nmh-0.09 added a
    new <i>repl</i> switch: <i>-mime</i>. It does what example above
    did: adds a <tt>#forw</tt> directive to include the message(s)
    you're replying to.

    <p>
    Unfortunately, using the <tt>#forw</tt> directive doesn't let you
    select one part of a multipart message. It also doesn't
    undo <i>quoted-printable</i> or <i>base64</i> encodings so that
    you can include (and edit) the original message text. One
    workaround is to use the <a href="e-mimeca.html"><i>mimecat</i>
    script</a> to pull in the original draft, unencoded. For instance,
    to read part 2 of the original (current) message into your draft,
    add an appropriate directive:

    <pre>
    #text/plain [your message] |mimecat -part 2
    </pre>

    If you want to edit the included text, use a <tt>#&lt;</tt>
    directive instead:

    <pre>
    #&lt;text/plain [your message]
    </pre>

    Then, as you're editing the draft, read in the original message
    part. For example, to read message 23 from the <i>mimecat</i>
    output with <i>vi</i>:

    <pre>
    <tt><b>:r !mimecat 23</b></tt>
    </pre>

    As I write this, I hadn't found a replacement for <i>repl</i> that
    automates the job. <!-- By the time you read the book, there
    \fImay\fP be something in the book's online archive file (Section
    href="obtpro.html" Obtaining Example Files From This Book ) -- for
    instance, a script named \fImrepl\fP that replaces \fIrepl\fP.
    (Sorry, no promises.) --> If you hear of something good, please
    send me email. I'll update the archive and the book.

    <?
      includeFooter('$Date: 2006-05-31 15:13:43 -0700 (Wed, 31 May 2006) $',
        'OReilly: 1991, 1992, 1995; Jerry: 1996, 1997, 1999, 2000, 2002, 2004');
    ?>
  </body>
</html>