tips for specific environments
[unix-history] / usr / src / usr.sbin / sendmail / src / READ_ME
index d4a5e53..1cb7e30 100644 (file)
@@ -4,7 +4,7 @@
 #
 # %sccs.include.redist.sh%
 #
 #
 # %sccs.include.redist.sh%
 #
-#      @(#)READ_ME     6.7 (Berkeley) %G%
+#      @(#)READ_ME     8.19 (Berkeley) %G%
 #
 
 This directory contains the source files for sendmail.
 #
 
 This directory contains the source files for sendmail.
@@ -13,68 +13,183 @@ For detailed instructions, please read the document ../doc/op.me:
 
        eqn ../doc/op.me | pic | ditroff -me
 
 
        eqn ../doc/op.me | pic | ditroff -me
 
-The Makefile is for the new Berkeley make, available from ftp.uu.net
-in the directory /systems/unix/bsd-sources/usr.bin/make.  There is
-also a Makefile.dist which is much less clever, but works on the old
-traditional make.  You can use this using:
+The Makefile is for the new (4.4BSD) Berkeley make, available from
+ftp.uu.net in the directory /systems/unix/bsd-sources/usr.bin/make.
+It has assumptions about the 4.4 file system layout built in.  There
+is also a Makefile.dist which is much less clever, but works on the
+old traditional make.  You can use this using:
 
        make -f Makefile.dist
 
 
        make -f Makefile.dist
 
-There are a couple of other Makefiles for other systems -- these are
-the ones that I use, and I don't guarantee that they will work in
-your environment.  They are provided for information only.
+There are a bunch of other Makefiles for other systems -- these are
+the ones that I use, they have "Berkeley quirks" in them, and I don't
+guarantee that they will work unmodified in your environment.  However,
+they are all designed for the old make and can be used to help you get
+started.  They have names like "Makefile.HPUX".  Many of them include
+-I/usr/sww/include/db and -L/usr/sww/lib -- this is Berkeley's
+location for the new database libraries, described below.
+
+There is also a shell script (makesendmail) that tries to be clever
+about using object subdirectories.  It's pretty straightforward, and
+may help if you share a source tree among different architectures.
+
+
++----------------------+
+| DATABASE DEFINITIONS |
++----------------------+
+
+There are several database formats that can be used for the alias files
+and for general maps.  When used for alias files they interact in an
+attempt to be back compatible.
+
+The three options are NEWDB (the new Berkeley DB package), NDBM (the
+older DBM implementation -- the very old V7 implementation is no
+longer supported), and NIS (Network Information Services).  Used alone
+these just include the support they indicate.
+
+If NEWDB and NDBM are defined (but not NIS), then sendmail will read
+NDBM format alias files, but the next time a newaliases is run the
+format will be converted to NEWDB; that format will be used forever
+more.  This is intended as a transition feature.  [Note however that
+the NEWDB library also catches and maps NDBM calls; you will have to
+back out this feature to get this to work.  See ``Quirks'' section
+below for details.]
+
+If all three are defined, sendmail operates as described above, and also
+looks for the file /var/yp/Makefile.  If it exists, newaliases will
+build BOTH the NEWDB and NDBM format alias files.  However, it will
+only use the NEWDB file; the NDBM format file is used only by the
+NIS subsystem.
+
+If NDBM and NIS are defined (regardless of the definition of NEWDB
+or the existance of /var/yp/Makefile), sendmail adds the special
+tokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are
+required if the NDBM file is to be used as an NIS map.
+
+All of -DNEWDB, -DNDBM, and -DNIS are normally defined in the DBMDEF
+line in the Makefile.
+
+
++---------------+
+| COMPILE FLAGS |
++---------------+
 
 Whereever possible, I try to make sendmail pull in the correct
 
 Whereever possible, I try to make sendmail pull in the correct
-compilation options based on automatically defined symbols.  Some
-machines don't seem to have useful symbols availble, requiring
-the following compilation flags in the Makefile:
+compilation options needed to compile on various environments based on
+automatically defined symbols.  Some machines don't seem to have useful
+symbols availble, requiring the following compilation flags in the
+Makefile:
 
 SOLARIS                Define this if you are running Solaris 2.0 or higher.
 
 SOLARIS                Define this if you are running Solaris 2.0 or higher.
