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