Use execprog() instead of system() ... partly transition
[mmh] / man / mh-profile.man5
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH MH-PROFILE %manext5% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 mh-profile \- user profile customization for mmh message handler
7 .SH SYNOPSIS
8 .I $HOME/.mmh/profile
9 .br
10 .I $HOME/.mmh/context
11 .SH DESCRIPTION
12 Each user of
13 .B mmh
14 is expected to have a file named
15 .I $HOME/.mmh/profile
16 in his or her home directory.  This file contains
17 a set of user parameters used by some or all of the
18 .B mmh
19 family of programs.  Each entry in the file is of the format
20 .PP
21 .RS 5
22 .IR Profile\-Component ": " value
23 .RE
24 .PP
25 If the text of profile entry is long, you may extend it across several
26 real lines by indenting the continuation lines with leading spaces or tabs.
27
28 .SS "Standard Profile Entries"
29 The possible profile components are exemplified below.  The only mandatory
30 entry is `Path:'.  The others are optional; some have default values if
31 they are not present.  In the notation used below, (profile, default)
32 indicates whether the information is kept in the user's
33 .B mmh
34 profile or
35 .B mmh
36 context, and indicates what the default value is.
37 .PP
38 .BR Path :
39 Mail
40 .RS 5
41 Sets the user's mail storage to `Mail'.  This is the
42 only mandatory profile entry.  (profile, no default)
43 .RE
44 .PP
45 .BR Context :
46 context
47 .RS 5
48 Declares the location of the
49 .B mmh
50 context file.  This is overridden by the environment variable
51 .BR $MMHC .
52 See the
53 .B HISTORY
54 section below.
55 (profile, default: $HOME/.mmh/context)
56 .RE
57 .PP
58 .BR Current\-Folder :
59 inbox
60 .RS 5
61 Keeps track of the current open folder.
62 (context, default: folder specified by `Inbox')
63 .RE
64 .PP
65 .BR Inbox :
66 inbox
67 .RS 5
68 Defines the name of your default inbox.
69 (profile, default: inbox)
70 .RE
71 .PP
72 .BR Previous\-Sequence :
73 .I pseq
74 .RS 5
75 Names the sequence or sequences which should be defined as the `msgs' or
76 `msg' argument given to any
77 .B mmh
78 command.  If not present or empty,
79 no such sequences are defined.  Otherwise, for each name given, the
80 sequence is first zero'd and then each message is added to the sequence.
81 Read the
82 .BR mh\-sequence (7)
83 man page for the details about this sequence. (profile, no default)
84 .RE
85 .PP
86 .BR Sequence\-Negation :
87 \&!
88 .RS 5
89 Defines the string which, when prefixed to a sequence name, negates
90 that sequence.  Hence, `!foo' means all those messages that
91 are not a member of the sequence `foo'.
92 To deactivate this mechanism, define Sequence\-Negation to an empty value.
93 Read the
94 .BR mh\-sequence (7)
95 man page for the details.  (profile, default: !)
96 .RE
97 .PP
98 .BR Unseen\-Sequence :
99 u
100 .RS 5
101 Names the sequence or sequences which shall contain any unread messages.
102 The commands
103 .BR inc ,
104 .BR rcvstore ,
105 and
106 .B show
107 will add or remove messages from these
108 sequences when they are incorporated or read.  If defined with an empty
109 value, no such sequences are defined.  Otherwise, each message is
110 added to, or removed from, each sequence name given.  Read the
111 .BR mh\-sequence (7)
112 man page for the details about this sequence.
113 (profile, default: u)
114 .RE
115 .PP
116 .BR Mh\-Sequences :
117 \&.mh_sequences
118 .RS 5
119 The name of the file in each folder which defines public sequences.
120 To disable the use of public sequences, leave the value portion of this
121 entry blank.  (profile, default: \&.mh_sequences)
122 .RE
123 .PP
124 .BI atr\- seq \- folder :
125 172\0178\-181\0212
126 .RS 5
127 Keeps track of the private sequence called `seq' in the specified
128 folder.  Private sequences are generally used for read\-only folders.
129 See the
130 .BR mh\-sequence (7)
131 man page for details about private sequences.
132 (context, no default)
133 .RE
134 .PP
135 .BR Editor :
136 vi
137 .RS 5
138 Defines the editor to be used by the commands
139 .BR comp ,
140 .BR dist ,
141 .BR forw ,
142 and
143 .BR repl .
144 This profile entry overrides the $VISUAL and $EDITOR environment variables,
145 but gets overridden by the $MMHEDITOR environment variabel.
146 (profile, default: vi)
147 .RE
148 .PP
149 .BR Pager :
150 more
151 .RS 5
152 This is the program used by
153 .B mhl
154 to page the
155 .B mhl
156 formatted message when displaying to a terminal.  It is also the default
157 program used by
158 .B show
159 to display message bodies (or message parts) of type text/plain.
160 This profile entry overrides the $PAGER environment variable, but gets
161 overridden by the $MMHPAGER environment variable.
162 (profile, default: more)
163 .RE
164 .PP
165 .BR Sendmail :
166 /usr/sbin/sendmail
167 .RS 5
168 The path name to the
169 .B sendmail
170 program, used by
171 .BR spost
172 to send mail.
173 (profile, default: %sendmailpath%)
174 .RE
175 .PP
176 .BR Attachment-Header :
177 Attach
178 .RS 5
179 The (pseudo) header in draft messages, that contains files to be attached
180 to the message on sending.
181 If you like to type a lot, name it `X-MH-Attachment'.
182 (profile, default: `Attach')
183 .RE
184 .PP
185 .BR Sign-Header :
186 Sign
187 .RS 5
188 The (pseudo) header in draft messages, that requests the message to be
189 signed automatically by
190 .BR send ,
191 using
192 .BR mhsign .
193 If you like to type a lot, name it `X-MH-Sign-This-Message'.
194 (profile, default: `Sign')
195 .RE
196 .PP
197 .BR Enc-Header :
198 Enc
199 .RS 5
200 The (pseudo) header in draft messages, that requests the message to be
201 signed and encrypted by
202 .BR send ,
203 using
204 .BR mhsign .
205 If you like to type a lot, name it `X-MH-Encrypt-This-Message'.
206 (profile, default: `Enc')
207 .RE
208 .PP
209 .BR Mime-Type-Query :
210 file \-b \-\-mime
211 .RS 5
212 A command that prints the MIME type of a given file.
213 The file name is appended to the command line.
214 Note: Older versions of file(1) won't generate the desired output.
215 file-4.26, for instance, omits a required semicolon.
216 file-5.04 is known to work.
217 Alternatively, you can use
218 .BR print\-mimetype ,
219 which is part of mmh, but guesses MIME types by file name extensions only.
220 .RE
221 .PP
222 .BR Msg\-Protect :
223 0644
224 .RS 5
225 An octal number which defines the permission bits for new message files.
226 See
227 .BR chmod (1)
228 for an explanation of the octal number.
229 (profile, default: 0600)
230 .RE
231 .PP
232 .BR Folder\-Protect :
233 0750
234 .RS 5
235 An octal number which defines the permission bits for new folder
236 directories.  See
237 .BR chmod (1)
238 for an explanation of the octal number.
239 (profile, default: 0700)
240 .RE
241 .PP
242 .IR program :
243 .I default switches
244 .RS 5
245 Sets default switches to be used whenever the mmh program
246 .I program
247 is invoked.  For example, one could override the `Editor:' profile
248 component when replying to messages by adding a component such as:
249 .PP
250 .RS 5
251 repl: \-editor /bin/ed
252 .RE
253 .PP
254 (profile, no defaults)
255 .RE
256 .PP
257 .IB lasteditor "-next:"
258 .I nexteditor
259 .RS 5
260 Names `nexteditor' to be the default editor after using
261 `lasteditor'.  This takes effect at `What now?' prompt
262 in
263 .BR comp ,
264 .BR dist ,
265 .BR forw ,
266 and
267 .BR repl .
268 After editing
269 the draft with `lasteditor', the default editor is set to be
270 `nexteditor'.  If the user types `edit' without any
271 arguments to `What now?', then `nexteditor' is used.
272 (profile, no default)
273 .RE
274 .PP
275 .BR Folder\-Stack :
276 .I folders
277 .RS 5
278 The contents of the folder-stack for the
279 .B folder
280 command.
281 (context, no default)
282 .RE
283 .PP
284 .BR Alternate\-Mailboxes :
285 mh@uci\-750a, bug-mh*
286 .RS 5
287 Tells
288 .B repl
289 and
290 .B scan
291 which addresses are really yours.
292 In this way,
293 .B repl
294 knows which addresses should be included in the
295 reply, and
296 scan
297 knows if the message really originated from you.
298 Addresses must be separated by a comma, and the hostnames listed should
299 be the `official' hostnames for the mailboxes you indicate, as
300 local nicknames for hosts are not replaced with their official site names.
301 For each address, if a host is not given, then that address on any host is
302 considered to be you.  In addition, an asterisk (`*') may appear at either
303 or both ends of the mailbox and host to indicate wild-card matching.
304 (profile, default: your user-id)
305 .RE
306 .PP
307 .BR Aliasfile :
308 aliases
309 .I other-alias
310 .RS 5
311 Indicates aliases files for
312 .BR ali ,
313 .BR send .
314 and
315 .BR spost .
316 (profile, no default)
317 .RE
318 .PP
319 .BR Draft\-Folder :
320 drafts
321 .RS 5
322 Changes the default draft folder.  Read the
323 .BR mh\-draft (7)
324 man page for details. (profile, default: +drafts)
325 .RE
326 .PP
327 .BR Trash\-Folder :
328 trash
329 .RS 5
330 Changes the default folder for removed messages.  Read the
331 .BR rmm (1)
332 man page for details.
333 (profile, default: +trash)
334 .RE
335 .PP
336 .BI digest\-issue\- list :
337 1
338 .RS 5
339 Tells
340 .B forw
341 the last issue of the last volume sent for the digest
342 .IR list .
343 (context, no default)
344 .RE
345 .PP
346 .BI digest\-volume\- list :
347 1
348 .RS 5
349 Tells
350 .B forw
351 the last volume sent for the digest
352 .IR list .
353 (context, no default)
354 .RE
355 .PP
356 .BR MailDrop :
357 \&.mail
358 .RS 5
359 Tells
360 .B inc
361 your maildrop, if different from the default.  This is
362 superseded by the environment variable
363 .BR $MAILDROP .
364 (profile, default: %mailspool%/$USER)
365 .RE
366 .PP
367 .BR Signature :
368 RAND MH System (agent: Marshall Rose)
369 .RS 5
370 Tells
371 .B send
372 your mail signature.  This is superseded by the
373 environment variable
374 .BR $SIGNATURE .
375 If
376 .B $SIGNATURE
377 is not set and this profile entry is not present, the `gcos' field of
378 the \fI/etc/passwd\fP file will be used.
379 Your signature will be added to the address
380 .B send
381 puts in the `From:' header; do not include an address in the
382 signature text.  (profile, no default)
383 .RE
384
385 .SS "Process Profile Entries"
386 The following profile elements are used whenever an
387 .B nmh
388 program invokes some other program such as
389 .BR more .
390 The profile can be used to select alternate programs if the
391 user wishes.  The default values are given in the examples.
392 .RE
393 .PP
394 .BR listproc :
395 show
396 .RS 5
397 This program is used to list the contents of a message in response
398 to the
399 .B list
400 and
401 .B display
402 directive at the `What now?' prompt.
403 The absolute pathname of the message to list will be appended to
404 the command line given.
405 .RE
406 .PP
407 .BR whatnowproc :
408 %bindir%/whatnow
409 .RS 5
410 This is the program invoked by
411 .BR comp ,
412 .BR forw ,
413 .BR dist ,
414 and
415 .B repl
416 to query about the disposition of a composed draft message.
417 .RE
418
419 .SS "Environment Variables"
420 The operation of
421 .B mmh
422 and its commands it also controlled by the
423 presence of certain environment variables.
424 .PP
425 Many of these environment variables are used internally by the
426 `What now?' interface.  It's amazing all the information
427 that has to get passed via environment variables to make the
428 `What now?' interface look squeaky clean to the
429 .B mmh
430 user, isn't it?  The reason for all this is that the
431 .B mmh
432 user
433 can select
434 .B any
435 program as the
436 .IR whatnowproc ,
437 including
438 one of the standard shells.  As a result, it's not possible to pass
439 information via an argument list. The convention is that environment
440 variables whose names are all upper-case are user-settable; those
441 whose names are lower-case only are used internally by mmh and should
442 not generally be set by the user.
443 .PP
444 If the
445 .B WHATNOW
446 option was set during
447 .B mmh
448 configuration, and
449 if this environment variable is set, then if the commands
450 .BR refile\ ,
451 .BR send
452 or
453 .BR show
454 are not given any `msgs'
455 arguments, then they will default to using the file indicated by
456 .BR mh\-draft (7).
457 This is useful for getting the default behavior
458 supplied by the default
459 .IR whatnowproc .
460 .PP
461 .B $MMH
462 .RS 5
463 With this environment variable, you can specify an alternative
464 mmh directory. Personal mmh configuration files are located relative to
465 the mmh directory.
466 Non-absolute values are relative to the home directory.
467 This is one of the very few exceptions in
468 .B mmh
469 where non-absolute pathnames are not considered relative to the user's
470 mmh directory.
471 .RE
472 .PP
473 .B $MMHP
474 .RS 5
475 With this environment variable, you can specify a profile
476 other than
477 .I $HOME/.mmh/profile
478 to be read by the
479 .B mmh
480 programs
481 that you invoke.  If the value of
482 .B $MMHP
483 is not absolute, it will be presumed to start from the mmh directory.
484 .RE
485 .PP
486 .B $MMHC
487 .RS 5
488 With this environment variable, you can specify a
489 context other than the normal context file (as specified in
490 the profile).  As always, unless the value of
491 .B $MMHC
492 is absolute, it will be presumed to start from your mmh directory.
493 .RE
494 .PP
495 .B $MM_CHARSET
496 .RS 5
497 With this environment variable, you can specify
498 the native character set you are using.  You must be able to display
499 this character set on your terminal.
500 .PP
501 This variable is checked to see if a RFC-2047 header field should be
502 decoded (in
503 .BR inc ,
504 .BR scan ,
505 .BR mhl ).
506 This variable is
507 checked by
508 .B show
509 to see if the
510 .I showproc
511 or
512 .I showmimeproc
513 should
514 be called, since showmimeproc will be called if a text message uses
515 a character set that doesn't match
516 .BR $MM_CHARSET .
517 This variable is
518 checked by
519 .B show
520 for matches against the charset parameter
521 of text contents to decide it the text content can be displayed
522 without modifications to your terminal.  This variable is checked by
523 .B mhbuild
524 to decide what character set to specify in the charset
525 parameter of text contents containing 8\-bit characters.
526 .PP
527 When decoding text in such an alternate character set,
528 .B mmh
529 must be able to determine which characters are alphabetic, which
530 are control characters, etc.  For many operating systems, this
531 will require enabling the support for locales (such as setting
532 the environment variable
533 .B $LC_CTYPE
534 to iso_8859_1).
535 .RE
536 .PP
537 .B $MAILDROP
538 .RS 5
539 This variable tells
540 .B inc
541 the default maildrop. This supersedes the `MailDrop' profile entry.
542 .RE
543 .PP
544 .B $SIGNATURE
545 .RS 5
546 This variable tells
547 .B send
548 and
549 .B post
550 your mail signature. This supersedes the `Signature' profile entry.
551 .RE
552 .PP
553 .B $HOME
554 .RS 5
555 This variable tells all
556 .B mmh
557 programs your home directory
558 .RE
559 .PP
560 .B $SHELL
561 .RS 5
562 This variable tells
563 .B bbl
564 the default shell to run
565 .RE
566 .PP
567 .B $MMHEDITOR
568 .br
569 .B $VISUAL
570 .br
571 .B $EDITOR
572 .RS 5
573 These variables (in descending priority) define the default editor to use.
574 .RE
575 .PP
576 .B $MMHPAGER
577 .br
578 .B $PAGER
579 .RS 5
580 These variables (in descending priority) define the default pager to use.
581 .RE
582 .PP
583 .B $TERM
584 .RS 5
585 This variable tells
586 .B mmh
587 your terminal type.
588 .PP
589 The environment variable
590 .B $TERMCAP
591 is also consulted.  In particular,
592 these tell
593 .B scan
594 and
595 .B mhl
596 how many columns wide your terminal is.  They also tell
597 .B mhl
598 how many
599 lines long your terminal screen is.
600 .RE
601 .PP
602 .B $mhdraft
603 .RS 5
604 This is the path to the working draft.
605 .PP
606 This is set by
607 .BR comp ,
608 .BR dist ,
609 .BR forw ,
610 and
611 .B repl
612 to tell the
613 .I whatnowproc
614 which file to ask `What now?'
615 questions about.
616 .RE
617 .PP
618 .B $mhaltmsg
619 .RS 5
620 .B dist
621 and
622 .B repl
623 set
624 .B $mhaltmsg
625 to tell the
626 .I whatnowproc
627 about an alternate message associated with the
628 draft (the message being distributed or replied to).
629 It is also set during edit sessions so you can peruse the
630 message being distributed or replied to.
631 This variable replaces the older
632 .B $editalt
633 variable.
634 There used to be a link named `@' in the working directory, pointing
635 to the alternate message, there is no such link anymore.
636 .RE
637 .PP
638 .B $mhdist
639 .RS 5
640 .B dist
641 sets
642 .B $mhdist
643 to tell the
644 .I whatnowproc
645 that message re-distribution is occurring.
646 .RE
647 .PP
648 .B $mheditor
649 .RS 5
650 This is set by
651 .BR comp ,
652 .BR repl ,
653 .BR forw ,
654 and
655 .B dist
656 to tell the
657 .I whatnowproc
658 the user's choice of
659 editor (unless overridden by
660 .BR \-noedit ).
661 .RE
662 .PP
663 .B $mhuse
664 .RS 5
665 This may be set by
666 .BR comp .
667 .RE
668 .PP
669 .B $mhmessages
670 .RS 5
671 This is set by
672 .BR dist ,
673 .BR forw ,
674 and
675 .B repl
676 if annotations are to occur.
677 .RE
678 .PP
679 .B $mhannotate
680 .RS 5
681 This is set by
682 .BR dist ,
683 .BR forw ,
684 and
685 .B repl
686 if annotations are to occur.
687 .RE
688 .PP
689 .B $mhfolder
690 .RS 5
691 This is the folder containing the alternate message.
692 .PP
693 This is set by
694 .B dist
695 and
696 .B repl
697 during edit sessions so you
698 can peruse other messages in the current folder besides the one being
699 distributed or replied to.
700 .RE
701
702 .SH FILES
703 .fc ^ ~
704 .nf
705 .ta \w'%etcdir%/ExtraBigFileName  'u
706 ^$HOME/.mmh~^The user's mmh directory
707 ^or $MMH~^Rather than the standard mmh directory
708 ^$HOME/.mmh/profile~^The user's profile
709 ^or $MMHP~^Rather than the standard profile
710 ^$HOME/.mmh/context~^The user's context
711 ^or $MMHC~^Rather than the standard context
712 ^<folder>/.mh_sequences~^Public sequences for <folder>
713 .fi
714
715 .SH "SEE ALSO"
716 nmh(1), environ(5), mh-sequence(7)
717
718 .SH HISTORY
719 The
720 .I $HOME/.mmh/profile
721 contains only static information, which
722 .B mmh
723 programs will
724 .B NOT
725 update.  Changes in context are made to the
726 .I $HOME/.mmh/context
727 file.
728 This includes, but is not limited to: the `Current\-Folder' entry
729 and all private sequence information.  Public sequence information is
730 kept in each folder in the file determined by the `Mh\-Sequences'
731 profile entry (default is
732 .IR \&.mh_sequences ).
733 .PP
734 The profile may override the path of the
735 .I context
736 file, by specifying a `Context' entry.
737 As a result, you can actually have more than one set of
738 private sequences by using different context files.
739
740 .SH BUGS
741 The shell quoting conventions are not available in the profile.
742 Each token is separated by whitespace.
743 .PP
744 There is some question as to what kind of arguments should be placed
745 in the profile as options.  In order to provide a clear answer, recall
746 command line semantics of all
747 .B mmh
748 programs: conflicting switches
749 (e.g.
750 .B \-header
751 and
752 .BR \-noheader )
753 may occur more than one time on the
754 command line, with the last switch taking effect.  Other arguments, such
755 as message sequences, filenames and folders, are always remembered on
756 the invocation line and are not superseded by following arguments of
757 the same type.  Hence, it is safe to place only switches (and their
758 arguments) in the profile.
759 .PP
760 If one finds that an
761 .B mmh
762 program is being invoked again and again
763 with the same arguments, and those arguments aren't switches, then there
764 are a few possible solutions to this problem.  The first is to create a
765 (soft) link in your
766 .I $HOME/bin
767 directory to the
768 .B mmh
769 program
770 of your choice.  By giving this link a different name, you can create
771 a new entry in your profile and use an alternate set of defaults for
772 the
773 .B mmh
774 command.  Similarly, you could create a small shell script
775 which called the
776 .B mmh
777 program of your choice with an alternate set
778 of invocation line switches (using links and an alternate profile entry
779 is preferable to this solution).
780 .PP
781 Finally, the
782 .B csh
783 user could create an alias for the command of the form:
784 .PP
785 .RS 5
786 alias cmd 'cmd arg1 arg2 ...'
787 .RE
788 .PP
789 In this way, the user can avoid lengthy type-in to the shell, and still
790 give
791 .B mmh
792 commands safely.  (Recall that some
793 .B mmh
794 commands
795 invoke others, and that in all cases, the profile is read, meaning that
796 aliases are disregarded beyond an initial command invocation)