-NeXT           Define this if you are on a NeXT box.
+NeXT           Define this if you are on a NeXT box.  (This one may
+               be pre-defined for you.)  There are other hacks you
+               have to make -- see below.
 _AIX3          Define this if you are IBM AIX 3.x.
 _AIX3          Define this if you are IBM AIX 3.x.
+RISCOS         Define this if you are running RISC/os from MIPS.
 
 
-Other compilation flags that you may need to tweak in order to get
-it to compile and link properly include:
+If you are a system that sendmail has already been ported to, you
+probably won't have to touch these.  But if you are porting, you may
+have to tweak the following compilation flags in conf.h in order to
+get it to compile and link properly:
 
 
-UNSETENV       Define this if your system library does NOT include the
-               "unsetenv" subroutine.
 SYSTEM5                Adjust for System V.
 SYSTEM5                Adjust for System V.
-LOCKF          Set this if you do not have the flock system call -- it
-               will revert to System V file locking.  There are some
-               semantic gotchas, so flock is preferred.  Implied by
-               SYSTEM5.
-SYS5TZ         Use System V-style time zones.  If not set, the TZ
-               environment variable is ignored.  Implied by SYSTEM5.
+SYS5SIGNALS    Use System V signal semantics -- the signal handler
+               is automatically dropped when the signal is caught.
+               If this is not set, use POSIX/BSD semantics, where the
+               signal handler stays in force until an exec or an
+               explicit delete.  Implied by SYSTEM5.
+HASFLOCK       Set this if you prefer to use the flock(2) system call
+               rather than using fcntl-based locking.  Fcntl locking
+               has some semantic gotchas, but many vendor systems
+               also interface it to lockd(8) to do NFS-style locking.
+               For this reason, this should not be set unless you
+               don't have an alternative.
 HASUNAME       Set if you have the "uname" system call.  Implied by
                SYSTEM5.
 HASUNAME       Set if you have the "uname" system call.  Implied by
                SYSTEM5.
-HASSTATFS      Define this if you have the statfs(2) system call.
-HASUSTAT       Define this if you have the ustat(2) system call.
+HASUNSETENV    Define this if your system library has the "unsetenv"
+               subroutine.
+HASSTATFS      Define this if you have the statfs(2) system call.  It's
+               not a disaster to get this wrong -- but you do lose the
+               queue free space code.
+HASUSTAT       Define this if you have the ustat(2) system call.  It's
+               not a disaster to get this wrong -- but you do lose the
+               queue free space code.
 HASSETSID      Define this if you have the setsid(2) system call.  This
                is implied if your system appears to be POSIX compliant.
 HASINITGROUPS  Define this if you have the initgroups(3) routine.
 HASSETSID      Define this if you have the setsid(2) system call.  This
                is implied if your system appears to be POSIX compliant.
 HASINITGROUPS  Define this if you have the initgroups(3) routine.
