nmh is the name of a powerful message handling system. Rather than
being a single comprehensive program,
nmh consists of a collection
of fairly simple single-purpose programs to send, retrieve, save,
and manipulate messages.
Unlike most mail clients in UNIX,
nmh is not a closed system which
must be explicitly run, then exited when you wish to return to the shell.
You may freely intersperse
nmh commands with other shell commands,
allowing you to read and answer your mail while you have (for example)
a compilation running, or search for a file or run programs as needed
to find the answer to someones question before answering their mail.
The rest of this manual entry is a quick tutorial which will teach you
the basics of
nmh. You should read the manual entries for the
individual programs for complete documentation.
To get started using
nmh, put the directory
$PATH. Run the
install-mh command. If youve never used
nmh before, it will create the necessary default files and directories after
asking you if you wish it to do so.
inc moves mail from your system maildrop into your
folder, breaking it up into separate files and converting it
nmh format as it goes. It prints one line for each message it
processes, containing the from field, the subject field and as much of
the first line of the message as will fit. It leaves the first message
it processes as your current message. Youll need to run
time you wish to incorporate new mail into your
scan prints a list of the messages in your current folder.
prev are used to read
specific messages from the current folder.
show displays the
current message, or a specific message, which may be specified by its
number, which you pass as an argument to
prev display, respectively, the message numerically after or before
the current message. In all cases, the message displayed becomes the
current message. If there is no current message,
show may be
called with an argument, or
next may be used to advance to the
rmm (remove message) deletes the current message. It may be called
with message numbers passed as arguments, to delete specific messages.
repl is used to respond to the current message (by default).
It places you in the editor with a prototype response form. While youre
in the editor, you may peruse the item youre responding to by reading
@. After completing your response, type
list (review) it, or
comp allows you to compose a message by putting you in the editor
on a prototype message form, and then lets you send it via the
whatnow also supports easy-to-use management of MIME attachments via
attach and related responses, as described in its man page.
nmh command arguments are usually called
switches. Some switches have a corresponding -no switch, which
negates all previous occurrences of that switch on the command line.
This allows a user to conveniently override, on the command line, a
switch in their profile. Switches may be abbreviated as long as there
is no ambiguity with another switch of the same command. To avoid
ambiguity with any switches that may be added in the future, it is
recommended that full switch names be used in durable code such as
shell scripts, functions, and aliases.
nmh commands may be run with the single switch
-help, which causes them to print a list of the switches they may be invoked
with and then exit.
nmh commands may be run with the single switch
-version, which causes them to print the version number of the
nmh distribution, and then exit.
Commands which take a message number as an argument
repl, ...) also take one of the words first,
prev, cur, next, or last to indicate
(respectively) the first, previous, current, next, or last message in
the current folder (assuming they are defined).
As a shorthand, . is equivalent to cur.
Commands which take a range of message numbers
show, ...) also take any of the abbreviations:
Commands that take a folder name
scan, ...) accept the folder name in two formats: +folder or
@folder. In both cases, folder can be a
/-separated path, e.g. foo/bar. +folder
specifies a directory path to a folder. If folder starts
with / then its an absolute path from the root directory.
If it is . or .., or starts with ./ or
../, then its relative to the current working directory.
Otherwise its relative to mh-profile(5)s
Path, i.e. as given by
mhpath +. @folder is a shorthand for +curfolder/folder; its
a relative path from the current folder. curfolder is given
mhpath. For example, assuming a
Path profile component of Mail,
Indicates all messages in the range <num1> to <num2>, inclusive.
The range must be nonempty.
Indicates all messages, i.e.,
N messages beginning with (or ending with) message
Num may be any of the pre-defined symbols
The first, previous, next or last
messages, if they exist.
There are many other possibilities such as creating multiple folders
for different topics, and automatically refiling messages according to
subject, source, destination, or content. These are beyond the scope
of this manual entry.
scan +inbox ||
scan +work/todo |
scan @todo ||
scans $HOME/Mail/work/todo, if current folder is +work
refile @../done |
refiles to $HOME/Mail/work/done, if the current folder is +work/todo
scan +/tmp ||
scan +. ||
scans the current directory
refile @. ||
refiles current message to end of current folder.