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