REPL(1)
π REPL(1) π
General Commands Manual Β· repl(1)
okay bestie, we're doing this π
this is the manual page for repl, the nmh tool that sets up your replies for you, and it is so much more than it looks. we're reading every single line together, no skipping, no skimming, periodt. β¨
πΈ NAME πΈ
repl β reply to an nmh message π«Ά
β¨ SYNOPSIS β¨
repl [-help] [-version] [+folder] [msg] [-annotate | -noannotate]
[-group | -nogroup] [-cc all/to/cc/me] [-nocc all/to/cc/me] [-query
| -noquery] [-form formfile] [-format | -noformat] [-filter
filterfile] [-inplace | -noinplace] [-mime | -nomime] [-fcc
+folder] [-width columns] [-draftfolder +folder] [-draftmessage
msg] [-nodraftfolder] [-editor editor] [-noedit] [-convertargs type
argstring] [-whatnowproc program] [-nowhatnowproc] [-atfile]
[-noatfile] [-fmtproc program] [-nofmtproc] [-build] [-file
msgfile]
that's the entire flag lineup, fr fr. every one of these gets explained below, don't even worry.
π DESCRIPTION π
repl may be used to reply to a message. That's the whole job. π
In its simplest form (with no arguments), repl will set up a message-form skeleton in reply to the current message in the current folder, and invoke the whatnow shell. So you just... type repl and it hands you a draft. iconic behaviour honestly.
repl uses a reply template to construct the draft of the reply. And a reply template is simply an mhl format file β see mh-format(5) for the deets, iykyk.
π the default single-reply era: -nogroup and "replcomps" π
If the switch -nogroup is given (it is on by default, so this is the normal mode, bestie), then repl will use the standard forms file "replcomps". This will construct a draft message that is intended to be sent only to the author of the message to which you are replying. And if a file named "replcomps" exists in the user's nmh directory, it will be used instead of this default forms file. your house, your rules. π
The default reply template "replcomps" will direct repl to construct the reply message draft as follows:
To: <Mail-Reply-To> or <Reply-To> or <From>
cc: <To> and <cc> and <personal address>
Fcc: {fcc switch} or +outbox
Subject: Re: <Subject>
In-Reply-To: <Message-Id>
References: <Message-Id>
Comments: In-Reply-To <From> or <apparently from> or <Sender>
message dated <date>
--------
where field names enclosed in angle brackets (< >) indicate the contents of the named field from the message to which the reply is being made. cute little placeholders, love that for us. π
By default, the "cc:" field is empty. You may selectively add addresses to this default with the -cc type switch. This switch takes an argument (all/to/cc/me) which specifies who gets added to the default "cc:" list of the reply. You may give this switch multiple times (with different arguments) if you wish to add multiple types of address. stack 'em, babe. β¨
π¦ the group chat era: -group and "replgroupcomps" π¦
If the switch -group is given, then repl will use the standard forms file "replgroupcomps". This will construct a draft message that is intended as a group or followup reply. If a file named "replgroupcomps" exists in the user's nmh directory, it will be used instead of this default forms file, unless you specify another forms file on the command line or in your profile.
The default group reply template "replgroupcomps" will direct repl to construct the reply message draft as follows:
To: <Mail-Followup-To>
Subject: Re: <Subject>
In-Reply-To: Message from <From> of <Date>.
<Message-Id>
--------
or if the field <Mail-Followup-To> is not available:
To: <Mail-Reply-To> or <Reply-To> or <From>
cc: <To> and <cc> and <personal address>
Subject: Re: <Subject>
In-Reply-To: Message from <From> of <Date>.
<Message-Id>
--------
By default, the "cc:" contains all the addresses shown. You may selectively remove addresses from this default with the -nocc type switch. This switch takes an argument (all/to/cc/me) which specifies who gets removed from the default "cc:" list of the reply. You may give this switch multiple times (with different arguments) if you wish to remove multiple types of address. bye bestie, you're off the cc. π
In any case, you may specify an alternative forms file with the switch -form formfile.
The -query switch modifies the action of the -nocc type switch by interactively asking you if each address that normally would be placed in the "To:" and "cc:" list should actually be sent a copy. This is useful for special-purpose replies. Note that the position of the -cc and -nocc switches, like all other switches which take a positive and negative form, is important.
π¨ okay so this one matters: switch ORDER changes what happens. do not shuffle your flags around and then act surprised, babe.
Lines beginning with the fields "To:", "cc:", and "Bcc:" will be standardized and have duplicate addresses removed. In addition, the -width columns switch will guide repl's formatting of these fields.
If the draft already exists, repl will ask you as to the disposition of the draft. A reply of quit will abort repl, leaving the draft intact; replace will replace the existing draft with a blank skeleton; and list will display the draft. three options, no notes. π
π§ editing, the "@" link, and the env vars π§
See comp(1) for a description of the -editor and -noedit switches. Note that while in the editor, with -atfile and if the current directory is writable, the message being replied to is available through a link named "@" (assuming the default whatnowproc). In addition, the actual pathname of the message is stored in the environment variable $editalt, and the pathname of the folder containing the message is stored in the environment variable $mhfolder. The creation of the "@" file is controlled via the -atfile and -noatfile options.
So: one little "@" file, two environment variables, and you always know where your original message lives. so organized. β¨
π
-convertargs π
The -convertargs switch directs repl to pass the arguments for type to mhbuild. Both arguments are required; type must be non-empty while argstring can be empty, e.g., '' in a shell command line. The -convertargs switch can be used multiple times. See the Convert Interface section of mhbuild(1) for a description of the convert mechanism, and /usr/share/doc/nmh/contrib/replaliases for examples of its use.
π the body of the reply: filters, -format, -noformat, -filter π
Although repl uses a forms file to direct it how to construct the beginning of the draft, it uses a message filter file to direct it as to how the message to which you are replying should be filtered (re-formatted) in the body of the draft. The filter file for repl should be a standard form file for mhl, as repl will invoke mhl to format the message to which you are replying.
The switches -noformat, -format, and -filter filterfile specify which message filter file to use.
If the switch -noformat is given (it is the default) and the -filter switch is not used, then the message to which you are replying is not included in the body of the draft. blank canvas energy.
If the switch -format is given, then a default message filter file is used. This default message filter should be adequate for most users. This default filter "mhl.reply" is:
; mhl.reply
;
; default message filter for `repl' (repl -format)
;
from:nocomponent,formatfield="%(unquote(decode(friendly{text}))) writes:"
body:component="> ",overflowtext="> ",overflowoffset=0
which outputs each line of the body of the message prefaced with the ">" character and a space.
If a file named "mhl.reply" exists in the user's nmh directory, it will be used instead of this form. You may specify an alternate message filter file with the switch -filter filterfile.
Other reply filters are commonly used, such as:
:
body:nocomponent,compwidth=9,offset=9
which says to output a blank line, and then the body of the message being replied to, indented by one tab stop. Another popular format is:
message-id:nocomponent,nonewline,\
formatfield=βIn message %{text}, β
from:nocomponent,formatfield=β%(decode(friendly{text})) writes:β
body:component=β>β,overflowtext=β>β,overflowoffset=0
This message filter file cites the Message-ID and author of the message being replied to, and then outputs each line of the body prefaced with the ">" character.
You can also use an external format program to format the message body. The format program is specified by the formatproc profile entry, and is enabled by the "format" flag. A message filter using an external format program would look like this:
body:component=β>β,nowrap,format
See the mhl(1) documentation for more information. The format program can be changed by the -fmtproc program and -nofmtproc switches.
π MIME, annotation, -fcc, and the extra escape π
To use the MIME rules for encapsulation, specify the -mime switch. This directs repl to generate an mhbuild composition file. Note that nmh will not invoke mhbuild automatically; you must specifically give the command
What now? mime
prior to sending the draft.
π do not forget that What now? mime step. nmh is not going to do it for you, bestie. it is a whole separate command and it must happen before you send.
If the -annotate switch is given, the message being replied to will be annotated with the lines
Replied: date Replied: addrs
where the address list contains one line for each addressee. The annotation will be done only if the message is sent directly from repl. If the message is not sent immediately from repl, comp -use may be used to re-edit and send the constructed message, but the annotations won't take place. Normally annotations are done inplace in order to preserve any links to the message. You may use the -noinplace switch to change this.
Although the default template specifies that a copy of the reply will be put in the folder outbox, if the -fcc +folder switch is given it will override the default value. More than one folder, each preceded by -fcc, can be named.
In addition to the standard mh-format(5) escapes, repl also recognizes the following additional component escape:
fccβ returns astringβ any folders specified with-fcc folder'
To avoid reiteration, repl strips any leading Re: strings from the subject component. (nobody wants Re: Re: Re: Re: in their life. π«Ά)
The -draftfolder +folder and -draftmessage msg switches invoke the nmh draft folder facility. This is an advanced (and highly useful) feature. Consult mh-draft(5) for more information.
π whatnow, -build, and -file π
Upon exiting from the editor, repl will invoke the whatnow program. See whatnow(1) for a discussion of available options. The invocation of this program can be inhibited by using the -nowhatnowproc switch. (In fact, it is the whatnow program which starts the initial edit. Hence, -nowhatnowproc will prevent any edit from occurring.) β
The -build switch is intended to be used by the Emacs mh-e interface to nmh. It implies -nowhatnowproc. It causes a file <mh-dir>/reply to be created, containing the draft message that would normally be presented to the user for editing. No mail is actually sent. π«₯
The -file msgfile switch specifies the message to be replied to as an exact filename rather than as an nmh folder and message number. The same caveats apply to this option as to the -build switch.
π FILES π
okay so repl is a little scavenger bestie π¦ β it goes hunting for all its format, filter and template files in a whole bunch of places:
- absolute pathnames get accessed directly, no questions asked
- tilde expansion happens on usernames
- then it searches the user's Mail directory, as specified in their profile
and if it's still not finding anything there? it checks /etc/nmh. like, the last-resort friend that always has snacks π
here's the full guest list:
/etc/nmh/replcompsβ the standard reply template β¨- or
<mh-dir>/replcompsβ rather than the standard template /etc/nmh/replgroupcompsβ the standardreply -grouptemplate- or
<mh-dir>/replgroupcompsβ rather than the standard template /etc/nmh/mhl.replyβ the standard message filter- or
<mh-dir>/mhl.replyβ rather than the standard filter $HOME/.mh_profileβ the user profile<mh-dir>/draftβ the draft file π
π PROFILE COMPONENTS π
these are the profile entries that get a say in how repl does its thing:
Path:β to determine the user's nmh directoryAlternate-Mailboxes:β to determine the user's mailboxesCurrent-Folder:β to find the default current folderDraft-Folder:β to specify the default draftfolderEditor:β to override the default editorMsg-Protect:β to set mode when creating a new message (draft)fileproc:β program to refile the messagemhlproc:β program to filter message being replied-towhatnowproc:β program to ask the βWhat now?β questions π¬
π SEE ALSO π
go read these, bestie, they're all part of the lore π«Ά
comp(1)forw(1)mh-draft(5)mh-format(5)mhbuild(1)send(1)whatnow(1)/usr/share/doc/nmh/contrib/replaliases
β DEFAULTS β
no cap, here's what repl assumes if you just⦠don't say anything:
+folderdefaults to the current foldermsgdefaults to cur-nogroup-nocc allwith-nogroup,-cc allwith-group-noannotate-nodraftfolder-noformat-inplace-nomime-noquery-noatfile-width 72
πΈ CONTEXT πΈ
if you hand it a folder, that folder becomes the current folder β it's giving main character energy and it's not sorry. and the message you replied to? yeah, that becomes the current message. periodt π
π BUGS π
listen, we love it, but it's not perfect:
if any addresses occur in the reply template, addresses in the template that do not contain hosts are defaulted incorrectly. instead of using the localhost for the default, repl uses the sender's host. moral of the story: if you're going to include addresses in a reply template, include the host portion of the address. fr fr, don't skip it π
the -width columns switch is only used to do address-folding; other headers are not line-wrapped. so don't come for it about wrapping, it said what it said π
if whatnowproc is whatnow, then repl uses a built-in whatnow β it does not actually run the whatnow program. hence, if you define your own whatnowproc, don't call it whatnow since repl won't run it. the way that is so sneaky of it π
okay that's the whole page bestie, you're officially a repl girlie now π
this lil masterpiece is from the nmh-1.8 era, dated 2022-12-22 β iconic behavior honestly, mwah πβ¨
π¦ where this page comes from
- alpine 3.24: nmh-doc 1.8-r3 Β· BSD-3-Clause
- epel 10: nmh 1.8-3.el10_1 Β· BSD
- epel 9: nmh 1.8-1.el9 Β· BSD
- fedora 43: nmh 1.8-9.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: nmh 1.8-10.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms