table of contents
MH-PROFILE(5mh) | MH-PROFILE(5mh) |
NAME¶
mh-profile, mh_profile - user customization for nmh message handler
DESCRIPTION¶
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.
Standard Profile Entries¶
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: prompter
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
- 1)
- -user switch to inc, msgchk, post, send, or whom program
- 2)
- the login name on the local machine
The password for SMTP services is the first of:
- 1)
- password value from matching entry in file named “.netrc” in the user's home directory
- 2)
- password obtained by interactively prompting the user
With a “file:netrc” credentials entry, the username is the first of:
- 1)
- -user switch to program
- 2)
- login name from matching entry in netrc file
- 3)
- value provided by user in response to interactive query
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.8-RC2
Process Profile Entries¶
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
If the profile contains a post component and a postproc component is not present, a warning message that the post component will be ignored will be displayed by every nmh program that reads the profile and has its stderr associated with a terminal.
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
Profile Lookup¶
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.
ENVIRONMENT¶
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.
- LC_ALL, LC_CTYPE, and LANG
- These variables are used to set the locale, see locale(1). The “locale” profile entry supersedes these.
- MAILDROP
- This variable tells inc the default mail drop. This supersedes the “MailDrop” profile entry.
- MAILHOST
- This variable tells inc the POP host to query for mail to incorporate. See inc(1) for more information.
- MH
- With this environment variable, you can specify a profile other than .mh-profile to be read by the nmh programs that you invoke. If the value of MH is not absolute, (i.e., does not begin with a “/”), it will be presumed to start from the current working directory. This is one of the very few exceptions in nmh where non-absolute pathnames are not considered relative to the user's nmh directory.
- MHBUILD
- With this environment variable, you can specify an additional user profile (file) to be read by mhbuild, in addition to the mhn.defaults profile.
- MHCONTEXT
- With this environment variable, you can specify a context other than the normal context file (as specified in the nmh profile). As usual, unless the value of MHCONTEXT is absolute, it will be presumed to start from your nmh directory.
- MHLDEBUG
- If this variable is set to a non-null value, mhl will emit debugging information.
- MHMTSCONF
- If this variable is set to a non-null value, it specifies the name of the mail transport configuration file to use by inc, post, and other programs that interact with the mail transport system, instead of the default. See mh-tailor(5).
- MHMTSUSERCONF
- If this variable is set to a non-null value, it specifies the name of a mail transport configuration file to be read in addition to the default. See mh-tailor(5).
- MHN
- With this environment variable, you can specify an additional user profile (file) to be read by mhn, in addition to the mhn.defaults profile. mhn is deprecated, so support for this variable will be removed from a future nmh release.
- MHSHOW
- With this environment variable, you can specify an additional user profile (file) to be read by mhshow, in addition to the mhn.defaults profile.
- MHSTORE
- With this environment variable, you can specify an additional user profile (file) to be read by mhstore, in addition to the mhn.defaults profile.
- MHTMPDIR, TMPDIR
- These variables are searched, in order, for the directory in which to create some temporary files. MHTMPDIR is deprecated and will be removed in a future release of nmh.
- MHWDEBUG
- If this variable is set to a non-null value, nmh commands that use the Alternate-Mailboxes profile entry will display debugging information about the values in that entry.
- PAGER
- If set to a non-null value, this supersedes the value of the default built-in pager command.
- SIGNATURE
- This variable tells send and post your mail signature. This supersedes the “Signature” profile entry, and is not used when the “Local-Mailbox” profile component is set.
- USER
- This variable tells repl your user name and inc your default mail drop: see the “MailDrop” profile entry.
- USERNAME_EXTENSION
- This variable is for use with username_extension masquerading. See mh-tailor(5).
- editalt
- This is the alternate message. This is set by dist and repl during edit sessions so you can peruse the message being distributed or replied to. The message is also available, when the -atfile switch is used, through a link called “@” in the current directory if your current working directory and the folder the message lives in are on the same Unix filesystem, and if your current working directory is writable.
- mhaltmsg
- dist and repl set mhaltmsg to tell the whatnowproc about an alternate message associated with the draft (the message being distributed or replied to).
- mhannotate
- This is set by dist, forw, and repl if annotations are to occur.
- mhdist
- dist sets mhdist to tell the whatnowproc that message re-distribution is occurring.
- mhdraft
- This is the path to the working draft. It is set by comp, dist, forw, and repl to tell the whatnowproc which file to ask “What now?” questions about.
- mheditor
- This is set by comp, repl, forw, and dist to tell the whatnowproc the user's choice of editor (unless overridden by -noedit).
- mhfolder
- This is the folder containing the alternate message. It is set by dist and repl during edit sessions so you can peruse other messages in the current folder besides the one being distributed or replied to. The environment variable mhfolder is also set by next, prev, and show for use by mhl.
- mhinplace
- This is set by dist, forw, and repl if annotations are to occur.
- mhmessages
- This is set by dist, forw, and repl if annotations are to occur.
- mhuse
- This may be set by comp.
FILES¶
- $HOME/.mh-profile
- The user's profile.
- <mh-dir>/context
- The user's context
- <folder>/.mh-sequences
- Public sequences for <folder>.
SEE ALSO¶
mhbuild(1), mhshow(1), mhstore(1), mh-sequence(5), nmh(7), post(8)
BUGS¶
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.8-RC2 |