1MH-PROFILE(5) File Formats Manual MH-PROFILE(5)
2
3
4
6 mh-profile, mh_profile - user customization for nmh message handler
7
9 Each user of nmh is expected to have a file named .mh-profile in their
10 home directory. This file contains a set of user parameters used by
11 the nmh family of programs. Each entry in the file is of the format
12
13 profile-component: value
14
15 If the text of a profile entry is long, you may extend it across sev‐
16 eral real lines by indenting the continuation lines with leading spaces
17 or tabs. Comments may be introduced by a line starting with `#:':
18
19 #: This is a comment.
20
21 Blank lines are not permitted in .mh-profile. Shell quoting conven‐
22 tions are not available; each token is separated by whitespace.
23
24 Standard Profile Entries
25 The possible profile components are exemplified below. The only manda‐
26 tory entry is `Path:'. The others are optional; some have default val‐
27 ues if they are not present. In the notation used below, (profile, de‐
28 fault) indicates whether the information is kept in the user's nmh pro‐
29 file or nmh context, and indicates what the default value is. Note
30 that a profile component can only appear once. Multiple appearances
31 will trigger a warning that all appearances after the first are ig‐
32 nored.
33
34 Some MH programs, including mhbuild, mhshow, and mhstore, have specific
35 profile components that are described in their respective man pages.
36 Each component name specific to these programs begins with the name of
37 the program and is followed by a dash.
38
39 Path: Mail
40 Locates nmh transactions in directory “Mail”. A relative Path
41 starts from the user's home directory. This is the only mandatory
42 profile entry. (profile, no default)
43
44 locale: locale
45 Set the locale for all nmh programs except post, install-mh, and
46 slocal. See the LC_ALL, LC_CTYPE, and LANG variables in the "EN‐
47 VIRONMENT" section below for a reference on how the locale is set
48 if this profile component is not used.
49
50 context: context
51 Declares the location of the nmh context file. This can be over‐
52 ridden by the environment variable MHCONTEXT. See the HISTORY
53 section below. (profile, default: <nmh-dir>/context)
54
55 Current-Folder: inbox
56 Keeps track of the current open folder. (context, default: folder
57 specified by “Inbox”)
58
59 Inbox: inbox
60 Defines the name of the default inbox. (profile, default: inbox)
61
62 Previous-Sequence: pseq
63 Names the sequence or sequences which should be defined as the
64 `msgs' or `msg' argument given to any nmh command. If not present
65 or empty, no such sequences are defined. Otherwise, for each name
66 given, the sequence is first zeroed and then each message is added
67 to the sequence. Read mh-sequence(5) for the details about this
68 sequence. (profile, no default)
69
70 Sequence-Negation: not
71 Defines the string which, when prefixed to a sequence name,
72 negates that sequence. Hence, “notseen” means all those messages
73 that are not a member of the sequence “seen”. Read mh-sequence(5)
74 for the details. (profile, no default)
75
76 Unseen-Sequence: unseen
77 Names the sequence or sequences which should be defined as those
78 messages which are unread. The commands inc, rcvstore, mhshow,
79 and show will add or remove messages from these sequences when
80 they are incorporated or read. If not present or empty, no such
81 sequences are defined. Otherwise, each message is added to, or
82 removed from, each sequence name given. Read mh-sequence(5) for
83 the details about this sequence. (profile, no default)
84
85 mh-sequences: .mh-sequences
86 The name of the file in each folder which defines public se‐
87 quences. To disable the use of public sequences, leave the value
88 portion of this entry blank. (profile, default: .mh-sequences)
89
90 atr-seq-folder: 172 178-181 212
91 Keeps track of the private sequence called “seq” in the specified
92 folder. Private sequences are generally used for read-only fold‐
93 ers. See mh-sequence(5) for details about private sequences.
94 (context, no default)
95
96 Editor: prompter
97 Defines the editor to be used by the commands comp, dist, forw,
98 and repl. If not set, the value will be taken from the VISUAL and
99 EDITOR environment variables. (profile, default: prompter)
100
101 Msg-Protect: 600
102 An octal number which defines the permission bits for new message
103 files. See chmod(1) for an explanation of the octal number. Note
104 that some filesystems, such as FAT32, do not support removal of
105 read file permissions. (profile, default: 0600)
106
107 Folder-Protect: 700
108 An octal number which defines the permission bits for new folder
109 directories. See chmod(1) for an explanation of the octal number.
110 (profile, default: 700)
111
112 datalocking: fcntl
113 The locking algorithm used to lock changes to any nmh data files,
114 such as sequences or context. The locking algorithm is any one of
115 the following entries:
116
117 fcntl dot flock lockf
118
119 Available locking algorithms can vary depending on the operating
120 system. Note: currently, transactional locking is only supported
121 on public sequences; see mh-sequence(5) for more information.
122 (profile, default: fcntl)
123
124 program: default switches
125 Sets default switches to be used whenever the mh program program
126 is invoked. For example, one could override the “Editor:” profile
127 component when replying to messages by adding a component such as:
128
129 repl: -editor /bin/ed
130
131 (profile, no defaults)
132
133 lasteditor-next: nexteditor
134 Names “nexteditor” to be the default editor after using “lastedi‐
135 tor”. This takes effect at the “What now?” prompt in comp, dist,
136 forw, and repl. After editing the draft with “lasteditor”, the
137 default editor is set to be “nexteditor”. If the user types
138 “edit” without any arguments to “What now?”, then “nexteditor” is
139 used. (profile, no default)
140
141 Folder-Stack: folders
142 The contents of the folder-stack for the folder command. (con‐
143 text, no default)
144
145 Local-Mailbox: Your Username <user@some.host>
146 Tells the MH programs what your local mailbox is. If set, it will
147 be used by the default component files by programs like comp and
148 repl to construct your default “From:” header. The text used here
149 will be copied exactly to your “From:” header, so it should al‐
150 ready be RFC 822 compliant. If this is set, the Signature profile
151 entry is not used, so it should include a signature as well.
152 (profile, default: userid@local.hostname)
153
154 Alternate-Mailboxes: mh@uci-750a, bug-mh*
155 Tells repl and scan which additional addresses are yours. In this
156 way, repl knows which addresses should be included in the reply,
157 and scan knows if a message originated from you. Addresses must
158 be separated by a comma, and the hostnames listed should be the
159 “official” hostnames for the mailboxes you indicate, as local
160 nicknames for hosts are not replaced with their official site
161 names. For each address, if a host is not given, then that ad‐
162 dress on any host is considered to be you. In addition, an aster‐
163 isk (`*') may appear at either or both ends of the mailbox and
164 host to indicate wild-card matching. (profile, default: your
165 user-id)
166
167 Aliasfile: aliases other-aliases
168 Indicates alias files for ali, whom, and send. This may be used
169 instead of the -alias file switch. (profile, no default)
170
171 Draft-Folder: drafts
172 Indicates a default draft folder for comp, dist, forw, refile, and
173 repl. Read mh-draft(5) for details. (profile, no default)
174
175 digest-issue-list: 1
176 Tells forw the last issue of the last volume sent for the digest
177 list. (context, no default)
178
179 digest-volume-list: 1
180 Tells forw the last volume sent for the digest list. (context, no
181 default)
182
183 MailDrop: .mail
184 Tells inc your mail drop, if different from the default. This is
185 superseded by the environment variable MAILDROP. (profile, de‐
186 fault: /var/mail/$USER)
187
188 Signature: RAND MH System (agent: Marshall Rose)
189 Tells front-end programs such as comp, forw, and repl your mail
190 signature. (This is not to be confused with a .signature that
191 might be appended to mails.) This is superseded by the environment
192 variable SIGNATURE. If SIGNATURE is not set and this profile en‐
193 try is not present, the “gcos” field of the /etc/passwd file will
194 be used. Your signature will be added to the address send puts in
195 the “From:” header; do not include an address in the signature
196 text. The “Local-Mailbox” profile component supersedes all of
197 this. (profile, no default)
198
199 credentials: legacy
200 Indicates how the username and password credentials will be re‐
201 trieved for access to external servers, such as those that provide
202 SMTP or POP service. The supported entry values are “legacy”,
203 “file:netrc”, and “file-nopermcheck:netrc”. With “legacy”, or if
204 there is no credentials entry, the username is the first of:
205
206 1) -user switch to inc, msgchk, post, send, or whom program
207 2) the login name on the local machine
208
209 The password for SMTP services is the first of:
210
211 1) password value from matching entry in file named
212 “.netrc” in the user's home directory
213 2) password obtained by interactively prompting the user
214
215 With a “file:netrc” credentials entry, the username is the first
216 of:
217 1) -user switch to program
218 2) login name from matching entry in netrc file
219 3) value provided by user in response to interactive query
220
221 Similarly, the password is provided either in the netrc file or
222 interactively. netrc can be any valid filename, either absolute
223 or relative to Path or $HOME. The netrc file contains authentica‐
224 tion information, for each server, using a line of the following
225 form. (Replace myserver, mylogin, and mypassword with your own
226 account information.)
227
228 machine myserver login mylogin password mypassword
229
230 This netrc file must be owned and readable only by you.
231
232 The “file-nopermcheck:netrc” credentials entry is identical in be‐
233 havior to the “file” entry, with the exception that the permission
234 checks done by “file” are not performed. This entry should be
235 used with caution and only when absolutely necessary. (profile,
236 default: legacy)
237
238 Welcome: disable
239 If the Welcome component is not present, or its value is not “dis‐
240 able”, a welcome message will be displayed the first time that an
241 interactive nmh program is run after updating the nmh installa‐
242 tion. The user must press the Enter key to continue.
243
244 If the MHCONTEXT environment variable is set and non-empty (and
245 the Welcome component is not “disable”), the welcome message is
246 only displayed if the context file contains a version reference,
247 and that reference is older than the installed nmh version. The
248 version reference is of the form:
249
250 Version: nmh-1.8
251
252 Process Profile Entries
253 The following profile elements are used whenever an nmh program invokes
254 some other program, such as more. The .mh-profile can be used to se‐
255 lect alternate programs if the user wishes. The default values are
256 given in the examples.
257
258 If the profile element contains spaces, the element is split at spaces
259 into tokens and each token is given as a separate argument to the ex‐
260 ecvp(2) system call. If the element contains shell metacharacters then
261 the entire element is executed using /bin/sh.
262
263 buildmimeproc: /usr/bin/mhbuild
264 This is the program used by whatnow to process drafts which are
265 MIME composition files.
266
267 fileproc: /usr/bin/refile
268 This program is used to refile or link a message to another
269 folder. It is used by post to file a copy of a message into a
270 folder given by a “Fcc:” field. It is used by the draft folder
271 facility in comp, dist, forw, and repl to refile a draft message
272 into another folder. It is used to refile a draft message in re‐
273 sponse to the refile directive at the “What now?” prompt.
274
275 formatproc:
276 Program called by mhl to filter a component when it is tagged with
277 the “format” variable in the mhl filter. See mhl(5) for more in‐
278 formation.
279
280 incproc: /usr/bin/inc
281 Program called by mhmail to incorporate new mail when it is in‐
282 voked with no arguments.
283
284 lproc: more
285 This program is used to list the contents of a message in response
286 to the list directive at the “What now?” prompt. It is also used
287 by the draft folder facility in comp, dist, forw, and repl to dis‐
288 play the draft message. (Note that the environment variable PAGER
289 supersedes the default built-in pager command.)
290
291 mailproc: /usr/bin/mhmail
292 This is the program used to automatically mail various messages
293 and notifications. It is used by send to post failure notices.
294 It is used to retrieve an external-body with access-type `mail-
295 server' (such as when storing the body with mhstore).
296
297 mhlproc: /usr/libexec/nmh/mhl
298 This is the program used to filter messages in various ways. It
299 is used by mhshow to filter and display the message headers of
300 MIME messages. When the -format or -filter option is used by forw
301 or repl, the mhlproc is used to filter the message that you are
302 forwarding, or to which you are replying. When the -filter option
303 is given to send, the mhlproc is used to filter the copy of the
304 message that is sent to “Bcc:” recipients.
305
306 moreproc: more
307 This is the program used by mhl to page the mhl formatted message
308 when displaying to a terminal. It is also the default program
309 used by mhshow to display message bodies (or message parts) of
310 type text/plain. (Note that the environment variable PAGER super‐
311 sedes the default built-in pager command.)
312
313 packproc: /usr/bin/packf
314 Currently not used.
315
316 postproc: /usr/libexec/nmh/post
317 This is the program used by send, mhmail, rcvdist, and viamail
318 (used by the sendfiles shell script) to post a message to the mail
319 transport system. It is also called by whom (called with the
320 switches -whom and -library) to do address verification.
321
322 If the profile contains a post component and a postproc component
323 is not present, a warning message that the post component will be
324 ignored will be displayed by every nmh program that reads the pro‐
325 file and has its stderr associated with a terminal.
326
327 rmmproc: none
328 This is the program used by rmm, refile, and mhfixmsg to delete a
329 message from a folder.
330
331 sendproc: /usr/bin/send
332 This is the program used by whatnow to actually send the message
333
334 showmimeproc: /usr/bin/mhshow
335 This is the program used by show to process and display non-text
336 (MIME) messages.
337
338 showproc: /usr/libexec/nmh/mhl
339 This is the program used by show to filter and display text (non-
340 MIME) messages.
341
342 whatnowproc: /usr/bin/whatnow
343 This is the program invoked by comp, dist, forw, and repl to query
344 about the disposition of a composed draft message.
345
346 whomproc: /usr/bin/whom
347 This is the program used by whatnow to determine to whom a message
348 would be sent.
349
350 Profile Lookup
351 After consulting .mh_profile, some programs read an optional profile
352 specified by a program-specific environment variable, and then the sys‐
353 tem-wide profile /etc/nmh/mhn.defaults. These programs are mhbuild,
354 mhshow, mhstore, and mhn. mhfixmsg is similar, but has no optional
355 profile.
356
357 The first occurrence of a component is used, e.g. .mh_profile's trumps
358 $MHSHOW's. A component with no value still stops further occurrences
359 being used, but is considered absent.
360
361 The .mh-profile contains only static information, which nmh programs
362 will not update. Changes in context are made to the context file kept
363 in the users nmh directory. This includes, but is not limited to: the
364 “Current-Folder” entry and all private sequence information. Public
365 sequence information is kept in each folder in the file determined by
366 the “mh-sequences” profile entry (default is .mh-sequences).
367
368 The .mh-profile may override the path of the context file, by specify‐
369 ing a “context” entry (this must be in lower-case). If the entry is
370 not absolute (does not start with a “/”), then it is interpreted rela‐
371 tive to the user's nmh directory. As a result, you can actually have
372 more than one set of private sequences by using different context
373 files.
374
376 The operation of nmh and its commands it also controlled by the pres‐
377 ence of certain environment variables.
378
379 Many of these environment variables are used internally by the “What
380 now?” interface. It's amazing all the information that has to get
381 passed via environment variables to make the “What now?” interface look
382 squeaky clean to the nmh user, isn't it? The reason for all this is
383 that the nmh user can select any program as the whatnowproc, including
384 one of the standard shells. As a result, it's not possible to pass in‐
385 formation via an argument list. The convention is that environment
386 variables whose names are all upper-case are user-settable; those whose
387 names are lower-case only are used internally by nmh and should not
388 generally be set by the user.
389
390 HOME If set and non-null, it is used as the user's home directory.
391 If not set or null, then getpwuid(3)'s pw_dir is used.
392
393 LC_ALL, LC_CTYPE, and LANG
394 These variables are used to set the locale, see locale(1). The
395 “locale” profile entry supersedes these.
396
397 MAILDROP
398 This variable tells inc the default mail drop. This supersedes
399 the “MailDrop” profile entry.
400
401 MAILHOST
402 This variable tells inc the POP host to query for mail to incor‐
403 porate. See inc(1) for more information.
404
405 MH With this environment variable, you can specify a profile other
406 than .mh-profile to be read by the nmh programs that you invoke.
407 If the value of MH is not absolute, (i.e., does not begin with a
408 “/”), it will be presumed to start from the current working di‐
409 rectory. This is one of the very few exceptions in nmh where
410 non-absolute pathnames are not considered relative to the user's
411 nmh directory.
412
413 MHBUILD
414 With this environment variable, you can specify an additional
415 user profile (file) to be read by mhbuild, in addition to the
416 mhn.defaults profile.
417
418 MHCONTEXT
419 With this environment variable, you can specify a context other
420 than the normal context file (as specified in the nmh profile).
421 As usual, unless the value of MHCONTEXT is absolute, it will be
422 presumed to start from your nmh directory.
423
424 MHLDEBUG
425 If this variable is set to a non-null value, mhl will emit de‐
426 bugging information.
427
428 MHMTSCONF
429 If this variable is set to a non-null value, it specifies the
430 name of the mail transport configuration file to use by inc,
431 post, and other programs that interact with the mail transport
432 system, instead of the default. See mh-tailor(5).
433
434 MHMTSUSERCONF
435 If this variable is set to a non-null value, it specifies the
436 name of a mail transport configuration file to be read in addi‐
437 tion to the default. See mh-tailor(5).
438
439 MHN With this environment variable, you can specify an additional
440 user profile (file) to be read by mhn, in addition to the
441 mhn.defaults profile. mhn is deprecated, so support for this
442 variable will be removed from a future nmh release.
443
444 MHSHOW With this environment variable, you can specify an additional
445 user profile (file) to be read by mhshow, in addition to the
446 mhn.defaults profile.
447
448 MHSTORE
449 With this environment variable, you can specify an additional
450 user profile (file) to be read by mhstore, in addition to the
451 mhn.defaults profile.
452
453 MHTMPDIR, TMPDIR
454 These variables are searched, in order, for the directory in
455 which to create some temporary files. MHTMPDIR is deprecated
456 and will be removed in a future release of nmh.
457
458 MHWDEBUG
459 If this variable is set to a non-null value, nmh commands that
460 use the Alternate-Mailboxes profile entry will display debugging
461 information about the values in that entry.
462
463 PAGER If set to a non-null value, this supersedes the value of the de‐
464 fault built-in pager command.
465
466 SIGNATURE
467 This variable tells send and post your mail signature. This su‐
468 persedes the “Signature” profile entry, and is not used when the
469 “Local-Mailbox” profile component is set.
470
471 USER This variable tells repl your user name and inc your default
472 mail drop: see the “MailDrop” profile entry.
473
474 USERNAME_EXTENSION
475 This variable is for use with username_extension masquerading.
476 See mh-tailor(5).
477
478 editalt
479 This is the alternate message. This is set by dist and repl
480 during edit sessions so you can peruse the message being dis‐
481 tributed or replied to. The message is also available, when the
482 -atfile switch is used, through a link called “@” in the current
483 directory if your current working directory and the folder the
484 message lives in are on the same Unix filesystem, and if your
485 current working directory is writable.
486
487 mhaltmsg
488 dist and repl set mhaltmsg to tell the whatnowproc about an al‐
489 ternate message associated with the draft (the message being
490 distributed or replied to).
491
492 mhannotate
493 This is set by dist, forw, and repl if annotations are to occur.
494
495 mhdist dist sets mhdist to tell the whatnowproc that message re-distri‐
496 bution is occurring.
497
498 mhdraft
499 This is the path to the working draft. It is set by comp, dist,
500 forw, and repl to tell the whatnowproc which file to ask “What
501 now?” questions about.
502
503 mheditor
504 This is set by comp, repl, forw, and dist to tell the whatnow‐
505 proc the user's choice of editor (unless overridden by -noedit).
506
507 mhfolder
508 This is the folder containing the alternate message. It is set
509 by dist and repl during edit sessions so you can peruse other
510 messages in the current folder besides the one being distributed
511 or replied to. The environment variable mhfolder is also set by
512 next, prev, and show for use by mhl.
513
514 mhinplace
515 This is set by dist, forw, and repl if annotations are to occur.
516
517 mhmessages
518 This is set by dist, forw, and repl if annotations are to occur.
519
520 mhuse This may be set by comp.
521
523 $HOME/.mh-profile The user's profile.
524 <mh-dir>/context The user's context
525 <folder>/.mh-sequences
526 Public sequences for <folder>.
527
529 mhbuild(1), mhshow(1), mhstore(1), mh-sequence(5), nmh(7), post(8)
530
532 There is some question as to what kind of arguments should be placed in
533 the profile as options. In order to provide a clear answer, recall the
534 command line semantics of all nmh programs: conflicting switches (e.g.
535 -header and -noheader) may occur more than one time on the command
536 line, with the last switch taking effect. Other arguments, such as
537 message sequences, filenames and folders, are always remembered on the
538 invocation line and are not superseded by following arguments of the
539 same type. Hence, it is safe to place only switches (and their argu‐
540 ments) in the profile.
541
542 If one finds that an nmh program is being invoked again and again with
543 the same arguments, and those arguments aren't switches, then there are
544 a few possible solutions to this problem. The first is to create a
545 (soft) link in your $HOME/bin directory to the nmh program of your
546 choice. By giving this link a different name, you can create a new en‐
547 try in your profile and use an alternate set of defaults for the nmh
548 command. Similarly, you could create a small shell script which called
549 the nmh program of your choice with an alternate set of invocation line
550 switches (using links and an alternate profile entry is preferable to
551 this solution).
552
553 Finally, the csh user could create an alias for the command of the
554 form:
555
556 alias cmd 'cmd arg1 arg2 ...'
557
558 In this way, the user can avoid lengthy type-in to the shell, and still
559 give nmh commands safely. (Recall that some nmh commands invoke oth‐
560 ers, and that in all cases, the profile is read, meaning that aliases
561 are disregarded beyond an initial command invocation)
562
563
564
565nmh-1.8 2016-10-19 MH-PROFILE(5)