xref: /original-bsd/usr.sbin/sendmail/src/READ_ME (revision ae751293)
1# Copyright (c) 1983 Eric P. Allman
2# Copyright (c) 1988 The Regents of the University of California.
3# All rights reserved.
4#
5# %sccs.include.redist.sh%
6#
7#	@(#)READ_ME	8.22 (Berkeley) 09/04/93
8#
9
10This directory contains the source files for sendmail.
11
12For detailed instructions, please read the document ../doc/op.me:
13
14	eqn ../doc/op.me | pic | ditroff -me
15
16The Makefile is for the new (4.4BSD) Berkeley make, available from
17ftp.uu.net in the directory /systems/unix/bsd-sources/usr.bin/make.
18It has assumptions about the 4.4 file system layout built in.  There
19is also a Makefile.dist which is much less clever, but works on the
20old traditional make.  You can use this using:
21
22	make -f Makefile.dist
23
24There are a bunch of other Makefiles for other systems -- these are
25the ones that I use, they have "Berkeley quirks" in them, and I don't
26guarantee that they will work unmodified in your environment.  However,
27they are all designed for the old make and can be used to help you get
28started.  They have names like "Makefile.HPUX".  Many of them include
29-I/usr/sww/include/db and -L/usr/sww/lib -- this is Berkeley's
30location for the new database libraries, described below.
31
32There is also a shell script (makesendmail) that tries to be clever
33about using object subdirectories.  It's pretty straightforward, and
34may help if you share a source tree among different architectures.
35
36
37+----------------------+
38| DATABASE DEFINITIONS |
39+----------------------+
40
41There are several database formats that can be used for the alias files
42and for general maps.  When used for alias files they interact in an
43attempt to be back compatible.
44
45The three options are NEWDB (the new Berkeley DB package), NDBM (the
46older DBM implementation -- the very old V7 implementation is no
47longer supported), and NIS (Network Information Services).  Used alone
48these just include the support they indicate.  [If you are using NEWDB,
49get the latest version from FTP.CS.Berkeley.EDU in /ucb/4bsd.  DO NOT
50use the version from the Net2 distribution!]
51
52If NEWDB and NDBM are defined (but not NIS), then sendmail will read
53NDBM format alias files, but the next time a newaliases is run the
54format will be converted to NEWDB; that format will be used forever
55more.  This is intended as a transition feature.  [Note however that
56the NEWDB library also catches and maps NDBM calls; you will have to
57back out this feature to get this to work.  See ``Quirks'' section
58below for details.]
59
60If all three are defined, sendmail operates as described above, and also
61looks for the file /var/yp/Makefile.  If it exists, newaliases will
62build BOTH the NEWDB and NDBM format alias files.  However, it will
63only use the NEWDB file; the NDBM format file is used only by the
64NIS subsystem.
65
66If NDBM and NIS are defined (regardless of the definition of NEWDB
67or the existance of /var/yp/Makefile), sendmail adds the special
68tokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are
69required if the NDBM file is to be used as an NIS map.
70
71All of -DNEWDB, -DNDBM, and -DNIS are normally defined in the DBMDEF
72line in the Makefile.
73
74
75+---------------+
76| COMPILE FLAGS |
77+---------------+
78
79Whereever possible, I try to make sendmail pull in the correct
80compilation options needed to compile on various environments based on
81automatically defined symbols.  Some machines don't seem to have useful
82symbols availble, requiring the following compilation flags in the
83Makefile:
84
85SOLARIS		Define this if you are running Solaris 2.0 or higher.
86NeXT		Define this if you are on a NeXT box.  (This one may
87		be pre-defined for you.)  There are other hacks you
88		have to make -- see below.
89_AIX3		Define this if you are IBM AIX 3.x.
90RISCOS		Define this if you are running RISC/os from MIPS.
91
92If you are a system that sendmail has already been ported to, you
93probably won't have to touch these.  But if you are porting, you may
94have to tweak the following compilation flags in conf.h in order to
95get it to compile and link properly:
96
97SYSTEM5		Adjust for System V.
98SYS5SIGNALS	Use System V signal semantics -- the signal handler
99		is automatically dropped when the signal is caught.
100		If this is not set, use POSIX/BSD semantics, where the
101		signal handler stays in force until an exec or an
102		explicit delete.  Implied by SYSTEM5.
103HASFLOCK	Set this if you prefer to use the flock(2) system call
104		rather than using fcntl-based locking.  Fcntl locking
105		has some semantic gotchas, but many vendor systems
106		also interface it to lockd(8) to do NFS-style locking.
107		For this reason, this should not be set unless you
108		don't have an alternative.
109HASUNAME	Set if you have the "uname" system call.  Implied by
110		SYSTEM5.
111HASUNSETENV	Define this if your system library has the "unsetenv"
112		subroutine.
113HASSTATFS	Define this if you have the statfs(2) system call.  It's
114		not a disaster to get this wrong -- but you do lose the
115		queue free space code.
116HASUSTAT	Define this if you have the ustat(2) system call.  It's
117		not a disaster to get this wrong -- but you do lose the
118		queue free space code.
119HASSETSID	Define this if you have the setsid(2) system call.  This
120		is implied if your system appears to be POSIX compliant.
121HASINITGROUPS	Define this if you have the initgroups(3) routine.
122HASSETVBUF	Define this if you have the setvbuf(3) library call.
123		If you don't, setlinebuf will be used instead.  This
124		defaults on if your compiler defines __STDC__.
125HASSETREUID	Define this if you have setreuid(2) ***AND*** root can
126		use setreuid to change to an arbitrary user.  This second
127		condition is not satisfied on AIX 3.x.  You may find that
128		your system has setresuid(2), (for example, on HP-UX) in
129		which case you will also have to #define setreuid(r, e)
130		to be the appropriate call.  Some systems (such as Solaris)
131		have a compatibility routine that doesn't work properly.
132		The important thing is that you have a call that will set
133		the effective uid independently of the real or saved uid.
134		Setting this improves the security somewhat, since
135		sendmail doesn't have to read .forward and :include: files
136		as root.
137GIDSET_T	The type of entries in a gidset passed as the second
138		argument to getgroups(2).  Historically this has been an
139		int, so this is the default, but some systems (such as
140		IRIX) pass it as a gid_t, which is an unsigned short.
141		This will make a difference, so it is important to get
142		this right!  However, it is only an issue if you have
143		group sets.
144SLEEP_T		The type returned by the system sleep() function.
145		Defaults to "unsigned int".  Don't worry about this
146		if you don't have compilation problems.
147ARBPTR_T	The type of an arbitrary pointer -- defaults to "void *".
148		If you are an very old compiler you may need to define
149		this to be "char *".
150LA_TYPE		The type of load average your kernel supports.  These
151		can be LA_SUBR (4) if you have the getloadavg(3) routine,
152		LA_MACH (5) to use MACH-style load averages (calls
153		processor_set_info()), LA_FLOAT (3) if you read kmem and
154		interpret the value as a floating point number, LA_INT (2)
155		to interpret as a long integer, or LA_SHORT (6) to
156		interpret as a short integer.  These last three have
157		several other parameters that they try to divine: the
158		name of your kernel, the name of the variable in the
159		kernel to examine, the number of bits of precision in
160		a fixed point load average, and so forth.  In desparation,
161		use LA_ZERO (1) -- it always returns the load average as
162		"zero" (and does so on all architectures).  The actual
163		code is in conf.c -- it can be tweaked if you are brave.
164ERRLIST_PREDEFINED
165		If set, assumes that some header file defines sys_errlist.
166		This may be needed if you get type conflicts on this
167		variable -- otherwise don't worry about it.
168
169
170+-----------------------+
171| COMPILE-TIME FEATURES |
172+-----------------------+
173
174There are a bunch of features that you can decide to compile in, such
175as selecting various database packages and special protocol support.
176Several are assumed based on other compilation flags -- if you want to
177"un-assume" something, you probably need to edit conf.h.  Compilation
178flags that add support for special features include:
179
180NDBM		Include support for "new" DBM library for aliases and maps.
181		Normally defined in the Makefile.
182NEWDB		Include support for Berkeley "db" package (hash & btree)
183		for aliases and maps.  Normally defined in the Makefile.
184NIS		Define this to get NIS (YP) support for aliases and maps.
185		Normally defined in the Makefile.
186USERDB		Include support for the User Information Database.  Implied
187		by NEWDB in conf.h.
188IDENTPROTO	Define this to get IDENT (RFC 1413) protocol support.
189		This is assumed unless you are running on Ultrix or
190		HP-UX, both of which have a problem in the UDP
191		implementation.
192MIME		Include support for MIME-encapsulated error messages.
193LOG		Set this to get syslog(3) support.  Defined by default
194		in conf.h.  You want this if at all possible.
195NETINET		Set this to get TCP/IP support.  Defined by default
196		in conf.h.  You probably want this.
197NETISO		Define this to get ISO networking support.
198SMTP		Define this to get the SMTP code.  Implied by NETINET
199		or NETISO.
200NAMED_BIND	Define this to get DNS (name daemon) support, including
201		MX support.  The specs you must use this if you run
202		SMTP.  Defined by default in conf.h.
203QUEUE		Define this to get queueing code.  Implied by NETINET
204		or NETISO; required by SMTP.  This gives you other good
205		stuff -- it should be on.
206DAEMON		Define this to get general network support.  Implied by
207		NETINET or NETISO.  Defined by default in conf.h.  You
208		almost certainly want it on.
209MATCHGECOS	Permit fuzzy matching of user names against the full
210		name (GECOS) field in the /etc/passwd file.  This should
211		probably be on, since you can disable it from the config
212		file if you want to.  Defined by default in conf.h.
213SETPROCTITLE	Try to set the string printed by "ps" to something
214		informative about what sendmail is doing.  Defined by
215		default in conf.h.
216
217
218+-------------------------------------+
219| OPERATING SYSTEM AND COMPILE QUIRKS |
220+-------------------------------------+
221
222SunOS 4.x (Solaris 1.x)
223	You may have to use -lresolv on SunOS.  However, beware that
224	this links in a new version of gethostbyname that does not
225	understand NIS, so you must have all of your hosts in DNS.
226
227	There is substantial disagreement about whether you can make
228	this work with resolv+, which allows you to specify a search-path
229	of services.  Some people report that it works fine, others
230	claim it doesn't work at all (including causing sendmail to
231	drop core when it tries to do multiple resolv+ lookups for a
232	single job).  I haven't tried resolv+, as we use DNS exclusively.
233
234	Should you want to try resolv+, it is on ftp.uu.net in
235	/networking/ip/dns.
236
237Solaris 2.x (SunOS 5.x)
238	To compile for Solaris, be sure you use -DSOLARIS.
239
240	From a correspondent:
241
242	   For solaris 2.2, I have
243
244		hosts:      files dns
245
246	   in /etc/nsswitch.conf and /etc/hosts has to have the fully
247	   qualified host name. I think "files" has to be before "dns"
248	   in /etc/nsswitch.conf during bootup.
249
250	To the best of my knowledge, Solaris does not have the
251	gethostbyname problem described above.
252
253	The Solaris "syslog" function is apparently limited to something
254	about 90 characters because of a kernel limitation.  If you have
255	source code, you can probably up this number.  Bill Wisner
256	<wisner@well.sf.ca.us> was able to get an unofficial, unsupported
257	patch.
258
259OSF/1
260	If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
261
262NeXT
263	If you are compiling on NeXT, you will have to create an empty
264	file "unistd.h" and create a file "dirent.h" containing:
265
266		#include <sys/dir.h>
267		#define dirent	direct
268
269	(The Makefile.NeXT should try to do both of these for you.)
270
271	Apparently, there is a bug in getservbyname on Nextstep 3.0
272	that causes it to fail under some circumstances with the
273	message "SYSERR: service "smtp" unknown" logged.  You should
274	be able to work around this by including the line:
275
276		OPort=25
277
278	in your .cf file.
279
280	You may have to use -DNeXT.
281
282BSDI (BSD/386)
283	I have reports that the "m4" from BSDI won't handle the config
284	files properly.  I haven't had a chance to test this myself.
285
2864.3BSD
287	If you are running a "virgin" version of 4.3BSD, you'll have
288	a very old resolver and be missing some header files.  The
289	header files are simple -- create empty versions and everything
290	will work fine.  For the resolver you should really port a new
291	version (4.8.3 or later) of the resolver; 4.9 is available on
292	gatekeeper.DEC.COM in pub/BSD/bind/4.9.  If you are really
293	determined to continue to use your old, buggy version (or as
294	a shortcut to get sendmail working -- I'm sure you have the
295	best intentions to port a modern version of BIND), you can
296	copy ../contrib/oldbind.compat.c into src and add
297	oldbind.compat.o to OBJADD in the Makefile.
298
299Both NEWDB and NDBM
300	If you use both -DNDBM and -DNEWDB, you must delete the module
301	ndbm.o from libdb.a and delete the file "ndbm.h" from the files
302	that get installed (that is, use the OLD ndbm.h, not the new
303	ndbm.h).  This compatibility module maps ndbm calls into DB
304	calls, and breaks things rather badly.
305
306
307+-----------------------------+
308| DESCRIPTION OF SOURCE FILES |
309+-----------------------------+
310
311The following list describes the files in this directory:
312
313Makefile	The makefile used here; this version only works with
314		the new Berkeley make.
315Makefile.dist	A trimmed down version of the makefile that works with
316		the old make.
317READ_ME		This file.
318TRACEFLAGS	My own personal list of the trace flags -- not guaranteed
319		to be particularly up to date.
320alias.c		Does name aliasing in all forms.
321arpadate.c	A subroutine which creates ARPANET standard dates.
322clock.c		Routines to implement real-time oriented functions
323		in sendmail -- e.g., timeouts.
324collect.c	The routine that actually reads the mail into a temp
325		file.  It also does a certain amount of parsing of
326		the header, etc.
327conf.c		The configuration file.  This contains information
328		that is presumed to be quite static and non-
329		controversial, or code compiled in for efficiency
330		reasons.  Most of the configuration is in sendmail.cf.
331conf.h		Configuration that must be known everywhere.
332convtime.c	A routine to sanely process times.
333daemon.c	Routines to implement daemon mode.  This version is
334		specifically for Berkeley 4.1 IPC.
335deliver.c	Routines to deliver mail.
336domain.c	Routines that interface with DNS (the Domain Name
337		System).
338err.c		Routines to print error messages.
339envelope.c	Routines to manipulate the envelope structure.
340headers.c	Routines to process message headers.
341macro.c		The macro expander.  This is used internally to
342		insert information from the configuration file.
343main.c		The main routine to sendmail.  This file also
344		contains some miscellaneous routines.
345map.c		Support for database maps.
346mci.c		Routines that handle mail connection information caching.
347parseaddr.c	The routines which do address parsing.
348queue.c		Routines to implement message queueing.
349readcf.c	The routine that reads the configuration file and
350		translates it to internal form.
351recipient.c	Routines that manipulate the recipient list.
352savemail.c	Routines which save the letter on processing errors.
353sendmail.h	Main header file for sendmail.
354srvrsmtp.c	Routines to implement server SMTP.
355stab.c		Routines to manage the symbol table.
356stats.c		Routines to collect and post the statistics.
357sysexits.c	List of error messages associated with error codes
358		in sysexits.h.
359trace.c		The trace package.  These routines allow setting and
360		testing of trace flags with a high granularity.
361udb.c		The user database interface module.
362usersmtp.c	Routines to implement user SMTP.
363util.c		Some general purpose routines used by sendmail.
364version.c	The version number and information about this
365		version of sendmail.  Theoretically, this gets
366		modified on every change.
367
368Eric Allman
369
370(Version 8.22, last update 09/04/93 11:50:29)
371