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