# man > mh_profile(5mh)

[_MH-PROFILE_(5mh)](https://www.chedong.com/phpMan.php/man/MH-PROFILE/5mh/markdown)                                                                      [_MH-PROFILE_(5mh)](https://www.chedong.com/phpMan.php/man/MH-PROFILE/5mh/markdown)

## 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

            _profile-component_: _value_

       If the text of a profile entry is long, you may extend it across several real  lines  by  in‐
       denting  the continuation lines with leading spaces or tabs.  Comments may be introduced by a
       line starting with `#:':

            _#_: This is a comment.

       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  compo‐
       nent  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 pro‐
       grams begins with the name of the program and is followed by a dash.

       **Path**: Mail
            Locates  **nmh  **transactions  in directory “Mail”.  A relative Path starts from the user's
            home directory.  This is the only mandatory profile entry.  (profile, no default)

       **locale**: locale
            Set the locale for all **nmh **programs  except  **post**,  **install-mh**,  and  **slocal**.   See  the
            LC_ALL,  LC_CTYPE, and LANG variables in the "ENVIRONMENT" section below for a reference
            on how the locale is set if this profile component is not used.

       **context**: context
            Declares the location of the **nmh **context file.  This can be overridden by  the  environ‐
            ment  variable  MHCONTEXT.   See  the  **HISTORY  **section below.  (profile, default: <nmh-
            dir>/context)

       **Current-Folder**: inbox
            Keeps track of the current open folder.  (context, default: folder specified by “Inbox”)

       **Inbox**: inbox
            Defines the name of the default inbox.  (profile, default: inbox)

       **Previous-Sequence**: _pseq_
            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.  Oth‐
            erwise, for each name given, the sequence is first zeroed and then each message is added
            to the sequence.  Read [_mh-sequence_(5)](https://www.chedong.com/phpMan.php/man/mh-sequence/5/markdown) for the details about this sequence.  (profile, no
            default)

       **Sequence-Negation**: not
            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 [_mh-sequence_(5)](https://www.chedong.com/phpMan.php/man/mh-sequence/5/markdown) for the details.  (profile, no default)

       **Unseen-Sequence**: unseen
            Names  the sequence or sequences which should be defined as those messages which are un‐
            read.  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  se‐
            quence  name given.  Read [_mh-sequence_(5)](https://www.chedong.com/phpMan.php/man/mh-sequence/5/markdown) for the details about this sequence.  (profile,
            no default)

       **mh-sequences**: .mh-sequences
            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  se‐
            quences  are generally used for read-only folders.  See [_mh-sequence_(5)](https://www.chedong.com/phpMan.php/man/mh-sequence/5/markdown) for details about
            private sequences.  (context, no default)

       **Editor**: prompter
            Defines the editor to be used by the commands **comp**, **dist**, **forw**, and **repl**.  If  not  set,
            the value will be taken from the VISUAL and EDITOR environment variables.  (profile, de‐
            fault: prompter)

       **Msg-Protect**: 600
            An  octal  number which defines the permission bits for new message files.  See [_chmod_(1)](https://www.chedong.com/phpMan.php/man/chmod/1/markdown)
            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)

       **Folder-Protect**: 700
            An  octal  number  which  defines  the  permission bits for new folder directories.  See
            [_chmod_(1)](https://www.chedong.com/phpMan.php/man/chmod/1/markdown) for an explanation of the octal number.  (profile, default: 700)

       **datalocking**: fcntl
            The locking algorithm used to lock changes to any **nmh **data files, such as  sequences  or
            context.  The locking algorithm is any one of the following entries:

                 fcntl dot flock lockf

            Available  locking  algorithms  can  vary depending on the operating system.  Note: cur‐
            rently, transactional locking is only supported on public sequences; see  [_mh-sequence_(5)](https://www.chedong.com/phpMan.php/man/mh-sequence/5/markdown)
            for more information.  (profile, default: fcntl)

       _program_: _default_ _switches_
            Sets  default switches to be used whenever the mh program _program_ is invoked.  For exam‐
            ple, one could override the “Editor:” profile component when  replying  to  messages  by
            adding a component such as:

                 repl: -editor /bin/ed

            (profile, no defaults)

       _lasteditor_**-next: _**nexteditor_
            Names “nexteditor” to be the default editor after using “lasteditor”.  This takes effect
            at  the  “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)

       **Folder-Stack**: _folders_
            The contents of the folder-stack for the **folder **command.  (context, no default)

       **Local-Mailbox**: Your Username <<user@some.host>>
            Tells  the  MH  programs what your local mailbox is.  If set, it will be used by the de‐
            fault component files by programs 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@local.hostname>)

       **Alternate-Mailboxes**: mh@uci-750a, bug-mh*
            Tells **repl **and **scan **which additional addresses are yours.  In this way, **repl **knows which
            addresses  should  be included in the reply, and **scan **knows if a message 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  match‐
            ing.  (profile, default: your user-id)

       **Aliasfile**: aliases _other-aliases_
            Indicates  alias  files for **ali**, **whom**, and **send**.  This may be used instead of the **-alias**
            _file_ switch.  (profile, no default)

       **Draft-Folder**: drafts
            Indicates a default  draft  folder  for  **comp**,  **dist**,  **forw**,  **refile**,  and  **repl**.   Read
            [_mh-draft_(5)](https://www.chedong.com/phpMan.php/man/mh-draft/5/markdown) for details.  (profile, no default)

       **digest-issue-_**list_**: **1
            Tells **forw **the last issue of the last volume sent for the digest _list_.  (context, no de‐
            fault)

       **digest-volume-_**list_**: **1
            Tells **forw **the last volume sent for the digest _list_.  (context, no default)

       **MailDrop**: .mail
            Tells  **inc **your mail drop, if different from the default.  This is superseded by the en‐
            vironment 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 not
            to be confused with a .signature that might be appended to mails.) 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)

       **credentials**: legacy
            Indicates  how the username and password credentials will be retrieved for access to ex‐
            ternal servers, such as those that provide SMTP or POP  service.   The  supported  entry
            values  are  “legacy”, “file:_netrc_”, and “file-nopermcheck:_netrc_”.  With “legacy”, or if
            there is no credentials entry, the username is the first of:

                 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.)

                 **machine _**myserver_ **login _**mylogin_ **password _**mypassword_

            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 Welcome component is not present, or its value is not “_disable_”, a  welcome  mes‐
            sage  will  be displayed the first time that an interactive **nmh **program is run after up‐
            dating the **nmh **installation.  The user must press the Enter key to continue.

            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 ver‐
            sion reference is of the form:

                 Version: nmh-1.8

### 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)](https://www.chedong.com/phpMan.php/man/execvp/2/markdown) system call.  If the element  contains
       shell metacharacters then the entire element is executed using **/bin/sh**.

       **buildmimeproc**: /usr/bin/mh/mhbuild
            This is the program used by **whatnow **to process drafts which are MIME composition files.

       **fileproc**: /usr/bin/mh/refile
            This  program is used to refile or link a message to another folder.  It is used by **post**
            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 an‐
            other folder.  It is used to refile a draft message in response to the **refile  **directive
            at the “What now?” prompt.

       **formatproc**:
            Program called by **mhl **to filter a component when it is tagged with the “format” variable
            in the mhl filter.  See [_mhl_(5)](https://www.chedong.com/phpMan.php/man/mhl/5/markdown) for more information.

       **incproc**: /usr/bin/mh/inc
            Program called by **mhmail **to incorporate new mail when it is invoked with no arguments.

       **lproc**: more
            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 the environment variable  PAGER
            supersedes the default built-in pager command.)

       **mailproc**: /usr/bin/mh/mhmail
            This  is  the program used to automatically mail various messages and notifications.  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**).

       **mhlproc**: /usr/lib/mh/mhl
            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.

       **moreproc**: more
            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 the environment variable PAGER supersedes
            the default built-in pager command.)

       **packproc**: /usr/bin/mh/packf
            Currently not used.

       **postproc**: /usr/lib/mh/post
            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.

            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
            This is the program used by **rmm**, **refile**, and **mhfixmsg **to delete a message from a folder.

       **sendproc**: /usr/bin/mh/send
            This is the program used by **whatnow **to actually send the message

       **showmimeproc**: /usr/bin/mh/mhshow
            This is the program used by **show **to process and display non-text (MIME) messages.

       **showproc**: /usr/lib/mh/mhl
            This is the program used by **show **to filter and display text (non-MIME) messages.

       **whatnowproc**: /usr/bin/mh/whatnow
            This is the program invoked by **comp**, **dist**, **forw**, and **repl **to query about the disposition
            of a composed draft message.

       **whomproc**: /usr/bin/mh/whom
            This is the program used by **whatnow **to determine to whom a message would be sent.

### 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 compo‐
       nent 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 in‐
       cludes, but is not limited to: the “Current-Folder” entry and all private  sequence  informa‐
       tion.   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  environ‐
       ment 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  con‐
       vention 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.

       HOME   If  set  and  non-null,  it is used as the user's home directory.  If not set or null,
              then [getpwuid(3)](https://www.chedong.com/phpMan.php/man/getpwuid/3/markdown)'s pw_dir is used.

       LC_ALL, LC_CTYPE, and LANG
              These variables are used to set the locale, see [locale(1)](https://www.chedong.com/phpMan.php/man/locale/1/markdown).  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)](https://www.chedong.com/phpMan.php/man/inc/1/markdown) 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 di‐
              rectory.  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  con‐
              text  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  trans‐
              port 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)](https://www.chedong.com/phpMan.php/man/mh-tailor/5/markdown).

       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)](https://www.chedong.com/phpMan.php/man/mh-tailor/5/markdown).

       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  sup‐
              port 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 tem‐
              porary 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-Mail‐**
              **boxes **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  “Signa‐
              ture”  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)](https://www.chedong.com/phpMan.php/man/mh-tailor/5/markdown).

       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  associ‐
              ated 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  **dur‐
              ing  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)](https://www.chedong.com/phpMan.php/man/mhbuild/1/markdown), [_mhshow_(1)](https://www.chedong.com/phpMan.php/man/mhshow/1/markdown), [_mhstore_(1)](https://www.chedong.com/phpMan.php/man/mhstore/1/markdown), [_mh-sequence_(5)](https://www.chedong.com/phpMan.php/man/mh-sequence/5/markdown), [_nmh_(7)](https://www.chedong.com/phpMan.php/man/nmh/7/markdown), [_post_(8)](https://www.chedong.com/phpMan.php/man/post/8/markdown)

## BUGS
       There is some question as to what kind of arguments should be placed in the  profile  as  op‐
       tions.  In order to provide a clear answer, recall the command line semantics of all **nmh **pro‐
       grams: 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 se‐
       quences, filenames and folders, are always remembered on the invocation line and are not  su‐
       perseded  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)

nmh-1.8                                      2016-10-19                              [_MH-PROFILE_(5mh)](https://www.chedong.com/phpMan.php/man/MH-PROFILE/5mh/markdown)
