MH-PROFILE(5mh) | MH-PROFILE(5mh) |
mh-profile - user customization for nmh message handler
Each user of nmh is expected to have a file named .mh-profile in their home directory. This file contains a set of user parameters used by the nmh family of programs. Each entry in the file is of the format
If the text of a profile entry is long, you may extend it across several real lines by indenting the continuation lines with leading spaces or tabs. Comments may be introduced by a line starting with `#:':
Blank lines are not permitted in .mh-profile. Shell quoting conventions are not available; each token is separated by whitespace.
The possible profile components are exemplified below. The only mandatory entry is `Path:'. The others are optional; some have default values if they are not present. In the notation used below, (profile, default) indicates whether the information is kept in the user's nmh profile or nmh context, and indicates what the default value is. Note that a profile component can only appear once. Multiple appearances will trigger a warning that all appearances after the first are ignored.
Some MH programs, including mhbuild, mhshow, and mhstore, have specific profile components that are described in their respective man pages. Each component name specific to these programs begins with the name of the program and is followed by a dash.
Path: Mail
locale: locale
context: context
Current-Folder: inbox
Inbox: inbox
Previous-Sequence: pseq
Sequence-Negation: not
Unseen-Sequence: unseen
mh-sequences: .mh-sequences
atr-seq-folder: 172 178-181 212
Editor: vi
Msg-Protect: 600
Folder-Protect: 700
datalocking: fcntl
fcntl dot flock lockf
Available locking algorithms can vary depending on the operating system. Note: currently, transactional locking is only supported on public sequences; see mh-sequence(5) for more information. (profile, default: fcntl)
program: default switches
(profile, no defaults)
lasteditor-next: nexteditor
Folder-Stack: folders
Local-Mailbox: Your Username <user@some.host>
Alternate-Mailboxes: mh@uci-750a, bug-mh*
Aliasfile: aliases other-aliases
Draft-Folder: drafts
digest-issue-list: 1
digest-volume-list: 1
MailDrop: .mail
Signature: RAND MH System (agent: Marshall Rose)
credentials: legacy
The password for SMTP services is the first of:
The password for POP service when the -sasl switch is used with one of these programs is the login name on the local machine.
With a “file:netrc” credentials entry, the username is the first of:
Similarly, the password is provided either in the netrc file or interactively. netrc can be any valid filename, either absolute or relative to Path or $HOME. The netrc file contains authentication information, for each server, using a line of the following form. (Replace myserver, mylogin, and mypassword with your own account information.)
This netrc file must be owned and readable only by you.
The “file-nopermcheck:netrc” credentials entry is identical in behavior to the “file” entry, with the exception that the permission checks done by “file” are not performed. This entry should be used with caution and only when absolutely necessary. (profile, default: legacy)
Welcome: disable
If the MHCONTEXT environment variable is set and non-empty (and the Welcome component is not “disable”), the welcome message is only displayed if the context file contains a version reference, and that reference is older than the installed nmh version. The version reference is of the form:
Version: nmh-1.7.1
The following profile elements are used whenever an nmh program invokes some other program, such as more. The .mh-profile can be used to select alternate programs if the user wishes. The default values are given in the examples.
If the profile element contains spaces, the element is split at spaces into tokens and each token is given as a separate argument to the execvp(2) system call. If the element contains shell metacharacters then the entire element is executed using /bin/sh.
buildmimeproc: /usr/bin/mh/mhbuild
fileproc: /usr/bin/mh/refile
formatproc:
incproc: /usr/bin/mh/inc
lproc: more
mailproc: /usr/bin/mh/mhmail
mhlproc: /usr/lib/mh/mhl
moreproc: more
packproc: /usr/bin/mh/packf
postproc: /usr/lib/mh/post
rmmproc: none
sendproc: /usr/bin/mh/send
showmimeproc: /usr/bin/mh/mhshow
showproc: /usr/lib/mh/mhl
whatnowproc: /usr/bin/mh/whatnow
whomproc: /usr/bin/mh/whom
After consulting .mh_profile, some programs read an optional profile specified by a program-specific environment variable, and then the system-wide profile /etc/nmh/mhn.defaults. These programs are mhbuild, mhshow, mhstore, and mhn. mhfixmsg is similar, but has no optional profile.
The first occurrence of a component is used, e.g. .mh_profile's trumps $MHSHOW's. A component with no value still stops further occurrences being used, but is considered absent.
The .mh-profile contains only static information, which nmh programs will not update. Changes in context are made to the context file kept in the users nmh directory. This includes, but is not limited to: the “Current-Folder” entry and all private sequence information. Public sequence information is kept in each folder in the file determined by the “mh-sequences” profile entry (default is .mh-sequences).
The .mh-profile may override the path of the context file, by specifying a “context” entry (this must be in lower-case). If the entry is not absolute (does not start with a “/”), then it is interpreted relative to the user's nmh directory. As a result, you can actually have more than one set of private sequences by using different context files.
The operation of nmh and its commands it also controlled by the presence of certain environment variables.
Many of these environment variables are used internally by the “What now?” interface. It's amazing all the information that has to get passed via environment variables to make the “What now?” interface look squeaky clean to the nmh user, isn't it? The reason for all this is that the nmh user can select any program as the whatnowproc, including one of the standard shells. As a result, it's not possible to pass information via an argument list. The convention is that environment variables whose names are all upper-case are user-settable; those whose names are lower-case only are used internally by nmh and should not generally be set by the user.
There is some question as to what kind of arguments should be placed in the profile as options. In order to provide a clear answer, recall the command line semantics of all nmh programs: conflicting switches (e.g. -header and -noheader) may occur more than one time on the command line, with the last switch taking effect. Other arguments, such as message sequences, filenames and folders, are always remembered on the invocation line and are not superseded by following arguments of the same type. Hence, it is safe to place only switches (and their arguments) in the profile.
If one finds that an nmh program is being invoked again and again with the same arguments, and those arguments aren't switches, then there are a few possible solutions to this problem. The first is to create a (soft) link in your $HOME/bin directory to the nmh program of your choice. By giving this link a different name, you can create a new entry in your profile and use an alternate set of defaults for the nmh command. Similarly, you could create a small shell script which called the nmh program of your choice with an alternate set of invocation line switches (using links and an alternate profile entry is preferable to this solution).
Finally, the csh user could create an alias for the command of the form:
In this way, the user can avoid lengthy type-in to the shell, and still give nmh commands safely. (Recall that some nmh commands invoke others, and that in all cases, the profile is read, meaning that aliases are disregarded beyond an initial command invocation)
2016-10-19 | nmh-1.7.1 |