xref: /csrg-svn/usr.sbin/sendmail/src/READ_ME (revision 64706)
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*64706Seric#	@(#)READ_ME	8.28 (Berkeley) 10/08/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.
1864501Seric(Paul Southworth <pauls@umich.edu> published a description of porting
1964501Sericthis make in comp.unix.bsd.)  This Makefile has assumptions about the
2064501Seric4.4 file system layout built in.
2157418Seric
2264501SericThere is also a Makefile.dist which is much less clever, but works on
2364501Sericthe old traditional make.  You can use this using:
2464501Seric
2557418Seric	make -f Makefile.dist
2657418Seric
2764262SericThere are a bunch of other Makefiles for other systems -- these are
2860584Sericthe ones that I use, they have "Berkeley quirks" in them, and I don't
2964262Sericguarantee that they will work unmodified in your environment.  However,
3064262Sericthey are all designed for the old make and can be used to help you get
3164262Sericstarted.  They have names like "Makefile.HPUX".  Many of them include
3264262Seric-I/usr/sww/include/db and -L/usr/sww/lib -- this is Berkeley's
3364262Sericlocation for the new database libraries, described below.
3457943Seric
3564272SericThere is also a shell script (makesendmail) that tries to be clever
3664272Sericabout using object subdirectories.  It's pretty straightforward, and
3764272Sericmay help if you share a source tree among different architectures.
3864035Seric
3964701SericIMPORTANT:  DO NOT USE OPTIMIZATION (``-O'') IF YOU ARE RUNNING GCC
4064701Seric2.4.x.  THERE IS A BUG IN THE GCC OPTIMIZER THAT CAUSES SENDMAIL TO
4164701SericFAIL MISERABLY.
4264272Seric
4364701Seric
4464250Seric+----------------------+
4564250Seric| DATABASE DEFINITIONS |
4664250Seric+----------------------+
4764250Seric
4864250SericThere are several database formats that can be used for the alias files
4964250Sericand for general maps.  When used for alias files they interact in an
5064250Sericattempt to be back compatible.
5164250Seric
5264250SericThe three options are NEWDB (the new Berkeley DB package), NDBM (the
5364250Sericolder DBM implementation -- the very old V7 implementation is no
5464250Sericlonger supported), and NIS (Network Information Services).  Used alone
5564376Sericthese just include the support they indicate.  [If you are using NEWDB,
5664376Sericget the latest version from FTP.CS.Berkeley.EDU in /ucb/4bsd.  DO NOT
5764376Sericuse the version from the Net2 distribution!]
5864250Seric
5964250SericIf NEWDB and NDBM are defined (but not NIS), then sendmail will read
6064250SericNDBM format alias files, but the next time a newaliases is run the
6164250Sericformat will be converted to NEWDB; that format will be used forever
6264250Sericmore.  This is intended as a transition feature.  [Note however that
6364250Sericthe NEWDB library also catches and maps NDBM calls; you will have to
6464250Sericback out this feature to get this to work.  See ``Quirks'' section
6564250Sericbelow for details.]
6664250Seric
6764250SericIf all three are defined, sendmail operates as described above, and also
6864250Sericlooks for the file /var/yp/Makefile.  If it exists, newaliases will
6964250Sericbuild BOTH the NEWDB and NDBM format alias files.  However, it will
7064250Sericonly use the NEWDB file; the NDBM format file is used only by the
7164250SericNIS subsystem.
7264250Seric
7364250SericIf NDBM and NIS are defined (regardless of the definition of NEWDB
7464250Sericor the existance of /var/yp/Makefile), sendmail adds the special
7564250Serictokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are
7664250Sericrequired if the NDBM file is to be used as an NIS map.
7764250Seric
7864250SericAll of -DNEWDB, -DNDBM, and -DNIS are normally defined in the DBMDEF
7964250Sericline in the Makefile.
8064250Seric
8164250Seric
8264035Seric+---------------+
8364035Seric| COMPILE FLAGS |
8464035Seric+---------------+
8564035Seric
8660565SericWhereever possible, I try to make sendmail pull in the correct
8760584Sericcompilation options needed to compile on various environments based on
8860584Sericautomatically defined symbols.  Some machines don't seem to have useful
8960584Sericsymbols availble, requiring the following compilation flags in the
9060584SericMakefile:
9160565Seric
9260565SericSOLARIS		Define this if you are running Solaris 2.0 or higher.
9364077SericNeXT		Define this if you are on a NeXT box.  (This one may
9464072Seric		be pre-defined for you.)  There are other hacks you
9564072Seric		have to make -- see below.
9660565Seric_AIX3		Define this if you are IBM AIX 3.x.
9763965SericRISCOS		Define this if you are running RISC/os from MIPS.
9864501Seric_SCO_unix_	Define this if you are on SCO UNIX.
9960565Seric
10060584SericIf you are a system that sendmail has already been ported to, you
10160584Sericprobably won't have to touch these.  But if you are porting, you may
10263962Serichave to tweak the following compilation flags in conf.h in order to
10363962Sericget it to compile and link properly:
10460565Seric
10560565SericSYSTEM5		Adjust for System V.
10664035SericSYS5SIGNALS	Use System V signal semantics -- the signal handler
10764035Seric		is automatically dropped when the signal is caught.
10864035Seric		If this is not set, use POSIX/BSD semantics, where the
10964035Seric		signal handler stays in force until an exec or an
11064035Seric		explicit delete.  Implied by SYSTEM5.
111*64706SericSYS5SETPGRP	Use System V setpgrp() semantics.  Implied by SYSTEM5.
11264035SericHASFLOCK	Set this if you prefer to use the flock(2) system call
11364035Seric		rather than using fcntl-based locking.  Fcntl locking
11464035Seric		has some semantic gotchas, but many vendor systems
11564035Seric		also interface it to lockd(8) to do NFS-style locking.
11664035Seric		For this reason, this should not be set unless you
11764035Seric		don't have an alternative.
11860565SericHASUNAME	Set if you have the "uname" system call.  Implied by
11960565Seric		SYSTEM5.
12063962SericHASUNSETENV	Define this if your system library has the "unsetenv"
12163962Seric		subroutine.
12260584SericHASSTATFS	Define this if you have the statfs(2) system call.  It's
12360584Seric		not a disaster to get this wrong -- but you do lose the
12460584Seric		queue free space code.
12560584SericHASUSTAT	Define this if you have the ustat(2) system call.  It's
12660584Seric		not a disaster to get this wrong -- but you do lose the
12760584Seric		queue free space code.
12860565SericHASSETSID	Define this if you have the setsid(2) system call.  This
12960565Seric		is implied if your system appears to be POSIX compliant.
13060565SericHASINITGROUPS	Define this if you have the initgroups(3) routine.
13163753SericHASSETVBUF	Define this if you have the setvbuf(3) library call.
13263753Seric		If you don't, setlinebuf will be used instead.  This
13363753Seric		defaults on if your compiler defines __STDC__.
13463902SericHASSETREUID	Define this if you have setreuid(2) ***AND*** root can
13563902Seric		use setreuid to change to an arbitrary user.  This second
13663902Seric		condition is not satisfied on AIX 3.x.  You may find that
13763902Seric		your system has setresuid(2), (for example, on HP-UX) in
13863902Seric		which case you will also have to #define setreuid(r, e)
13963902Seric		to be the appropriate call.  Some systems (such as Solaris)
14063902Seric		have a compatibility routine that doesn't work properly.
14163902Seric		The important thing is that you have a call that will set
14263902Seric		the effective uid independently of the real or saved uid.
14363902Seric		Setting this improves the security somewhat, since
14463902Seric		sendmail doesn't have to read .forward and :include: files
14563902Seric		as root.
14663937SericGIDSET_T	The type of entries in a gidset passed as the second
14763937Seric		argument to getgroups(2).  Historically this has been an
14863937Seric		int, so this is the default, but some systems (such as
14963937Seric		IRIX) pass it as a gid_t, which is an unsigned short.
15063937Seric		This will make a difference, so it is important to get
15163937Seric		this right!  However, it is only an issue if you have
15263937Seric		group sets.
15363968SericSLEEP_T		The type returned by the system sleep() function.
15463968Seric		Defaults to "unsigned int".  Don't worry about this
15563968Seric		if you don't have compilation problems.
15663974SericARBPTR_T	The type of an arbitrary pointer -- defaults to "void *".
15763974Seric		If you are an very old compiler you may need to define
15863974Seric		this to be "char *".
15960584SericLA_TYPE		The type of load average your kernel supports.  These
16060584Seric		can be LA_SUBR (4) if you have the getloadavg(3) routine,
16164376Seric		LA_MACH (5) to use MACH-style load averages (calls
16264376Seric		processor_set_info()), LA_FLOAT (3) if you read kmem and
16364376Seric		interpret the value as a floating point number, LA_INT (2)
16464376Seric		to interpret as a long integer, or LA_SHORT (6) to
16564376Seric		interpret as a short integer.  These last three have
16664376Seric		several other parameters that they try to divine: the
16764376Seric		name of your kernel, the name of the variable in the
16864376Seric		kernel to examine, the number of bits of precision in
16964376Seric		a fixed point load average, and so forth.  In desparation,
17064376Seric		use LA_ZERO (1) -- it always returns the load average as
17164376Seric		"zero" (and does so on all architectures).  The actual
17264376Seric		code is in conf.c -- it can be tweaked if you are brave.
17363962SericERRLIST_PREDEFINED
17463962Seric		If set, assumes that some header file defines sys_errlist.
17563962Seric		This may be needed if you get type conflicts on this
17663962Seric		variable -- otherwise don't worry about it.
17764562SericWAITUNION	The wait(2) routine takes a "union wait" argument instead
17864562Seric		of an integer argument.  This is for compatibility with
17964562Seric		old versions of BSD.
18060565Seric
18164035Seric
18264035Seric+-----------------------+
18364035Seric| COMPILE-TIME FEATURES |
18464035Seric+-----------------------+
18564035Seric
18660584SericThere are a bunch of features that you can decide to compile in, such
18760584Sericas selecting various database packages and special protocol support.
18860584SericSeveral are assumed based on other compilation flags -- if you want to
18960584Seric"un-assume" something, you probably need to edit conf.h.  Compilation
19060584Sericflags that add support for special features include:
19160565Seric
19260565SericNDBM		Include support for "new" DBM library for aliases and maps.
19364250Seric		Normally defined in the Makefile.
19460565SericNEWDB		Include support for Berkeley "db" package (hash & btree)
19564250Seric		for aliases and maps.  Normally defined in the Makefile.
19660565SericNIS		Define this to get NIS (YP) support for aliases and maps.
19764250Seric		Normally defined in the Makefile.
19860565SericUSERDB		Include support for the User Information Database.  Implied
19964250Seric		by NEWDB in conf.h.
20060565SericIDENTPROTO	Define this to get IDENT (RFC 1413) protocol support.
20160565Seric		This is assumed unless you are running on Ultrix or
20260565Seric		HP-UX, both of which have a problem in the UDP
20360565Seric		implementation.
20460565SericMIME		Include support for MIME-encapsulated error messages.
20560565SericLOG		Set this to get syslog(3) support.  Defined by default
20660584Seric		in conf.h.  You want this if at all possible.
20760565SericNETINET		Set this to get TCP/IP support.  Defined by default
20860584Seric		in conf.h.  You probably want this.
20960565SericNETISO		Define this to get ISO networking support.
21060565SericSMTP		Define this to get the SMTP code.  Implied by NETINET
21160565Seric		or NETISO.
21260565SericNAMED_BIND	Define this to get DNS (name daemon) support, including
21360565Seric		MX support.  The specs you must use this if you run
21460565Seric		SMTP.  Defined by default in conf.h.
21560565SericQUEUE		Define this to get queueing code.  Implied by NETINET
21660584Seric		or NETISO; required by SMTP.  This gives you other good
21760584Seric		stuff -- it should be on.
21860565SericDAEMON		Define this to get general network support.  Implied by
21960584Seric		NETINET or NETISO.  Defined by default in conf.h.  You
22060584Seric		almost certainly want it on.
22160565SericMATCHGECOS	Permit fuzzy matching of user names against the full
22260565Seric		name (GECOS) field in the /etc/passwd file.  This should
22360565Seric		probably be on, since you can disable it from the config
22460584Seric		file if you want to.  Defined by default in conf.h.
22560565SericSETPROCTITLE	Try to set the string printed by "ps" to something
22660584Seric		informative about what sendmail is doing.  Defined by
22760584Seric		default in conf.h.
22860565Seric
22964035Seric
23064035Seric+-------------------------------------+
23164035Seric| OPERATING SYSTEM AND COMPILE QUIRKS |
23264035Seric+-------------------------------------+
23364035Seric
23464376SericSunOS 4.x (Solaris 1.x)
23564376Seric	You may have to use -lresolv on SunOS.  However, beware that
23664376Seric	this links in a new version of gethostbyname that does not
23764376Seric	understand NIS, so you must have all of your hosts in DNS.
23864035Seric
23964400Seric	There is substantial disagreement about whether you can make
24064400Seric	this work with resolv+, which allows you to specify a search-path
24164400Seric	of services.  Some people report that it works fine, others
24264400Seric	claim it doesn't work at all (including causing sendmail to
24364400Seric	drop core when it tries to do multiple resolv+ lookups for a
24464400Seric	single job).  I haven't tried resolv+, as we use DNS exclusively.
24564400Seric
24664400Seric	Should you want to try resolv+, it is on ftp.uu.net in
24764400Seric	/networking/ip/dns.
24864400Seric
24964376SericSolaris 2.x (SunOS 5.x)
25064376Seric	To compile for Solaris, be sure you use -DSOLARIS.
25164376Seric
25264364Seric	From a correspondent:
25364364Seric
25464364Seric	   For solaris 2.2, I have
25564364Seric
25664364Seric		hosts:      files dns
25764364Seric
25864364Seric	   in /etc/nsswitch.conf and /etc/hosts has to have the fully
25964364Seric	   qualified host name. I think "files" has to be before "dns"
26064364Seric	   in /etc/nsswitch.conf during bootup.
26164364Seric
26264376Seric	To the best of my knowledge, Solaris does not have the
26364376Seric	gethostbyname problem described above.
26464376Seric
26564385Seric	The Solaris "syslog" function is apparently limited to something
26664385Seric	about 90 characters because of a kernel limitation.  If you have
26764385Seric	source code, you can probably up this number.  Bill Wisner
26864385Seric	<wisner@well.sf.ca.us> was able to get an unofficial, unsupported
26964385Seric	patch.
27064385Seric
27164250SericOSF/1
27264250Seric	If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
27357977Seric
27464250SericNeXT
27564250Seric	If you are compiling on NeXT, you will have to create an empty
27664250Seric	file "unistd.h" and create a file "dirent.h" containing:
27763753Seric
27864250Seric		#include <sys/dir.h>
27964250Seric		#define dirent	direct
28064035Seric
28164250Seric	(The Makefile.NeXT should try to do both of these for you.)
28264077Seric
28364364Seric	Apparently, there is a bug in getservbyname on Nextstep 3.0
28464364Seric	that causes it to fail under some circumstances with the
28564364Seric	message "SYSERR: service "smtp" unknown" logged.  You should
28664364Seric	be able to work around this by including the line:
28764364Seric
28864670Seric		OOPort=25
28964364Seric
29064364Seric	in your .cf file.
29164364Seric
29264376Seric	You may have to use -DNeXT.
29364376Seric
29464250SericBSDI (BSD/386)
29564250Seric	I have reports that the "m4" from BSDI won't handle the config
29664250Seric	files properly.  I haven't had a chance to test this myself.
29757943Seric
29864364Seric4.3BSD
29964364Seric	If you are running a "virgin" version of 4.3BSD, you'll have
30064364Seric	a very old resolver and be missing some header files.  The
30164364Seric	header files are simple -- create empty versions and everything
30264364Seric	will work fine.  For the resolver you should really port a new
30364364Seric	version (4.8.3 or later) of the resolver; 4.9 is available on
30464364Seric	gatekeeper.DEC.COM in pub/BSD/bind/4.9.  If you are really
30564364Seric	determined to continue to use your old, buggy version (or as
30664364Seric	a shortcut to get sendmail working -- I'm sure you have the
30764364Seric	best intentions to port a modern version of BIND), you can
30864364Seric	copy ../contrib/oldbind.compat.c into src and add
30964364Seric	oldbind.compat.o to OBJADD in the Makefile.
31064364Seric
31164501SericLinux
31264501Seric	From: Karl London <karl@borg.demon.co.uk>
31364501Seric	Subject: Little bit to add to a readme for Linux for 8.6
31464501Seric	Date: Fri, 10 Sep 1993 20:16:05 +0100 (BST)
31564501Seric
31664501Seric	Below is a copy of a section of the /usr/include/unistd.h from
31764501Seric	linux libc-4.4.1 which needs changing because of a bug in the
31864501Seric	header files. Should be fixed for future releases..
31964501Seric
32064501Seric	Karl
32164501Seric
32264501Seric	The #if 0 and #endif are new!!
32364501Seric
32464501Seric	-------
32564501Seric
32664501Seric	   If OPTS begins with `--', then non-option arguments
32764501Seric	   are treated as arguments to the option '\0'.
32864501Seric	   This behavior is specific to the GNU `getopt'.  */
32964501Seric	#if 0
33064501Seric	extern int getopt __P ((int __argc, char *__const * __argv,
33164501Seric				__const char *__opts));
33264501Seric	#endif
33364501Seric	extern int opterr;
33464501Seric	extern int optind;
33564501Seric
33664250SericBoth NEWDB and NDBM
33764250Seric	If you use both -DNDBM and -DNEWDB, you must delete the module
33864250Seric	ndbm.o from libdb.a and delete the file "ndbm.h" from the files
33964250Seric	that get installed (that is, use the OLD ndbm.h, not the new
34064250Seric	ndbm.h).  This compatibility module maps ndbm calls into DB
34164250Seric	calls, and breaks things rather badly.
34258709Seric
34364559SericGNU getopt
34464559Seric	I'm told that GNU getopt has a problem in that it gets confused
34564559Seric	by the double call.  Use the version in conf.c instead.
34664250Seric
34764559Seric
34864035Seric+-----------------------------+
34964035Seric| DESCRIPTION OF SOURCE FILES |
35064035Seric+-----------------------------+
35164035Seric
3529881SericThe following list describes the files in this directory:
3535369Seric
35457418SericMakefile	The makefile used here; this version only works with
35557418Seric		the new Berkeley make.
35657418SericMakefile.dist	A trimmed down version of the makefile that works with
35757418Seric		the old make.
3585369SericREAD_ME		This file.
35960565SericTRACEFLAGS	My own personal list of the trace flags -- not guaranteed
36060565Seric		to be particularly up to date.
3615369Sericalias.c		Does name aliasing in all forms.
3629881Sericarpadate.c	A subroutine which creates ARPANET standard dates.
3639881Sericclock.c		Routines to implement real-time oriented functions
3649881Seric		in sendmail -- e.g., timeouts.
3655369Sericcollect.c	The routine that actually reads the mail into a temp
3665369Seric		file.  It also does a certain amount of parsing of
3675369Seric		the header, etc.
3685369Sericconf.c		The configuration file.  This contains information
3695369Seric		that is presumed to be quite static and non-
3705369Seric		controversial, or code compiled in for efficiency
3715369Seric		reasons.  Most of the configuration is in sendmail.cf.
3729881Sericconf.h		Configuration that must be known everywhere.
3735369Sericconvtime.c	A routine to sanely process times.
3749881Sericdaemon.c	Routines to implement daemon mode.  This version is
3759881Seric		specifically for Berkeley 4.1 IPC.
3765369Sericdeliver.c	Routines to deliver mail.
37760565Sericdomain.c	Routines that interface with DNS (the Domain Name
37860565Seric		System).
3795369Sericerr.c		Routines to print error messages.
3809881Sericenvelope.c	Routines to manipulate the envelope structure.
3815369Sericheaders.c	Routines to process message headers.
3825369Sericmacro.c		The macro expander.  This is used internally to
3835369Seric		insert information from the configuration file.
3845369Sericmain.c		The main routine to sendmail.  This file also
3855369Seric		contains some miscellaneous routines.
38660565Sericmap.c		Support for database maps.
38760565Sericmci.c		Routines that handle mail connection information caching.
3889881Sericparseaddr.c	The routines which do address parsing.
3895369Sericqueue.c		Routines to implement message queueing.
3905369Sericreadcf.c	The routine that reads the configuration file and
3915369Seric		translates it to internal form.
3929881Sericrecipient.c	Routines that manipulate the recipient list.
3935369Sericsavemail.c	Routines which save the letter on processing errors.
3945369Sericsendmail.h	Main header file for sendmail.
3955369Sericsrvrsmtp.c	Routines to implement server SMTP.
3965369Sericstab.c		Routines to manage the symbol table.
3975369Sericstats.c		Routines to collect and post the statistics.
3985369Sericsysexits.c	List of error messages associated with error codes
3995369Seric		in sysexits.h.
4009881Serictrace.c		The trace package.  These routines allow setting and
4019881Seric		testing of trace flags with a high granularity.
40260565Sericudb.c		The user database interface module.
4035369Sericusersmtp.c	Routines to implement user SMTP.
4045369Sericutil.c		Some general purpose routines used by sendmail.
40560565Sericversion.c	The version number and information about this
40660565Seric		version of sendmail.  Theoretically, this gets
40760565Seric		modified on every change.
4085369Seric
4095369SericEric Allman
4105369Seric
411*64706Seric(Version 8.28, last update 10/08/93 16:01:21)
412