+HASSETVBUF     Define this if you have the setvbuf(3) library call.
+               If you don't, setlinebuf will be used instead.  This
+               defaults on if your compiler defines __STDC__.
+HASSETREUID    Define this if you have setreuid(2) ***AND*** root can
+               use setreuid to change to an arbitrary user.  This second
+               condition is not satisfied on AIX 3.x.  You may find that
+               your system has setresuid(2), (for example, on HP-UX) in
+               which case you will also have to #define setreuid(r, e)
+               to be the appropriate call.  Some systems (such as Solaris)
+               have a compatibility routine that doesn't work properly.
+               The important thing is that you have a call that will set
+               the effective uid independently of the real or saved uid.
+               Setting this improves the security somewhat, since
+               sendmail doesn't have to read .forward and :include: files
+               as root.
+GIDSET_T       The type of entries in a gidset passed as the second
+               argument to getgroups(2).  Historically this has been an
+               int, so this is the default, but some systems (such as
+               IRIX) pass it as a gid_t, which is an unsigned short.
+               This will make a difference, so it is important to get
+               this right!  However, it is only an issue if you have
+               group sets.
+SLEEP_T                The type returned by the system sleep() function.
+               Defaults to "unsigned int".  Don't worry about this
+               if you don't have compilation problems.
+ARBPTR_T       The type of an arbitrary pointer -- defaults to "void *".
+               If you are an very old compiler you may need to define
+               this to be "char *".
+LA_TYPE                The type of load average your kernel supports.  These
+               can be LA_SUBR (4) if you have the getloadavg(3) routine,
+               LA_FLOAT (3) if you read kmem and interpret the value
+               as a floating point number, LA_INT (2) to interpret as
+               an integer.  These last two have several other parameters
+               that they try to divine: the name of your kernel, the name
+               of the variable in the kernel to examine, the number of
+               bits of precision in a fixed point load average, and so
+               forth.  In desparation, use LA_ZERO -- it always returns
+               the load average as "zero" (and does so on all architectures).
+               The actual code is in conf.c -- it can be tweaked if you
+               are brave.
+ERRLIST_PREDEFINED
+               If set, assumes that some header file defines sys_errlist.
+               This may be needed if you get type conflicts on this
+               variable -- otherwise don't worry about it.
 
 
-Compilation flags that add support for special features include:
+
++-----------------------+
+| COMPILE-TIME FEATURES |
++-----------------------+
+
+There are a bunch of features that you can decide to compile in, such
+as selecting various database packages and special protocol support.
+Several are assumed based on other compilation flags -- if you want to
+"un-assume" something, you probably need to edit conf.h.  Compilation
+flags that add support for special features include:
 
 NDBM           Include support for "new" DBM library for aliases and maps.
 
 NDBM           Include support for "new" DBM library for aliases and maps.
+               Normally defined in the Makefile.
 NEWDB          Include support for Berkeley "db" package (hash & btree)
 NEWDB          Include support for Berkeley "db" package (hash & btree)
-               for aliases and maps.
+               for aliases and maps.  Normally defined in the Makefile.
 NIS            Define this to get NIS (YP) support for aliases and maps.
 NIS            Define this to get NIS (YP) support for aliases and maps.
-YPCOMPAT       Define this to force building of DBM versions of alias
-               files even if you have NEWDB defined; this will only
-               occur on NIS master machines.  It is independent of NIS.
+               Normally defined in the Makefile.
 USERDB         Include support for the User Information Database.  Implied
 USERDB         Include support for the User Information Database.  Implied
-               by NEWDB.
+               by NEWDB in conf.h.
 IDENTPROTO     Define this to get IDENT (RFC 1413) protocol support.
                This is assumed unless you are running on Ultrix or
                HP-UX, both of which have a problem in the UDP
                implementation.
 MIME           Include support for MIME-encapsulated error messages.
 IDENTPROTO     Define this to get IDENT (RFC 1413) protocol support.
                This is assumed unless you are running on Ultrix or
                HP-UX, both of which have a problem in the UDP
                implementation.
 MIME           Include support for MIME-encapsulated error messages.
-FROZENCONFIG   Define this to get support for frozen configuration
-               files.  At this point this is NOT recommended.
 LOG            Set this to get syslog(3) support.  Defined by default
 LOG            Set this to get syslog(3) support.  Defined by default
-               in conf.h.
+               in conf.h.  You want this if at all possible.
 NETINET                Set this to get TCP/IP support.  Defined by default
 NETINET                Set this to get TCP/IP support.  Defined by default
-               in conf.h
+               in conf.h.  You probably want this.
 NETISO         Define this to get ISO networking support.
 SMTP           Define this to get the SMTP code.  Implied by NETINET
                or NETISO.
 NETISO         Define this to get ISO networking support.
 SMTP           Define this to get the SMTP code.  Implied by NETINET
                or NETISO.
@@ -82,30 +197,87 @@ NAMED_BIND Define this to get DNS (name daemon) support, including
                MX support.  The specs you must use this if you run
                SMTP.  Defined by default in conf.h.
 QUEUE          Define this to get queueing code.  Implied by NETINET
                MX support.  The specs you must use this if you run
                SMTP.  Defined by default in conf.h.
 QUEUE          Define this to get queueing code.  Implied by NETINET
-               or NETISO; required by SMTP.
+               or NETISO; required by SMTP.  This gives you other good
+               stuff -- it should be on.
 DAEMON         Define this to get general network support.  Implied by
 DAEMON         Define this to get general network support.  Implied by
