$book = '..'?>include "$book/mh.php"; includeHeader('thecom.html', 'forfor-2.html'); ?>
The repl command is flexible -- there are a lot of great features that weren't covered in the introduction.
You don't have to reply to everyone who got the original message, and repl -query makes it easy to choose who gets your reply. The -nocc and -cc 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.
By default, when you reply to a message, repl will send a copy of your reply to everyone who got the original message -- that includes the author, you, and all addresses in the To: and cc: fields. If you don't want that to happen all the time, repl can ask you. Just start repl with its -query switch. You can type it on the command line, just for particular messages:
% repl -queryOr, if you like -query enough to use it most of the time, you can add it to your MH profile -- then, whenever you don't want -query, you can use -noquery on the command line:
% repl -noqueryNow, for a demonstration of -query. First, show part of the message. Then, start repl -query 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:
% show last (Message mh-users:8) Date: 13 Nov 89 00:28:18 GMT From: Al Bok <email@example.com> To: firstname.lastname@example.org cc: email@example.com, firstname.lastname@example.org Subject: Query about "repl -query" I have a question about repl -query... ... % repl -query Reply to Al Bok <email@example.com>? y Reply to firstname.lastname@example.org? n Reply to email@example.com? n Reply to firstname.lastname@example.org? y Reply to auser? n To: Al Bok <email@example.com> cc: firstname.lastname@example.org Subject: Re: Query about "repl -query" In-reply-to: Your message of "13 Nov 89 00:28:18 +0000." -------- Al, I think this is the answer. Guru, am I right? ...If you hadn't used -query, your reply would have been addressed to all the original recipients.
(Notice the last query Reply to auser?. This happened because repl will automatically send a copy to you (auser) at your local address if your replcomps file tells it to. Even though auser's complete address (email@example.com) was already in the header, repl couldn't tell the difference, so it asked again. There are ways around these problems besides -query. See the Sections Selective Replies with -nocc and -cc and Defining Alternate Mailboxes.)
If you press your interrupt key (like CTRL-C) while -query is asking for addresses, repl 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 replace the empty draft. If you use a draft folder, it will fill up with empty drafts; a cron job that runs find -size 0 -name '[1-9]*' in the draft folder can remove those empty files.
A quick note to programmers: -query works with the (formataddr) function escape in your repl components file (like replcomps). If the format string doesn't use (formataddr), then the -query switch won't work.
You can also tell repl 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:
% repl -nocc to -nocc ccwould have sent the reply only to Al Bok and you. You might ask: why you? (Let's assume you're auser.) Didn't you use -nocc cc to ignore the cc: field? Yes, but repl always sends a copy to you, by default -- unless, that is, you use the -nocc me switch.
% repl -nocc to -nocc cc -nocc meThat's getting pretty long. Using -nocc all or -cc all lets you exclude or include cc:'s to everyone listed in the original message. You could do the same thing as the command above with:
% repl -nocc all
% repl -nocc all -cc to % repl -cc to -nocc allThe first one works (sends a copy to the To: addresses) because -cc to comes last on the command line and thus undoes part of the -nocc all.
repl: -nocc cc -nocc meThen, for example, you can use the -cc switch when you want to include one of the header fields (overriding the -nocc switches in your MH profile):
% repl -cc cc
As you've seen, comp has a components file to control the header, and repl has its replcomps file. The replcomps 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 replcomps ignores some of the addresses that you might want to reply to!
For more information, see the Section The replcomps File.
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.
One way to do that is by editing your reply with a text editor like vi which can read other files. repl lets you read the original message file through a link named @ (at sign). (On systems that use an at sign (@) as the line-delete character, type \@.) For example, with vi, just move to the bottom of the draft reply and type:
:read @If it doesn't work, check to see whether you started repl 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. This Section has an alias for repl 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 @ will be a pain.
Depending on your editor, you may also be able to read the original message by using the editalt environment variable. In vi, for instance, type:
:read $editaltIf neither of those works, the mhpath command can find the pathname for you. For example, you can always read the original message by typing the command in backquotes (`). For example, in vi, enter:
:read `mhpath cur`The Section Shell Command Substitution covers backquoting. You'll also want to know about The mhpath Command.
Another way to add the original message is with a program like append -- you use it at the What now? prompt.
Finally, the Section Including the Original Message with -filter has what might be the best way of all.
Another way to include the original message in your reply is by using a filter file and the repl -filter command. A filter file uses mhl message-formatting instructions to control which lines of the original message are included in the reply and how they're formatted.
This isn't the place to explain mhl in depth. If you're interested, look at the Section mhl. Otherwise, here's some "cookbook" help.
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 replfilt (the exact name doesn't matter) in your MH Mail directory:
: body:nocomponent,compwidth=9,offset=9Be sure that there's no space between body: and nocomponent. Then, reply to the message this way (use the original message number and other switches, as well, if you need to):
% repl -filter replfiltA lot of people like to include the original message with the right angle bracket (>) and a space before every line of the original, like this:
% repl -filter replfilt To: Al Bok <firstname.lastname@example.org> cc: email@example.com Subject: Re: Query about "repl -query" In-reply-to: Your message of "13 Nov 89 00:28:18 +0000." -------- > I have a question about repl -query. > Why does it ask twice if I want a copy of my reply? Al, that's because repl automatically sends a copy ...To do that, make your replfilt file look like this:
body:component="> ",compwidth=0Note that the right angle bracket has a space (blank) after it (> ). 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 (>) only before the first line of the included reply or insert a > in the middle of some lines of text. If your version of MH does either of these, you'll need a newer version of MH, such as MH 6.7.
You can make that the default by adding -filter replfilt to a repl: 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 replfilt formatting. (repl doesn't have a -nofilter switch.) The Section Versions of repl shows some ways to make all of this easier. For instance, you can fix your own mail environment so that you can type replx to use your filter file or repl to reply without including the original message. To add text to the end of each reply, see the Section Automatic Signature on End of Messages.
At a What now? prompt, you can type display or just d to show the original message on your screen. (This is different than list, which shows the draft reply.)
If you use the -annotate switch -- on the repl command line or in your MH profile -- the message you reply to will have fields like these added to its header:
Replied: Mon, 09 Jan 1995 18:28:46 -0500 Replied: Al Bok <firstname.lastname@example.org> Replied: email@example.comThis lets you know that you've sent a reply -- a useful feature for busy or absent-minded people.
By default, scan looks for these Replied: fields in messages. It marks these messages with a dash (-) in the listing. For example, here are two messages; you've replied to the second one:
5 01/09 Al Bok The next project...<<...is going to be 11 -01/10 Donna Lewis About the next project...<<Al, I'm won
If you get a single-part message and you want to send a multipart MIME reply, this section shows an easy way: Add a #forw directive that includes the original message. If you want to edit the included message, edit the draft with mhn or mhbuild, then start a text editor to clean up the included part.
% repl 86 Reply to "Emma H. User" <firstname.lastname@example.org>? y From: Jerry Peek <email@example.com> X-Mailer: MH 6.8.3 To: "Emma H. User" <firstname.lastname@example.org> Fcc: inbox Subject: Re: Reviewers needed for book chapters about MIME under MH In-reply-to: Message from "Emma H. User" <email@example.com> of "Mon, 09 Jan 1995 12:22:47 -0800." <1995Jan09.firstname.lastname@example.org> -------- #forw #<text/enriched [my reply] Emma, it would be <bold>great</bold> if you have time to ...omitted... #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 -------- What now? e mhn (...or, in nmh, mime...) What now? e vi ...edit first part (original message excerpt)... What now? p %MH 6.8.4 and nmh-0.09 added a new repl switch: -mime. It does what example above did: adds a #forw directive to include the message(s) you're replying to.
Unfortunately, using the #forw directive doesn't let you select one part of a multipart message. It also doesn't undo quoted-printable or base64 encodings so that you can include (and edit) the original message text. One workaround is to use the mimecat script 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:
#text/plain [your message] |mimecat -part 2If you want to edit the included text, use a #< directive instead:
#<text/plain [your message]Then, as you're editing the draft, read in the original message part. For example, to read message 23 from the mimecat output with vi:
:r !mimecat 23As I write this, I hadn't found a replacement for repl that automates the job. 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'); ?>