MH-PROFILE(5mh) | MH-PROFILE(5mh) |
NAME¶
mh-profile - user profile customization for nmh message handlerDESCRIPTION¶
Each user of nmh is expected to have a file named .mh_profile in his or her home directory. This file contains a set of user parameters used by some or all of the nmh family of programs. Each entry in the file is of the formatIf the text of 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. The shell quoting conventions are not available in the .mh_profile; 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 with trigger a warning that all appearances after the first are ignored.Path: Mail
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 what is supported by 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-alias
Draft-Folder: drafts
digest-issue-list: 1
digest-volume-list: 1
MailDrop: .mail
Signature: RAND MH System (agent: Marshall Rose)
credentials: legacy
2) the login name on the local machine
The password for SMTP services is the first of:
2) password obtained by interactively prompting the user
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:
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 the words myserver, mylogin, and mypassword with your own account information:
This netrc file must be owned and readable only by you. (profile, default: legacy)
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
mshproc: /usr/bin/mh/msh
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
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.
Environment Variables¶
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.
$MH
$MHCONTEXT
$MHBUILD
$MHN
$MHSHOW
$MHSTORE
$MAILDROP
$MAILHOST
$USERNAME_EXTENSION
$SIGNATURE
$USER
$HOME
$TERM
The environment variable $TERMCAP is also consulted. In particular, these tell scan and mhl how to clear your terminal, and how many columns wide your terminal is. They also tell mhl how many lines long your terminal screen is.
$MHMTSCONF
$MHMTSUSERCONF
$MHTMPDIR $TMPDIR
$MHLDEBUG
$MHPDEBUG
$MHWDEBUG
$PAGER
$editalt
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.
$mhdraft
This is set by comp, dist, forw, and repl to tell the whatnowproc which file to ask “What now?” questions about.
$mhaltmsg
$mhfolder
This 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 show, prev, and next for use by mhl.
$mhdist
$mheditor
$mhuse
$mhmessages
$mhannotate
$mhinplace
FILES¶
^$HOME/.mh_profile~^The user profile ^or $MH~^Rather than the standard profile ^<mh-dir>/context~^The user context ^or $MHCONTEXT~^Rather than the standard context ^<folder>/.mh_sequences~^Public sequences for <folder>
SEE ALSO¶
environ(5), mh-sequence(5), nmh(7)HISTORY¶
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.
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 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)
February 16, 2014 | nmh-1.6 |