-               NETINET or NETISO.
+               NETINET or NETISO.  Defined by default in conf.h.  You
+               almost certainly want it on.
 MATCHGECOS     Permit fuzzy matching of user names against the full
                name (GECOS) field in the /etc/passwd file.  This should
                probably be on, since you can disable it from the config
 MATCHGECOS     Permit fuzzy matching of user names against the full
                name (GECOS) field in the /etc/passwd file.  This should
                probably be on, since you can disable it from the config
-               file if you want to.
+               file if you want to.  Defined by default in conf.h.
 SETPROCTITLE   Try to set the string printed by "ps" to something
 SETPROCTITLE   Try to set the string printed by "ps" to something
-               informative about what sendmail is doing.
+               informative about what sendmail is doing.  Defined by
+               default in conf.h.
+
+
++-------------------------------------+
+| OPERATING SYSTEM AND COMPILE QUIRKS |
++-------------------------------------+
+
+SunOS
+       You may have to use -lresolv on SunOS.
+
+Solaris
+       From a correspondent:
+
+          For solaris 2.2, I have 
+
+               hosts:      files dns
+
+          in /etc/nsswitch.conf and /etc/hosts has to have the fully
+          qualified host name. I think "files" has to be before "dns"
+          in /etc/nsswitch.conf during bootup.
+
+OSF/1
+       If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
+
+NeXT
+       If you are compiling on NeXT, you will have to create an empty
+       file "unistd.h" and create a file "dirent.h" containing:
+
+               #include <sys/dir.h>
+               #define dirent  direct
+
+       (The Makefile.NeXT should try to do both of these for you.)
+
+       Apparently, there is a bug in getservbyname on Nextstep 3.0
+       that causes it to fail under some circumstances with the
+       message "SYSERR: service "smtp" unknown" logged.  You should
+       be able to work around this by including the line:
+
+               OPort=25
+
+       in your .cf file.
+
+BSDI (BSD/386)
+       I have reports that the "m4" from BSDI won't handle the config
+       files properly.  I haven't had a chance to test this myself.
 
 
-If you are compiling on SunOS and want to use frozen configuration
-files, you must use -Bstatic -- if you do not, frozen configuration
-files fail in bizarre ways and you will open up several security holes.
+4.3BSD
+       If you are running a "virgin" version of 4.3BSD, you'll have
+       a very old resolver and be missing some header files.  The
+       header files are simple -- create empty versions and everything
+       will work fine.  For the resolver you should really port a new
+       version (4.8.3 or later) of the resolver; 4.9 is available on
+       gatekeeper.DEC.COM in pub/BSD/bind/4.9.  If you are really
+       determined to continue to use your old, buggy version (or as
+       a shortcut to get sendmail working -- I'm sure you have the
+       best intentions to port a modern version of BIND), you can
+       copy ../contrib/oldbind.compat.c into src and add
+       oldbind.compat.o to OBJADD in the Makefile.
 
 
-If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
+Both NEWDB and NDBM
+       If you use both -DNDBM and -DNEWDB, you must delete the module
+       ndbm.o from libdb.a and delete the file "ndbm.h" from the files
+       that get installed (that is, use the OLD ndbm.h, not the new
+       ndbm.h).  This compatibility module maps ndbm calls into DB
+       calls, and breaks things rather badly.
 
 
-If you use both -DNDBM and -DNEWDB, you must delete the module ndbm.o
-from libdb.a and delete the file "ndbm.h" from the files that get
-installed (that is, use the OLD ndbm.h, not the new ndbm.h).  This
-compatibility module maps ndbm calls into DB calls, and breaks things
-rather badly.
 
 
-You probably want to look over the compilation options in conf.h
-before you compile.  These are intended to be per-site information.
++-----------------------------+
+| DESCRIPTION OF SOURCE FILES |
++-----------------------------+
 
 The following list describes the files in this directory:
 
 
 The following list describes the files in this directory:
 
@@ -166,4 +338,4 @@ version.c   The version number and information about this
 
 Eric Allman
 
 
 Eric Allman
 
-(Version 6.7, last update %G% 16:04:58)
+(Version 8.19, last update %G% 11:22:15)