xref: /csrg-svn/usr.sbin/sendmail/src/READ_ME (revision 64385)
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*64385Seric#	@(#)READ_ME	8.21 (Berkeley) 09/02/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
1664262SericThe Makefile is for the new (4.4BSD) Berkeley make, available from
1764262Sericftp.uu.net in the directory /systems/unix/bsd-sources/usr.bin/make.
1864262SericIt has assumptions about the 4.4 file system layout built in.  There
1964262Sericis also a Makefile.dist which is much less clever, but works on the
2064262Sericold traditional make.  You can use this using:
2157418Seric
2257418Seric	make -f Makefile.dist
2357418Seric
2464262SericThere are a bunch of other Makefiles for other systems -- these are
2560584Sericthe ones that I use, they have "Berkeley quirks" in them, and I don't
2664262Sericguarantee that they will work unmodified in your environment.  However,
2764262Sericthey are all designed for the old make and can be used to help you get
2864262Sericstarted.  They have names like "Makefile.HPUX".  Many of them include
2964262Seric-I/usr/sww/include/db and -L/usr/sww/lib -- this is Berkeley's
3064262Sericlocation for the new database libraries, described below.
3157943Seric
3264272SericThere is also a shell script (makesendmail) that tries to be clever
3364272Sericabout using object subdirectories.  It's pretty straightforward, and
3464272Sericmay help if you share a source tree among different architectures.
3564035Seric
3664272Seric
3764250Seric+----------------------+
3864250Seric| DATABASE DEFINITIONS |
3964250Seric+----------------------+
4064250Seric
4164250SericThere are several database formats that can be used for the alias files
4264250Sericand for general maps.  When used for alias files they interact in an
4364250Sericattempt to be back compatible.
4464250Seric
4564250SericThe three options are NEWDB (the new Berkeley DB package), NDBM (the
4664250Sericolder DBM implementation -- the very old V7 implementation is no
4764250Sericlonger supported), and NIS (Network Information Services).  Used alone
4864376Sericthese just include the support they indicate.  [If you are using NEWDB,
4964376Sericget the latest version from FTP.CS.Berkeley.EDU in /ucb/4bsd.  DO NOT
5064376Sericuse the version from the Net2 distribution!]
5164250Seric
5264250SericIf NEWDB and NDBM are defined (but not NIS), then sendmail will read
5364250SericNDBM format alias files, but the next time a newaliases is run the
5464250Sericformat will be converted to NEWDB; that format will be used forever
5564250Sericmore.  This is intended as a transition feature.  [Note however that
5664250Sericthe NEWDB library also catches and maps NDBM calls; you will have to
5764250Sericback out this feature to get this to work.  See ``Quirks'' section
5864250Sericbelow for details.]
5964250Seric
6064250SericIf all three are defined, sendmail operates as described above, and also
6164250Sericlooks for the file /var/yp/Makefile.  If it exists, newaliases will
6264250Sericbuild BOTH the NEWDB and NDBM format alias files.  However, it will
6364250Sericonly use the NEWDB file; the NDBM format file is used only by the
6464250SericNIS subsystem.
6564250Seric
6664250SericIf NDBM and NIS are defined (regardless of the definition of NEWDB
6764250Sericor the existance of /var/yp/Makefile), sendmail adds the special
6864250Serictokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are
6964250Sericrequired if the NDBM file is to be used as an NIS map.
7064250Seric
7164250SericAll of -DNEWDB, -DNDBM, and -DNIS are normally defined in the DBMDEF
7264250Sericline in the Makefile.
7364250Seric
7464250Seric
7564035Seric+---------------+
7664035Seric| COMPILE FLAGS |
7764035Seric+---------------+
7864035Seric
7960565SericWhereever possible, I try to make sendmail pull in the correct
8060584Sericcompilation options needed to compile on various environments based on
8160584Sericautomatically defined symbols.  Some machines don't seem to have useful
8260584Sericsymbols availble, requiring the following compilation flags in the
8360584SericMakefile:
8460565Seric
8560565SericSOLARIS		Define this if you are running Solaris 2.0 or higher.
8664077SericNeXT		Define this if you are on a NeXT box.  (This one may
8764072Seric		be pre-defined for you.)  There are other hacks you
8864072Seric		have to make -- see below.
8960565Seric_AIX3		Define this if you are IBM AIX 3.x.
9063965SericRISCOS		Define this if you are running RISC/os from MIPS.
9160565Seric
9260584SericIf you are a system that sendmail has already been ported to, you
9360584Sericprobably won't have to touch these.  But if you are porting, you may
9463962Serichave to tweak the following compilation flags in conf.h in order to
9563962Sericget it to compile and link properly:
9660565Seric
9760565SericSYSTEM5		Adjust for System V.
9864035SericSYS5SIGNALS	Use System V signal semantics -- the signal handler
9964035Seric		is automatically dropped when the signal is caught.
10064035Seric		If this is not set, use POSIX/BSD semantics, where the
10164035Seric		signal handler stays in force until an exec or an
10264035Seric		explicit delete.  Implied by SYSTEM5.
10364035SericHASFLOCK	Set this if you prefer to use the flock(2) system call
10464035Seric		rather than using fcntl-based locking.  Fcntl locking
10564035Seric		has some semantic gotchas, but many vendor systems
10664035Seric		also interface it to lockd(8) to do NFS-style locking.
10764035Seric		For this reason, this should not be set unless you
10864035Seric		don't have an alternative.
10960565SericHASUNAME	Set if you have the "uname" system call.  Implied by
11060565Seric		SYSTEM5.
11163962SericHASUNSETENV	Define this if your system library has the "unsetenv"
11263962Seric		subroutine.
11360584SericHASSTATFS	Define this if you have the statfs(2) system call.  It's
11460584Seric		not a disaster to get this wrong -- but you do lose the
11560584Seric		queue free space code.
11660584SericHASUSTAT	Define this if you have the ustat(2) system call.  It's
11760584Seric		not a disaster to get this wrong -- but you do lose the
11860584Seric		queue free space code.
11960565SericHASSETSID	Define this if you have the setsid(2) system call.  This
12060565Seric		is implied if your system appears to be POSIX compliant.
12160565SericHASINITGROUPS	Define this if you have the initgroups(3) routine.
12263753SericHASSETVBUF	Define this if you have the setvbuf(3) library call.
12363753Seric		If you don't, setlinebuf will be used instead.  This
12463753Seric		defaults on if your compiler defines __STDC__.
12563902SericHASSETREUID	Define this if you have setreuid(2) ***AND*** root can
12663902Seric		use setreuid to change to an arbitrary user.  This second
12763902Seric		condition is not satisfied on AIX 3.x.  You may find that
12863902Seric		your system has setresuid(2), (for example, on HP-UX) in
12963902Seric		which case you will also have to #define setreuid(r, e)
13063902Seric		to be the appropriate call.  Some systems (such as Solaris)
13163902Seric		have a compatibility routine that doesn't work properly.
13263902Seric		The important thing is that you have a call that will set
13363902Seric		the effective uid independently of the real or saved uid.
13463902Seric		Setting this improves the security somewhat, since
13563902Seric		sendmail doesn't have to read .forward and :include: files
13663902Seric		as root.
13763937SericGIDSET_T	The type of entries in a gidset passed as the second
13863937Seric		argument to getgroups(2).  Historically this has been an
13963937Seric		int, so this is the default, but some systems (such as
14063937Seric		IRIX) pass it as a gid_t, which is an unsigned short.
14163937Seric		This will make a difference, so it is important to get
14263937Seric		this right!  However, it is only an issue if you have
14363937Seric		group sets.
14463968SericSLEEP_T		The type returned by the system sleep() function.
14563968Seric		Defaults to "unsigned int".  Don't worry about this
14663968Seric		if you don't have compilation problems.
14763974SericARBPTR_T	The type of an arbitrary pointer -- defaults to "void *".
14863974Seric		If you are an very old compiler you may need to define
14963974Seric		this to be "char *".
15060584SericLA_TYPE		The type of load average your kernel supports.  These
15160584Seric		can be LA_SUBR (4) if you have the getloadavg(3) routine,
15264376Seric		LA_MACH (5) to use MACH-style load averages (calls
15364376Seric		processor_set_info()), LA_FLOAT (3) if you read kmem and
15464376Seric		interpret the value as a floating point number, LA_INT (2)
15564376Seric		to interpret as a long integer, or LA_SHORT (6) to
15664376Seric		interpret as a short integer.  These last three have
15764376Seric		several other parameters that they try to divine: the
15864376Seric		name of your kernel, the name of the variable in the
15964376Seric		kernel to examine, the number of bits of precision in
16064376Seric		a fixed point load average, and so forth.  In desparation,
16164376Seric		use LA_ZERO (1) -- it always returns the load average as
16264376Seric		"zero" (and does so on all architectures).  The actual
16364376Seric		code is in conf.c -- it can be tweaked if you are brave.
16463962SericERRLIST_PREDEFINED
16563962Seric		If set, assumes that some header file defines sys_errlist.
16663962Seric		This may be needed if you get type conflicts on this
16763962Seric		variable -- otherwise don't worry about it.
16860565Seric
16964035Seric
17064035Seric+-----------------------+
17164035Seric| COMPILE-TIME FEATURES |
17264035Seric+-----------------------+
17364035Seric
17460584SericThere are a bunch of features that you can decide to compile in, such
17560584Sericas selecting various database packages and special protocol support.
17660584SericSeveral are assumed based on other compilation flags -- if you want to
17760584Seric"un-assume" something, you probably need to edit conf.h.  Compilation
17860584Sericflags that add support for special features include:
17960565Seric
18060565SericNDBM		Include support for "new" DBM library for aliases and maps.
18164250Seric		Normally defined in the Makefile.
18260565SericNEWDB		Include support for Berkeley "db" package (hash & btree)
18364250Seric		for aliases and maps.  Normally defined in the Makefile.
18460565SericNIS		Define this to get NIS (YP) support for aliases and maps.
18564250Seric		Normally defined in the Makefile.
18660565SericUSERDB		Include support for the User Information Database.  Implied
18764250Seric		by NEWDB in conf.h.
18860565SericIDENTPROTO	Define this to get IDENT (RFC 1413) protocol support.
18960565Seric		This is assumed unless you are running on Ultrix or
19060565Seric		HP-UX, both of which have a problem in the UDP
19160565Seric		implementation.
19260565SericMIME		Include support for MIME-encapsulated error messages.
19360565SericLOG		Set this to get syslog(3) support.  Defined by default
19460584Seric		in conf.h.  You want this if at all possible.
19560565SericNETINET		Set this to get TCP/IP support.  Defined by default
19660584Seric		in conf.h.  You probably want this.
19760565SericNETISO		Define this to get ISO networking support.
19860565SericSMTP		Define this to get the SMTP code.  Implied by NETINET
19960565Seric		or NETISO.
20060565SericNAMED_BIND	Define this to get DNS (name daemon) support, including
20160565Seric		MX support.  The specs you must use this if you run
20260565Seric		SMTP.  Defined by default in conf.h.
20360565SericQUEUE		Define this to get queueing code.  Implied by NETINET
20460584Seric		or NETISO; required by SMTP.  This gives you other good
20560584Seric		stuff -- it should be on.
20660565SericDAEMON		Define this to get general network support.  Implied by
20760584Seric		NETINET or NETISO.  Defined by default in conf.h.  You
20860584Seric		almost certainly want it on.
20960565SericMATCHGECOS	Permit fuzzy matching of user names against the full
21060565Seric		name (GECOS) field in the /etc/passwd file.  This should
21160565Seric		probably be on, since you can disable it from the config
21260584Seric		file if you want to.  Defined by default in conf.h.
21360565SericSETPROCTITLE	Try to set the string printed by "ps" to something
21460584Seric		informative about what sendmail is doing.  Defined by
21560584Seric		default in conf.h.
21660565Seric
21764035Seric
21864035Seric+-------------------------------------+
21964035Seric| OPERATING SYSTEM AND COMPILE QUIRKS |
22064035Seric+-------------------------------------+
22164035Seric
22264376SericSunOS 4.x (Solaris 1.x)
22364376Seric	You may have to use -lresolv on SunOS.  However, beware that
22464376Seric	this links in a new version of gethostbyname that does not
22564376Seric	understand NIS, so you must have all of your hosts in DNS.
22664376Seric	I understand that resolv+ works properly, allowing you to
22764376Seric	specify a search-path of services.  I haven't tried this, as
22864376Seric	we use DNS exclusively.
22964035Seric
23064376SericSolaris 2.x (SunOS 5.x)
23164376Seric	To compile for Solaris, be sure you use -DSOLARIS.
23264376Seric
23364364Seric	From a correspondent:
23464364Seric
23564364Seric	   For solaris 2.2, I have
23664364Seric
23764364Seric		hosts:      files dns
23864364Seric
23964364Seric	   in /etc/nsswitch.conf and /etc/hosts has to have the fully
24064364Seric	   qualified host name. I think "files" has to be before "dns"
24164364Seric	   in /etc/nsswitch.conf during bootup.
24264364Seric
24364376Seric	To the best of my knowledge, Solaris does not have the
24464376Seric	gethostbyname problem described above.
24564376Seric
246*64385Seric	The Solaris "syslog" function is apparently limited to something
247*64385Seric	about 90 characters because of a kernel limitation.  If you have
248*64385Seric	source code, you can probably up this number.  Bill Wisner
249*64385Seric	<wisner@well.sf.ca.us> was able to get an unofficial, unsupported
250*64385Seric	patch.
251*64385Seric
25264250SericOSF/1
25364250Seric	If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
25457977Seric
25564250SericNeXT
25664250Seric	If you are compiling on NeXT, you will have to create an empty
25764250Seric	file "unistd.h" and create a file "dirent.h" containing:
25863753Seric
25964250Seric		#include <sys/dir.h>
26064250Seric		#define dirent	direct
26164035Seric
26264250Seric	(The Makefile.NeXT should try to do both of these for you.)
26364077Seric
26464364Seric	Apparently, there is a bug in getservbyname on Nextstep 3.0
26564364Seric	that causes it to fail under some circumstances with the
26664364Seric	message "SYSERR: service "smtp" unknown" logged.  You should
26764364Seric	be able to work around this by including the line:
26864364Seric
26964364Seric		OPort=25
27064364Seric
27164364Seric	in your .cf file.
27264364Seric
27364376Seric	You may have to use -DNeXT.
27464376Seric
27564250SericBSDI (BSD/386)
27664250Seric	I have reports that the "m4" from BSDI won't handle the config
27764250Seric	files properly.  I haven't had a chance to test this myself.
27857943Seric
27964364Seric4.3BSD
28064364Seric	If you are running a "virgin" version of 4.3BSD, you'll have
28164364Seric	a very old resolver and be missing some header files.  The
28264364Seric	header files are simple -- create empty versions and everything
28364364Seric	will work fine.  For the resolver you should really port a new
28464364Seric	version (4.8.3 or later) of the resolver; 4.9 is available on
28564364Seric	gatekeeper.DEC.COM in pub/BSD/bind/4.9.  If you are really
28664364Seric	determined to continue to use your old, buggy version (or as
28764364Seric	a shortcut to get sendmail working -- I'm sure you have the
28864364Seric	best intentions to port a modern version of BIND), you can
28964364Seric	copy ../contrib/oldbind.compat.c into src and add
29064364Seric	oldbind.compat.o to OBJADD in the Makefile.
29164364Seric
29264250SericBoth NEWDB and NDBM
29364250Seric	If you use both -DNDBM and -DNEWDB, you must delete the module
29464250Seric	ndbm.o from libdb.a and delete the file "ndbm.h" from the files
29564250Seric	that get installed (that is, use the OLD ndbm.h, not the new
29664250Seric	ndbm.h).  This compatibility module maps ndbm calls into DB
29764250Seric	calls, and breaks things rather badly.
29858709Seric
29964250Seric
30064035Seric+-----------------------------+
30164035Seric| DESCRIPTION OF SOURCE FILES |
30264035Seric+-----------------------------+
30364035Seric
3049881SericThe following list describes the files in this directory:
3055369Seric
30657418SericMakefile	The makefile used here; this version only works with
30757418Seric		the new Berkeley make.
30857418SericMakefile.dist	A trimmed down version of the makefile that works with
30957418Seric		the old make.
3105369SericREAD_ME		This file.
31160565SericTRACEFLAGS	My own personal list of the trace flags -- not guaranteed
31260565Seric		to be particularly up to date.
3135369Sericalias.c		Does name aliasing in all forms.
3149881Sericarpadate.c	A subroutine which creates ARPANET standard dates.
3159881Sericclock.c		Routines to implement real-time oriented functions
3169881Seric		in sendmail -- e.g., timeouts.
3175369Sericcollect.c	The routine that actually reads the mail into a temp
3185369Seric		file.  It also does a certain amount of parsing of
3195369Seric		the header, etc.
3205369Sericconf.c		The configuration file.  This contains information
3215369Seric		that is presumed to be quite static and non-
3225369Seric		controversial, or code compiled in for efficiency
3235369Seric		reasons.  Most of the configuration is in sendmail.cf.
3249881Sericconf.h		Configuration that must be known everywhere.
3255369Sericconvtime.c	A routine to sanely process times.
3269881Sericdaemon.c	Routines to implement daemon mode.  This version is
3279881Seric		specifically for Berkeley 4.1 IPC.
3285369Sericdeliver.c	Routines to deliver mail.
32960565Sericdomain.c	Routines that interface with DNS (the Domain Name
33060565Seric		System).
3315369Sericerr.c		Routines to print error messages.
3329881Sericenvelope.c	Routines to manipulate the envelope structure.
3335369Sericheaders.c	Routines to process message headers.
3345369Sericmacro.c		The macro expander.  This is used internally to
3355369Seric		insert information from the configuration file.
3365369Sericmain.c		The main routine to sendmail.  This file also
3375369Seric		contains some miscellaneous routines.
33860565Sericmap.c		Support for database maps.
33960565Sericmci.c		Routines that handle mail connection information caching.
3409881Sericparseaddr.c	The routines which do address parsing.
3415369Sericqueue.c		Routines to implement message queueing.
3425369Sericreadcf.c	The routine that reads the configuration file and
3435369Seric		translates it to internal form.
3449881Sericrecipient.c	Routines that manipulate the recipient list.
3455369Sericsavemail.c	Routines which save the letter on processing errors.
3465369Sericsendmail.h	Main header file for sendmail.
3475369Sericsrvrsmtp.c	Routines to implement server SMTP.
3485369Sericstab.c		Routines to manage the symbol table.
3495369Sericstats.c		Routines to collect and post the statistics.
3505369Sericsysexits.c	List of error messages associated with error codes
3515369Seric		in sysexits.h.
3529881Serictrace.c		The trace package.  These routines allow setting and
3539881Seric		testing of trace flags with a high granularity.
35460565Sericudb.c		The user database interface module.
3555369Sericusersmtp.c	Routines to implement user SMTP.
3565369Sericutil.c		Some general purpose routines used by sendmail.
35760565Sericversion.c	The version number and information about this
35860565Seric		version of sendmail.  Theoretically, this gets
35960565Seric		modified on every change.
3605369Seric
3615369SericEric Allman
3625369Seric
363*64385Seric(Version 8.21, last update 09/02/93 17:14:51)
364