xref: /csrg-svn/usr.sbin/sendmail/src/READ_ME (revision 64364)
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*64364Seric#	@(#)READ_ME	8.19 (Berkeley) 08/26/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
4864250Sericthese just include the support they indicate.
4964250Seric
5064250SericIf NEWDB and NDBM are defined (but not NIS), then sendmail will read
5164250SericNDBM format alias files, but the next time a newaliases is run the
5264250Sericformat will be converted to NEWDB; that format will be used forever
5364250Sericmore.  This is intended as a transition feature.  [Note however that
5464250Sericthe NEWDB library also catches and maps NDBM calls; you will have to
5564250Sericback out this feature to get this to work.  See ``Quirks'' section
5664250Sericbelow for details.]
5764250Seric
5864250SericIf all three are defined, sendmail operates as described above, and also
5964250Sericlooks for the file /var/yp/Makefile.  If it exists, newaliases will
6064250Sericbuild BOTH the NEWDB and NDBM format alias files.  However, it will
6164250Sericonly use the NEWDB file; the NDBM format file is used only by the
6264250SericNIS subsystem.
6364250Seric
6464250SericIf NDBM and NIS are defined (regardless of the definition of NEWDB
6564250Sericor the existance of /var/yp/Makefile), sendmail adds the special
6664250Serictokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are
6764250Sericrequired if the NDBM file is to be used as an NIS map.
6864250Seric
6964250SericAll of -DNEWDB, -DNDBM, and -DNIS are normally defined in the DBMDEF
7064250Sericline in the Makefile.
7164250Seric
7264250Seric
7364035Seric+---------------+
7464035Seric| COMPILE FLAGS |
7564035Seric+---------------+
7664035Seric
7760565SericWhereever possible, I try to make sendmail pull in the correct
7860584Sericcompilation options needed to compile on various environments based on
7960584Sericautomatically defined symbols.  Some machines don't seem to have useful
8060584Sericsymbols availble, requiring the following compilation flags in the
8160584SericMakefile:
8260565Seric
8360565SericSOLARIS		Define this if you are running Solaris 2.0 or higher.
8464077SericNeXT		Define this if you are on a NeXT box.  (This one may
8564072Seric		be pre-defined for you.)  There are other hacks you
8664072Seric		have to make -- see below.
8760565Seric_AIX3		Define this if you are IBM AIX 3.x.
8863965SericRISCOS		Define this if you are running RISC/os from MIPS.
8960565Seric
9060584SericIf you are a system that sendmail has already been ported to, you
9160584Sericprobably won't have to touch these.  But if you are porting, you may
9263962Serichave to tweak the following compilation flags in conf.h in order to
9363962Sericget it to compile and link properly:
9460565Seric
9560565SericSYSTEM5		Adjust for System V.
9664035SericSYS5SIGNALS	Use System V signal semantics -- the signal handler
9764035Seric		is automatically dropped when the signal is caught.
9864035Seric		If this is not set, use POSIX/BSD semantics, where the
9964035Seric		signal handler stays in force until an exec or an
10064035Seric		explicit delete.  Implied by SYSTEM5.
10164035SericHASFLOCK	Set this if you prefer to use the flock(2) system call
10264035Seric		rather than using fcntl-based locking.  Fcntl locking
10364035Seric		has some semantic gotchas, but many vendor systems
10464035Seric		also interface it to lockd(8) to do NFS-style locking.
10564035Seric		For this reason, this should not be set unless you
10664035Seric		don't have an alternative.
10760565SericHASUNAME	Set if you have the "uname" system call.  Implied by
10860565Seric		SYSTEM5.
10963962SericHASUNSETENV	Define this if your system library has the "unsetenv"
11063962Seric		subroutine.
11160584SericHASSTATFS	Define this if you have the statfs(2) system call.  It's
11260584Seric		not a disaster to get this wrong -- but you do lose the
11360584Seric		queue free space code.
11460584SericHASUSTAT	Define this if you have the ustat(2) system call.  It's
11560584Seric		not a disaster to get this wrong -- but you do lose the
11660584Seric		queue free space code.
11760565SericHASSETSID	Define this if you have the setsid(2) system call.  This
11860565Seric		is implied if your system appears to be POSIX compliant.
11960565SericHASINITGROUPS	Define this if you have the initgroups(3) routine.
12063753SericHASSETVBUF	Define this if you have the setvbuf(3) library call.
12163753Seric		If you don't, setlinebuf will be used instead.  This
12263753Seric		defaults on if your compiler defines __STDC__.
12363902SericHASSETREUID	Define this if you have setreuid(2) ***AND*** root can
12463902Seric		use setreuid to change to an arbitrary user.  This second
12563902Seric		condition is not satisfied on AIX 3.x.  You may find that
12663902Seric		your system has setresuid(2), (for example, on HP-UX) in
12763902Seric		which case you will also have to #define setreuid(r, e)
12863902Seric		to be the appropriate call.  Some systems (such as Solaris)
12963902Seric		have a compatibility routine that doesn't work properly.
13063902Seric		The important thing is that you have a call that will set
13163902Seric		the effective uid independently of the real or saved uid.
13263902Seric		Setting this improves the security somewhat, since
13363902Seric		sendmail doesn't have to read .forward and :include: files
13463902Seric		as root.
13563937SericGIDSET_T	The type of entries in a gidset passed as the second
13663937Seric		argument to getgroups(2).  Historically this has been an
13763937Seric		int, so this is the default, but some systems (such as
13863937Seric		IRIX) pass it as a gid_t, which is an unsigned short.
13963937Seric		This will make a difference, so it is important to get
14063937Seric		this right!  However, it is only an issue if you have
14163937Seric		group sets.
14263968SericSLEEP_T		The type returned by the system sleep() function.
14363968Seric		Defaults to "unsigned int".  Don't worry about this
14463968Seric		if you don't have compilation problems.
14563974SericARBPTR_T	The type of an arbitrary pointer -- defaults to "void *".
14663974Seric		If you are an very old compiler you may need to define
14763974Seric		this to be "char *".
14860584SericLA_TYPE		The type of load average your kernel supports.  These
14960584Seric		can be LA_SUBR (4) if you have the getloadavg(3) routine,
15060584Seric		LA_FLOAT (3) if you read kmem and interpret the value
15160584Seric		as a floating point number, LA_INT (2) to interpret as
15260584Seric		an integer.  These last two have several other parameters
15360584Seric		that they try to divine: the name of your kernel, the name
15460584Seric		of the variable in the kernel to examine, the number of
15560584Seric		bits of precision in a fixed point load average, and so
15660584Seric		forth.  In desparation, use LA_ZERO -- it always returns
15760584Seric		the load average as "zero" (and does so on all architectures).
15860584Seric		The actual code is in conf.c -- it can be tweaked if you
15960584Seric		are brave.
16063962SericERRLIST_PREDEFINED
16163962Seric		If set, assumes that some header file defines sys_errlist.
16263962Seric		This may be needed if you get type conflicts on this
16363962Seric		variable -- otherwise don't worry about it.
16460565Seric
16564035Seric
16664035Seric+-----------------------+
16764035Seric| COMPILE-TIME FEATURES |
16864035Seric+-----------------------+
16964035Seric
17060584SericThere are a bunch of features that you can decide to compile in, such
17160584Sericas selecting various database packages and special protocol support.
17260584SericSeveral are assumed based on other compilation flags -- if you want to
17360584Seric"un-assume" something, you probably need to edit conf.h.  Compilation
17460584Sericflags that add support for special features include:
17560565Seric
17660565SericNDBM		Include support for "new" DBM library for aliases and maps.
17764250Seric		Normally defined in the Makefile.
17860565SericNEWDB		Include support for Berkeley "db" package (hash & btree)
17964250Seric		for aliases and maps.  Normally defined in the Makefile.
18060565SericNIS		Define this to get NIS (YP) support for aliases and maps.
18164250Seric		Normally defined in the Makefile.
18260565SericUSERDB		Include support for the User Information Database.  Implied
18364250Seric		by NEWDB in conf.h.
18460565SericIDENTPROTO	Define this to get IDENT (RFC 1413) protocol support.
18560565Seric		This is assumed unless you are running on Ultrix or
18660565Seric		HP-UX, both of which have a problem in the UDP
18760565Seric		implementation.
18860565SericMIME		Include support for MIME-encapsulated error messages.
18960565SericLOG		Set this to get syslog(3) support.  Defined by default
19060584Seric		in conf.h.  You want this if at all possible.
19160565SericNETINET		Set this to get TCP/IP support.  Defined by default
19260584Seric		in conf.h.  You probably want this.
19360565SericNETISO		Define this to get ISO networking support.
19460565SericSMTP		Define this to get the SMTP code.  Implied by NETINET
19560565Seric		or NETISO.
19660565SericNAMED_BIND	Define this to get DNS (name daemon) support, including
19760565Seric		MX support.  The specs you must use this if you run
19860565Seric		SMTP.  Defined by default in conf.h.
19960565SericQUEUE		Define this to get queueing code.  Implied by NETINET
20060584Seric		or NETISO; required by SMTP.  This gives you other good
20160584Seric		stuff -- it should be on.
20260565SericDAEMON		Define this to get general network support.  Implied by
20360584Seric		NETINET or NETISO.  Defined by default in conf.h.  You
20460584Seric		almost certainly want it on.
20560565SericMATCHGECOS	Permit fuzzy matching of user names against the full
20660565Seric		name (GECOS) field in the /etc/passwd file.  This should
20760565Seric		probably be on, since you can disable it from the config
20860584Seric		file if you want to.  Defined by default in conf.h.
20960565SericSETPROCTITLE	Try to set the string printed by "ps" to something
21060584Seric		informative about what sendmail is doing.  Defined by
21160584Seric		default in conf.h.
21260565Seric
21364035Seric
21464035Seric+-------------------------------------+
21564035Seric| OPERATING SYSTEM AND COMPILE QUIRKS |
21664035Seric+-------------------------------------+
21764035Seric
21864250SericSunOS
21964250Seric	You may have to use -lresolv on SunOS.
22064035Seric
221*64364SericSolaris
222*64364Seric	From a correspondent:
223*64364Seric
224*64364Seric	   For solaris 2.2, I have
225*64364Seric
226*64364Seric		hosts:      files dns
227*64364Seric
228*64364Seric	   in /etc/nsswitch.conf and /etc/hosts has to have the fully
229*64364Seric	   qualified host name. I think "files" has to be before "dns"
230*64364Seric	   in /etc/nsswitch.conf during bootup.
231*64364Seric
23264250SericOSF/1
23364250Seric	If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
23457977Seric
23564250SericNeXT
23664250Seric	If you are compiling on NeXT, you will have to create an empty
23764250Seric	file "unistd.h" and create a file "dirent.h" containing:
23863753Seric
23964250Seric		#include <sys/dir.h>
24064250Seric		#define dirent	direct
24164035Seric
24264250Seric	(The Makefile.NeXT should try to do both of these for you.)
24364077Seric
244*64364Seric	Apparently, there is a bug in getservbyname on Nextstep 3.0
245*64364Seric	that causes it to fail under some circumstances with the
246*64364Seric	message "SYSERR: service "smtp" unknown" logged.  You should
247*64364Seric	be able to work around this by including the line:
248*64364Seric
249*64364Seric		OPort=25
250*64364Seric
251*64364Seric	in your .cf file.
252*64364Seric
25364250SericBSDI (BSD/386)
25464250Seric	I have reports that the "m4" from BSDI won't handle the config
25564250Seric	files properly.  I haven't had a chance to test this myself.
25657943Seric
257*64364Seric4.3BSD
258*64364Seric	If you are running a "virgin" version of 4.3BSD, you'll have
259*64364Seric	a very old resolver and be missing some header files.  The
260*64364Seric	header files are simple -- create empty versions and everything
261*64364Seric	will work fine.  For the resolver you should really port a new
262*64364Seric	version (4.8.3 or later) of the resolver; 4.9 is available on
263*64364Seric	gatekeeper.DEC.COM in pub/BSD/bind/4.9.  If you are really
264*64364Seric	determined to continue to use your old, buggy version (or as
265*64364Seric	a shortcut to get sendmail working -- I'm sure you have the
266*64364Seric	best intentions to port a modern version of BIND), you can
267*64364Seric	copy ../contrib/oldbind.compat.c into src and add
268*64364Seric	oldbind.compat.o to OBJADD in the Makefile.
269*64364Seric
27064250SericBoth NEWDB and NDBM
27164250Seric	If you use both -DNDBM and -DNEWDB, you must delete the module
27264250Seric	ndbm.o from libdb.a and delete the file "ndbm.h" from the files
27364250Seric	that get installed (that is, use the OLD ndbm.h, not the new
27464250Seric	ndbm.h).  This compatibility module maps ndbm calls into DB
27564250Seric	calls, and breaks things rather badly.
27658709Seric
27764250Seric
27864035Seric+-----------------------------+
27964035Seric| DESCRIPTION OF SOURCE FILES |
28064035Seric+-----------------------------+
28164035Seric
2829881SericThe following list describes the files in this directory:
2835369Seric
28457418SericMakefile	The makefile used here; this version only works with
28557418Seric		the new Berkeley make.
28657418SericMakefile.dist	A trimmed down version of the makefile that works with
28757418Seric		the old make.
2885369SericREAD_ME		This file.
28960565SericTRACEFLAGS	My own personal list of the trace flags -- not guaranteed
29060565Seric		to be particularly up to date.
2915369Sericalias.c		Does name aliasing in all forms.
2929881Sericarpadate.c	A subroutine which creates ARPANET standard dates.
2939881Sericclock.c		Routines to implement real-time oriented functions
2949881Seric		in sendmail -- e.g., timeouts.
2955369Sericcollect.c	The routine that actually reads the mail into a temp
2965369Seric		file.  It also does a certain amount of parsing of
2975369Seric		the header, etc.
2985369Sericconf.c		The configuration file.  This contains information
2995369Seric		that is presumed to be quite static and non-
3005369Seric		controversial, or code compiled in for efficiency
3015369Seric		reasons.  Most of the configuration is in sendmail.cf.
3029881Sericconf.h		Configuration that must be known everywhere.
3035369Sericconvtime.c	A routine to sanely process times.
3049881Sericdaemon.c	Routines to implement daemon mode.  This version is
3059881Seric		specifically for Berkeley 4.1 IPC.
3065369Sericdeliver.c	Routines to deliver mail.
30760565Sericdomain.c	Routines that interface with DNS (the Domain Name
30860565Seric		System).
3095369Sericerr.c		Routines to print error messages.
3109881Sericenvelope.c	Routines to manipulate the envelope structure.
3115369Sericheaders.c	Routines to process message headers.
3125369Sericmacro.c		The macro expander.  This is used internally to
3135369Seric		insert information from the configuration file.
3145369Sericmain.c		The main routine to sendmail.  This file also
3155369Seric		contains some miscellaneous routines.
31660565Sericmap.c		Support for database maps.
31760565Sericmci.c		Routines that handle mail connection information caching.
3189881Sericparseaddr.c	The routines which do address parsing.
3195369Sericqueue.c		Routines to implement message queueing.
3205369Sericreadcf.c	The routine that reads the configuration file and
3215369Seric		translates it to internal form.
3229881Sericrecipient.c	Routines that manipulate the recipient list.
3235369Sericsavemail.c	Routines which save the letter on processing errors.
3245369Sericsendmail.h	Main header file for sendmail.
3255369Sericsrvrsmtp.c	Routines to implement server SMTP.
3265369Sericstab.c		Routines to manage the symbol table.
3275369Sericstats.c		Routines to collect and post the statistics.
3285369Sericsysexits.c	List of error messages associated with error codes
3295369Seric		in sysexits.h.
3309881Serictrace.c		The trace package.  These routines allow setting and
3319881Seric		testing of trace flags with a high granularity.
33260565Sericudb.c		The user database interface module.
3335369Sericusersmtp.c	Routines to implement user SMTP.
3345369Sericutil.c		Some general purpose routines used by sendmail.
33560565Sericversion.c	The version number and information about this
33660565Seric		version of sendmail.  Theoretically, this gets
33760565Seric		modified on every change.
3385369Seric
3395369SericEric Allman
3405369Seric
341*64364Seric(Version 8.19, last update 08/26/93 11:22:15)
342