xref: /csrg-svn/usr.sbin/sendmail/src/READ_ME (revision 64250)
135062Sbostic# Copyright (c) 1983 Eric P. Allman
248582Sbostic# Copyright (c) 1988 The Regents of the University of California.
333728Sbostic# All rights reserved.
433728Sbostic#
548582Sbostic# %sccs.include.redist.sh%
633728Sbostic#
7*64250Seric#	@(#)READ_ME	8.13 (Berkeley) 08/14/93
833728Sbostic#
948582Sbostic
109881SericThis directory contains the source files for sendmail.
115369Seric
1260565SericFor detailed instructions, please read the document ../doc/op.me:
135369Seric
1460565Seric	eqn ../doc/op.me | pic | ditroff -me
155369Seric
1657418SericThe Makefile is for the new Berkeley make, available from ftp.uu.net
1757418Sericin the directory /systems/unix/bsd-sources/usr.bin/make.  There is
1857418Sericalso a Makefile.dist which is much less clever, but works on the old
1957418Serictraditional make.  You can use this using:
2057418Seric
2157418Seric	make -f Makefile.dist
2257418Seric
2360565SericThere are a couple of other Makefiles for other systems -- these are
2460584Sericthe ones that I use, they have "Berkeley quirks" in them, and I don't
2560584Sericguarantee that they will work in your environment.  To make it worse,
2660584Sericsome are for the new Berkeley make, and some are for the old make.
2760584SericI provide them for information only.  Still, they may help you get
2860584Sericstarted.  They have names like "Makefile.HPUX".
2957943Seric
3064035Seric
31*64250Seric+----------------------+
32*64250Seric| DATABASE DEFINITIONS |
33*64250Seric+----------------------+
34*64250Seric
35*64250SericThere are several database formats that can be used for the alias files
36*64250Sericand for general maps.  When used for alias files they interact in an
37*64250Sericattempt to be back compatible.
38*64250Seric
39*64250SericThe three options are NEWDB (the new Berkeley DB package), NDBM (the
40*64250Sericolder DBM implementation -- the very old V7 implementation is no
41*64250Sericlonger supported), and NIS (Network Information Services).  Used alone
42*64250Sericthese just include the support they indicate.
43*64250Seric
44*64250SericIf NEWDB and NDBM are defined (but not NIS), then sendmail will read
45*64250SericNDBM format alias files, but the next time a newaliases is run the
46*64250Sericformat will be converted to NEWDB; that format will be used forever
47*64250Sericmore.  This is intended as a transition feature.  [Note however that
48*64250Sericthe NEWDB library also catches and maps NDBM calls; you will have to
49*64250Sericback out this feature to get this to work.  See ``Quirks'' section
50*64250Sericbelow for details.]
51*64250Seric
52*64250SericIf all three are defined, sendmail operates as described above, and also
53*64250Sericlooks for the file /var/yp/Makefile.  If it exists, newaliases will
54*64250Sericbuild BOTH the NEWDB and NDBM format alias files.  However, it will
55*64250Sericonly use the NEWDB file; the NDBM format file is used only by the
56*64250SericNIS subsystem.
57*64250Seric
58*64250SericIf NDBM and NIS are defined (regardless of the definition of NEWDB
59*64250Sericor the existance of /var/yp/Makefile), sendmail adds the special
60*64250Serictokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are
61*64250Sericrequired if the NDBM file is to be used as an NIS map.
62*64250Seric
63*64250SericAll of -DNEWDB, -DNDBM, and -DNIS are normally defined in the DBMDEF
64*64250Sericline in the Makefile.
65*64250Seric
66*64250Seric
6764035Seric+---------------+
6864035Seric| COMPILE FLAGS |
6964035Seric+---------------+
7064035Seric
7160565SericWhereever possible, I try to make sendmail pull in the correct
7260584Sericcompilation options needed to compile on various environments based on
7360584Sericautomatically defined symbols.  Some machines don't seem to have useful
7460584Sericsymbols availble, requiring the following compilation flags in the
7560584SericMakefile:
7660565Seric
7760565SericSOLARIS		Define this if you are running Solaris 2.0 or higher.
7864077SericNeXT		Define this if you are on a NeXT box.  (This one may
7964072Seric		be pre-defined for you.)  There are other hacks you
8064072Seric		have to make -- see below.
8160565Seric_AIX3		Define this if you are IBM AIX 3.x.
8263965SericRISCOS		Define this if you are running RISC/os from MIPS.
8360565Seric
8460584SericIf you are a system that sendmail has already been ported to, you
8560584Sericprobably won't have to touch these.  But if you are porting, you may
8663962Serichave to tweak the following compilation flags in conf.h in order to
8763962Sericget it to compile and link properly:
8860565Seric
8960565SericSYSTEM5		Adjust for System V.
9064035SericSYS5SIGNALS	Use System V signal semantics -- the signal handler
9164035Seric		is automatically dropped when the signal is caught.
9264035Seric		If this is not set, use POSIX/BSD semantics, where the
9364035Seric		signal handler stays in force until an exec or an
9464035Seric		explicit delete.  Implied by SYSTEM5.
9564035SericHASFLOCK	Set this if you prefer to use the flock(2) system call
9664035Seric		rather than using fcntl-based locking.  Fcntl locking
9764035Seric		has some semantic gotchas, but many vendor systems
9864035Seric		also interface it to lockd(8) to do NFS-style locking.
9964035Seric		For this reason, this should not be set unless you
10064035Seric		don't have an alternative.
10160565SericHASUNAME	Set if you have the "uname" system call.  Implied by
10260565Seric		SYSTEM5.
10363962SericHASUNSETENV	Define this if your system library has the "unsetenv"
10463962Seric		subroutine.
10560584SericHASSTATFS	Define this if you have the statfs(2) system call.  It's
10660584Seric		not a disaster to get this wrong -- but you do lose the
10760584Seric		queue free space code.
10860584SericHASUSTAT	Define this if you have the ustat(2) system call.  It's
10960584Seric		not a disaster to get this wrong -- but you do lose the
11060584Seric		queue free space code.
11160565SericHASSETSID	Define this if you have the setsid(2) system call.  This
11260565Seric		is implied if your system appears to be POSIX compliant.
11360565SericHASINITGROUPS	Define this if you have the initgroups(3) routine.
11463753SericHASSETVBUF	Define this if you have the setvbuf(3) library call.
11563753Seric		If you don't, setlinebuf will be used instead.  This
11663753Seric		defaults on if your compiler defines __STDC__.
11763902SericHASSETREUID	Define this if you have setreuid(2) ***AND*** root can
11863902Seric		use setreuid to change to an arbitrary user.  This second
11963902Seric		condition is not satisfied on AIX 3.x.  You may find that
12063902Seric		your system has setresuid(2), (for example, on HP-UX) in
12163902Seric		which case you will also have to #define setreuid(r, e)
12263902Seric		to be the appropriate call.  Some systems (such as Solaris)
12363902Seric		have a compatibility routine that doesn't work properly.
12463902Seric		The important thing is that you have a call that will set
12563902Seric		the effective uid independently of the real or saved uid.
12663902Seric		Setting this improves the security somewhat, since
12763902Seric		sendmail doesn't have to read .forward and :include: files
12863902Seric		as root.
12963937SericGIDSET_T	The type of entries in a gidset passed as the second
13063937Seric		argument to getgroups(2).  Historically this has been an
13163937Seric		int, so this is the default, but some systems (such as
13263937Seric		IRIX) pass it as a gid_t, which is an unsigned short.
13363937Seric		This will make a difference, so it is important to get
13463937Seric		this right!  However, it is only an issue if you have
13563937Seric		group sets.
13663968SericSLEEP_T		The type returned by the system sleep() function.
13763968Seric		Defaults to "unsigned int".  Don't worry about this
13863968Seric		if you don't have compilation problems.
13963974SericARBPTR_T	The type of an arbitrary pointer -- defaults to "void *".
14063974Seric		If you are an very old compiler you may need to define
14163974Seric		this to be "char *".
14260584SericLA_TYPE		The type of load average your kernel supports.  These
14360584Seric		can be LA_SUBR (4) if you have the getloadavg(3) routine,
14460584Seric		LA_FLOAT (3) if you read kmem and interpret the value
14560584Seric		as a floating point number, LA_INT (2) to interpret as
14660584Seric		an integer.  These last two have several other parameters
14760584Seric		that they try to divine: the name of your kernel, the name
14860584Seric		of the variable in the kernel to examine, the number of
14960584Seric		bits of precision in a fixed point load average, and so
15060584Seric		forth.  In desparation, use LA_ZERO -- it always returns
15160584Seric		the load average as "zero" (and does so on all architectures).
15260584Seric		The actual code is in conf.c -- it can be tweaked if you
15360584Seric		are brave.
15463962SericERRLIST_PREDEFINED
15563962Seric		If set, assumes that some header file defines sys_errlist.
15663962Seric		This may be needed if you get type conflicts on this
15763962Seric		variable -- otherwise don't worry about it.
15860565Seric
15964035Seric
16064035Seric+-----------------------+
16164035Seric| COMPILE-TIME FEATURES |
16264035Seric+-----------------------+
16364035Seric
16460584SericThere are a bunch of features that you can decide to compile in, such
16560584Sericas selecting various database packages and special protocol support.
16660584SericSeveral are assumed based on other compilation flags -- if you want to
16760584Seric"un-assume" something, you probably need to edit conf.h.  Compilation
16860584Sericflags that add support for special features include:
16960565Seric
17060565SericNDBM		Include support for "new" DBM library for aliases and maps.
171*64250Seric		Normally defined in the Makefile.
17260565SericNEWDB		Include support for Berkeley "db" package (hash & btree)
173*64250Seric		for aliases and maps.  Normally defined in the Makefile.
17460565SericNIS		Define this to get NIS (YP) support for aliases and maps.
175*64250Seric		Normally defined in the Makefile.
17660565SericUSERDB		Include support for the User Information Database.  Implied
177*64250Seric		by NEWDB in conf.h.
17860565SericIDENTPROTO	Define this to get IDENT (RFC 1413) protocol support.
17960565Seric		This is assumed unless you are running on Ultrix or
18060565Seric		HP-UX, both of which have a problem in the UDP
18160565Seric		implementation.
18260565SericMIME		Include support for MIME-encapsulated error messages.
18360565SericFROZENCONFIG	Define this to get support for frozen configuration
18460584Seric		files.  Frozen configurations make sense if your I/O system
18560584Seric		is fast relative to your processor.  At this point this
18660584Seric		is NOT recommended.
18760565SericLOG		Set this to get syslog(3) support.  Defined by default
18860584Seric		in conf.h.  You want this if at all possible.
18960565SericNETINET		Set this to get TCP/IP support.  Defined by default
19060584Seric		in conf.h.  You probably want this.
19160565SericNETISO		Define this to get ISO networking support.
19260565SericSMTP		Define this to get the SMTP code.  Implied by NETINET
19360565Seric		or NETISO.
19460565SericNAMED_BIND	Define this to get DNS (name daemon) support, including
19560565Seric		MX support.  The specs you must use this if you run
19660565Seric		SMTP.  Defined by default in conf.h.
19760565SericQUEUE		Define this to get queueing code.  Implied by NETINET
19860584Seric		or NETISO; required by SMTP.  This gives you other good
19960584Seric		stuff -- it should be on.
20060565SericDAEMON		Define this to get general network support.  Implied by
20160584Seric		NETINET or NETISO.  Defined by default in conf.h.  You
20260584Seric		almost certainly want it on.
20360565SericMATCHGECOS	Permit fuzzy matching of user names against the full
20460565Seric		name (GECOS) field in the /etc/passwd file.  This should
20560565Seric		probably be on, since you can disable it from the config
20660584Seric		file if you want to.  Defined by default in conf.h.
20760565SericSETPROCTITLE	Try to set the string printed by "ps" to something
20860584Seric		informative about what sendmail is doing.  Defined by
20960584Seric		default in conf.h.
21060565Seric
21164035Seric
21264035Seric+-------------------------------------+
21364035Seric| OPERATING SYSTEM AND COMPILE QUIRKS |
21464035Seric+-------------------------------------+
21564035Seric
216*64250SericSunOS
217*64250Seric	If you are compiling on SunOS and want to use frozen configuration
218*64250Seric	files, you must use -Bstatic -- if you do not, frozen
219*64250Seric	configuration files fail in bizarre ways and you will open up
220*64250Seric	several security holes.
22160565Seric
222*64250Seric	You may have to use -lresolv on SunOS.
22364035Seric
224*64250SericOSF/1
225*64250Seric	If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
22657977Seric
227*64250SericNeXT
228*64250Seric	If you are compiling on NeXT, you will have to create an empty
229*64250Seric	file "unistd.h" and create a file "dirent.h" containing:
23063753Seric
231*64250Seric		#include <sys/dir.h>
232*64250Seric		#define dirent	direct
23364035Seric
234*64250Seric	(The Makefile.NeXT should try to do both of these for you.)
23564077Seric
236*64250SericBSDI (BSD/386)
237*64250Seric	I have reports that the "m4" from BSDI won't handle the config
238*64250Seric	files properly.  I haven't had a chance to test this myself.
23957943Seric
240*64250SericBoth NEWDB and NDBM
241*64250Seric	If you use both -DNDBM and -DNEWDB, you must delete the module
242*64250Seric	ndbm.o from libdb.a and delete the file "ndbm.h" from the files
243*64250Seric	that get installed (that is, use the OLD ndbm.h, not the new
244*64250Seric	ndbm.h).  This compatibility module maps ndbm calls into DB
245*64250Seric	calls, and breaks things rather badly.
24658709Seric
247*64250Seric
24864035Seric+-----------------------------+
24964035Seric| DESCRIPTION OF SOURCE FILES |
25064035Seric+-----------------------------+
25164035Seric
2529881SericThe following list describes the files in this directory:
2535369Seric
25457418SericMakefile	The makefile used here; this version only works with
25557418Seric		the new Berkeley make.
25657418SericMakefile.dist	A trimmed down version of the makefile that works with
25757418Seric		the old make.
2585369SericREAD_ME		This file.
25960565SericTRACEFLAGS	My own personal list of the trace flags -- not guaranteed
26060565Seric		to be particularly up to date.
2615369Sericalias.c		Does name aliasing in all forms.
2629881Sericarpadate.c	A subroutine which creates ARPANET standard dates.
2639881Sericclock.c		Routines to implement real-time oriented functions
2649881Seric		in sendmail -- e.g., timeouts.
2655369Sericcollect.c	The routine that actually reads the mail into a temp
2665369Seric		file.  It also does a certain amount of parsing of
2675369Seric		the header, etc.
2685369Sericconf.c		The configuration file.  This contains information
2695369Seric		that is presumed to be quite static and non-
2705369Seric		controversial, or code compiled in for efficiency
2715369Seric		reasons.  Most of the configuration is in sendmail.cf.
2729881Sericconf.h		Configuration that must be known everywhere.
2735369Sericconvtime.c	A routine to sanely process times.
2749881Sericdaemon.c	Routines to implement daemon mode.  This version is
2759881Seric		specifically for Berkeley 4.1 IPC.
2765369Sericdeliver.c	Routines to deliver mail.
27760565Sericdomain.c	Routines that interface with DNS (the Domain Name
27860565Seric		System).
2795369Sericerr.c		Routines to print error messages.
2809881Sericenvelope.c	Routines to manipulate the envelope structure.
2815369Sericheaders.c	Routines to process message headers.
2825369Sericmacro.c		The macro expander.  This is used internally to
2835369Seric		insert information from the configuration file.
2845369Sericmain.c		The main routine to sendmail.  This file also
2855369Seric		contains some miscellaneous routines.
28660565Sericmap.c		Support for database maps.
28760565Sericmci.c		Routines that handle mail connection information caching.
2889881Sericparseaddr.c	The routines which do address parsing.
2895369Sericqueue.c		Routines to implement message queueing.
2905369Sericreadcf.c	The routine that reads the configuration file and
2915369Seric		translates it to internal form.
2929881Sericrecipient.c	Routines that manipulate the recipient list.
2935369Sericsavemail.c	Routines which save the letter on processing errors.
2945369Sericsendmail.h	Main header file for sendmail.
2955369Sericsrvrsmtp.c	Routines to implement server SMTP.
2965369Sericstab.c		Routines to manage the symbol table.
2975369Sericstats.c		Routines to collect and post the statistics.
2985369Sericsysexits.c	List of error messages associated with error codes
2995369Seric		in sysexits.h.
3009881Serictrace.c		The trace package.  These routines allow setting and
3019881Seric		testing of trace flags with a high granularity.
30260565Sericudb.c		The user database interface module.
3035369Sericusersmtp.c	Routines to implement user SMTP.
3045369Sericutil.c		Some general purpose routines used by sendmail.
30560565Sericversion.c	The version number and information about this
30660565Seric		version of sendmail.  Theoretically, this gets
30760565Seric		modified on every change.
3085369Seric
3095369SericEric Allman
3105369Seric
311*64250Seric(Version 8.13, last update 08/14/93 11:32:03)
312