MH-PROFILE(5)
โจ NAME โจ
mh-profile, mh_profile โ user customization for nmh message handler ๐
So bestie, this is the man page for mh-profile (also spelled mh_profile, same vibe, different spelling ๐
).
๐ธ DESCRIPTION ๐ธ
okay so. every single user of nmh is expected to have a file called .mh-profile chilling in their home directory ๐ . this file is literally just a lil bundle of user parameters that the whole nmh family of programs reads. every entry in it looks like this:
profile-component: value
if the text of a profile entry is long (and honestly, when is it not ๐ญ), you can extend it across several real lines by indenting the continuation lines with leading spaces or tabs. and if you wanna leave a lil note to yourself, comments get introduced by a line starting with #::
#: This is a comment.
โ ๏ธ blank lines are not permitted in .mh-profile. not even one. not even a lil baby one. also, shell quoting conventions are not available โ each token is separated by whitespace. that's just the rules, no cap.
๐ฆ Standard Profile Entries ๐ฆ
the possible profile components are exemplified below ๐ the only mandatory entry is Path: โ everything else is optional, and some of them have default values if you don't bother setting them. in the notation used below, (profile, default) tells you whether the information is kept in the user's nmh profile or nmh context, and also tells you 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โ locates nmh transactions in directoryMail๐ฌ. a relativePathstarts from the user's home directory. this is the only mandatory profile entry, so like, you literally cannot skip it.(profile, no default)locale: localeโ sets the locale for all nmh programs exceptpost,install-mh, andslocal. ๐ if this profile component isn't used, go peek at theLC_ALL,LC_CTYPE, andLANGvariables in the "ENVIRONMENT" section below for a reference on how the locale is set.context: contextโ declares the location of the nmh context file ๐. this can be overridden by the environment variableMHCONTEXT. 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 themsgsormsgargument given to any nmh command. if not present or empty, no such sequences are defined. otherwise, for each name given, the sequence is first zeroed and then each message is added to the sequence ๐ข. readmh-sequence(5)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". readmh-sequence(5)for the details.(profile, no default)Unseen-Sequence: unseenโ names the sequence or sequences which should be defined as those messages which are unread ๐. the commandsinc,rcvstore,mhshow, andshowwill 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. readmh-sequence(5)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 sequences are generally used for read-only folders. seemh-sequence(5)for details about private sequences.(context, no default)Editor: prompterโ defines the editor to be used by the commandscomp,dist,forw, andreplโ๏ธ. if not set, the value will be taken from theVISUALandEDITORenvironment variables.(profile, default: prompter)Msg-Protect: 600โ an octal number which defines the permission bits for new message files ๐. seechmod(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)Folder-Protect: 700โ an octal number which defines the permission bits for new folder directories ๐๐. seechmod(1)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: 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 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)
lasteditor-next: nexteditorโ names "nexteditor" to be the default editor after using "lasteditor" ๐. this takes effect at the "What now?" prompt incomp,dist,forw, andrepl. 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 thefoldercommand ๐๏ธ.(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 default component files by programs likecompandreplto 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, theSignatureprofile entry is not used, so it should include a signature as well.(profile, default: userid@local.hostname)Alternate-Mailboxes: mh@uci-750a, bug-mh*โ tellsreplandscanwhich additional addresses are yours ๐โโ๏ธ. in this way,replknows which addresses should be included in the reply, andscanknows 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 matching โจ.(profile, default: your user-id)Aliasfile: aliases other-aliasesโ indicates alias files forali,whom, andsend๐. this may be used instead of the-aliasfile switch.(profile, no default)Draft-Folder: draftsโ indicates a default draft folder forcomp,dist,forw,refile, andrepl๐. readmh-draft(5)for details.(profile, no default)digest-issue-list: 1โ tellsforwthe last issue of the last volume sent for the digest list ๐ฐ.(context, no default)digest-volume-list: 1โ tellsforwthe last volume sent for the digest list ๐.(context, no default)MailDrop: .mailโ tellsincyour mail drop, if different from the default ๐ซ. this is superseded by the environment variableMAILDROP.(profile, default: /var/mail/$USER)Signature: RAND MH System (agent: Marshall Rose)โ tells front-end programs such ascomp,forw, andreplyour mail signature โ๏ธ. (this is not to be confused with a.signaturethat might be appended to mails.) this is superseded by the environment variableSIGNATURE. ifSIGNATUREis not set and this profile entry is not present, the "gcos" field of the/etc/passwdfile will be used. your signature will be added to the addresssendputs 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 external 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 nocredentialsentry, the username is the first of:-userswitch toinc,msgchk,post,send, orwhomprogram- the login name on the local machine
the password for SMTP services is the first of:
- password value from matching entry in file named ".netrc" in the user's home directory
- password obtained by interactively prompting the user
with a "file:netrc" credentials entry, the username is the first of:
-userswitch to program- login name from matching entry in netrc file
- 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. like, nobody else. periodt.
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)
more coming, bestie, don't go anywhere ๐ซถ
Welcome: disableโ the lil hello screen nobody asked for ๐
So here's the tea: if the Welcome component isn't there at all, or its value isn't literally disable, you get a welcome message the very first time an interactive nmh program gets run after you update the nmh installation. And bestie, you must press the Enter key to continue. No skipping, no escape hatch, just Enter ๐
Okay but plot twist: if the MHCONTEXT environment variable is set and non-empty (and the Welcome component isn't disable), then that welcome message only shows up if the context file contains a version reference, and that reference is older than the nmh version you've got installed. The version reference looks exactly like this, no cap:
Version: nmh-1.8
๐ง Process Profile Entries ๐ง
These profile elements are the ones that come out to play whenever an nmh program invokes some other program โ you know, stuff like more. And because .mh-profile is yours, you can totally swap in alternate programs if that's the vibe you want. The default values are right there in the examples below, mwah ๐
Okay so the mechanics, because this part actually matters: if the profile element contains spaces, the element gets split at spaces into tokens, and each token is handed over as a separate argument to the execvp(2) system call. But if the element contains shell metacharacters, then the entire element is executed using /bin/sh. Two different rules, one component. Periodt.
buildmimeproc: /usr/bin/mhbuildโ the programwhatnowuses to process drafts that are MIME composition files. She's the MIME draft handler, basically ๐fileproc: /usr/bin/refileโ used to refile or link a message to another folder.postuses it to file a copy of a message into a folder given by aFcc:field. The draft folder facility incomp,dist,forw, andrepluses it to refile a draft message into another folder. And it's also used to refile a draft message in response to therefiledirective at theWhat now?prompt. She does it all, fr fr.formatproc:โ program called bymhlto filter a component when it's tagged with theformatvariable in the mhl filter. Peepmhl(5)for more info. (No default, bestie โ it's giving "you set this yourself" ๐ )incproc: /usr/bin/incโ program called bymhmailto incorporate new mail whenmhmailis invoked with no arguments.lproc: moreโ used to list the contents of a message in response to thelistdirective at theWhat now?prompt. It's also used by the draft folder facility incomp,dist,forw, andreplto display the draft message. (Quick note: the environment variablePAGERsupersedes the default built-in pager command. SoPAGERreally said "I'm the main character" ๐ญ)mailproc: /usr/bin/mhmailโ the program used to automatically mail various messages and notifications.senduses it to post failure notices. And it's used to retrieve an external-body with access-typemail-serverโ like when you're storing the body withmhstore.mhlproc: /usr/libexec/nmh/mhlโ the program used to filter messages in all sorts of ways.mhshowuses it to filter and display the message headers of MIME messages. When the-formator-filteroption is used byforworrepl,mhlprocfilters the message you're forwarding, or the one you're replying to. And when-filteris given tosend,mhlprocfilters the copy of the message that gets sent toBcc:recipients. Versatile queen ๐ธmoreproc: moreโ used bymhlto page the mhl formatted message when displaying to a terminal. It's also the default programmhshowuses to display message bodies (or message parts) of typetext/plain. (Again: the environment variablePAGERsupersedes the default built-in pager command.PAGERstays undefeated ๐ซถ)packproc: /usr/bin/packfโ Currently not used. That's it. That's the whole description. She's retired, iconic, doing nothing, thriving ๐งpostproc: /usr/libexec/nmh/postโ the program used bysend,mhmail,rcvdist, andviamail(which is used by thesendfilesshell script) to post a message to the mail transport system. It's also called bywhom(called with the switches-whomand-library) to do address verification.
Heads up bestie ๐จ If your profile contains apostcomponent and apostproccomponent is not present, then a warning message saying thepostcomponent will be ignored gets displayed by every nmh program that reads the profile and has its stderr associated with a terminal. So like... fix it, or enjoy the spam ๐ญ
rmmproc: noneโ the program used byrmm,refile, andmhfixmsgto delete a message from a folder.sendproc: /usr/bin/sendโ the program used bywhatnowto actually send the message. The one that does the thing ๐ฅshowmimeproc: /usr/bin/mhshowโ the program used byshowto process and display non-text (MIME) messages.showproc: /usr/libexec/nmh/mhlโ the program used byshowto filter and display text (non-MIME) messages.whatnowproc: /usr/bin/whatnowโ the program invoked bycomp,dist,forw, andreplto query about the disposition of a composed draft message. She's the one asking "so... what now?" ๐whomproc: /usr/bin/whomโ the program used bywhatnowto determine to whom a message would be sent.
๐ Profile Lookup ๐
Okay so here's how the lookup order works, and honestly it's giving hierarchy ๐
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. Those programs are mhbuild, mhshow, mhstore, and mhn. mhfixmsg is similar โ except she has no optional profile. Not her thing, and that's fine ๐
The first occurrence of a component is the one that wins, e.g. .mh_profile's trumps $MHSHOW's. And a component with no value still stops further occurrences from being used โ but it's considered absent. So an empty value is a blocker, not a real answer. Iykyk โจ
The .mh-profile contains only static information, which nmh programs will not update. Changes in context get made to the context file kept in the user's nmh directory. That 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). ๐ฆ
And here's a fun one: the .mh-profile may override the path of the context file by specifying a context entry โ and bestie, that must be in lower-case. If the entry isn't absolute (doesn't start with a /), then it's 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. Multiple identities, multiple sequence sets, main character energy all around ๐
โจ ENVIRONMENT โจ
okay so bestie, nmh and all its lil commands are ALSO controlled by whatever environment variables are floating around. it's not just the profile file, it's the ~vibes of your shell~ too ๐
ngl, a whole bunch of these are used internally by the โWhat now?โ interface. and likeโฆ it's genuinely amazing how much info has to get passed through environment variables just to make the โWhat now?โ interface look squeaky clean to the nmh user, right?? ๐ญ the reason for all this drama is that you can pick any program as your whatnowproc, including one of the standard shells. so passing info through an argument list? not possible, babes. the convention instead is:
- env vars with ALL UPPER-CASE names are user-settable โ go off, set them ๐ซถ
- env vars with lower-case only names are used internally by nmh and should generally not be set by you ๐
the user-settable ones (uppercase queens ๐)
HOMEโ if it's set and non-null, it's used as your home directory. if it's not set, or it's null, thengetpwuid(3)'spw_dirgets used instead.LC_ALL,LC_CTYPE, andLANGโ these set the locale, seelocale(1). but heads up: the โlocaleโ profile entry supersedes these. profile wins, periodt.MAILDROPโ tellsincthe default mail drop. this supersedes the โMailDropโ profile entry.MAILHOSTโ tellsincthe POP host to query for mail to incorporate. seeinc(1)for more.MHโ with this one you can specify a profile other than.mh-profileto be read by the nmh programs you invoke. if the value ofMHis not absolute (i.e., doesn't 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 your nmh directory. lowkey iconic of it tbh.MHBUILDโ specifies an additional user profile (file) to be read bymhbuild, on top of themhn.defaultsprofile.MHCONTEXTโ specifies a context other than the normal context file (as specified in the nmh profile). as usual, unless the value ofMHCONTEXTis absolute, it's presumed to start from your nmh directory.MHLDEBUGโ if this is set to a non-null value,mhlwill emit debugging information. ๐MHMTSCONFโ if set to a non-null value, it names the mail transport configuration file to use instead of the default, forinc,post, and other programs that talk to the mail transport system. seemh-tailor(5).MHMTSUSERCONFโ if set to a non-null value, it names a mail transport configuration file to be read in addition to the default. seemh-tailor(5).MHNโ specifies an additional user profile (file) to be read bymhn, in addition to themhn.defaultsprofile. but bestieโฆmhnis deprecated, so support for this variable will be removed from a future nmh release. ๐MHSHOWโ specifies an additional user profile (file) to be read bymhshow, in addition to themhn.defaultsprofile.MHSTOREโ specifies an additional user profile (file) to be read bymhstore, in addition to themhn.defaultsprofile.MHTMPDIR,TMPDIRโ these are searched, in order, for the directory in which to create some temporary files.MHTMPDIRis deprecated and will be removed in a future release of nmh.MHWDEBUGโ if set to a non-null value, nmh commands that use theAlternate-Mailboxesprofile 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โ tellssendandpostyour mail signature. this supersedes the โSignatureโ profile entry, and it is not used when the โLocal-Mailboxโ profile component is set. ๐USERโ tellsreplyour user name, andincyour default mail drop: see the โMailDropโ profile entry.USERNAME_EXTENSIONโ this one is for use withusername_extensionmasquerading. seemh-tailor(5).
the internal ones (lowercase, do not touch ๐ )
editaltโ this is the alternate message. it's set bydistandreplduring edit sessions so you can peruse the message being distributed or replied to. the message is also available, when the-atfileswitch is used, through a link called โ@โ in the current directory โ but only 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โdistandreplsetmhaltmsgto tell thewhatnowprocabout an alternate message associated with the draft (the message being distributed or replied to).mhannotateโ set bydist,forw, andreplif annotations are to occur.mhdistโdistsetsmhdistto tell thewhatnowprocthat message re-distribution is occurring.mhdraftโ the path to the working draft. set bycomp,dist,forw, andreplto tell thewhatnowprocwhich file to ask โWhat now?โ questions about.mheditorโ set bycomp,repl,forw, anddistto tell thewhatnowprocthe user's choice of editor (unless overridden by-noedit).mhfolderโ the folder containing the alternate message. set bydistandreplduring edit sessions so you can peruse other messages in the current folder besides the one being distributed or replied to.mhfolderis also set bynext,prev, andshowfor use bymhl.mhinplaceโ set bydist,forw, andreplif annotations are to occur.mhmessagesโ set bydist,forw, andreplif annotations are to occur.mhuseโ this may be set bycomp.
๐ FILES ๐
$HOME/.mh-profileโ the user's profile. your main character document fr ๐<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 ๐
so there's some question as to what kind of arguments should even go in the profile as options. and to give you a clear answer, let's recall the command line semantics of all nmh programs:
- conflicting switches (e.g.
-headerand-noheader) may occur more than one time on the command line, with the last switch taking effect. - other arguments โ like message sequences, filenames and folders โ are always remembered on the invocation line and are not superseded by following arguments of the same type.
so the takeaway? it is safe to place only switches (and their arguments) in the profile. that's it, that's the rule ๐
now, if you find yourself invoking an nmh program again and again with the same arguments, and those arguments aren't switches, there are a few possible solutions to this problem:
- create a (soft) link in your
$HOME/bindirectory 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 that 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. but ngl โ using links and an alternate profile entry is preferable to this solution. just saying.
finally, the csh user could create an alias for the command of the form:
alias cmd 'cmd arg1 arg2 ...'
this way you can avoid lengthy type-in to the shell and still give nmh commands safely. (and recall, bestie: some nmh commands invoke others, and in all cases the profile is read โ meaning aliases are disregarded beyond an initial command invocation. so don't get too comfy with them ๐ญ)
and that's a wrap on MH-PROFILE(5)! this whole thing came to you from nmh-1.8, dated 2016-10-19 โ a lil vintage, a lil iconic, very much still serving ๐ซถโจ go forth and configure responsibly ๐๐ธ๐ฆ
๐ฆ where this page comes from
- alpine 3.24: nmh-doc 1.8-r3 ยท BSD-3-Clause
- epel 10: nmh 1.8-3.el10_1 ยท BSD
- epel 9: nmh 1.8-1.el9 ยท BSD
- fedora 43: nmh 1.8-9.fc43 ยท LicenseRef-Callaway-BSD
- fedora 44: nmh 1.8-10.fc44 ยท LicenseRef-Callaway-BSD
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms