xref: /original-bsd/usr.sbin/sendmail/src/READ_ME (revision e579053f)
1# Copyright (c) 1983, 1995 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.87 (Berkeley) 05/22/95
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
16*********************
17!! DO NOT USE MAKE !!  to compile sendmail -- instead, use the
18*********************  "makesendmail" script located in the src
19directory.  It will find an appropriate Makefile, and create an
20appropriate obj.* subdirectory so that multiplatform support
21works easily.
22
23The Makefile is for the new (4.4BSD) Berkeley make and uses syntax
24that is not recognized by older makes.  It also has assumptions
25about the 4.4 file system layout built in.  See below for details
26about other Makefiles.
27
28If you are porting to a new architecture for which there is no existing
29Makefile, you might start with Makefile.dist.  This works on the old
30traditional make, but isn't customized for any particular architecture.
31
32	**************************************************
33	**  Read below for more details of Makefiles.	**
34	**************************************************
35
36**************************************************************************
37**  IMPORTANT:  DO NOT USE OPTIMIZATION (``-O'') IF YOU ARE RUNNING	**
38**  GCC 2.4.x or 2.5.x.  THERE IS A BUG IN THE GCC OPTIMIZER THAT	**
39**  CAUSES SENDMAIL COMPILES TO FAIL MISERABLY.				**
40**************************************************************************
41
42Jim Wilson of Cygnus believes he has found the problem -- it will
43probably be fixed in GCC 2.5.6 -- but until this is verified, be
44very suspicious of gcc -O.
45
46This problem is reported to have been fixed in gcc 2.6.
47
48**************************************************************************
49**  IMPORTANT:  Read the appropriate paragraphs in the section on	**
50**  ``Operating System and Compile Quirks''.				**
51**************************************************************************
52
53
54+-----------+
55| MAKEFILES |
56+-----------+
57
58By far, the easiest way to compile sendmail is to use the "makesendmail"
59script:
60
61	sh makesendmail
62
63This uses the "uname" command to figure out what architecture you are
64on and selects a proper Makefile accordingly.  It also creates a
65subdirectory per object format, so that multiarchitecture support is
66easy.  In general this should be all you need.  However, if for some
67reason this doesn't work (e.g., NeXT systems don't have the "uname"
68command) you may have to set up your compile environment by hand.
69
70The "Makefile"s in these directories are from 4.4 BSD, and hence
71really only work properly if you are on a 4.4 system.  In particular,
72they use new syntax that will not be recognized on old make programs,
73and some of them do things like ``.include ../../Makefile.inc'' to
74pick up some system defines.  If you are getting sendmail separately,
75these files won't be included in the distribution, as they are
76outside of the sendmail tree.
77
78Instead, you should use one of the other Makefiles, such as
79Makefile.SunOS for a SunOS system, and so forth.  These should
80work with the version of make that is appropriate for that
81system.  All other Makefiles are in the "src/Makefiles" subdirectory.
82They use the version of make that is native for that system.  These
83are the Makefiles that I use, and they have "Berkeley quirks" in them.
84I can't guarantee that they will work unmodified in your environment.
85In particular, Many of them include -I/usr/sww/include/db and
86-L/usr/sww/lib -- these are Berkeley's locations in the ``Software
87Warehouse'' for the new database libraries, described below.  You don't
88have to remove these definitions if you don't have these directories,
89but you may have to remove -DNEWDB from the DBMDEF definition.
90
91Please look for an appropriate Makefile before you start trying to
92compile with Makefile or Makefile.dist.
93
94If you want to port the new Berkeley make, you can get it from
95ftp.uu.net in the directory /systems/unix/bsd-sources/usr.bin/make.
96Diffs and instructions for building this version of make under
97SunOS 4.1.x are available on ftp.css.itd.umich.edu in
98/pub/systems/sun/Net2-make.sun4.diff.Z.  Diffs and instructions
99for building this version of make under IBM AIX 3.2.4 are available
100on ftp.uni-stuttgart.de in /sw/src/patches/bsd-make-rus-patches.
101For Ultrix, try ftp.vix.com:~ftp/pub/patches/pmake-for-ultrix.Z.
102Paul Southworth <pauls@umich.edu> published a description of porting
103this make in comp.unix.bsd.
104
105The complete text of the Makefile.inc that is in the parent of the
106sendmail directory is:
107
108	#	@(#)Makefile.inc	8.1 (Berkeley) 6/6/93
109
110	BINDIR?=	/usr/sbin
111
112
113+----------------------+
114| DATABASE DEFINITIONS |
115+----------------------+
116
117There are several database formats that can be used for the alias files
118and for general maps.  When used for alias files they interact in an
119attempt to be back compatible.
120
121The three options are NEWDB (the new Berkeley DB package), NDBM (the
122older DBM implementation -- the very old V7 implementation is no
123longer supported), and NIS (Network Information Services).  Used alone
124these just include the support they indicate.  [If you are using NEWDB,
125get the latest version from FTP.CS.Berkeley.EDU in /ucb/4bsd/db.tar.Z
126(or db.tar.gz).  DO NOT use the version from the Net2 distribution!
127However, if you are on BSD/386 or 386BSD-based systems, use the one
128that already exists on your system.  You may need to #define OLD_NEWDB
1291 to do this.]
130
131[NOTE WELL: it is CRITICAL that you remove ndbm.o from libdb.a and
132ndbm.h from the appropriate include directories if you want to get
133ndbm support.  These files OVERRIDE calls to ndbm routines -- in
134particular, if you leave ndbm.h in, you can find yourself using
135the new db package even if you don't define NEWDB.]
136
137If NEWDB and NDBM are defined (but not NIS), then sendmail will read
138NDBM format alias files, but the next time a newaliases is run the
139format will be converted to NEWDB; that format will be used forever
140more.  This is intended as a transition feature.  [Note however that
141the NEWDB library also catches and maps NDBM calls; you will have to
142back out this feature to get this to work.  See ``Quirks'' section
143below for details.]
144
145If all three are defined, sendmail operates as described above, and also
146looks for the file /var/yp/Makefile.  If it exists, newaliases will
147build BOTH the NEWDB and NDBM format alias files.  However, it will
148only use the NEWDB file; the NDBM format file is used only by the
149NIS subsystem.
150
151If NDBM and NIS are defined (regardless of the definition of NEWDB
152or the existance of /var/yp/Makefile), sendmail adds the special
153tokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are
154required if the NDBM file is to be used as an NIS map.
155
156There is also preliminary support for NIS+ (-DNISPLUS), Hesiod
157(-DHESIOD), and NetInfo (-DNETINFO).  These have not been well
158tested.
159
160All of -DNEWDB, -DNDBM, -DNIS, -DNISPLUS, -DHESIOD, and -DNETINFO are
161normally defined in the DBMDEF line in the Makefile.
162
163
164+---------------+
165| COMPILE FLAGS |
166+---------------+
167
168Whereever possible, I try to make sendmail pull in the correct
169compilation options needed to compile on various environments based on
170automatically defined symbols.  Some machines don't seem to have useful
171symbols availble, requiring the following compilation flags in the
172Makefile:
173
174SOLARIS		Define this if you are running Solaris 2.0 or higher.
175SOLARIS_2_3	Define this if you are running Solaris 2.3 or higher.
176SUNOS403	Define this if you are running SunOS 4.0.3.
177NeXT		Define this if you are on a NeXT box.  (This one may
178		be pre-defined for you.)  There are other hacks you
179		have to make -- see below.
180_AIX3		Define this if you are IBM AIX 3.x.
181RISCOS		Define this if you are running RISC/os from MIPS.
182IRIX		Define this if you are running IRIX from SGI.
183_SCO_unix_	Define this if you are on SCO UNIX.
184_SCO_unix_4_2	Define this if you are on SCO Open Server 3.2v4.
185DGUX		Define this if you are on DG/UX 5.4.3 or later
186DGUX_5_4_2	Define this if you are on DG/UX systems prior to 5.4.3.
187NonStop_UX_BXX	Define this if you are on a Tandem NonStop-UX release
188		Bxx system.
189IRIX64		Define this if you are on an IRIX64 system.
190
191If you are a system that sendmail has already been ported to, you
192probably won't have to touch these.  But if you are porting, you may
193have to tweak the following compilation flags in conf.h in order to
194get it to compile and link properly:
195
196SYSTEM5		Adjust for System V (not necessarily Release 4).
197SYS5SIGNALS	Use System V signal semantics -- the signal handler
198		is automatically dropped when the signal is caught.
199		If this is not set, use POSIX/BSD semantics, where the
200		signal handler stays in force until an exec or an
201		explicit delete.  Implied by SYSTEM5.
202SYS5SETPGRP	Use System V setpgrp() semantics.  Implied by SYSTEM5.
203HASFLOCK	Set this if you prefer to use the flock(2) system call
204		rather than using fcntl-based locking.  Fcntl locking
205		has some semantic gotchas, but many vendor systems
206		also interface it to lockd(8) to do NFS-style locking.
207		For this reason, this should not be set unless you
208		don't have an alternative.
209HASUNAME	Set if you have the "uname" system call.  Implied by
210		SYSTEM5.
211HASUNSETENV	Define this if your system library has the "unsetenv"
212		subroutine.
213HASSETSID	Define this if you have the setsid(2) system call.  This
214		is implied if your system appears to be POSIX compliant.
215HASINITGROUPS	Define this if you have the initgroups(3) routine.
216HASSETVBUF	Define this if you have the setvbuf(3) library call.
217		If you don't, setlinebuf will be used instead.  This
218		defaults on if your compiler defines __STDC__.
219HASSETREUID	Define this if you have setreuid(2) ***AND*** root can
220		use setreuid to change to an arbitrary user.  This second
221		condition is not satisfied on AIX 3.x.  You may find that
222		your system has setresuid(2), (for example, on HP-UX) in
223		which case you will also have to #define setreuid(r, e)
224		to be the appropriate call.  Some systems (such as Solaris)
225		have a compatibility routine that doesn't work properly,
226		but may have "saved user ids" properly implemented so you
227		can ``#define setreuid(r, e) seteuid(e)'' and have it work.
228		The important thing is that you have a call that will set
229		the effective uid independently of the real or saved uid
230		and be able to set the effective uid back again when done.
231		There's a test program in ../test/t_setreuid.c that will
232		try things on your system.  Setting this improves the
233		security, since sendmail doesn't have to read .forward
234		and :include: files as root.  There are certain attacks
235		that may be unpreventable without this call.
236HASLSTAT	Define this if you have symbolic links (and thus the
237		lstat(2) system call).  This improves security.  Unlike
238		most other options, this one is on by default, so you
239		need to #undef it in conf.h if you don't have symbolic
240		links (these days everyone does).
241HASSETRLIMIT	Define this to 1 if you have the setrlimit(2) syscall.
242		You can define it to 0 to force it off.  It is assumed
243		if you are running a BSD-like system.
244HASULIMIT	Define this if you have the ulimit(2) syscall (System V
245		style systems).  HASSETRLIMIT overrides, as it is more
246		general.
247NEEDGETOPT	Define this if you need a reimplementation of getopt(3).
248		On some systems, getopt does very odd things if called
249		to scan the arguments twice.  This flag will ask sendmail
250		to compile in a local version of getopt that works
251		properly.
252NEEDSTRTOL	Define this if your standard C library does not define
253		strtol(3).  This will compile in a local version.
254NEEDVPRINTF	Define this if your standard C library does not define
255		vprintf(3).  Note that the resulting fake implementation
256		is not very elegant and may not even work on some
257		architectures.
258NEEDFSYNC	Define this if your standard C library does not define
259		fsync(2).  This will try to simulate the operation using
260		fcntl(2); if that is not available it does nothing, which
261		isn't great, but at least it compiles and runs.
262HASGETUSERSHELL	Define this to 1 if you have getusershell(3) in your
263		standard C library.  If this is not defined, or is defined
264		to be 0, sendmail will scan the /etc/shells file (no
265		NIS-style support, defaults to /bin/sh and /bin/csh if
266		that file does not exist) to get a list of unrestricted
267		user shells.  This is used to determine whether users
268		are allowed to forward their mail to a program or a file.
269GIDSET_T	The type of entries in a gidset passed as the second
270		argument to getgroups(2).  Historically this has been an
271		int, so this is the default, but some systems (such as
272		IRIX) pass it as a gid_t, which is an unsigned short.
273		This will make a difference, so it is important to get
274		this right!  However, it is only an issue if you have
275		group sets.
276SLEEP_T		The type returned by the system sleep() function.
277		Defaults to "unsigned int".  Don't worry about this
278		if you don't have compilation problems.
279ARBPTR_T	The type of an arbitrary pointer -- defaults to "void *".
280		If you are an very old compiler you may need to define
281		this to be "char *".
282LA_TYPE		The type of load average your kernel supports.  These
283		can be one of:
284		 LA_ZERO (1) -- it always returns the load average as
285			"zero" (and does so on all architectures).
286		 LA_INT (2) to read /dev/kmem for the symbol avenrun and
287			interpret as a long integer.
288		 LA_FLOAT (3) same, but interpret the result as a floating
289			point number.
290		 LA_SHORT (6) to interpret as a short integer.
291		 LA_SUBR (4) if you have the getloadavg(3) routine in your
292			system library.
293		 LA_MACH (5) to use MACH-style load averages (calls
294			processor_set_info()),
295		 LA_PROCSTR (7) to read /proc/loadavg and interpret it
296			as a string representing a floating-point
297			number (Linux-style).
298		 LA_READKSYM (8) is an implementation suitable for some
299			versions of SVr4 that uses the MIOC_READKSYM ioctl
300			call to read /dev/kmem.
301		 LA_DGUX (9) is a special implementation for DG/UX that uses
302			the dg_sys_info system call.
303		 LA_HPUX (10) is an HP-UX specific version that uses the
304			pstat_getdynamic system call.
305		LA_INT, LA_SHORT, LA_FLOAT, and LA_READKSYM have several
306		other parameters that they try to divine: the name of your
307		kernel, the name of the variable in the kernel to examine,
308		the number of bits of precision in a fixed point load average,
309		and so forth.
310		In desperation, use LA_ZERO.  The actual code is in
311		conf.c -- it can be tweaked if you are brave.
312FSHIFT		For LA_INT, LA_SHORT, and LA_READKSYM, this is the number
313		of bits of load average after the binary point -- i.e.,
314		the number of bits to shift right in order to scale the
315		integer to get the true integer load average.  Defaults to 8.
316_PATH_UNIX	The path to your kernel.  Needed only for LA_INT, LA_SHORT,
317		and LA_FLOAT.  Defaults to "/unix" on System V, "/vmunix"
318		everywhere else.
319LA_AVENRUN	For LA_INT, LA_SHORT, and LA_FLOAT, the name of the kernel
320		variable that holds the load average.  Defaults to "avenrun"
321		on System V, "_avenrun" everywhere else.
322SFS_TYPE	Encodes how your kernel can locate the amount of free
323		space on a disk partition.  This can be set to SFS_NONE
324		(0) if you have no way of getting this information,
325		SFS_USTAT (1) if you have the ustat(2) system call,
326		SFS_4ARGS (2) if you have a four-argument statfs(2)
327		system call (and the include file is <sys/statfs.h>),
328		SFS_VFS (3), SFS_MOUNT (4), SFS_STATFS (5) if you have
329		the two-argument statfs(2) system call with includes in
330		<sys/vfs.h>, <sys/mount.h>, or <sys/statfs.h> respectively,
331		or SFS_STATVFS (6) if you have the two-argument statvfs(2)
332		call.  The default if nothing is defined is SFS_NONE.
333SFS_BAVAIL	with SFS_4ARGS hou can also set SFS_BAVAIL to the field name
334		in the statfs structure that holds the useful information;
335		this defaults to f_bavail.
336SPT_TYPE	Encodes how your system can display what a process is doing
337		on a ps(1) command (SPT stands for Set Process Title).  Can
338		be set to:
339		SPT_NONE (0) -- Don't try to set the process title at all.
340		SPT_REUSEARGV (1) -- Pad out your argv with the information;
341			this is the default if none specified.
342		SPT_BUILTIN (2) -- The system library has setproctitle.
343		SPT_PSTAT (3) -- Use the PSTAT_SETCMD option to pstat(2)
344			to set the process title; this is used by HP-UX.
345		SPT_PSSTRINGS (4) -- Use the magic PS_STRINGS pointer (4.4BSD).
346SPT_PADCHAR	Character used to pad the process title; if undefined,
347		the space character (0x20) is used.  This is ignored if
348		SPT_TYPE != SPT_REUSEARGV
349ERRLIST_PREDEFINED
350		If set, assumes that some header file defines sys_errlist.
351		This may be needed if you get type conflicts on this
352		variable -- otherwise don't worry about it.
353WAITUNION	The wait(2) routine takes a "union wait" argument instead
354		of an integer argument.  This is for compatibility with
355		old versions of BSD.
356SCANF		You can set this to extend the F command to accept a
357		scanf string -- this gives you a primitive parser for
358		class definitions -- BUT it can make you vulnerable to
359		core dumps if the target file is poorly formed.
360SYSLOG_BUFSIZE	You can define this to be the size of the buffer that
361		syslog accepts.  If it is not defined, it assumes a
362		1024-byte buffer.  If the buffer is very small (under
363		256 bytes) the log message format changes -- each
364		e-mail message will log many more messages, since it
365		will log each piece of information as a separate line
366		in syslog.
367BROKEN_RES_SEARCH
368		On Ultrix (and maybe other systems?) if you use the
369		res_search routine with an unknown host name, it returns
370		-1 but sets h_errno to 0 instead of HOST_NOT_FOUND.  If
371		you set this, sendmail considers 0 to be the same as
372		HOST_NOT_FOUND.
373NAMELISTMASK	If defined, values returned by nlist(3) are masked
374		against this value before use -- a common value is
375		0x7fffffff to strip off the top bit.
376BSD4_4_SOCKADDR	If defined, socket addresses have an sa_len field that
377		defines the length of this address.
378
379
380
381+-----------------------+
382| COMPILE-TIME FEATURES |
383+-----------------------+
384
385There are a bunch of features that you can decide to compile in, such
386as selecting various database packages and special protocol support.
387Several are assumed based on other compilation flags -- if you want to
388"un-assume" something, you probably need to edit conf.h.  Compilation
389flags that add support for special features include:
390
391NDBM		Include support for "new" DBM library for aliases and maps.
392		Normally defined in the Makefile.
393NEWDB		Include support for Berkeley "db" package (hash & btree)
394		for aliases and maps.  Normally defined in the Makefile.
395OLD_NEWDB	If non-zero, the version of NEWDB you have is the old
396		one that does not include the "fd" call.  This call was
397		added in version 1.5 of the Berkeley DB code.  If you
398		use -DOLD_NEWDB=0 it forces you to use the new interface.
399NIS		Define this to get NIS (YP) support for aliases and maps.
400		Normally defined in the Makefile.
401NISPLUS		Define this to get NIS+ support for aliases and maps.
402		Normally defined in the Makefile.
403HESIOD		Define this to get Hesiod support for aliases and maps.
404		Normally defined in the Makefile.
405NETINFO		Define this to get NeXT NetInfo support for aliases and maps.
406		Normally defined in the Makefile.
407USERDB		Include support for the User Information Database.  Implied
408		by NEWDB in conf.h.
409IDENTPROTO	Define this as 1 to get IDENT (RFC 1413) protocol support.
410		This is assumed unless you are running on Ultrix or
411		HP-UX, both of which have a problem in the UDP
412		implementation.  You can define it to be 0 to explicitly
413		turn off IDENT protocol support.  If defined off, the code
414		is actually still compiled in, but it defaults off; you
415		can turn it on by setting the IDENT timeout to 30s in the
416		configuration file.
417IP_SRCROUTE	Define this to 1 to get IP source routing information
418		displayed in the Received: header.  This is assumed on
419		most systems, but some (e.g., Ultrix) apparently have a
420		broken version of getsockopt that doesn't properly
421		support the IP_OPTIONS call.  You probably want this if
422		your OS can cope with it.
423LOG		Set this to get syslog(3) support.  Defined by default
424		in conf.h.  You want this if at all possible.
425NETINET		Set this to get TCP/IP support.  Defined by default
426		in conf.h.  You probably want this.
427NETISO		Define this to get ISO networking support.
428SMTP		Define this to get the SMTP code.  Implied by NETINET
429		or NETISO.
430NAMED_BIND	If non-zero, include DNS (name daemon) support, including
431		MX support.  The specs you must use this if you run
432		SMTP.  Defined by default in conf.h.
433QUEUE		Define this to get queueing code.  Implied by NETINET
434		or NETISO; required by SMTP.  This gives you other good
435		stuff -- it should be on.
436DAEMON		Define this to get general network support.  Implied by
437		NETINET or NETISO.  Defined by default in conf.h.  You
438		almost certainly want it on.
439MATCHGECOS	Permit fuzzy matching of user names against the full
440		name (GECOS) field in the /etc/passwd file.  This should
441		probably be on, since you can disable it from the config
442		file if you want to.  Defined by default in conf.h.
443MIME8TO7	If non-zero, include 8 to 7 bit MIME conversions.  This
444		also controls advertisement of 8BITMIME in the ESMTP
445		startup dialogue.
446MIME7TO8	If non-zero, include 7 to 8 bit MIME conversions.  Not yet
447		implemented.
448
449
450+---------------------+
451| DNS/RESOLVER ISSUES |
452+---------------------+
453
454Many systems have old versions of the resolver library.  At a minimum,
455you should be running BIND 4.8.3; older versions may compile, but they
456have known bugs that should give you pause.
457
458Common problems in old versions include "undefined" errors for
459dn_skipname.
460
461Some people have had a problem with BIND 4.9; it uses some routines
462that it expects to be externally defined such as strerror().  It may
463help to link with "-l44bsd" to solve this problem.
464
465!PLEASE! be sure to link with the same version of the resolver as
466the header files you used -- some people have used the 4.9 headers
467and linked with BIND 4.8 or vice versa, and it doesn't work.
468Unfortunately, it doesn't fail in an obvious way -- things just
469subtly don't work.
470
471
472+-------------------------------------+
473| OPERATING SYSTEM AND COMPILE QUIRKS |
474+-------------------------------------+
475
476GCC 2.5.x problems  *** IMPORTANT ***
477	Date: Mon, 29 Nov 93 19:08:44 PST
478	From: wilson@cygnus.com (Jim Wilson)
479	Message-Id: <9311300308.AA04608@cygnus.com>
480	To: kenner@vlsi1.ultra.nyu.edu
481	Subject: [cattelan@thebarn.com: gcc 2.5.4-2.5.5 -O bug]
482	Cc: cattelan@thebarn.com, rms@gnu.ai.mit.edu, sendmail@cs.berkeley.edu
483
484	This fixes a problem that occurs when gcc 2.5.5 is used to compile
485	sendmail 8.6.4 with optimization on a sparc.
486
487	Mon Nov 29 19:00:14 1993  Jim Wilson  (wilson@sphagnum.cygnus.com)
488
489		* reload.c (find_reloads_toplev): Replace obsolete reference to
490		BYTE_LOADS_*_EXTEND with LOAD_EXTEND_OP.
491
492	*** clean-ss-931128/reload.c    Sun Nov 14 16:20:01 1993
493	--- ss-931128/reload.c  Mon Nov 29 18:52:55 1993
494	*************** find_reloads_toplev (x, opnum, type, ind
495	*** 3888,3894 ****
496		 force a reload in that case.  So we should not do anything here.  */
497
498		else if (regno >= FIRST_PSEUDO_REGISTER
499	! #if defined(BYTE_LOADS_ZERO_EXTEND) || defined(BYTE_LOADS_SIGN_EXTEND)
500		       && (GET_MODE_SIZE (GET_MODE (x))
501			   <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
502	  #endif
503	--- 3888,3894 ----
504		 force a reload in that case.  So we should not do anything here.  */
505
506		else if (regno >= FIRST_PSEUDO_REGISTER
507	! #ifdef LOAD_EXTEND_OP
508		       && (GET_MODE_SIZE (GET_MODE (x))
509			   <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
510	  #endif
511
512
513SunOS 4.x (Solaris 1.x)
514	You may have to use -lresolv on SunOS.  However, beware that
515	this links in a new version of gethostbyname that does not
516	understand NIS, so you must have all of your hosts in DNS.
517
518	Some people have reported problems with the SunOS version of
519	-lresolv and/or in.named, and suggest that you get a newer
520	version.  The symptoms are delays when you connect to the
521	SMTP server on a SunOS machine or having your domain added to
522	addresses inappropriately.  There is a version of BIND
523	version 4.9 on gatekeeper.DEC.COM in pub/BSD/bind/4.9.
524
525	There is substantial disagreement about whether you can make
526	this work with resolv+, which allows you to specify a search-path
527	of services.  Some people report that it works fine, others
528	claim it doesn't work at all (including causing sendmail to
529	drop core when it tries to do multiple resolv+ lookups for a
530	single job).  I haven't tried resolv+, as we use DNS exclusively.
531
532	Should you want to try resolv+, it is on ftp.uu.net in
533	/networking/ip/dns.
534
535	Apparently getservbyname() can fail under moderate to high
536	load under some circumstances.  This will exhibit itself as
537	the message ``554 makeconnection: service "smtp" unknown''.
538	The problem has been traced to one or more blank lines in
539	/etc/services on the NIS server machine.  Delete these
540	and it should work.  This info is thanks to Brian Bartholomew
541	<bb@math.ufl.edu> of I-Kinetics, Inc.
542
543Solaris 2.x (SunOS 5.x)
544	To compile for Solaris, be sure you use -DSOLARIS.
545
546	To the best of my knowledge, Solaris does not have the
547	gethostbyname problem described above.  However, it does
548	have another one:
549
550	From a correspondent:
551
552	   For solaris 2.2, I have
553
554		hosts:      files dns
555
556	   in /etc/nsswitch.conf and /etc/hosts has to have the fully
557	   qualified host name. I think "files" has to be before "dns"
558	   in /etc/nsswitch.conf during bootup.
559
560	From another correspondent:
561
562	   When running sendmail under Solaris, the gethostbyname()
563	   hack in conf.c which should perform proper canonicalization
564	   of host names could fail.  Result: the host name is not
565	   canonicalized despite the hack, and you'll have to define $j
566	   and $m in sendmail.cf somewhere.
567
568	   The reason could be that /etc/nsswitch.conf is improperly
569	   configured (at least from sendmail's point of view).  For
570	   example, the line
571
572		hosts:      files nisplus dns
573
574	   will make gethostbyname() look in /etc/hosts first, then ask
575	   nisplus, then dns.  However, if /etc/hosts does not contain
576	   the full canonicalized hostname, then no amount of
577	   gethostbyname()s will work.
578
579	   Solution (or rather, a workaround): Ask nisplus first, then
580	   dns, then local files:
581
582		hosts:      nisplus dns [NOTFOUND=return] files
583
584	The Solaris "syslog" function is apparently limited to something
585	about 90 characters because of a kernel limitation.  If you have
586	source code, you can probably up this number.  You can get patches
587	that fix this problem: the patch ids are:
588
589		Solaris 2.1	100834
590		Solaris 2.2	100999
591		Solaris 2.3	101318
592
593	Be sure you have the appropriate patch installed or you won't
594	see system logging.
595
596Ultrix
597	By default, the IDENT protocol is turned off on Ultrix.  If you
598	are running Ultrix 4.4 or later, or if you have gotten a patch
599	the TCP problem for an earlier version of Ultrix, you can turn
600	IDENT on in the configuration file by setting the "ident" timeout
601	to 30 seconds.
602
603OSF/1
604	If you are compiling on OSF/1 (DEC Alpha), you must use
605	-L/usr/shlib (otherwise it core dumps on startup).  You may also
606	need -mld to get the nlist() function, although some versions
607	apparently don't need this.
608
609	Also, the enclosed makefile removed /usr/sbin/smtpd; if you need
610	it, just create the link to the sendmail binary.
611
612IRIX
613	The header files on SGI IRIX are completely prototyped, and as
614	a result you can sometimes get some warning messages during
615	compilation.  These can be ignored.  There are two errors in
616	deliver only if you are using gcc, both of the form ``warning:
617	passing arg N of `execve' from incompatible pointer type''.
618	Also, if you compile with -DNIS, you will get a complaint
619	about a declaration of struct dom_binding in a prototype
620	when compiling map.c; this is not important because the
621	function being prototyped is not used in that file.
622
623	In order to compile sendmail you will have had to install
624	the developers' option in order to get the necessary include
625	files.
626
627NeXT
628	If you are compiling on NeXT, you will have to create an empty
629	file "unistd.h" and create a file "dirent.h" containing:
630
631		#include <sys/dir.h>
632		#define dirent	direct
633
634	(The Makefile.NeXT should try to do both of these for you.)
635
636	Apparently, there is a bug in getservbyname on Nextstep 3.0
637	that causes it to fail under some circumstances with the
638	message "SYSERR: service "smtp" unknown" logged.  You should
639	be able to work around this by including the line:
640
641		OOPort=25
642
643	in your .cf file.
644
645	You may have to use -DNeXT.
646
647BSDI (BSD/386) 1.0, NetBSD 0.9, FreeBSD 1.0
648	The "m4" from BSDI won't handle the config files properly.
649	I haven't had a chance to test this myself.
650
651	The M4 shipped in FreeBSD and NetBSD 0.9 don't handle the config
652	files properly. One must use either GNU m4 1.1 or the PD-M4
653	recently posted in comp.os.386bsd.bugs (and maybe others).
654	NetBSD-current includes the PD-M4 (as stated in the NetBSD file
655	CHANGES).
656
657	FreeBSD 1.0 RELEASE has uname(2) now. Use -DUSEUNAME in order to
658	use it (look into Makefile.FreeBSD). NetBSD-current may have
659	it too but it has not been verified.
660
661	You cannot port the latest version of the Berkeley db library
662	and use it with sendmail without recompiling the world.  This
663	is because C library routines use the older version which have
664	incompatible header files -- the result is that it can't read
665	other system files, such as /etc/passwd, unless you use the
666	new db format throughout your system.  You should normally just
667	use the version of db supplied in your release.  You may need
668	to use -DOLD_NEWDB=1 to make this work -- this turns off some
669	new interface calls (for file locking) that are not in older
670	versions of db.  You'll get compile errors if you need this
671	flag and don't have it set.
672
6734.3BSD
674	If you are running a "virgin" version of 4.3BSD, you'll have
675	a very old resolver and be missing some header files.  The
676	header files are simple -- create empty versions and everything
677	will work fine.  For the resolver you should really port a new
678	version (4.8.3 or later) of the resolver; 4.9 is available on
679	gatekeeper.DEC.COM in pub/BSD/bind/4.9.  If you are really
680	determined to continue to use your old, buggy version (or as
681	a shortcut to get sendmail working -- I'm sure you have the
682	best intentions to port a modern version of BIND), you can
683	copy ../contrib/oldbind.compat.c into src and add
684	oldbind.compat.o to OBJADD in the Makefile.
685
686A/UX
687	Date: Tue, 12 Oct 1993 18:28:28 -0400 (EDT)
688	From: "Eric C. Hagberg" <hagberg@med.cornell.edu>
689	Subject: Fix for A/UX ndbm
690
691	I guess this isn't really a sendmail bug, however, it is something
692	that A/UX users should be aware of when compiling sendmail 8.6.
693
694	Apparently, the calls that sendmail is using to the ndbm routines
695	in A/UX 3.0.x contain calls to "broken" routines, in that the
696	aliases database will break when it gets "just a little big"
697	(sorry I don't have exact numbers here, but it broke somewhere
698	around 20-25 aliases for me.), making all aliases non-functional
699	after exceeding this point.
700
701	What I did was to get the gnu-dbm-1.6 package, compile it, and
702	then re-compile sendmail with "-lgdbm", "-DNDBM", and using the
703	ndbm.h header file that comes with the gnu-package. This makes
704	things behave properly.
705
706	I suppose porting the New Berkeley db package is another route,
707	however, I made a quick attempt at it, and found it difficult
708	(not easy at least); the gnu-dbm package "configured" and
709	compiled easily.
710
711SCO Unix
712	From: Thomas Essebier <tom@stallion.oz.au>
713	Organisation:  Stallion Technologies Pty Ltd.
714
715	It will probably help those who are trying to configure sendmail 8.6.9
716	to know that if they are on SCO, they had better set
717		OI-dnsrch
718	or they will core dump as soon as they try to use the resolver.
719	ie. although SCO has _res.dnsrch defined, and is kinda BIND 4.8.3, it
720	does not inititialise it, nor does it understand 'search' in
721	/etc/named.boot.
722		- sigh -
723
724DG/UX
725	Doug Anderson <dlander@afterlife.ncsc.mil> has successfully run
726	V8 on the DG/UX 5.4.2 and 5.4R3.x platforms under heavy usage.
727	Originally, the DG /bin/mail program wasn't compatible with
728	the V8 sendmail, since the DG /bin/mail requires the environment
729	variable "_FORCE_MAIL_LOCAL_=yes" be set.  Version 8.7 now includes
730	this in the environment before invoking the local mailer.  Some
731	have used procmail to avoid this problem in the past.  It works
732	but some have experienced file locking problems with their DG/UX
733	ports of procmail.
734
735Apollo DomainOS
736	If you are compiling on Apollo, you will have to create an empty
737	file "unistd.h" and create a file "dirent.h" containing:
738
739		#include <sys/dir.h>
740		#define dirent	direct
741
742	(The Makefile.DomainOS will attempt to do both of these for you.)
743
744HP-UX 8.00
745	Date: Mon, 24 Jan 1994 13:25:45 +0200
746	From: Kimmo Suominen <Kimmo.Suominen@lut.fi>
747	Subject: 8.6.5 w/ HP-UX 8.00 on s300
748
749	Just compiled and fought with sendmail 8.6.5 on a HP9000/360 (ie. a
750	series 300 machine) running HP-UX 8.00.
751
752	I was getting segmentation fault when delivering to a local user.
753	With debugging I saw it was faulting when doing _free@libc... *sigh*
754	It seems the new implementation of malloc on s300 is buggy as of 8.0,
755	so I tried out the one in -lmalloc (malloc(3X)).  With that it seems
756	to work just dandy.
757
758	When linking, you will get the following error:
759
760	ld: multiply defined symbol _freespace in file /usr/lib/libmalloc.a
761
762	but you can just ignore it.  You might want to add this info to the
763	README file for the future...
764
765Linux
766	Something broke between versions 0.99.13 and 0.99.14 of Linux:
767	the flock() system call gives errors.  If you are running .14,
768	you must not use flock.  You can do this with -DHASFLOCK=0.
769
770	Around the inclusion of bind-4.9.3 & linux libc-4.6.20, the
771	initialization of the _res structure changed.  If /etc/hosts.conf
772	was configured as "hosts, bind" the resolver code could return
773	"Name server failure" errors.  This is supposedly fixed in
774	later versions of libc (>= 4.6.29?), and later versions of
775	sendmail (> 8.6.10) try to work around the problem.
776
777	Some older versions (< 4.6.20?) of the libc/include files conflict
778	with sendmail's version of cdefs.h.  Deleting sendmail's version
779	on those systems should be non-harmful, and new versions don't care.
780
781AIX
782	This version of sendmail does not support MB, MG, and MR resource
783	records, which are supported by AIX sendmail.
784
785RISC/os
786	RISC/os from MIPS is a merged AT&T/Berkeley system.  When you
787	compile on that platform you will get duplicate definitions
788	on many files.  You can ignore these.
789
790System V Release 4 Based Systems
791	There is a single Makefile that is intended for all SVR4-based
792	systems (called Makefile.SVR4).  It defines __svr4__, which is
793	predefined by some compilers.  If your compiler already defines
794	this compile variable, you can delete the definition from the
795	Makefile.
796
797	It's been tested on Dell Issue 2.2.
798
799DELL SVR4
800	Date:      Mon, 06 Dec 1993 10:42:29 EST
801	From: "Kimmo Suominen" <kim@grendel.lut.fi>
802	Message-ID: <2d0352f9.lento29@lento29.UUCP>
803	To: eric@cs.berkeley.edu
804	Cc: sendmail@cs.berkeley.edu
805	Subject:   Notes for DELL SVR4
806
807	Eric,
808
809	Here are some notes for compiling Sendmail 8.6.4 on DELL SVR4.  I ran
810	across these things when helping out some people who contacted me by
811	e-mail.
812
813	1) Use gcc 2.4.5 (or later?).  Dell distributes gcc 2.1 with their
814	   Issue 2.2 Unix.  It is too old, and gives you problems with
815	   clock.c, because sigset_t won't get defined in <sys/signal.h>.
816	   This is due to a problematic protection rule in there, and is
817	   fixed with gcc 2.4.5.
818
819	2) If you don't use the new Berkeley DB (-DNEWDB), then you need
820	   to add "-lc -lucb" to the libraries to link with.  This is because
821	   the -ldbm distributed by Dell needs the bcopy, bcmp and bzero
822	   functions.  It is important that you specify both libraries in
823	   the given order to be sure you only get the BSTRING functions
824	   from the UCB library (and not the signal routines etc.).
825
826	3) Don't leave out "-lelf" even if compiling with "-lc -lucb".
827	   The UCB library also has another copy of the nlist routines,
828	   but we do want the ones from "-lelf".
829
830	If anyone needs a compiled gcc 2.4.5 and/or a ported DB library, they
831	can use anonymous ftp to fetch them from lut.fi in the /kim directory.
832	They are copies of what I use on grendel.lut.fi, and offering them
833	does not imply that I would also support them.  I have sent the DB
834	port for SVR4 back to Keith Bostic for inclusion in the official
835	distribution, but I haven't heard anything from him as of today.
836
837	- gcc-2.4.5-svr4.tar.gz	(gcc 2.4.5 and the corresponding libg++)
838	- db-1.72.tar.gz	(with source, objects and a installed copy)
839
840	Cheers
841	+ Kim
842	--
843	 *  Kimmo.Suominen@lut.fi  *  SysVr4 enthusiast at GRENDEL.LUT.FI  *
844	*    KIM@FINFILES.BITNET   *  Postmaster and Hostmaster at LUT.FI   *
845	 *    + 358 200 865 718    *  Unix area moderator at NIC.FUNET.FI  *
846
847ConvexOS 10.1 and below
848	In order to use the name server, you must create the file
849	/etc/use_nameserver.  If this file does not exist, the call
850	to res_init() will fail and you will have absolutely no
851	access to DNS, including MX records.
852
853Amdahl UTS 2.1.5
854	In order to get UTS to work, you will have to port BIND 4.9.
855	The vendor's BIND is reported to be ``totally inadequate.''
856	See sendmail/contrib/AmdahlUTS.patch for the patches necessary
857	to get BIND 4.9 compiled for UTS.
858
859UnixWare 2.0
860	According to Alexander Kolbasov <sasha@unitech.gamma.ru>,
861	the m4 on UnixWare 2.0 (still in Beta) will core dump on the
862	config files.  GNU m4 and the m4 from UnixWare 1.x both work.
863
864Non-DNS based sites
865	This version of sendmail always tries to connect to the Domain
866	Name System (DNS) to resolve names, regardless of the setting
867	of the `I' option.  On most systems that are not running DNS,
868	this will fail quickly and sendmail will continue, but on some
869	systems it has a long timeout.  If you have this problem, you
870	will have to recompile without NAMED_BIND.  Some people have
871	claimed that they have successfully used "OI+USEVC" to force
872	sendmail to use a virtual circuit -- this will always time out
873	quickly, but also tells sendmail that a failed connection
874	should requeue the message (probably not what you intended).
875	A future release of sendmail will correct this problem.
876
877Both NEWDB and NDBM
878	If you use both -DNDBM and -DNEWDB, you must delete the module
879	ndbm.o from libdb.a and delete the file "ndbm.h" from the files
880	that get installed (that is, use the OLD ndbm.h, not the new
881	ndbm.h).  This compatibility module maps ndbm calls into DB
882	calls, and breaks things rather badly.
883
884GNU getopt
885	I'm told that GNU getopt has a problem in that it gets confused
886	by the double call.  Use the version in conf.c instead.
887
888BIND 4.9.2 and Ultrix
889	If you are running on Ultrix, be sure you read conf/Info.Ultrix
890	in the BIND distribution very carefully -- there is information
891	in there that you need to know in order to avoid errors of the
892	form:
893
894		/lib/libc.a(gethostent.o): sethostent: multiply defined
895		/lib/libc.a(gethostent.o): endhostent: multiply defined
896		/lib/libc.a(gethostent.o): gethostbyname: multiply defined
897		/lib/libc.a(gethostent.o): gethostbyaddr: multiply defined
898
899	during the link stage.
900
901strtoul
902	Some compilers (notably gcc) claim to be ANSI C but do not
903	include the ANSI-required routine "strtoul".  If your compiler
904	has this problem, you will get an error in srvrsmtp.c on the
905	code:
906
907	  # ifdef defined(__STDC__) && !defined(BROKEN_ANSI_LIBRARY)
908			e->e_msgsize = strtoul(vp, (char **) NULL, 10);
909	  # else
910			e->e_msgsize = strtol(vp, (char **) NULL, 10);
911	  # endif
912
913	You can use -DBROKEN_ANSI_LIBRARY to get around this problem.
914
915
916+--------------+
917| MANUAL PAGES |
918+--------------+
919
920The manual pages have been written against the -mandoc macros
921instead of the -man macros.  The latest version of groff has them
922included.  You can also get a copy from FTP.UU.NET in directory
923/systems/unix/bsd-sources/share/tmac.
924
925
926+-----------------+
927| DEBUGGING HOOKS |
928+-----------------+
929
930As of 8.6.5, sendmail daemons will catch a SIGUSR1 signal and log
931some debugging output (logged at LOG_DEBUG severity).  The
932information dumped is:
933
934 * The value of the $j macro.
935 * A warning if $j is not in the set $=w.
936 * A list of the open file descriptors.
937 * The contents of the connection cache.
938 * If ruleset 89 is defined, it is evaluated and the results printed.
939
940This allows you to get information regarding the runtime state of the
941daemon on the fly.  This should not be done too frequently, since
942the process of rewriting may lose memory which will not be recovered.
943Also, ruleset 89 may call non-reentrant routines, so there is a small
944non-zero probability that this will cause other problems.  It is
945really only for debugging serious problems.
946
947A typical formulation of ruleset 89 would be:
948
949	R$*		$@ $>0 some test address
950
951
952+-----------------------------+
953| DESCRIPTION OF SOURCE FILES |
954+-----------------------------+
955
956The following list describes the files in this directory:
957
958Makefile	The makefile used here; this version only works with
959		the new Berkeley make.
960Makefile.dist	A trimmed down version of the makefile that works with
961		the old make.
962READ_ME		This file.
963TRACEFLAGS	My own personal list of the trace flags -- not guaranteed
964		to be particularly up to date.
965alias.c		Does name aliasing in all forms.
966arpadate.c	A subroutine which creates ARPANET standard dates.
967clock.c		Routines to implement real-time oriented functions
968		in sendmail -- e.g., timeouts.
969collect.c	The routine that actually reads the mail into a temp
970		file.  It also does a certain amount of parsing of
971		the header, etc.
972conf.c		The configuration file.  This contains information
973		that is presumed to be quite static and non-
974		controversial, or code compiled in for efficiency
975		reasons.  Most of the configuration is in sendmail.cf.
976conf.h		Configuration that must be known everywhere.
977convtime.c	A routine to sanely process times.
978daemon.c	Routines to implement daemon mode.  This version is
979		specifically for Berkeley 4.1 IPC.
980deliver.c	Routines to deliver mail.
981domain.c	Routines that interface with DNS (the Domain Name
982		System).
983err.c		Routines to print error messages.
984envelope.c	Routines to manipulate the envelope structure.
985headers.c	Routines to process message headers.
986macro.c		The macro expander.  This is used internally to
987		insert information from the configuration file.
988main.c		The main routine to sendmail.  This file also
989		contains some miscellaneous routines.
990map.c		Support for database maps.
991mci.c		Routines that handle mail connection information caching.
992parseaddr.c	The routines which do address parsing.
993queue.c		Routines to implement message queueing.
994readcf.c	The routine that reads the configuration file and
995		translates it to internal form.
996recipient.c	Routines that manipulate the recipient list.
997savemail.c	Routines which save the letter on processing errors.
998sendmail.h	Main header file for sendmail.
999srvrsmtp.c	Routines to implement server SMTP.
1000stab.c		Routines to manage the symbol table.
1001stats.c		Routines to collect and post the statistics.
1002sysexits.c	List of error messages associated with error codes
1003		in sysexits.h.
1004trace.c		The trace package.  These routines allow setting and
1005		testing of trace flags with a high granularity.
1006udb.c		The user database interface module.
1007usersmtp.c	Routines to implement user SMTP.
1008util.c		Some general purpose routines used by sendmail.
1009version.c	The version number and information about this
1010		version of sendmail.  Theoretically, this gets
1011		modified on every change.
1012
1013Eric Allman
1014
1015(Version 8.87, last update 05/22/95 08:29:55)
1016