DIST(1)
π DIST(1) β okay bestie, it's giving "manual, General Commands Manual" energy β¨
So real talk: this page lives in the General Commands Manual as DIST(1), and it's all about the dist command. Buckle up, we're redistributing mail and we're gonna look cute doing it. π
β¨ NAME β¨
dist β distribute an nmh message to additional addresses π¦
πΈ SYNOPSIS πΈ
dist [-help] [-version] [+folder] [msg] [-form formfile] [-annotate |
-noannotate] [-inplace | -noinplace] [-draftfolder +folder]
[-draftmessage msg] [-nodraftfolder] [-editor editor] [-noedit]
[-width columns] [-from address] [-to address] [-cc address] [-fcc
+folder] [-whatnowproc program] [-nowhatnowproc] [-atfile]
[-noatfile]
π DESCRIPTION π
Okay so dist is basically forw's cousin β very similar vibe, different purpose. What it does is take the message you specified and get it ready to be redistributed to addresses that (presumably) are not already on the original address list. Like, you're sending it out to a whole new crew. π
The default message form has these elements, and yes this is the whole thing:
Resent-From: {from switch} or <Local-Mailbox> or <username@hostname>
Resent-To: {to switch} or blank
Resent-cc: {cc switch} or blank
Resent-fcc: {fcc switch} or blank
But here's the tea: if there's a file named distcomps chillin' in your nmh directory, that gets used instead of the default form. And if you wanna pick your own alternate forms file, just hit it with the -form formfile switch. Forms get processed through the nmh template system β peep mh-format(5) for the full details. Components from the redistributed message are available as standard component escapes in the forms file. π§
And on top of the standard mh-format(5) escapes, these component escapes are also supported:
fccβ returns a string β any folders specified with-fcc foldernmh-fromβ returns a string β addresses specified with-from addressnmh-toβ returns a string β addresses specified with-to addressnmh-ccβ returns a string β addresses specified with-cc address
Wanna know what -from, -to, -cc, and -fcc actually do? Run, don't walk, to forw(1), it's all described there. π
Draft already exists? Then dist is gonna ask you what to do with it, main character style. Your options:
quitβ abortsdist, leaves the draft intact. πͺreplaceβ swaps the existing draft out for a blank skeleton. πlistβ just shows you the draft. π
Now, important: only the addresses in Resent-To:, Resent-cc:, and Resent-Bcc: get sent. Also, a Resent-Fcc: folder will be honored (check send(1) for that). And heads up β with dist, the draft should contain only Resent-xxx: fields and no body. The headers and the body of the original message get copied to the draft when the message is sent. So please, use care when you're constructing the headers for the redistribution. Be intentional, bestie. π
Because the draft is so minimal, the prompter(1) editor is super useful with dist. It's giving perfect match. π«Ά
π The -annotate switch π
If you give -annotate, the message being distributed gets annotated with these lines:
Resent: date
Resent: addrs
where each address list contains as many lines as required. This annotation happens only if the message is sent directly from dist. If the message isn't sent immediately from dist, you can use comp -use to re-edit and send the constructed message β but the annotations won't take place. π
Normally, annotations are done in place, so any links to the message get preserved. Wanna change that? Use the -noinplace switch.
π Editors, @ files, and env vars π
Check comp(1) for a description of the -editor and -noedit switches. And note this: while you're in the editor, with -atfile and if the current directory is writable, the message being resent is available through a link named @ (assuming the default whatnowproc). Iconic. Also:
- the actual pathname of the message is stored in the environment variable
$editalt - the pathname of the folder containing the message is stored in the environment variable
$mhfolder
The creation of that @ file is controlled via the -atfile and -noatfile options. β¨
π Draft folder facility π
The -draftfolder +folder and -draftmessage msg switches invoke the nmh draft folder facility. This is an advanced (and highly useful) feature, no cap. Go consult mh-draft(5) for more info, it's worth the read.
π What happens after the editor π
Upon exiting from the editor, dist will invoke the whatnow program. See whatnow(1) for a discussion of the available options. You can inhibit the invocation of this program by using the -nowhatnowproc switch.
(In fact, it is thewhatnowprogram which starts the initial edit. Hence,-nowhatnowprocwill prevent any edit from occurring.) So yeah β that switch is a big deal, don't sleep on it. π³
π¦ FILES π¦
/etc/nmh/distcompsβ the default message skeleton<mh-dir>/distcompsβ the user's message skeleton$HOME/.mh_profileβ the user's profile<mh-dir>/draftβ the draft file
πΈ PROFILE COMPONENTS πΈ
Path:β to determine the user's nmh directoryCurrent-Folder:β to find the default current folderDraft-Folder:β to specify the default draftfolderEditor:β to override the default editorfileproc:β program to refile the messagewhatnowproc:β program to ask the "What now?" questions
π SEE ALSO π
comp(1), forw(1), mh-draft(5), prompter(1), repl(1), send(1), whatnow(1)
β¨ DEFAULTS β¨
+folderβ the current foldermsgβ the current message-noannotate-nodraftfolder-inplace-noatfile
π CONTEXT π
If a folder is given, it will become the current folder. And the message distributed will become the current message. Simple as that. π«
π HISTORY π
Okay so storytime: dist originally used headers of the form Distribute-xxx: instead of Resent-xxx:. But in order to conform with the ARPA Internet standard, RFC 822, the Resent-xxx: form is now used. And the glow-up didn't stop there β dist will recognize Distribute-xxx: type headers and automatically convert them to Resent-xxx:. Adaptive queen. π
π BUGS π
distdoes not rigorously check the message being distributed for adherence to the transport standard β butpost, called bysend, does. Thepostprogram will balk (and rightly so) at poorly formatted messages, anddistwon't correct things for you. So like... fix your own mess, bestie. π- If
whatnowprociswhatnow, thencompuses a built-in whatnow β it does not actually run thewhatnowprogram. Hence, if you define your ownwhatnowproc, don't call itwhatnow, sincecompwon't run it. Trap avoided. πͺ€
And that's the whole page, bestie! This little masterpiece is from nmh-1.8, dated 2022-12-22. Go forth and redistribute responsibly. π β¨
π¦ 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