home *** CD-ROM | disk | FTP | other *** search
/ ftp.freefriends.org / ftp.freefriends.org.tar / ftp.freefriends.org / arnold / Source / mush.rstevens.tar.gz / mush.tar / README < prev    next >
Text File  |  1992-10-30  |  34KB  |  690 lines

  1. /* @(#)README        (c) copyright 2/1/92    (Dan Heller) */
  2.  
  3. Authors:
  4.     Dan Heller
  5.     Bart Schaefer
  6.  
  7. Network addresses:
  8.     argv@z-code.com        argv@sun.com        argv@ora.com
  9.     schaefer@zigzag.z-code.com            schaefer@cse.ogi.edu
  10.  
  11. When sending mail, mail to the addresses in the order given.
  12.  
  13. Contained is the source for "Mail User's Shell" (MUSH), a "Mail User
  14. Agent" (MUA) that is designed to manage electronic mail on most UNIX
  15. systems.  That is, mush is used by users to read mail, sort it, edit
  16. it, delete it, or use it to act as an interface to send mail to others.
  17. A Mail Transport Agent (MTA) is the program which mush communicates with
  18. that actually -delivers- mail.
  19.  
  20. Mush is copyright (c) 1986, 1987, 1988, 1989, 1990, 1991 by Dan Heller.
  21. All Rights Reserved.   This software is not in the public domain.
  22.  
  23. Redistribution of the unmodified source code is permitted as long as all
  24. copyright notices remain intact and all other identifying notices remain
  25. in the code and in the binary.  This includes message headers on outgoing
  26. mail and the startup message.  Future releases may extract the release
  27. version from the message headers of mush-originated messages to aid in
  28. implementing features and providing backwards compatibility with previous
  29. versions.  Modification of the source for personal use is permitted.
  30. Modifications sent to the authors are humbly accepted and it is their
  31. prerogative to make the mods official.  Only the "official" sources may be
  32. redistributed and no sale of the code or any part thereof is permitted
  33. without written consent from the authors.  Further, no part of the code
  34. may be used in any other product, free or otherwise, without consent from
  35. the authors.  Distribution of sources containing adaptations of the SunView
  36. interface to XView or to any X11-based interface is expressly prohibited.
  37.  
  38. MUSH IS PROVIDED AS IS, WITHOUT WARRANTY.  AUTHORS HEREBY DISCLAIM
  39. ALL WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
  40. OF FITNESS FOR A PARTICULAR PURPOSE.
  41.  
  42. With that out of the way...
  43.  
  44. Mush runs on various flavors of unix.  To build mush, you should identify
  45. which unix you are running:
  46.  
  47.     SunOS (all versions from 3.5 and higher).
  48.     BSD (versions 4.2 and up, or SunOS earlier than 3.5)
  49.     System-V / Version 7 / System III (Bell Labs)
  50.     Xenix (this might be tricky)
  51.     Hybrids including HP-UX and IRIX (Version 4.0 and up is best)
  52.  
  53. You will need to copy "config.h-dist" to config.h and edit it to reflect
  54. the system dependencies described there.  These consist of "compile-time
  55. definitions and macros."
  56.  
  57. When it comes to "compile-time definitions", you may use one of two methods:
  58.  
  59.     #define DEFINITION    /* in the config.h file */
  60.     -DDEFINITION    /* in your makefile */
  61.  
  62. If the definition is of the form MACRO="string", then use:
  63.  
  64.     #define MACRO string
  65.     -DMACRO=string
  66.  
  67. Note that if you use definitions in the makefile, you should remove the
  68. corresponding definitions from config.h -- if you do not, the config.h
  69. definitions will override the -D definitions.  The compiler will usually
  70. print a warning message if this happens, but the result will still be wrong.
  71.  
  72. ---------------
  73. Which makefile to use:
  74.  
  75. If you are on a Sun Workstation:
  76.  
  77.     makefile.sun applies only to suns and creates a binary called "mush."
  78.     If the binary ends in "tool", then the graphics (suntools) mode will be
  79.     used by default on invocation.  Otherwise, you must specify -t for
  80.     toolmode on sun workstations.  The SUNTOOL define is used in the
  81.     makefile.sun in order to compile the suntools version.  You DO need
  82.     to be running SunView; old SunWindows (2.0+) no longer works.  Be sure
  83.     to follow the notes in the makefile.sun for SunOS-4.0 machines.
  84.  
  85.     If you know that you're not going to use the suntools mode then you
  86.     should use makefile.bsd so that SUNTOOL won't be defined and unnecessary
  87.     files will not be compiled so the binary will be smaller.
  88.  
  89.     Whether or not you define SUNTOOL, you should define one of SUN_3_5,
  90.     SUN_4_0, or SUN_4_1 depending on your SunOS version.  If SUNTOOL is
  91.     the only thing defined, SUN_4_1 will be used.  If your version of
  92.     SunOS is older than 3.5, you can't use SUNTOOL, so go to makefile.bsd.
  93.     NOTE: Even though SUN_4_1 is the default, NO_COMMAS is not defined
  94.     unless you explicitly define SUN_4_1 or (NO_COMMAS itself).
  95.  
  96.     You may also choose to define NO_WALK_MENUS to disable walking menus
  97.     for file names selectable from the "folder" and "save" command items.
  98.  
  99. If you are on a BSD UNIX machine:
  100.  
  101.     You should use the makefile.bsd makefile.
  102.  
  103. If you are using XENIX:
  104.  
  105.     There is one makefile for xenix: makefile.xenix.  However, SCO-xenix
  106.     runs on either 80286 or 80386 architectures.  This makefile has been
  107.     tuned for SCO's version of xenix.  This does not mean that it won't
  108.     work under other xenix versions -- however, some changes may have to
  109.     be made by hand.  If your xenix release is sco-xenix 2.2 or higher
  110.     then you must define USG. The libraries to use may be -ltinfo instead
  111.     of -lcurses -ltermlib.  This is because the curses package may use
  112.     termio instead of the sgtty data structure.  If you want to use termio
  113.     anyway, even if you're on an older xenix system (that supports termio),
  114.     then you may define USG anyway.
  115.  
  116.     Follow the hints in the makefile.xenix for compiling for 286 systems
  117.     or 386 systems.  It is *very likely* that the CFLAGS will have to be
  118.     modified -- specifically, the model size and the stack size options.
  119.     You should be very familiar with your xenix to know how to tune this
  120.     properly.
  121.  
  122. If you are on a System-V Bell labs machine:
  123.  
  124.     makefile.sys.v is for unix machines that are not running any flavor of
  125.     BSD and probably running a system-v flavor of unix -- this defines USG
  126.     so that termio will be used.
  127.  
  128.     True System V Release 2 systems should define SVR2 to get full support
  129.     for dot-locking (see DOT_LOCK below).  The default for SYSV is SVR3.
  130.     See below for SVR4.  Some SVR3 machines (e.g. Motorola SysV/88) are
  131.     close enough to SVR4 that you may need to use the libraries described
  132.     below.  However, this does not normally mean you should define SVR4.
  133.  
  134.     SCO UNIX V.2.0 users should add -lx to OTHERLIBS in makefile.sys.v.
  135.     It may also be desirable to change MANDIR to /usr/man/man.C and
  136.     MANEXT to C in the makefile.  SCO UNIX V.3.2 users should avoid -lx
  137.     like the plague, and should define DIRECTORY and SELECT instead.
  138.  
  139.     MicroPort sys-v users should probably remove the -O compiler option
  140.     from the makefile, and may have trouble with the msg_bit() macro
  141.     defined in mush.h.  It should be fairly trivial to generate an
  142.     equivalent function.
  143.  
  144. If you have System V Release 4:
  145.  
  146.     Use makefile.sys.v as above, but define SVR4 and DIRECTORY.  You
  147.     should also change
  148.     LIBS=         -lcurses -lPW
  149.     to
  150.     LIBS=         -lcurses -lgen
  151.  
  152. If you are using Ultrix:
  153.  
  154.     Start with makefile.bsd.
  155.  
  156.     For Ultrix 2.2, change LIBS in makefile.bsd from
  157.     LIBS= -lcurses -ltermlib
  158.     to 
  159.     LIBS= -lcurses -ltermcap
  160.  
  161.     For Ultrix V3.0, use the standard makefile.bsd LIBS, but add
  162.     -DSIGRET=void
  163.     to the CFLAGS, or add
  164.     #define SIGRET void
  165.     to config.h (see discussion below).
  166.  
  167.     Ultrix V4.0 is generally the same as 3.0 but may exhibit problems with
  168.     alignment errors in the environment of forked children (e.g. the MTA).
  169.     The only workaround is to replace the popen(3) function with one of
  170.     your own that passes the environment explicitly via execve().  If you
  171.     never use mush's "setenv" command you'll probably never see this.
  172.  
  173. If you are using HP-UX:
  174.  
  175.     Use makefile.hpux.
  176.  
  177.     Versions 6.5 and 7.0 of HP-UX (not to be confused with the same
  178.     version numbers of Mush) have the Berkeley-style directory access
  179.     libraries.  Those using older versions should omit -DDIRECTORY
  180.     from the CFLAGS.  This will cause the portable directory access
  181.     routines in that file to be compiled.
  182.  
  183. If you are using Apollo Domain/OS:
  184.  
  185.     Good luck.
  186.  
  187.     Actually, there is some hope for you, but best if you have Domain/OS
  188.     version 10.3.x with the 4.3 BSD environment installed.  Included with
  189.     the distribution as of version 7.2.4 is apollo.shar, which contains
  190.     patches, auxiliary files, and makefile.apollo to put them all together.  
  191.     Run "sh apollo.shar" and "patch -N -p1 apollo.patch" (or patch by hand)
  192.     then make using makefile.apollo.  You *should* be able to make this
  193.     procedure work under the System V environment, but ....
  194.  
  195. If you are using Apple A/UX:
  196.  
  197.     Use makefile.sys.v, and add -DAUX -DDIRECTORY to CFLAGS.
  198.  
  199.     Mush uses 4.2-BSD compatible signal handling when AUX is defined.
  200.  
  201. If you have SGI Iris or Indigo workstations:
  202.  
  203.     Silicon Graphics IRIX workstations should use makefile.sys.v.  If you
  204.     have IRIX version 3.x, you're pretty much on your own.
  205.  
  206.     Add -DDIRECTORY to prevent the portable directory routines from being
  207.     compiled in.  You may optionally add -DSELECT if you want to use the BSD
  208.     style select() function.  If you do this, you must also add -lbsd to the
  209.     OTHERLIBS macro definition in the Makefile.
  210.     
  211.     For IRIX 4.x you should add -DIRIX4 to CFLAGS and use:
  212.     CC= cc -signed -cckr
  213.     OTHERLIBS= -lsun -lmalloc
  214.     Note that -lsun is used in place of -lbsd here.  This provides network
  215.     compatibility with sun workstations, or something like that.  You may
  216.     be able to get by with -lbsd.
  217.  
  218. If you are using a hybrid BSD/SysV system:
  219.  
  220.     You may have to use a combination of many of the defines listed
  221.     throughout this file.  You may also have to add additional libraries
  222.     to the LIBS= in the appropriate makefile.  For example, to use the
  223.     bsd system calls such as select(), getwd(), the directory reading
  224.     routines ...  you may have to define additional parameters such as
  225.     -DSELECT, -DGETWD, -DDIRECTORY, ... and possibly add -lbsd.
  226.  
  227.     MIPS workstations:
  228.  
  229.     These are also hybrid systems that may require additional hand-
  230.     configuration in order to work properly.  There seem to be
  231.     major differences between the last several releases, so your
  232.     milage may vary.  Before RISC/OS 3.2, there are numerous curses
  233.     library bugs, and lock.c should be compiled with BSD defined, but
  234.     everything else should be SYSV.  -DGETWD should be used and -lbsd
  235.     must be added to OTHERLIBS in the Makefile.
  236.  
  237.     For RISC/OS 3.2 and later, start with makefile.bsd, add -DDIRECTORY
  238.     to CFLAGS, and use:
  239.     CC= cc -Wf,-XNd5000 -std0 -systype bsd43
  240.     OTHERLIBS= -lbsd
  241.  
  242. When you decide on an appropriate makefile, _copy_ it to a new file called
  243. Makefile _before_ making any of local changes.  Please read the following
  244. sections for addtional configuration information.  In addition to changing
  245. compilation options as appropriate, you should examine the rules for the
  246. "install:" target.  Running "make" will NOT use this target by default;
  247. it is provided for your convenience only.
  248. ---------------
  249.  
  250. Your Mail Transport Agent:
  251. Sendmail:
  252.     Mush was originally designed to use sendmail as the Mail Transport Agent.
  253.     However, other MTA's will work.  The MTA you use should be defined in
  254.     config.h under the MAIL_DELIVERY macro define. By default,
  255.         /usr/lib/sendmail -i
  256.     is used -- the option, -i, tells sendmail not to accept "." on a line
  257.     by itself as an end-of-file marker.  This has been obsleted by "-oi",
  258.     but "-i" still works and is backwards compatible with older sendmails.
  259.  
  260.     If you are compiling on a machine that has the Rand MH mail system as
  261.     its native user agent (machines at Rand Corp. and Tektronix boxes
  262.     running Utek 3.x or 4.x, among others) your system mailbox may be in
  263.     MMDF format even though your MTA is sendmail.  Define MMDF to parse
  264.     the mailbox, but also define M_EXECMAIL to use sendmail-style protocol
  265.     for talking to the MTA.  However, do NOT use /usr/lib/mail/execmail
  266.     as the MAIL_DELIVERY.  Make sure MAIL_DELIVERY is /usr/lib/sendmail
  267.     as usual, and that the VERBOSE_ARG, METOO_ARG, and MTA_EXIT macros
  268.     are the ones associated with the sendmail MAIL_DELIVERY.
  269.  
  270. Delivermail:
  271.     Some mailers such as delivermail and MMDF use special strings to separate
  272.     messages stored in a folder.  Older delivermail versions would use "^C".
  273.     Whatever your system uses, if it is NOT "From " (just the first 5 chars
  274.     on a line matching "From "), then this string should be defined in
  275.     config.h with the MSG_SEPARATOR macro.
  276.  
  277. MMDF:
  278.     NOTE: MMDF sites can define MMDF and not worry about MSG_SEPARATOR.  See
  279.     config.h-dist if you run MMDF.
  280.  
  281.     Since MMDF can deliver users' mail in their home directories, there is
  282.     a define to specify this option: -DHOMEMAIL
  283.  
  284.     Since MMDF uses its own libraries to do file locking, you should add the
  285.     appropriate library to the LIBS list in your makefile.
  286.  
  287.     MMDF sites should probably NOT define PICKY_MAILER (see below).
  288.  
  289.     If you are using SCO UNIX 3.2 and the MMDF "submit" program gives you
  290.     trouble because of file permissions, define M_EXECMAIL to use the
  291.     execmail program instead.
  292.     
  293.     Another reason you may need execmail is that under MMDF, the system
  294.     knows itself only by its hostname; other names, including the fully-
  295.     qualified domain name, have to be specified in the local channel file.
  296.     If this is not done, mail From: user@host.domain will be returned with
  297.     a "no valid author spec" message.  However, it won't fail if the mail
  298.     is submitted by root; /usr/lib/mail/execmail is setuid root, so mail
  299.     submitted that way will succeed.  You should only resort to M_EXECMAIL
  300.     if you are unable to change the MMDF permissions or cannot edit the
  301.     channel file.
  302.  
  303. Smail:
  304.     If you are using smail-2.x you need to define NO_COMMAS and PICKY_MAILER.
  305.     On a SYSV system, define MAIL_DELIVERY as /bin/rmail.
  306.  
  307. POP:
  308.     Define POP3_SUPPORT.  You may also need to define HOMEMAIL; see config.h
  309.     for additional configuration of HOMEMAIL.
  310.  
  311.     You will still need to define other macros appropriately for the
  312.     transport agent that is used to *send* mail from your machine.
  313.  
  314. All others:
  315.     Chances are, your MTA uses the "From " format to separate messges in
  316.     a folder.  This includes, /bin/mail, rmail, smail, execmail, and so on.
  317.     Unless you *know* otherwise, assume this to be the case with your MTA.
  318.  
  319.     If no MSG_SEPARATOR is specified, what mush looks for is a pattern of
  320.     From <string> <date format>
  321.     The "string" is usually the return address of the sender and the date
  322.     format is supposed to be in ctime(3) format.  Even still, some MTAs
  323.     don't conform completely to this standard and vary slightly in
  324.     implementation.  The function load_folder() (which reads in messages)
  325.     contains a scanf which looks for this format to verify that this is
  326.     indeed a new message being scanned.  If you install mush and find that
  327.     you are entering a shell, but mush indicates there are no messages in
  328.     the folder, it could be that you have a weird "From " line format and
  329.     the scanf() call needs to be either modified or removed.
  330.  
  331.     Machines that use mail transfer agents that *do not* use a colon-less
  332.     "From " line as a message separator should #define in config.h the string
  333.     MSG_SEPARATOR.  Since this string is usually control characters, you
  334.     need to specify actual ascii values for those characters.  Users of MMDF,
  335.     for example, may use "\001\001\001\001" since some mmdf versions use four
  336.     control-A's to separate messages.  This message separator assumes that
  337.     there is a carriage return at the end of the string.  Systems that use
  338.     sendmail need not concern themselves with this define.  MSG_SEPARATOR
  339.     should not contain a newline, except for MMDF.  The MSG_SEPARATOR must
  340.     match a complete line; a prefix will not work.
  341.  
  342. #defines specifically for your MTA:
  343.  
  344. MSG_SEPARATOR
  345.     See the discussion above.
  346.  
  347. MAILDIR
  348.     This is automatically defined as /usr/mail for SYSV prior to SVR4 and
  349.     as /usr/spool/mail for BSD and SVR4.  However, some systems are unusual,
  350.     so you may need to define this explicitly.
  351.  
  352. MAIL_DELIVERY
  353.     This is the program that mush invokes to send your messages off to your
  354.     list of recipients.  It defaults to "sendmail" (or "submit" for MMDF).
  355.     See notes below on modifying this via M_EXECMAIL for misconfigured MMDFs.
  356.     For vanilla SYSV, redefine MAIL_DELIVERY as /bin/mail or /bin/rmail.
  357.  
  358. UUCP
  359.     This should be defined if your MTA does not automatically create a
  360.     From: header *and* your machine talks to other computers via uucp.
  361.     If defined, the From: line created specifies the user's address in
  362.     UUCP format (host!user).  Otherwise, arpa format is used (user@host).
  363.     Also, return addresses generated from RFC822 route specs will be put
  364.     in UUCP format with a complete path.
  365.  
  366. MTA_EXIT
  367.     The exit code of a successful delivery of a message by your MTA.
  368.     This is typically 0, but MMDF sites should define 9 (see config.h-dist).
  369.  
  370. NO_COMMAS
  371.     If your mailer does *NOT* like commas between addresses (smail sites,
  372.     xenix and sys-v machines), then you should define NO_COMMAS.  Otherwise,
  373.     you will get mailer-daemon [type] messages back when trying to send mail
  374.     to multiple users.  Sendmail should not normally need this, but early
  375.     versions of SunOS 4.1 were shipped with a broken sendmail configuration
  376.     and require NO_COMMAS anyway.
  377.  
  378. VERBOSE_ARG
  379.     If your mailer does NOT have a verbose option, then you should not have
  380.     VERBOSE_ARG defined.  Otherwise, define it to be whatever the verbose
  381.     argument is for your mailer.  The default is -v.
  382.  
  383. METOO_ARG
  384.     Sendmail uses the -m argument to say, "metoo" -- when sending to sendmail
  385.     aliases (e.g. mailing lists), sendmail will expand the alias, but if your
  386.     address appears in the expansion, you are excluded from getting your own
  387.     mail.  However, if you have the variable metoo set with your variables,
  388.     then the metoo argument is passed to sendmail to say, "I know I'm on this
  389.     mailing list, but send me a copy of my message even tho I sent it."  For
  390.     sendmail, this is -m.  If your mailer uses something else, then define
  391.     METOO_ARG in the config.h file.  If you don't have it (sys-v), then this
  392.     should not be defined.
  393.  
  394. PICKY_MAILER
  395.     Most RFC822 compliant mailers (sendmail) will add the headers From:
  396.     and Date: on outgoing mail.  If the user or UA sends these headers,
  397.     most MTAs will not append them automatically.  However, there are
  398.     certain MTAs which will not allow this -- these "picky mailers" will
  399.     precede such headers with a '>' and make the headers very ugly and
  400.     somewhat redundant or contradictory.  It's hard to determine whether
  401.     or not your MTA will do this without actually sending mail to yourself.
  402.     However, it is advised to set this *unless* your mailer is not RFC822-
  403.     compliant (used to be defined by OLD_MAILER in previous mush releases).
  404.  
  405.     PICKY_MAILER should NOT normally be defined when MMDF is defined.
  406.  
  407. DOT_LOCK
  408.     Different systems use different locking mechanisms.  By default,
  409.     mush uses one of flock(), locking(), or lockf() (depending on your
  410.     system).  Some  systems use a file called the same name as the file
  411.     you're locking with an appended ".lock" at the end (some Xenix's use
  412.     /tmp/$USER.mlk).  If you define DOT_LOCK, mush will first check for the
  413.     .lock file.  If it exists, mush loops until it goes away and then mush
  414.     creates it mode 600.  Regardless of whether you use dot-locking, mush
  415.     will continue to try to use flock(), or whatever.
  416.  
  417.     If your MTA is smail-2.x, you should define DOT_LOCK regardless of
  418.     your operating system type.  DOT_LOCK may also be helpful in preventing
  419.     corruption of NFS-mounted mail spools, but only if the MTA can be made
  420.     to also use this protocol.
  421.  
  422.     Dot-locking requires mush to have write access to the directory where
  423.     your mailbox exists.  Normally, this directory isn't writable by the
  424.     average user, so to do this you may have to sgid mush to the group id
  425.     of the owner of that directory.  Mush will get the effective gid at the
  426.     beginning of the program and immediately reset it to your real gid until
  427.     the time it needs to lock the file occurs.  It changes back to the sgid,
  428.     locks, then returns to normal.  There shouldn't be a security problem.
  429.  
  430.     If you don't know what any of this means, ignore DOT_LOCK.
  431.  
  432.     Another warning is that some MTA's don't even follow their own protocol.
  433.     System V, it has been reported, creates the .lock file without checking
  434.     to see if it exists (therefore ruining someone else's lock).
  435.  
  436. ---------------
  437. Signals:
  438.  
  439. SIGRET
  440.     When signals occur in unix, the program can identify a function to be
  441.     called whenever a specific signal interrupts the process.  That function
  442.     returns one of two types in unix: int and void.  Because the return value
  443.     of this function is always ignored, many unix systems are converting
  444.     their definition of this function from int to void.  Mush has a define:
  445.     SIGRET which defines what the function should return.
  446.  
  447.     By default, SIGRET is defined to be "int", except for SunOS4.0, where
  448.     it is defined to be "void".
  449.  
  450.     Some System-V, some Ultrix and some Xenix machines should also define
  451.     SIGRET to be void.  If you don't know, leave it alone.  If you guess
  452.     wrong, you will get compiler "warnings" on lines that read:
  453.     on_intr();
  454.     off_intr();
  455. ---------------
  456. Memory allocation:
  457.  
  458. INTERNAL_MALLOC
  459.     Mush depends on the xfree() function to detect invalid pointers, so
  460.     that they will not be incorrectly passed to free().  Some system
  461.     organizations make this very difficult, if not impossible.  80286-based
  462.     machines in certain memory models, AT&T 3b2s and 3b15s, and others have
  463.     these difficulties; VAX, Sun, Sequent, Apollo, and most 680x0 and many
  464.     80386-based machines do not.  Changes have been made to xfree() to
  465.     handle the AT&T machines, but if you aren't sure about your machine,
  466.     or if you get unexpected segmentation faults, define INTERNAL_MALLOC.
  467.     SysV users may want to define this anyway, because the internal malloc
  468.     may be faster than the default malloc(3).
  469.  
  470.     By default, INTERNAL_MALLOC is undefined.
  471.  
  472. ---------------
  473. Miscellaneous defines:
  474.  
  475. TIMEZONE
  476.     If this is defined, the string it is defined to is used as your timezone
  477.     regardless of what the system thinks your timezone is.  This is intended
  478.     for systems which have no functions for determining the timezone.  On
  479.     newer Gould BSD 4.3 systems, it is safe to use
  480.         #define TIMEZONE T->tm_zone
  481.     On other systems, it is better to define TIMEZONE as a string, e.g.
  482.         #define TIMEZONE "PST"    /* Or "-0800" for international */
  483.  
  484. DAYLITETZ
  485.     This should be defined to your Daylight Savings Time timezone string if
  486.     and only if you also define TIMEZONE (above).  Do not define this if you
  487.     use the Gould tm_zone.
  488.  
  489. USA
  490.     If you are in the United States of America or nearby parts of North
  491.     America and you want your timezones to be generated as three-letter
  492.     acronyms (EST, CDT, etc.) you can define USA.  Otherwise, generated
  493.     timezones will be expressed as offsets from Universal Time (GMT).
  494.     It is recommended that you avoid defining USA.  Mush will do its best
  495.     to comprehend TLA timezones on incoming mail, regardless of USA.
  496.  
  497. VPRINTF
  498.     This should be defined if your system has the vprintf functions. You
  499.     *have* these functions if you are running:
  500.     o system V
  501.     o xenix
  502.     o Sun release 3.0 or higher.
  503.     o BSD 4.3-tahoe, 4.3-reno, or 4.4.
  504.     If you are still not sure, try the following command from your shell:
  505.  
  506.     % ar t /lib/libc.a | grep 'v.*printf'
  507.  
  508.     If you have it, you'll probably get something like
  509.     vprintf.o
  510.     vsprintf.o
  511.     as output.  If you don't have it, you won't have any output.  If your
  512.     main C-libraries are not in /lib/libc.a, then find where they are and
  513.     try the same command using that file.  BSD machines before 4.3-tahoe
  514.     do not have vprintf().
  515.  
  516. GETWD
  517.     This should be defined if your system uses the getwd() system call, as
  518.     opposed to getcwd(), and your system is not a BSD system (e.g. MIPS).
  519.  
  520. ---------------
  521. The sprintf() function:
  522.     If you *know* your system's sprintf returns a char *, you can remove the
  523.     #define sprintf Sprintf
  524.     in strings.h.  Careful, not all BSD4.3 machines are alike!  If you don't
  525.     know for sure, don't change this define.
  526.  
  527. ---------------
  528. Regular expression defines:
  529.     Some systems have regcmp/regex as their regular expression matching
  530.     routines while others have re_comp/re_exec -- If you have regcmp,
  531.     you should define REGCMP so that you will use the routines regcmp()
  532.     and regex() as the regular expression composer/parser.  REGCMP should
  533.     normally be defined for xenix and System-V Unix.  If you don't have
  534.     REGCMP defined, then the routines re_comp() and re_exec() are used
  535.     (this is the default for mush).
  536.  
  537.     Note that some systems do not have either set of routines in the default
  538.     libraries.  You must find the library to use and add it to the list of
  539.     libraries to use.  If this is the case, your link will fail with the
  540.     errors that regex and re_comp are undefined functions.  Read your man
  541.     page for regex(3) to find where to locate those libraries.
  542.  
  543. ---------------
  544. The Berkeley directory(3) routines:
  545.     If your system has directory access routines compatible with BSD Unix
  546.     (opendir, readdir, closedir) you should define DIRECTORY in either the
  547.     makefile or config.h.  This is already reflected in the makefile.hpux.
  548.     See the notes above for other Sys-V-ish systems that may require this.
  549.     If DIRECTORY is not defined, replacement routines in glob.c are used.
  550.  
  551. ---------------
  552. The select() function call:
  553.     Mush uses select() to implement macros, mappings and bindings.  If your
  554.     system is a BSD system, then this is defined for you.  However, with the
  555.     advent of hybrid bsd/sys-v systems, you may not be able to set BSD, but
  556.     you know you still have select() --for such systems, define SELECT in
  557.     your makefile or in config.h.  For example, SGI systems require this.
  558.  
  559.     Newer xenix machines have this as so some system-v machines.  If you don't
  560.     define one of BSD or SELECT, mush will use another function although not
  561.     as optimal as select().
  562.  
  563. ---------------
  564. The default Mushrc startup file:
  565.     A default mushrc should be installed, containing local configuration
  566.     information (aliases or variable settings).  This can also provide
  567.     first-time users with a more friendly interface.  UCB mail's default
  568.     Mail.rc works, but no default file works also.  The location of the
  569.     default file should be defined in config.h.  To have no default Mushrc,
  570.     set the default to /dev/null.
  571.  
  572.     The Mushrc file supplied with the mush distribution is heavily commented
  573.     and uses several of mush's features in setting up the interface.  THIS
  574.     FILE IS NOT INTENDED TO BE USED WITHOUT LOCAL MODIFICATIONS!  If you
  575.     use this file, you should modify it so settings of the variables MAILRC,
  576.     ALTERNATE_RC, and ALT_DEF_RC correspond to the definitions in your
  577.     config.h file.  You should also examine and possibly delete the help
  578.     section for new users (creates the .mushuser/.mushexpert files), which is
  579.     included mainly as an example.  The Mushrc is designed to source the
  580.     ALT_DEF_RC, which is usually equivalent to the UCB mail Mail.rc.  This
  581.     eases the transition to mush for UCB sites, and allows aliases and
  582.     settings that should apply to both mush and mail to reside in a single
  583.     file.  UUCP sites may also want to uncomment the line which sets the
  584.     auto_route and known_hosts variables; be sure to modify known_hosts to be
  585.     an accurate list of your UUCP mail neighbors.
  586.  
  587.     Important Note to sys-v'ers who can't get their hostname from utsname(2)
  588.     (xenix, more?), the hostname should probably be set in the default Mushrc
  589.     defined in config.h.    set hostname=whatever
  590.  
  591.     If your system has a LAN or UUCP name returned by gethostname(3) and
  592.     an additional network mail (domain) name, you probably want to add the
  593.     domain name to the value of hostname.   set hostname="domain $hostname"
  594.     (where "domain" is your local domain name).  Sometimes, the domain name
  595.     is listed among the alternate names for the machine, which mush is able
  596.     to look up, but will not be the first name mush finds.  Since mush uses
  597.     the first name listed in $hostname when constructing From: lines and
  598.     the like, you may need to use a "set" in Mushrc to rearrange the list.
  599.  
  600.     For sun systems, the sun Mail Mailrc (/usr/lib/Mailrc) does not work
  601.     very well because sun's Mail is not standard /usr/ucb/Mail.  For this
  602.     reason, sun for many years did not change the default Mail.rc, which
  603.     still resides in /usr/lib/Mail.rc (note this has the "." whereas the
  604.     other file does not).  The default config.h-dist reflects this.  In
  605.     recent versions of SunOS, things like "if t" and "set |=" have begun
  606.     to creep into Mail.rc, which may cause mush to behave oddly.  Avoid
  607.     sourcing $ALT_DEF_RC in Mushrc if this is the case, and consider
  608.     changing the definition of ALT_DEF_RC in config.h.
  609.  
  610.     There is a supplied Mailrc file with mush, but this is only intended to
  611.     be used as an example of how to make mush look like ucbMail.  This is a
  612.     _reduction_ in functionality and its usage is not encouraged.  It is
  613.     provided for those who wish to "invisibly" replace UCB mail with mush.
  614.  
  615.     There is a Gnurc file, also supplied as an example, which can aid in
  616.     making mush's curses mode appear similar to gnu-emacs (NOT Rmail).
  617.  
  618.     The files sample.mushrc and advanced.mushrc are intended as samples of
  619.     individual users' ~/.mushrc files.  There is some overlap from Mushrc
  620.     in sample.mushrc; in particular, if you use Mushrc as the default file,
  621.     the sample.mushrc need not source ~/.mailrc.
  622.  
  623. ---------------
  624. Help files:
  625.     The help files should be placed somewhere which is readable and accessible
  626.     by all.  Failing to do so removes virtually the entire help facility's
  627.     ability to help anyone.  There is a help file (cmd_help) for command help
  628.     (e.g. "command -?"), and the file tool_help is for the graphics mode (Sun
  629.     workstations only).  You should define where you want these files in
  630.     config.h so at runtime, they can be accessed without error.  If for some
  631.     reason you can't define a location at run-time, you can change Mushrc
  632.     to set the variables $cmd_help and $tool_help to the correct locations.
  633.  
  634. ---------------
  635.  
  636. You should now be able to run make.  You may wish to use the target "install"
  637. to put the mush binary and the help and init files in their proper places; be
  638. sure to correct the destination directories in the Makefile you have selected,
  639. and to doublecheck file path names in the init files.
  640.  
  641. ---------------
  642. Maintenance:
  643.  
  644. If you want to use dbx or any other debugger, or to use your default tty
  645. driver, -e should be used as command line argument when you run the program.
  646. What this flag does is prevents your echo from being turned off and leaving
  647. cbreak off, thus, keeping your tty in a sane state.  This prevents the use
  648. of mappings and macros (map and map!).  However, curses mode will automatic-
  649. ally disable that mode.  The -e flag is highly discouraged.
  650.  
  651. If you have memory allocation checking and validation (sun 3.0+ ?) then
  652. define M_DEBUG in the makefile (main.c) and add the library
  653. /usr/lib/debug/malloc.o to the library list. Do this only if you
  654. find bugs in the program and suspect memory allocation errors. main.c
  655. has the code which sets the debugging level according to the value of
  656. an environment variable.  Because malloc-debugging is so cpu intensive,
  657. the tool mode program may get a SIGXCPU (cpu time limit exceeded)
  658. because of the large amount of opening and closing large pixrects and
  659. devices.  For this reason, SIGXPCPU is is caught in main.c.
  660.  
  661. The "warning" variable may be set (at runtime in your .mushrc or as
  662. a command: "set warning") to aid in finding runtime errors that aren't
  663. fatal.  You can also use the "debug" command:
  664.     debug 1    --    general trace messages
  665.     debug 3    --    verbose messages, MTA disabled
  666.     debug 4    --    really verbose messages
  667.     debug 5    --    free() disabled
  668.  
  669. If you ever get "Message N has bad date: <date string>" then note
  670. the FORMAT of that date and edit dates.c.  There are a number of
  671. "sscanf"s which you can see match known date formats.  Use them as
  672. examples and insert the new date format you have.
  673.  
  674. If Mush ever coredumps and you are suspicious about whether or not
  675. your folder (or spool directory) was removed, or if you were editing
  676. a letter, you should check for the files .mushXXXXXX and .edXXXXXXX.
  677. Unless something incredibly awful has happened, Mush won't die without
  678. asking if you want to save the .mushXXXXX file and if you actually want
  679. it to dump core.  Note that if you run mush from .suntools and there is
  680. a core dump, it probably wants to do some IO with the console and may
  681. hang (not exit) because it doesn't know it can't talk to you.  If mush
  682. is killed by SIGHUP, it won't remove the .mushXXXXXX file, but it won't
  683. tell you about it either (unfortunately).
  684.  
  685. Bare-bones line-mode mush (no CURSES) and tool mode (SUNTOOL) pass lint
  686. with a small number of errors, mostly about long assignments losing accuracy.
  687. The SysV code has not been linted as thoroughly as the rest.  Curses doesn't
  688. lint very well, but even when you lint mush with CURSES defined, it mainly
  689. complains about the unused curses globals in curses.h.
  690.