mh-profile (5) - Linux Man Pages
mh-profile: user profile customization for nmh message handler
mh-profile - user profile customization for nmh message handler
DESCRIPTIONEach 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 format
- profile-component: value
If 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 `#:':
- #: This is a comment.
Standard Profile EntriesThe 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.
- Locates nmh transactions in directory ``Mail''. This is the only mandatory profile entry. (profile, no default)
- Declares the location of the nmh context file. This is overridden by the environment variable $MHCONTEXT. See the HISTORY section below. (profile, default: <nmh-dir>/context)
- Keeps track of the current open folder. (context, default: folder specified by ``Inbox'')
- Defines the name of your default inbox. (profile, default: inbox)
- Names the sequence or sequences which should be defined as the `msgs' or `msg' argument given to any nmh command. If not present or empty, no such sequences are defined. Otherwise, for each name given, the sequence is first zero'd and then each message is added to the sequence. Read the mh-sequence(5) man page for the details about this sequence. (profile, no default)
- Defines the string which, when prefixed to a sequence name, negates that sequence. Hence, ``notseen'' means all those messages that are not a member of the sequence ``seen''. Read the mh-sequence(5) man page for the details. (profile, no default)
- Names the sequence or sequences which should be defined as those messages which are unread. The commands inc, rcvstore, mhshow, and show will add or remove messages from these sequences when they are incorporated or read. If not present or empty, no such sequences are defined. Otherwise, each message is added to, or removed from, each sequence name given. Read the mh-sequence(5) man page for the details about this sequence. (profile, no default)
- The name of the file in each folder which defines public sequences. To disable the use of public sequences, leave the value portion of this entry blank. (profile, default: .mh_sequences)
atr-seq-folder: 172 178-181 212
- Keeps track of the private sequence called ``seq'' in the specified folder. Private sequences are generally used for read-only folders. See the mh-sequence(5) man page for details about private sequences. (context, no default)
- Defines the editor to be used by the commands comp, dist, forw, and repl. If not set in profile the value will be taken from the VISUAL and EDITOR environment variables. (profile, default: vi)
- An octal number which defines the permission bits for new message files. See chmod(1) for an explanation of the octal number. Note that some filesystems, such as FAT32, do not support removal of read file permissions. (profile, default: 0600)
- An octal number which defines the permission bits for new folder directories. See chmod(1) for an explanation of the octal number. (profile, default: 700)
The locking algorithm used to lock changes to any
data files, such as sequences or the context. The locking algorithm is
any one of the following entries:
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
Sets default switches to be used whenever the mh program
is invoked. For example, one could override the ``Editor:'' profile
component when replying to messages by adding a component such as:
- repl: -editor /bin/ed
(profile, no defaults)
- Names ``nexteditor'' to be the default editor after using ``lasteditor''. This takes effect at ``What now?'' prompt in comp, dist, forw, and repl. After editing the draft with ``lasteditor'', the default editor is set to be ``nexteditor''. If the user types ``edit'' without any arguments to ``What now?'', then ``nexteditor'' is used. (profile, no default)
- The contents of the folder-stack for the folder command. (context, no default)
Local-Mailbox: Your Username <user [at] some.host>
- Tells the various MH tools what your local mailbox is. If set, will be used by the default component files by tools like comp and repl to construct your default ``From'' header. The text used here will be copied exactly to your From: header, so it should already be RFC 822 compliant. If this is set, the Signature profile entry is NOT used, so it should include a signature as well. (profile, default: userid [at] local.hostname)
Alternate-Mailboxes: mh [at] uci-750a, bug-mh*
- Tells repl and scan which addresses are really yours. In this way, repl knows which addresses should be included in the reply, and scan knows if the message really originated from you. Addresses must be separated by a comma, and the hostnames listed should be the ``official'' hostnames for the mailboxes you indicate, as local nicknames for hosts are not replaced with their official site names. For each address, if a host is not given, then that address on any host is considered to be you. In addition, an asterisk (`*') may appear at either or both ends of the mailbox and host to indicate wild-card matching. (profile, default: your user-id)
Aliasfile: aliases other-alias
- Indicates aliases files for ali, whom, and send. This may be used instead of the -alias file switch. (profile, no default)
- Indicates a default draft folder for comp, dist, forw, refile, and repl. Read the mh-draft(5) man page for details. (profile, no default)
- Tells forw the last issue of the last volume sent for the digest list. (context, no default)
- Tells forw the last volume sent for the digest list. (context, no default)
- Tells inc your maildrop, if different from the default. This is superseded by the environment variable $MAILDROP. (profile, default: /var/mail/$USER)
Signature: RAND MH System (agent: Marshall Rose)
- Tells front-end programs such as comp, forw, and repl your mail signature. This is superseded by the environment variable $SIGNATURE. If $SIGNATURE is not set and this profile entry is not present, the ``gcos'' field of the /etc/passwd file will be used. Your signature will be added to the address send puts in the ``From:'' header; do not include an address in the signature text. The ``Local-Mailbox'' profile component supersedes all of this. (profile, no default)
Indicates how the username and password credentials will be retrieved
for access to external servers, such as those that provide SMTP or POP
service. The supported entry values are ``legacy'' and
With ``legacy'', or if there is no credentials entry, the
username is the first of:
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
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:
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 the words myserver, mylogin, and mypassword with your own account information:
- machine myserver login mylogin password mypassword
This netrc file must be owned and readable only by you. (profile, default: legacy)
- 1) -user switch to send, post, whom, inc, or msgchk program
Process Profile EntriesThe 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.
- This is the program used by whatnow to process drafts which are MIME composition files.
- This program is used to refile or link a message to another folder. It is used by send to file a copy of a message into a folder given by a ``Fcc:'' field. It is used by the draft folder facility in comp, dist, forw, and repl to refile a draft message into another folder. It is used to refile a draft message in response to the refile directive at the ``What now?'' prompt.
- Program called by mhl to filter a component when it is tagged with the ``format'' variable in the mhl filter. See mhl(5) for more information.
- Program called by mhmail to incorporate new mail when it is invoked with no arguments.
- This program is used to list the contents of a message in response to the list directive at the ``What now?'' prompt. It is also used by the draft folder facility in comp, dist, forw, and repl to display the draft message. (Note that $PAGER supersedes the default built-in pager command.)
- This is the program used to automatically mail various messages and notifications. It is used by conflict when using the -mail option. It is used by send to post failure notices. It is used to retrieve an external-body with access-type `mail-server' (such as when storing the body with mhstore).
- This is the program used to filter messages in various ways. It is used by mhshow to filter and display the message headers of MIME messages. When the -format or -filter option is used by forw or repl, the mhlproc is used to filter the message that you are forwarding, or to which you are replying. When the -filter option is given to send, the mhlproc is used to filter the copy of the message that is sent to ``Bcc:'' recipients.
- This is the program used by mhl to page the mhl formatted message when displaying to a terminal. It is also the default program used by mhshow to display message bodies (or message parts) of type text/plain. (Note that $PAGER supersedes the default built-in pager command.)
- Currently not used.
- Currently not used.
- This is the program used by send, mhmail, rcvdist, and viamail (used by the sendfiles shell script) to post a message to the mail transport system. It is also called by whom (called with the switches -whom and -library) to do address verification.
- This is the program used by rmm, refile, and mhfixmsg to delete a message from a folder.
- This is the program to use by whatnow to actually send the message
- This is the program used by show to process and display non-text (MIME) messages.
- This is the program used by show to filter and display text (non-MIME) messages.
- This is the program invoked by comp, forw, dist, and repl to query about the disposition of a composed draft message.
- This is the program used by whatnow to determine to whom a message would be sent.
Profile LookupAfter 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.
Environment VariablesThe 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.
- 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.
- With this environment variable, you can specify a context other than the normal context file (as specified in the nmh profile). As always, unless the value of $MHCONTEXT is absolute, it will be presumed to start from your nmh directory.
- With this environment variable, you can specify an additional user profile (file) to be read by mhbuild, in addition to the mhn.defaults profile.
- 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 this support for this variable will be removed from a future nmh release.
- With this environment variable, you can specify an additional user profile (file) to be read by mhshow, in addition to the mhn.defaults profile.
- With this environment variable, you can specify an additional user profile (file) to be read by mhstore, in addition to the mhn.defaults profile.
- This variable tells inc the default maildrop. This supersedes the ``MailDrop'' profile entry.
- This variable tells inc the POP host to query for mail to incorporate. See the inc(1) man page for more information.
- This variable is for use with username_extension masquerading. See the mh-tailor(5) man page.
- 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.
- This variable tells repl your user name and inc your default maildrop: see the ``MailDrop'' profile entry.
- This variable tells all nmh programs your home directory
This variable tells
your terminal type.
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.
- If this variable is set to a non-null value, it specifies the name of the mail transport configuration file to use by post, inc, and other programs that interact with the mail transport system, instead of the default. See mh-tailor(5).
- 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).
- These variables are searched, in order, for the directory in which to create some temporary files.
- If this variable is set to a non-null value, mhl will emit debugging information.
- If this variable is set to a non-null value, pick will emit a representation of the search pattern.
- 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.
- If set to a non-null value, this supersedes the value of the default built-in pager command.
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.
This is the path to the working draft.
This is set by comp, dist, forw, and repl to tell the whatnowproc which file to ask ``What now?'' questions about.
- dist and repl set $mhaltmsg to tell the whatnowproc about an alternate message associated with the draft (the message being distributed or replied to).
This is the folder containing the alternate message.
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.
- dist sets $mhdist to tell the whatnowproc that message re-distribution is occurring.
- This is set by comp, repl, forw, and dist to tell the whatnowproc the user's choice of editor (unless overridden by -noedit).
- This may be set by comp.
- This is set by dist, forw, and repl if annotations are to occur.
- This is set by dist, forw, and repl if annotations are to occur.
- This is set by dist, forw, and repl if annotations are to occur.
^$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 ALSOenviron(5), mh-sequence(5), nmh(7)
HISTORYThe .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.
BUGSThere 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:
- alias cmd 'cmd arg1 arg2 ...'
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)
Linux man pages generated by: SysTutorials