xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 65749)
19147Seric /*
234920Sbostic  * Copyright (c) 1983 Eric P. Allman
362522Sbostic  * Copyright (c) 1988, 1993
462522Sbostic  *	The Regents of the University of California.  All rights reserved.
533728Sbostic  *
642825Sbostic  * %sccs.include.redist.c%
733728Sbostic  *
8*65749Seric  *	@(#)conf.h	8.77 (Berkeley) 01/15/94
933728Sbostic  */
109147Seric 
1122726Sdist /*
1222726Sdist **  CONF.H -- All user-configurable parameters for sendmail
1322726Sdist */
149147Seric 
1557232Seric # include <sys/param.h>
1664705Seric # include <sys/types.h>
1759389Seric # include <sys/stat.h>
1864380Seric # include <sys/file.h>
1964500Seric # include <sys/wait.h>
2058689Seric # include <fcntl.h>
2164035Seric # include <signal.h>
2257232Seric 
2363902Seric /**********************************************************************
249147Seric **  Table sizes, etc....
259147Seric **	There shouldn't be much need to change these....
2663902Seric **********************************************************************/
279147Seric 
2859303Seric # define MAXLINE	2048		/* max line length */
2924945Seric # define MAXNAME	256		/* max length of a name */
309147Seric # define MAXPV		40		/* max # of parms to mailers */
3159303Seric # define MAXATOM	200		/* max atoms per address */
329147Seric # define MAXMAILERS	25		/* maximum mailers known to system */
3357143Seric # define MAXRWSETS	100		/* max # of sets of rewriting rules */
349147Seric # define MAXPRIORITIES	25		/* max values for Precedence: field */
3557143Seric # define MAXMXHOSTS	20		/* max # of MX records */
3652106Seric # define SMTPLINELIM	990		/* maximum SMTP line length */
3757232Seric # define MAXKEY		128		/* maximum size of a database key */
3857232Seric # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
3959056Seric # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
4059667Seric # define MAXALIASDB	12		/* max # of alias databases */
4157143Seric 
4257143Seric # ifndef QUEUESIZE
4357143Seric # define QUEUESIZE	1000		/* max # of jobs per queue run */
4457143Seric # endif
4557143Seric 
4663902Seric /**********************************************************************
479147Seric **  Compilation options.
4825673Seric **
4925673Seric **	#define these if they are available; comment them out otherwise.
5063902Seric **********************************************************************/
519147Seric 
5225673Seric # define LOG		1	/* enable logging */
5325673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
5464813Seric # define NETUNIX	1	/* include unix domain support */
5558778Seric # define NETINET	1	/* include internet support */
5625673Seric # define SETPROCTITLE	1	/* munge argv to display current status */
5735651Seric # define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
5853735Seric # define MATCHGECOS	1	/* match user names from gecos field */
5963753Seric # define XDEBUG		1	/* enable extended debugging */
6036483Sbostic 
6156337Seric # ifdef NEWDB
6256337Seric # define USERDB		1	/* look in user database (requires NEWDB) */
6356337Seric # endif
6456337Seric 
6564032Seric /*
6664944Seric **  Most systems have symbolic links today, so default them on.  You
6764944Seric **  can turn them off by #undef'ing this below.
6864944Seric */
6964944Seric 
7064944Seric # define HASLSTAT	1	/* has lstat(2) call */
7164944Seric 
7264962Seric /*
7364962Seric **  General "standard C" defines.
7464962Seric **
7564962Seric **	These may be undone later, to cope with systems that claim to
7664962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
7764962Seric **	doesn't realize that the library is part of the language.
7864962Seric **
7964962Seric **	Life would be much easier if we could get rid of this sort
8064962Seric **	of bozo problems.
8164962Seric */
8264962Seric 
8364962Seric #ifdef __STDC__
8464962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
8564962Seric #endif
8664962Seric 
8763902Seric /**********************************************************************
8859023Seric **  Operating system configuration.
8959023Seric **
9059023Seric **	Unless you are porting to a new OS, you shouldn't have to
9159023Seric **	change these.
9263902Seric **********************************************************************/
9356823Seric 
9463787Seric /*
9563787Seric **  Per-Operating System defines
9663787Seric */
9763787Seric 
9864314Seric 
9963902Seric /*
10065565Seric **  HP-UX -- tested for 8.07, 9.00, and 9.01.
10163902Seric */
10263902Seric 
10359348Seric # ifdef __hpux
10464727Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
10564727Seric # undef m_flags
10663787Seric # define SYSTEM5	1	/* include all the System V defines */
10764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
10864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
10963902Seric # define setreuid(r, e)		setresuid(r, e, -1)
11063962Seric # define LA_TYPE	LA_FLOAT
111*65749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
11265354Seric # define GIDSET_T	gid_t
11363962Seric # define _PATH_UNIX	"/hp-ux"
11465354Seric # ifndef _PATH_SENDMAILCF
11565354Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
11665354Seric # endif
11765167Seric # ifndef IDENTPROTO
11865167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
11956823Seric # endif
12065581Seric # ifndef HASGETUSERSHELL
12165581Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
12265581Seric # endif
12365504Seric # define syslog		hard_syslog
12465581Seric # ifdef __STDC__
12565581Seric extern int	syslog(int, char *, ...);
12665167Seric # endif
12765581Seric # endif
12856823Seric 
12964314Seric 
13063902Seric /*
13163902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
13263902Seric */
13363902Seric 
13460224Seric # ifdef _AIX3
13564035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
13664840Seric # define HASUNAME	1	/* use System V uname(2) system call */
13765211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
13860219Seric # define FORK		fork	/* no vfork primitive available */
13964494Seric # undef  SETPROCTITLE		/* setproctitle confuses AIX */
140*65749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
14160219Seric # endif
14260219Seric 
14364314Seric 
14463902Seric /*
14563902Seric **  Silicon Graphics IRIX
14663902Seric **
14763965Seric **	Compiles on 4.0.1.
14863902Seric */
14963902Seric 
15063753Seric # ifdef IRIX
15164727Seric # include <sys/sysmacros.h>
15264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
15364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
15465211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
15563753Seric # define FORK		fork	/* no vfork primitive available */
15664562Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
15764155Seric # define setpgid	BSDsetpgrp
15863937Seric # define GIDSET_T	gid_t
159*65749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
16063753Seric # endif
16163753Seric 
16263902Seric 
16363902Seric /*
16464813Seric **  SunOS and Solaris
16564813Seric **
16664813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
16764813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
16863902Seric */
16963902Seric 
17063787Seric #if defined(sun) && !defined(BSD)
17159074Seric 
17264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
17364813Seric # define HASUNAME	1	/* use System V uname(2) system call */
17465211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
175*65749Seric # define LA_TYPE	LA_INT
17660564Seric 
17764842Seric # ifdef SOLARIS_2_3
17864842Seric #  define SOLARIS
17964842Seric # endif
18064842Seric 
18160602Seric # ifdef SOLARIS
18263902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
18365222Seric #  ifndef __svr4__
18465222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
18565222Seric #  endif
18663787Seric #  include <sys/time.h>
18764832Seric #  define gethostbyname	solaris_gethostbyname	/* get working version */
18864832Seric #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
18965172Seric #  define GIDSET_T	gid_t
19065189Seric #  ifndef _PATH_UNIX
19165189Seric #   define _PATH_UNIX	"/kernel/unix"
19265189Seric #  endif
19363962Seric #  ifndef _PATH_SENDMAILCF
19463962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
19564072Seric #  endif
19664072Seric #  ifndef _PATH_SENDMAILPID
19763962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
19863962Seric #  endif
19963787Seric 
20060602Seric # else
20165105Seric 			/* SunOS 4.0.3 or 4.1.x */
20265189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
20364831Seric #  define HASFLOCK	1	/* has flock(2) call */
204*65749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
20560564Seric #  include <vfork.h>
20663787Seric 
20765105Seric #  ifdef SUNOS403
20865105Seric 			/* special tweaking for SunOS 4.0.3 */
20965105Seric #   include <malloc.h>
21065105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
21165105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
21265105Seric #   undef WIFEXITED
21365105Seric #   undef WEXITSTATUS
21465105Seric #   undef HASUNAME
21565105Seric #   define setpgid	setpgrp
21665105Seric typedef int		pid_t;
21765105Seric extern char		*getenv();
21865105Seric 
21965105Seric #  endif
22060564Seric # endif
22159023Seric #endif
22259023Seric 
22364718Seric /*
22464813Seric **  DG/UX
22564813Seric **
22664813Seric **	Tested on 5.4.2
22764718Seric */
22864314Seric 
22964718Seric #ifdef	DGUX
23064718Seric # define SYSTEM5	1
23164718Seric # define LA_TYPE	LA_SUBR
23264718Seric # define HASSETREUID	1	/* has setreuid(2) call */
23364718Seric # define HASUNAME	1	/* use System V uname(2) system call */
23464718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
23564718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
23665167Seric # ifndef IDENTPROTO
23765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
23865167Seric # endif
23964718Seric # undef SETPROCTITLE
240*65749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
24164813Seric 
24264813Seric /* these include files must be included early on DG/UX */
24364813Seric # include <netinet/in.h>
24464813Seric # include <arpa/inet.h>
24564813Seric 
24664718Seric # define inet_addr	dgux_inet_addr
24764718Seric extern long	dgux_inet_addr();
24864718Seric #endif
24964718Seric 
25064718Seric 
25163902Seric /*
25263902Seric **  Digital Ultrix 4.2A or 4.3
25364264Seric **
25464264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
25564264Seric **	not dropped when the process exits.  This causes major problems,
25664264Seric **	so flock is the only alternative.
25763902Seric */
25863902Seric 
25960564Seric #ifdef ultrix
26064035Seric # define HASSETREUID	1	/* has setreuid(2) call */
26163962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
26264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
26364264Seric # define HASFLOCK	1	/* has flock(2) call */
26465211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
26565135Seric # ifdef vax
26665135Seric #  define LA_TYPE	LA_FLOAT
26765135Seric # else
26865135Seric #  define LA_TYPE	LA_INT
26965135Seric #  define LA_AVENRUN	"avenrun"
27065135Seric # endif
271*65749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
27265167Seric # ifndef IDENTPROTO
27365167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
27465167Seric # endif
27560564Seric #endif
27660564Seric 
27764314Seric 
27863902Seric /*
27963902Seric **  OSF/1 (tested on Alpha)
28063902Seric */
28163902Seric 
28263787Seric #ifdef __osf__
28363962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
28464035Seric # define HASSETREUID	1	/* has setreuid(2) call */
28564035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
28664831Seric # define HASFLOCK	1	/* has flock(2) call */
28763962Seric # define LA_TYPE	LA_INT
288*65749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
28964813Seric # ifndef _PATH_SENDMAILPID
29065504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
29164813Seric # endif
29259287Seric #endif
29359287Seric 
29464314Seric 
29563902Seric /*
29663902Seric **  NeXTstep
29763902Seric */
29863902Seric 
29964076Seric #ifdef NeXT
30064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
30164035Seric # define HASFLOCK	1	/* has flock(2) call */
30264125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
30364563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
30463753Seric # define sleep		sleepX
30564155Seric # define setpgid	setpgrp
30664295Seric # ifndef LA_TYPE
30764295Seric #  define LA_TYPE	LA_MACH
30864295Seric # endif
309*65749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
31064500Seric # ifndef _POSIX_SOURCE
31164035Seric typedef int		pid_t;
31264500Seric #  undef WEXITSTATUS
31364500Seric #  undef WIFEXITED
31464500Seric # endif
31564072Seric # ifndef _PATH_SENDMAILCF
31664072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
31764072Seric # endif
31864072Seric # ifndef _PATH_SENDMAILPID
31964072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
32064072Seric # endif
32159288Seric #endif
32259288Seric 
32364314Seric 
32463902Seric /*
32563962Seric **  4.4 BSD
32664831Seric **
32764831Seric **	See also BSD defines.
32863902Seric */
32963902Seric 
33060568Seric #ifdef BSD4_4
33164072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
33260568Seric # include <sys/cdefs.h>
33363838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
33464072Seric # ifndef LA_TYPE
33564072Seric #  define LA_TYPE	LA_SUBR
33664072Seric # endif
337*65749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
33860568Seric #endif
33960568Seric 
34064314Seric 
34163902Seric /*
34265049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
34364733Seric **
34464733Seric **  4.3BSD clone, closer to 4.4BSD
34564831Seric **
34664831Seric **	See also BSD defines.
34764733Seric */
34864733Seric 
34965049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
35064733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
35164733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
35264733Seric # include <sys/cdefs.h>
35364733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
35464733Seric # ifndef LA_TYPE
35564733Seric #  define LA_TYPE	LA_SUBR
35664733Seric # endif
357*65749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
35864733Seric #endif
35964733Seric 
36064733Seric 
36164733Seric /*
36264813Seric **  Mach386
36364813Seric **
36464813Seric **	For mt Xinu's Mach386 system.
36564813Seric */
36664813Seric 
36764813Seric #if defined(MACH) && defined(i386)
36864813Seric # define MACH386	1
36964813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
37064813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
37164813Seric # define HASFLOCK	1	/* has flock(2) call */
37264813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
37364813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
37464813Seric # define setpgid	setpgrp
37564813Seric # ifndef LA_TYPE
37664813Seric #  define LA_TYPE	LA_FLOAT
37764813Seric # endif
378*65749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
37964962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
38064813Seric # undef WEXITSTATUS
38164813Seric # undef WIFEXITED
38264813Seric # ifndef _PATH_SENDMAILCF
38364813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
38464813Seric # endif
38564813Seric # ifndef _PATH_SENDMAILPID
38664813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
38764813Seric # endif
38864813Seric #endif
38964813Seric 
39064813Seric 
39164813Seric /*
39263969Seric **  4.3 BSD -- this is for very old systems
39363969Seric **
39463969Seric **	You'll also have to install a new resolver library.
39563969Seric **	I don't guarantee that support for this environment is complete.
39663969Seric */
39763969Seric 
39863969Seric #ifdef oldBSD43
39963969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
40063969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
40163970Seric # define ARBPTR_T	char *
40264155Seric # define setpgid	setpgrp
40363969Seric # ifndef LA_TYPE
40463969Seric #  define LA_TYPE	LA_FLOAT
40563969Seric # endif
40663969Seric # ifndef _PATH_SENDMAILCF
40763969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
40863969Seric # endif
40965167Seric # ifndef IDENTPROTO
41065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
41165167Seric # endif
41264834Seric # undef WEXITSTATUS
41364834Seric # undef WIFEXITED
41464834Seric typedef short		pid_t;
41564834Seric extern int		errno;
41663969Seric #endif
41763969Seric 
41864314Seric 
41963969Seric /*
42063902Seric **  SCO Unix
42165087Seric **
42265087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
42365087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
42465087Seric **	The second is, I believe, for an older version.
42563902Seric */
42663902Seric 
42765087Seric #ifdef _SCO_unix_4_2
42865087Seric # define _SCO_unix_
42965087Seric # define HASSETREUID	1	/* has setreuid(2) call */
43065087Seric # define _PATH_UNIX	"/unix"
43165087Seric # ifndef _PATH_SENDMAILCF
43265087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
43365087Seric # endif
43465087Seric # ifndef _PATH_SENDMAILPID
43565087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
43665087Seric # endif
43765087Seric #endif
43865087Seric 
43963838Seric #ifdef _SCO_unix_
44063838Seric # define SYSTEM5	1	/* include all the System V defines */
44164035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
44265212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
44363838Seric # define FORK		fork
44463838Seric # define MAXPATHLEN	PATHSIZE
44564718Seric # define LA_TYPE	LA_SHORT
446*65749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
44764813Seric # undef NETUNIX			/* no unix domain socket support */
44863838Seric #endif
44963838Seric 
45064314Seric 
45163962Seric /*
45263962Seric **  ConvexOS 11.0 and later
45363962Seric */
45463962Seric 
45563962Seric #ifdef _CONVEX_SOURCE
45663977Seric # define BSD		1	/* include all the BSD defines */
45763977Seric # define HASUNAME	1	/* use System V uname(2) system call */
45863962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
45963977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
46063962Seric # define LA_TYPE	LA_FLOAT
461*65749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
46265167Seric # ifndef IDENTPROTO
46365167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
46465167Seric # endif
46563962Seric #endif
46663962Seric 
46764314Seric 
46863962Seric /*
46964999Seric **  RISC/os 4.52
47063962Seric **
47164999Seric **	Gives a ton of warning messages, but otherwise compiles.
47263962Seric */
47363962Seric 
47463965Seric #ifdef RISCOS
47564999Seric 
47663962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
47764831Seric # define HASFLOCK	1	/* has flock(2) call */
47864999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
47964999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
48063962Seric # define LA_TYPE	LA_INT
48163962Seric # define LA_AVENRUN	"avenrun"
48263962Seric # define _PATH_UNIX	"/unix"
48364999Seric # undef WIFEXITED
48464999Seric 
48564999Seric # define setpgid	setpgrp
48664999Seric 
48764999Seric extern int		errno;
48864999Seric typedef int		pid_t;
48964999Seric #define			SIGFUNC_DEFINED
49064999Seric typedef int		(*sigfunc_t)();
49164999Seric extern char		*getenv();
49264999Seric extern void		*malloc();
49364999Seric 
49463962Seric #endif
49563962Seric 
49664314Seric 
49764155Seric /*
49864155Seric **  Linux 0.99pl10 and above...
49964155Seric **	From Karl London <karl@borg.demon.co.uk>.
50064155Seric */
50164155Seric 
50264770Seric #ifdef __linux__
50364155Seric # define BSD		1	/* pretend to be BSD based today */
50464155Seric # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
50564155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
50664380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
50764155Seric # ifndef LA_TYPE
50864155Seric #  define LA_TYPE	LA_FLOAT
50964155Seric # endif
51064763Seric # include <sys/sysmacros.h>
51165046Seric # define GIDSET_T	gid_t
51264155Seric #endif
51364155Seric 
51464155Seric 
51564345Seric /*
51664345Seric **  DELL SVR4 Issue 2.2, and others
51764345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
51864345Seric **
51964345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
52064345Seric **	defined, and the definitions conflict.
52164924Seric **
52264924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
52364924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
52464924Seric **	(SVR4.0/386 version 3.0).
52564345Seric */
52664345Seric 
52764345Seric #ifdef DELL_SVR4
52865189Seric 				/* no changes necessary */
52965189Seric 				/* see general __svr4__ defines below */
53064345Seric #endif
53164345Seric 
53264345Seric 
53364380Seric /*
53464380Seric **  Apple A/UX 3.0
53564380Seric */
53664345Seric 
53764380Seric #ifdef _AUX_SOURCE
53864729Seric # include <sys/sysmacros.h>
53964380Seric # define BSD			/* has BSD routines */
54064380Seric # define HASUNAME	1	/* use System V uname(2) system call */
54164380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
54264561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
54365167Seric # ifndef IDENTPROTO
54465167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
54565167Seric # endif
54664380Seric # define FORK		fork
54764380Seric # ifndef _PATH_SENDMAILCF
54864380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
54964380Seric # endif
55064380Seric # ifndef LA_TYPE
55164380Seric #  define LA_TYPE	LA_ZERO
55264380Seric # endif
553*65749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
55464560Seric # undef WIFEXITED
55564560Seric # undef WEXITSTATUS
55664380Seric #endif
55764380Seric 
55864380Seric 
55964705Seric /*
56064705Seric **  Encore UMAX V
56164705Seric **
56264705Seric **	Not extensively tested.
56364705Seric */
56464380Seric 
56564705Seric #ifdef UMAXV
56664705Seric # include <limits.h>
56764705Seric # define HASUNAME	1	/* use System V uname(2) system call */
56864705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
56964705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
57065211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
57164705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
57264705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
57364705Seric # define FORK		fork	/* no vfork(2) primitive available */
574*65749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
57564705Seric # define MAXPATHLEN	PATH_MAX
57664705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
57764705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
57864705Seric # undef WIFEXITED
57964705Seric # undef WEXITSTATUS
58064705Seric #endif
58164705Seric 
58264705Seric 
58364939Seric /*
58464939Seric **  Stardent Titan 3000 running TitanOS 4.2.
58564939Seric **
58664939Seric **	Must be compiled in "cc -43" mode.
58764939Seric **
58864944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
58964939Seric **
59064939Seric **	Note the tweaking below after the BSD defines are set.
59164939Seric */
59264705Seric 
59364939Seric #ifdef titan
59464939Seric # define setpgid	setpgrp
59564939Seric typedef int		pid_t;
59664939Seric # undef WIFEXITED
59764939Seric # undef WEXITSTATUS
59864939Seric #endif
59964939Seric 
60064939Seric 
60164962Seric /*
60264962Seric **  Sequent DYNIX 3.2.0
60364962Seric **
60464962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
60564962Seric */
60664939Seric 
60764962Seric #ifdef sequent
60864962Seric # define BSD		1
60964962Seric # define HASUNSETENV	1
61064962Seric # define BSD4_3		1	/* to get signal() in conf.c */
61164962Seric # define WAITUNION	1
61264962Seric # define LA_TYPE	LA_FLOAT
61364962Seric # ifdef	_POSIX_VERSION
61464962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
61564962Seric # endif
61664962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
61764962Seric # define setpgid	setpgrp
61864962Seric 
61964962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
62064962Seric # undef	WIFEXITED
62164962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
62264962Seric 			 ((union wait*)&(s))->w_termsig == 0)
62364962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
62464962Seric typedef int		pid_t;
62564962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
62664962Seric 
62764962Seric # ifndef _PATH_UNIX
62864962Seric #  define _PATH_UNIX	"/dynix"
62964962Seric # endif
63064962Seric # ifndef _PATH_SENDMAILCF
63164962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
63264962Seric # endif
63364962Seric 
63464962Seric #endif
63564962Seric 
63664962Seric 
63765748Seric /*
63865748Seric **  Cray Unicos
63965748Seric **
64065748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
64165748Seric */
64264962Seric 
64365748Seric #ifdef UNICOS
64465748Seric # define SYSTEM5	1	/* include all the System V defines */
64565748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
64665748Seric # define MAXPATHLEN	PATHSIZE
64765748Seric # define LA_TYPE	LA_ZERO
648*65749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
64965748Seric #endif
65064962Seric 
65165748Seric 
65265748Seric 
65363902Seric /**********************************************************************
65463787Seric **  End of Per-Operating System defines
65563902Seric **********************************************************************/
65663787Seric 
65763949Seric /**********************************************************************
65863949Seric **  More general defines
65963949Seric **********************************************************************/
66063949Seric 
66163962Seric /* general BSD defines */
66263962Seric #ifdef BSD
66364035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
66464035Seric # define HASSETREUID	1	/* has setreuid(2) call */
66564035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
66664035Seric # define HASFLOCK	1	/* has flock(2) call */
66763962Seric #endif
66863962Seric 
66965189Seric /* general System V Release 4 defines */
67065189Seric #ifdef __svr4__
67165189Seric # define SYSTEM5	1
67265189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
67365211Seric # ifndef HASGETUSERSHELL
67465211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
67565210Seric # endif
67665189Seric # define setreuid(r, e)	seteuid(e)
67765189Seric 
67865189Seric # ifndef _PATH_UNIX
67965189Seric #  define _PATH_UNIX		"/unix"
68065189Seric # endif
68165189Seric # ifndef _PATH_SENDMAILCF
68265189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
68365189Seric # endif
68465189Seric # ifndef _PATH_SENDMAILPID
68565189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
68665189Seric # endif
68765189Seric # ifndef SYSLOG_BUFSIZE
68865189Seric #  define SYSLOG_BUFSIZE	128
68965189Seric # endif
69065189Seric #endif
69165189Seric 
69263787Seric /* general System V defines */
69363787Seric # ifdef SYSTEM5
69464813Seric # include <sys/sysmacros.h>
69563949Seric # define HASUNAME	1	/* use System V uname(2) system call */
69664705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
69764962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
69863962Seric # ifndef LA_TYPE
699*65749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
70063962Seric # endif
701*65749Seric # ifndef SFS_TYPE
702*65749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
703*65749Seric # endif
70463949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
70563949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
70663949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
70763787Seric # endif
70863787Seric 
70963949Seric /* general POSIX defines */
71063949Seric #ifdef _POSIX_VERSION
71164718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
71264718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
71363949Seric #endif
71463949Seric 
71563787Seric /*
71663937Seric **  If no type for argument two of getgroups call is defined, assume
71763937Seric **  it's an integer -- unfortunately, there seem to be several choices
71863937Seric **  here.
71963937Seric */
72063937Seric 
72163937Seric #ifndef GIDSET_T
72263937Seric # define GIDSET_T	int
72363937Seric #endif
72463937Seric 
72564939Seric /*
72664939Seric **  Tweaking for systems that (for example) claim to be BSD but
72764939Seric **  don't have all the standard BSD routines (boo hiss).
72864939Seric */
72964439Seric 
73064939Seric #ifdef titan
73164939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
73264939Seric #endif
73364939Seric 
73465167Seric /*
73565167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
73665167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
73765167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
73865167Seric **  are closed.  Some firewalls return this error if you try to connect
73965167Seric **  to the IDENT port (113), so you can't receive email from these hosts
74065167Seric **  on these systems.  The firewall really should use a more specific
74165167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
74265167Seric **  not explicitly set to zero above, default it on.
74365167Seric */
74464939Seric 
74565167Seric #ifndef IDENTPROTO
74665167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
74765167Seric #endif
74865167Seric 
74965211Seric #ifndef HASGETUSERSHELL
75065211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
75165210Seric #endif
75265167Seric 
75365210Seric 
75464439Seric /**********************************************************************
75559023Seric **  Remaining definitions should never have to be changed.  They are
75659023Seric **  primarily to provide back compatibility for older systems -- for
75759287Seric **  example, it includes some POSIX compatibility definitions
75864439Seric **********************************************************************/
75959023Seric 
76059388Seric /* System 5 compatibility */
76159388Seric #ifndef S_ISREG
76264944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
76359388Seric #endif
76464944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
76564944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
76664944Seric #endif
76759388Seric #ifndef S_IWGRP
76859388Seric #define S_IWGRP		020
76959388Seric #endif
77059388Seric #ifndef S_IWOTH
77159388Seric #define S_IWOTH		002
77259388Seric #endif
77359388Seric 
77459023Seric /*
77550537Seric **  Older systems don't have this error code -- it should be in
77650537Seric **  /usr/include/sysexits.h.
77750537Seric */
77850537Seric 
77950537Seric # ifndef EX_CONFIG
78050537Seric # define EX_CONFIG	78	/* configuration error */
78150537Seric # endif
78256852Seric 
78364718Seric /* pseudo-code used in server SMTP */
78464718Seric # define EX_QUIT	22	/* drop out of server immediately */
78564718Seric 
78664718Seric 
78763993Seric /*
78863993Seric **  These are used in a few cases where we need some special
78963993Seric **  error codes, but where the system doesn't provide something
79063993Seric **  reasonable.  They are printed in errstring.
79163993Seric */
79263993Seric 
79363993Seric #ifndef E_PSEUDOBASE
79463993Seric # define E_PSEUDOBASE	256
79563993Seric #endif
79663993Seric 
79763993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
79863993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
79963993Seric 
80063970Seric /* type of arbitrary pointer */
80163970Seric #ifndef ARBPTR_T
80263970Seric # define ARBPTR_T	void *
80363970Seric #endif
80463970Seric 
80560568Seric #ifndef __P
80660568Seric # include "cdefs.h"
80760568Seric #endif
80860568Seric 
80956852Seric /*
81058778Seric **  Do some required dependencies
81158778Seric */
81258778Seric 
81358778Seric #if defined(NETINET) || defined(NETISO)
81459107Seric # define SMTP		1	/* enable user and server SMTP */
81559107Seric # define QUEUE		1	/* enable queueing */
81659107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
81758778Seric #endif
81858778Seric 
81958778Seric 
82058778Seric /*
82156852Seric **  Arrange to use either varargs or stdargs
82256852Seric */
82356852Seric 
82456852Seric # ifdef __STDC__
82556852Seric 
82656852Seric # include <stdarg.h>
82756852Seric 
82856852Seric # define VA_LOCAL_DECL	va_list ap;
82956852Seric # define VA_START(f)	va_start(ap, f)
83056852Seric # define VA_END		va_end(ap)
83156852Seric 
83256852Seric # else
83356852Seric 
83456852Seric # include <varargs.h>
83556852Seric 
83656852Seric # define VA_LOCAL_DECL	va_list ap;
83756852Seric # define VA_START(f)	va_start(ap)
83856852Seric # define VA_END		va_end(ap)
83956852Seric 
84056852Seric # endif
84157631Seric 
84257943Seric #ifdef HASUNAME
84357631Seric # include <sys/utsname.h>
84457631Seric # ifdef newstr
84557631Seric #  undef newstr
84657631Seric # endif
84757943Seric #else /* ! HASUNAME */
84857631Seric # define NODE_LENGTH 32
84957631Seric struct utsname
85057631Seric {
85157631Seric 	char nodename[NODE_LENGTH+1];
85257631Seric };
85357943Seric #endif /* HASUNAME */
85457642Seric 
85563838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
85663838Seric # define MAXHOSTNAMELEN	256
85757735Seric #endif
85858153Seric 
85958153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
86058153Seric # define SIGCHLD	SIGCLD
86158153Seric #endif
86258153Seric 
86358153Seric #ifndef STDIN_FILENO
86458153Seric #define STDIN_FILENO	0
86558153Seric #endif
86658153Seric 
86758153Seric #ifndef STDOUT_FILENO
86858153Seric #define STDOUT_FILENO	1
86958153Seric #endif
87058153Seric 
87158153Seric #ifndef STDERR_FILENO
87258153Seric #define STDERR_FILENO	2
87358153Seric #endif
87458689Seric 
87564072Seric #ifndef LOCK_SH
87664035Seric # define LOCK_SH	0x01	/* shared lock */
87764035Seric # define LOCK_EX	0x02	/* exclusive lock */
87864035Seric # define LOCK_NB	0x04	/* non-blocking lock */
87964035Seric # define LOCK_UN	0x08	/* unlock */
88064035Seric #endif
88158692Seric 
88264035Seric #ifndef SIG_ERR
88364035Seric # define SIG_ERR	((void (*)()) -1)
88458689Seric #endif
88558702Seric 
88664500Seric #ifndef WEXITSTATUS
88764500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
88864500Seric #endif
88964500Seric #ifndef WIFEXITED
89064500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
89164500Seric #endif
89264500Seric 
89364561Seric #ifndef SIGFUNC_DEFINED
89464561Seric typedef void		(*sigfunc_t) __P((int));
89564561Seric #endif
89664561Seric 
89765053Seric /* size of syslog buffer */
89865053Seric #ifndef SYSLOG_BUFSIZE
89965053Seric # define SYSLOG_BUFSIZE	1024
90065053Seric #endif
90165053Seric 
90258702Seric /*
90358702Seric **  Size of tobuf (deliver.c)
90458702Seric **	Tweak this to match your syslog implementation.  It will have to
90558702Seric **	allow for the extra information printed.
90658702Seric */
90758702Seric 
90858702Seric #ifndef TOBUFSIZE
90965053Seric # if (SYSLOG_BUFSIZE) > 512
91065053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
91165053Seric # else
91265053Seric #  define TOBUFSIZE	256
91365053Seric # endif
91458702Seric #endif
91560219Seric 
91665015Seric /*
91765015Seric **  Size of prescan buffer.
91865015Seric **	Despite comments in the _sendmail_ book, this probably should
91965015Seric **	not be changed; there are some hard-to-define dependencies.
92065015Seric */
92165015Seric 
92265015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
92360219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
92460219Seric # ifndef FORK
92560219Seric # define FORK		vfork		/* function to call to fork mailer */
92660219Seric # endif
927