xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 68145)
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*68145Seric  *	@(#)conf.h	8.129 (Berkeley) 01/07/95
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 */
4167729Seric # define MAXMAPSTACK	12		/* max # of stacked or sequenced maps */
4267729Seric # define MAXTOCLASS	8		/* max # of message timeout classes */
4357143Seric 
4457143Seric # ifndef QUEUESIZE
4557143Seric # define QUEUESIZE	1000		/* max # of jobs per queue run */
4657143Seric # endif
4757143Seric 
4863902Seric /**********************************************************************
499147Seric **  Compilation options.
5025673Seric **
5125673Seric **	#define these if they are available; comment them out otherwise.
5263902Seric **********************************************************************/
539147Seric 
5425673Seric # define LOG		1	/* enable logging */
5525673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
5664813Seric # define NETUNIX	1	/* include unix domain support */
5758778Seric # define NETINET	1	/* include internet support */
5853735Seric # define MATCHGECOS	1	/* match user names from gecos field */
5963753Seric # define XDEBUG		1	/* enable extended debugging */
6056337Seric # ifdef NEWDB
6156337Seric # define USERDB		1	/* look in user database (requires NEWDB) */
6256337Seric # endif
6356337Seric 
6466334Seric /**********************************************************************
6566334Seric **  0/1 Compilation options.
6666334Seric **	#define these to 1 if they are available;
6766334Seric **	#define them to 0 otherwise.
6866334Seric **********************************************************************/
6966334Seric 
7066334Seric # ifndef NAMED_BIND
7166334Seric #  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
7266334Seric # endif
7366334Seric 
7464032Seric /*
7564944Seric **  Most systems have symbolic links today, so default them on.  You
7664944Seric **  can turn them off by #undef'ing this below.
7764944Seric */
7864944Seric 
7964944Seric # define HASLSTAT	1	/* has lstat(2) call */
8064944Seric 
8164962Seric /*
8264962Seric **  General "standard C" defines.
8364962Seric **
8464962Seric **	These may be undone later, to cope with systems that claim to
8564962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
8664962Seric **	doesn't realize that the library is part of the language.
8764962Seric **
8864962Seric **	Life would be much easier if we could get rid of this sort
8964962Seric **	of bozo problems.
9064962Seric */
9164962Seric 
9264962Seric #ifdef __STDC__
9364962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
9464962Seric #endif
9564962Seric 
9663902Seric /**********************************************************************
9759023Seric **  Operating system configuration.
9859023Seric **
9959023Seric **	Unless you are porting to a new OS, you shouldn't have to
10059023Seric **	change these.
10163902Seric **********************************************************************/
10256823Seric 
10363787Seric /*
10463787Seric **  Per-Operating System defines
10563787Seric */
10663787Seric 
10764314Seric 
10863902Seric /*
10965565Seric **  HP-UX -- tested for 8.07, 9.00, and 9.01.
11063902Seric */
11163902Seric 
11267626Seric #ifdef __hpux
11364727Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
11464727Seric # undef m_flags
11563787Seric # define SYSTEM5	1	/* include all the System V defines */
11664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
11764035Seric # define HASSETREUID	1	/* has setreuid(2) call */
11865982Seric # define setreuid(r, e)		setresuid(r, e, -1)
11963962Seric # define LA_TYPE	LA_FLOAT
12065749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
12165354Seric # define GIDSET_T	gid_t
12263962Seric # define _PATH_UNIX	"/hp-ux"
12365354Seric # ifndef _PATH_SENDMAILCF
12465354Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
12565354Seric # endif
12665167Seric # ifndef IDENTPROTO
12765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
12856823Seric # endif
12965581Seric # ifndef HASGETUSERSHELL
13065581Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
13165581Seric # endif
13265504Seric # define syslog		hard_syslog
13365581Seric # ifdef __STDC__
13465581Seric extern int	syslog(int, char *, ...);
13565167Seric # endif
13667626Seric #endif
13756823Seric 
13864314Seric 
13963902Seric /*
14063902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
14163902Seric */
14263902Seric 
14367626Seric #ifdef _AIX3
14464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
14564840Seric # define HASUNAME	1	/* use System V uname(2) system call */
14665211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
14760219Seric # define FORK		fork	/* no vfork primitive available */
14865749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
14967771Seric # define SPT_PADCHAR	'\0'	/* pad process title with nulls */
150*68145Seric # define LA_TYPE	LA_INT
15167626Seric #endif
15260219Seric 
15364314Seric 
15463902Seric /*
15563902Seric **  Silicon Graphics IRIX
15663902Seric **
15763965Seric **	Compiles on 4.0.1.
15867967Seric **
15967967Seric **	Use IRIX64 instead of IRIX for 64-bit IRIX.
16067967Seric **
16167967Seric **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
16263902Seric */
16363902Seric 
16467967Seric #ifdef IRIX64
16567967Seric # define IRIX
16667967Seric #endif
16767967Seric 
16867626Seric #ifdef IRIX
16966763Seric # define SYSTEM5	1	/* this is a System-V derived system */
17064035Seric # define HASSETREUID	1	/* has setreuid(2) call */
17164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
17265211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
17363753Seric # define FORK		fork	/* no vfork primitive available */
17464562Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
17564155Seric # define setpgid	BSDsetpgrp
17663937Seric # define GIDSET_T	gid_t
17765749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
17866763Seric # define LA_TYPE	LA_INT
17967967Seric # ifdef IRIX64
18067967Seric #  define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
18167967Seric # else
18267967Seric #  define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
18367967Seric # endif
18467626Seric #endif
18563753Seric 
18663902Seric 
18763902Seric /*
18864813Seric **  SunOS and Solaris
18964813Seric **
19064813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
19164813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
19263902Seric */
19363902Seric 
19463787Seric #if defined(sun) && !defined(BSD)
19559074Seric 
19664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
19764813Seric # define HASUNAME	1	/* use System V uname(2) system call */
19865211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
19965749Seric # define LA_TYPE	LA_INT
20060564Seric 
20164842Seric # ifdef SOLARIS_2_3
20264842Seric #  define SOLARIS
20364842Seric # endif
20464842Seric 
20560602Seric # ifdef SOLARIS
20663902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
20765222Seric #  ifndef __svr4__
20865222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
20965222Seric #  endif
21063787Seric #  include <sys/time.h>
21164832Seric #  define gethostbyname	solaris_gethostbyname	/* get working version */
21264832Seric #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
21365172Seric #  define GIDSET_T	gid_t
21465189Seric #  ifndef _PATH_UNIX
21567129Seric #   define _PATH_UNIX	"/dev/ksyms"
21665189Seric #  endif
21763962Seric #  ifndef _PATH_SENDMAILCF
21863962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
21964072Seric #  endif
22064072Seric #  ifndef _PATH_SENDMAILPID
22163962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
22263962Seric #  endif
22366022Seric #  ifndef SYSLOG_BUFSIZE
22466022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
22566022Seric #  endif
22663787Seric 
22760602Seric # else
22865105Seric 			/* SunOS 4.0.3 or 4.1.x */
22965189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
23065830Seric #  ifndef HASFLOCK
23165830Seric #   define HASFLOCK	1	/* has flock(2) call */
23265830Seric #  endif
23365749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
23460564Seric #  include <vfork.h>
23563787Seric 
23665105Seric #  ifdef SUNOS403
23765105Seric 			/* special tweaking for SunOS 4.0.3 */
23865105Seric #   include <malloc.h>
23965105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
24065105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
24165105Seric #   undef WIFEXITED
24265105Seric #   undef WEXITSTATUS
24365105Seric #   undef HASUNAME
24465105Seric #   define setpgid	setpgrp
24565105Seric typedef int		pid_t;
24665105Seric extern char		*getenv();
24765105Seric 
24866732Seric #  else
24966732Seric 			/* 4.1.x specifics */
25066732Seric #   define HASSETSID	1	/* has Posix setsid(2) call */
25166732Seric #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
25266732Seric 
25365105Seric #  endif
25460564Seric # endif
25559023Seric #endif
25659023Seric 
25764718Seric /*
25864813Seric **  DG/UX
25964813Seric **
26067427Seric **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
26167427Seric **	older support.
26267427Seric **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
26364718Seric */
26464314Seric 
26567427Seric #ifdef DGUX_5_4_2
26667427Seric # define DGUX		1
26767427Seric #endif
26867427Seric 
26964718Seric #ifdef	DGUX
27064718Seric # define SYSTEM5	1
27164718Seric # define LA_TYPE	LA_SUBR
27264718Seric # define HASSETREUID	1	/* has setreuid(2) call */
27364718Seric # define HASUNAME	1	/* use System V uname(2) system call */
27464718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
27564718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
27666036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
27765167Seric # ifndef IDENTPROTO
27865167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
27965167Seric # endif
28067771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
28165749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
28264813Seric 
28364813Seric /* these include files must be included early on DG/UX */
28464813Seric # include <netinet/in.h>
28564813Seric # include <arpa/inet.h>
28664813Seric 
28767427Seric # ifdef DGUX_5_4_2
28867427Seric #  define inet_addr	dgux_inet_addr
28964718Seric extern long	dgux_inet_addr();
29067427Seric # endif
29164718Seric #endif
29264718Seric 
29364718Seric 
29463902Seric /*
29563902Seric **  Digital Ultrix 4.2A or 4.3
29664264Seric **
29764264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
29864264Seric **	not dropped when the process exits.  This causes major problems,
29964264Seric **	so flock is the only alternative.
30063902Seric */
30163902Seric 
30260564Seric #ifdef ultrix
30364035Seric # define HASSETREUID	1	/* has setreuid(2) call */
30463962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
30564035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
30666242Seric # define HASUNAME	1	/* use System V uname(2) system call */
30765830Seric # ifndef HASFLOCK
30865830Seric #  define HASFLOCK	1	/* has flock(2) call */
30965830Seric # endif
31065211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
31166318Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
31265135Seric # ifdef vax
31365135Seric #  define LA_TYPE	LA_FLOAT
31465135Seric # else
31565135Seric #  define LA_TYPE	LA_INT
31665135Seric #  define LA_AVENRUN	"avenrun"
31765135Seric # endif
31865749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
31965167Seric # ifndef IDENTPROTO
32065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
32165167Seric # endif
32260564Seric #endif
32360564Seric 
32464314Seric 
32563902Seric /*
32668072Seric **  OSF/1 for Intel Paragon.
32768072Seric **
32868082Seric **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
32968082Seric **	of Intel Scalable Systems Divison.
33068072Seric */
33168072Seric 
33268072Seric #ifdef __PARAGON__
33368072Seric # define __osf__	1	/* get OSF/1 defines below */
33468072Seric # ifndef _PATH_SENDMAILCF
33568072Seric #  define _PATH_SENDMAILCF	"/var/adm/sendmail/sendmail.cf"
33668072Seric # endif
33768072Seric #endif
33868072Seric 
33968072Seric 
34068072Seric /*
34163902Seric **  OSF/1 (tested on Alpha)
34263902Seric */
34363902Seric 
34463787Seric #ifdef __osf__
34563962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
34664035Seric # define HASSETREUID	1	/* has setreuid(2) call */
34764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
34866226Seric # ifndef HASFLOCK
34965830Seric #  define HASFLOCK	1	/* has flock(2) call */
35065830Seric # endif
35163962Seric # define LA_TYPE	LA_INT
35265749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
35364813Seric # ifndef _PATH_SENDMAILPID
35465504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
35564813Seric # endif
35659287Seric #endif
35759287Seric 
35864314Seric 
35963902Seric /*
36063902Seric **  NeXTstep
36163902Seric */
36263902Seric 
36364076Seric #ifdef NeXT
36464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
36565830Seric # ifndef HASFLOCK
36665830Seric #  define HASFLOCK	1	/* has flock(2) call */
36765830Seric # endif
36864125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
36964563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
37063753Seric # define sleep		sleepX
37164155Seric # define setpgid	setpgrp
37264295Seric # ifndef LA_TYPE
37364295Seric #  define LA_TYPE	LA_MACH
37464295Seric # endif
37565749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
37664500Seric # ifndef _POSIX_SOURCE
37764035Seric typedef int		pid_t;
37864500Seric #  undef WEXITSTATUS
37964500Seric #  undef WIFEXITED
38064500Seric # endif
38164072Seric # ifndef _PATH_SENDMAILCF
38264072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
38364072Seric # endif
38464072Seric # ifndef _PATH_SENDMAILPID
38564072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
38664072Seric # endif
38759288Seric #endif
38859288Seric 
38964314Seric 
39063902Seric /*
39163962Seric **  4.4 BSD
39264831Seric **
39364831Seric **	See also BSD defines.
39463902Seric */
39563902Seric 
39660568Seric #ifdef BSD4_4
39764072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
39860568Seric # include <sys/cdefs.h>
39963838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
40064072Seric # ifndef LA_TYPE
40164072Seric #  define LA_TYPE	LA_SUBR
40264072Seric # endif
40365749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
40467771Seric # define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
40560568Seric #endif
40660568Seric 
40764314Seric 
40863902Seric /*
40965982Seric **  BSD/386 (all versions)
41065982Seric **	From Tony Sanders, BSDI
41165982Seric */
41265982Seric 
41365982Seric #ifdef __bsdi__
41465982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
41565982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
41666843Seric # include <sys/cdefs.h>
41766843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
41866030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
41966843Seric # ifndef LA_TYPE
42066843Seric #  define LA_TYPE	LA_SUBR
42166843Seric # endif
42265982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
42366843Seric 			/* version 1.1 or later */
42467771Seric #  undef SPT_TYPE
42567771Seric #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
42666843Seric # else
42766843Seric 			/* version 1.0 or earlier */
42866843Seric #  ifndef OLD_NEWDB
42966843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
43066843Seric #  endif
43167771Seric #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
43265982Seric # endif
43365982Seric #endif
43465982Seric 
43565982Seric 
43665982Seric 
43765982Seric /*
43865049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
43964733Seric **
44064733Seric **  4.3BSD clone, closer to 4.4BSD
44164831Seric **
44264831Seric **	See also BSD defines.
44364733Seric */
44464733Seric 
44565049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
44664733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
44764733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
44866754Seric # ifdef __NetBSD__
44966754Seric #  define HASUNAME	1	/* has uname(2) syscall */
45066754Seric # endif
45164733Seric # include <sys/cdefs.h>
45264733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
45364733Seric # ifndef LA_TYPE
45464733Seric #  define LA_TYPE	LA_SUBR
45564733Seric # endif
45665749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
45764733Seric #endif
45864733Seric 
45964733Seric 
46064733Seric /*
46164813Seric **  Mach386
46264813Seric **
46364813Seric **	For mt Xinu's Mach386 system.
46464813Seric */
46564813Seric 
46664813Seric #if defined(MACH) && defined(i386)
46764813Seric # define MACH386	1
46864813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
46964813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
47066226Seric # ifndef HASFLOCK
47165830Seric #  define HASFLOCK	1	/* has flock(2) call */
47265830Seric # endif
47364813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
47464813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
47564813Seric # define setpgid	setpgrp
47664813Seric # ifndef LA_TYPE
47764813Seric #  define LA_TYPE	LA_FLOAT
47864813Seric # endif
47965749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
48064962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
48164813Seric # undef WEXITSTATUS
48264813Seric # undef WIFEXITED
48364813Seric # ifndef _PATH_SENDMAILCF
48464813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
48564813Seric # endif
48664813Seric # ifndef _PATH_SENDMAILPID
48764813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
48864813Seric # endif
48964813Seric #endif
49064813Seric 
49164813Seric 
49264813Seric /*
49363969Seric **  4.3 BSD -- this is for very old systems
49463969Seric **
49565949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
49665949Seric **
49763969Seric **	You'll also have to install a new resolver library.
49863969Seric **	I don't guarantee that support for this environment is complete.
49963969Seric */
50063969Seric 
50165949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
50263969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
50363969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
50463970Seric # define ARBPTR_T	char *
50564155Seric # define setpgid	setpgrp
50663969Seric # ifndef LA_TYPE
50763969Seric #  define LA_TYPE	LA_FLOAT
50863969Seric # endif
50963969Seric # ifndef _PATH_SENDMAILCF
51063969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
51163969Seric # endif
51265167Seric # ifndef IDENTPROTO
51365167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
51465167Seric # endif
51564834Seric # undef WEXITSTATUS
51664834Seric # undef WIFEXITED
51764834Seric typedef short		pid_t;
51864834Seric extern int		errno;
51963969Seric #endif
52063969Seric 
52164314Seric 
52263969Seric /*
52363902Seric **  SCO Unix
52465087Seric **
52565087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
52665087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
52765087Seric **	The second is, I believe, for an older version.
52863902Seric */
52963902Seric 
53065087Seric #ifdef _SCO_unix_4_2
53165087Seric # define _SCO_unix_
53265087Seric # define HASSETREUID	1	/* has setreuid(2) call */
53366757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
53465087Seric # define _PATH_UNIX	"/unix"
53565087Seric # ifndef _PATH_SENDMAILCF
53665087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
53765087Seric # endif
53865087Seric # ifndef _PATH_SENDMAILPID
53965087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
54065087Seric # endif
54165087Seric #endif
54265087Seric 
54363838Seric #ifdef _SCO_unix_
54463838Seric # define SYSTEM5	1	/* include all the System V defines */
54564035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
54665212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
54763838Seric # define FORK		fork
54863838Seric # define MAXPATHLEN	PATHSIZE
54964718Seric # define LA_TYPE	LA_SHORT
55067812Seric # define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
55167608Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
55264813Seric # undef NETUNIX			/* no unix domain socket support */
55363838Seric #endif
55463838Seric 
55564314Seric 
55663962Seric /*
55768040Seric **  Altos System V.
55868040Seric **	Contributed by Tim Rice <timr@crl.com>.
55968040Seric */
56068040Seric 
56168040Seric #ifdef ALTOS_SYS_V
56268040Seric # include <limits.h>
56368040Seric # define SYSTEM5	1	/* include all the System V defines */
56468040Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
56568040Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
56668040Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
56768040Seric # define NEEDFSYNC	1	/* no fsync(2) in system library */
56868040Seric # define FORK		fork
56968040Seric # define MAXPATHLEN	PATHSIZE
57068040Seric # define LA_TYPE	LA_SHORT
57168040Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
57268040Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
57368040Seric # undef NETUNIX			/* no unix domain socket support */
57468040Seric # undef WIFEXITED
57568040Seric # undef WEXITSTATUS
57668040Seric # define strtoul	strtol	/* gcc library bogosity */
57768040Seric 
57868040Seric typedef unsigned short	uid_t;
57968040Seric typedef unsigned short	gid_t;
58068040Seric typedef short		pid_t;
58168040Seric #endif
58268040Seric 
58368040Seric 
58468040Seric /*
58563962Seric **  ConvexOS 11.0 and later
58665949Seric **
58765949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
58865949Seric **	works on 9.1 as well.
58963962Seric */
59063962Seric 
59163962Seric #ifdef _CONVEX_SOURCE
59263977Seric # define BSD		1	/* include all the BSD defines */
59363977Seric # define HASUNAME	1	/* use System V uname(2) system call */
59463962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
59563977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
59663962Seric # define LA_TYPE	LA_FLOAT
59765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
59865949Seric # ifndef _PATH_SENDMAILCF
59965949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
60065949Seric # endif
60165949Seric # ifndef S_IREAD
60265949Seric #  define S_IREAD	_S_IREAD
60365949Seric #  define S_IWRITE	_S_IWRITE
60465949Seric #  define S_IEXEC	_S_IEXEC
60565949Seric #  define S_IFMT	_S_IFMT
60665949Seric #  define S_IFCHR	_S_IFCHR
60765949Seric #  define S_IFBLK	_S_IFBLK
60865949Seric # endif
60965167Seric # ifndef IDENTPROTO
61065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
61165167Seric # endif
61263962Seric #endif
61363962Seric 
61464314Seric 
61563962Seric /*
61664999Seric **  RISC/os 4.52
61763962Seric **
61864999Seric **	Gives a ton of warning messages, but otherwise compiles.
61963962Seric */
62063962Seric 
62163965Seric #ifdef RISCOS
62264999Seric 
62363962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
62466226Seric # ifndef HASFLOCK
62565830Seric #  define HASFLOCK	1	/* has flock(2) call */
62665830Seric # endif
62764999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
62864999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
62963962Seric # define LA_TYPE	LA_INT
63063962Seric # define LA_AVENRUN	"avenrun"
63163962Seric # define _PATH_UNIX	"/unix"
63264999Seric # undef WIFEXITED
63364999Seric 
63464999Seric # define setpgid	setpgrp
63564999Seric 
63664999Seric extern int		errno;
63764999Seric typedef int		pid_t;
63864999Seric #define			SIGFUNC_DEFINED
63964999Seric typedef int		(*sigfunc_t)();
64064999Seric extern char		*getenv();
64164999Seric extern void		*malloc();
64264999Seric 
64363962Seric #endif
64463962Seric 
64564314Seric 
64664155Seric /*
64764155Seric **  Linux 0.99pl10 and above...
64866300Seric **
64966300Seric **  Thanks to, in reverse order of contact:
65066300Seric **
65168093Seric **	John Kennedy <warlock@csuchico.edu>
65267885Seric **	Andrew Pam <avatar@aus.xanadu.com>
65366300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
65466300Seric **	Karl London <karl@borg.demon.co.uk>
65566300Seric **
65668093Seric **  Last compiled against:	[12/14/94 @ 11:38:41 PM (Wednesday)]
65768093Seric **	sendmail 8.7.a.5	named 4.9.3-beta12-p1	db-1.85
65868093Seric **	gcc 2.6.2		libc.so.4.6.20
65968093Seric **	slackware 2.1.0		linux 1.1.70
66064155Seric */
66164155Seric 
66264770Seric #ifdef __linux__
66366298Seric # define BSD		1	/* include BSD defines */
66464155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
66566298Seric # define HASUNAME	1	/* use System V uname(2) system call */
66664380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
66766298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
66866300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
66967885Seric # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
67064155Seric # ifndef LA_TYPE
67166301Seric #  define LA_TYPE	LA_PROCSTR
67264155Seric # endif
67366300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
67468093Seric # ifndef _PATH_SENDMAILPID
67568093Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
67668093Seric # endif
67768093Seric # define TZ_TYPE	TZ_TNAME
67864763Seric # include <sys/sysmacros.h>
67966300Seric # undef atol			/* wounded in <stdlib.h> */
68064155Seric #endif
68164155Seric 
68264155Seric 
68364345Seric /*
68464345Seric **  DELL SVR4 Issue 2.2, and others
68564345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
68664345Seric **
68764345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
68864345Seric **	defined, and the definitions conflict.
68964924Seric **
69064924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
69164924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
69264924Seric **	(SVR4.0/386 version 3.0).
69364345Seric */
69464345Seric 
69564345Seric #ifdef DELL_SVR4
69665189Seric 				/* no changes necessary */
69765189Seric 				/* see general __svr4__ defines below */
69864345Seric #endif
69964345Seric 
70064345Seric 
70164380Seric /*
70264380Seric **  Apple A/UX 3.0
70364380Seric */
70464345Seric 
70564380Seric #ifdef _AUX_SOURCE
70664729Seric # include <sys/sysmacros.h>
70764380Seric # define BSD			/* has BSD routines */
70864380Seric # define HASUNAME	1	/* use System V uname(2) system call */
70964380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
71064561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
71165167Seric # ifndef IDENTPROTO
71265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
71365167Seric # endif
71464380Seric # define FORK		fork
71564380Seric # ifndef _PATH_SENDMAILCF
71664380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
71764380Seric # endif
71864380Seric # ifndef LA_TYPE
71964380Seric #  define LA_TYPE	LA_ZERO
72064380Seric # endif
72165749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
72264560Seric # undef WIFEXITED
72364560Seric # undef WEXITSTATUS
72464380Seric #endif
72564380Seric 
72664380Seric 
72764705Seric /*
72864705Seric **  Encore UMAX V
72964705Seric **
73064705Seric **	Not extensively tested.
73164705Seric */
73264380Seric 
73364705Seric #ifdef UMAXV
73464705Seric # include <limits.h>
73564705Seric # define HASUNAME	1	/* use System V uname(2) system call */
73664705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
73764705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
73865211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
73964705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
74064705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
74164705Seric # define FORK		fork	/* no vfork(2) primitive available */
74265749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
74364705Seric # define MAXPATHLEN	PATH_MAX
74464705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
74564705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
74664705Seric # undef WIFEXITED
74764705Seric # undef WEXITSTATUS
74864705Seric #endif
74964705Seric 
75064705Seric 
75164939Seric /*
75264939Seric **  Stardent Titan 3000 running TitanOS 4.2.
75364939Seric **
75464939Seric **	Must be compiled in "cc -43" mode.
75564939Seric **
75664944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
75764939Seric **
75864939Seric **	Note the tweaking below after the BSD defines are set.
75964939Seric */
76064705Seric 
76164939Seric #ifdef titan
76264939Seric # define setpgid	setpgrp
76364939Seric typedef int		pid_t;
76464939Seric # undef WIFEXITED
76564939Seric # undef WEXITSTATUS
76664939Seric #endif
76764939Seric 
76864939Seric 
76964962Seric /*
77064962Seric **  Sequent DYNIX 3.2.0
77164962Seric **
77264962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
77364962Seric */
77464939Seric 
77564962Seric #ifdef sequent
77666038Seric 
77764962Seric # define BSD		1
77864962Seric # define HASUNSETENV	1
77964962Seric # define BSD4_3		1	/* to get signal() in conf.c */
78064962Seric # define WAITUNION	1
78164962Seric # define LA_TYPE	LA_FLOAT
78264962Seric # ifdef	_POSIX_VERSION
78364962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
78464962Seric # endif
78564962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
78664962Seric # define setpgid	setpgrp
78764962Seric 
78864962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
78964962Seric # undef	WIFEXITED
79064962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
79164962Seric 			 ((union wait*)&(s))->w_termsig == 0)
79264962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
79364962Seric typedef int		pid_t;
79464962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
79564962Seric 
79666144Seric # ifndef IDENTPROTO
79766144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
79866144Seric # endif
79966144Seric 
80064962Seric # ifndef _PATH_UNIX
80164962Seric #  define _PATH_UNIX	"/dynix"
80264962Seric # endif
80364962Seric # ifndef _PATH_SENDMAILCF
80464962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
80564962Seric # endif
80664962Seric 
80764962Seric #endif
80864962Seric 
80964962Seric 
81065748Seric /*
81166038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
81266038Seric **
81366038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
81466038Seric **
81566038Seric **	From Tim Wright <timw@sequent.com>.
81666038Seric */
81766038Seric 
81866038Seric #ifdef _SEQUENT_
81966038Seric # define SYSTEM5	1	/* include all the System V defines */
82066038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
82166038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
82266038Seric # define HASSETREUID	1	/* has setreuid(2) call */
82366038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
82466038Seric # define GIDSET_T	gid_t
82566038Seric # define LA_TYPE	LA_INT
82666038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
82767771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
82866144Seric # ifndef IDENTPROTO
82966144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
83066144Seric # endif
83166038Seric # ifndef _PATH_SENDMAILCF
83266038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
83366038Seric # endif
83466038Seric # ifndef _PATH_SENDMAILPID
83566038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
83666038Seric # endif
83766038Seric #endif
83866038Seric 
83966038Seric 
84066038Seric /*
84165748Seric **  Cray Unicos
84265748Seric **
84365748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
84465748Seric */
84564962Seric 
84665748Seric #ifdef UNICOS
84765748Seric # define SYSTEM5	1	/* include all the System V defines */
84865748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
84965748Seric # define MAXPATHLEN	PATHSIZE
85065748Seric # define LA_TYPE	LA_ZERO
85165749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
85265748Seric #endif
85364962Seric 
85465748Seric 
85565820Seric /*
85665820Seric **  Apollo DomainOS
85765820Seric **
85865820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
85965982Seric **
86065820Seric **  15 Jan 1994
86165820Seric **
86265820Seric */
86365748Seric 
86465820Seric #ifdef apollo
86565820Seric # define HASSETREUID	1	/* has setreuid(2) call */
86665820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
86767771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
86865820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
86966044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
87065820Seric # ifndef _PATH_SENDMAILCF
87165820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
87265820Seric # endif
87365820Seric # ifndef _PATH_SENDMAILPID
87465820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
87565820Seric # endif
87665820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
87765820Seric # undef  S_IFIFO
87865820Seric # define S_IFIFO	0010000
87965820Seric # ifndef IDENTPROTO
88065820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
88165820Seric # endif
88265982Seric #endif
88365820Seric 
88465820Seric 
88566748Seric /*
88667745Seric **  UnixWare 1.1.2.
88766752Seric **
88866752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
88966752Seric */
89066752Seric 
89166752Seric #ifdef UNIXWARE
89266752Seric # define SYSTEM5		1
89367745Seric # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
89467745Seric # define HASGETDTABLESIZE	1
89567745Seric # define HASSETREUID		1
89667745Seric # define HASSETSID		1
89767745Seric # define HASINITGROUPS		1
89867745Seric # define GIDSET_T		gid_t
89967745Seric # define SLEEP_T		unsigned
90066752Seric # define SFS_TYPE		SFS_STATVFS
90166752Seric # define LA_TYPE		LA_ZERO
90266752Seric # undef WIFEXITED
90366752Seric # undef WEXITSTATUS
90466752Seric # define _PATH_UNIX		"/unix"
90566752Seric # ifndef _PATH_SENDMAILCF
90666752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
90766752Seric # endif
90866752Seric # ifndef _PATH_SENDMAILPID
90966752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
91066752Seric # endif
91166752Seric # define SYSLOG_BUFSIZE	128
91266752Seric #endif
91366752Seric 
91466752Seric 
91566752Seric /*
91666748Seric **  Intergraph CLIX 3.1
91766748Seric **
91866748Seric **	From Paul Southworth <pauls@locust.cic.net>
91966748Seric */
92065820Seric 
92166748Seric #ifdef CLIX
92266748Seric # define SYSTEM5	1	/* looks like System V */
92366752Seric # ifndef HASGETUSERSHELL
92466752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
92566752Seric # endif
92666748Seric # define DEV_BSIZE	512	/* device block size not defined */
92766748Seric # define GIDSET_T	gid_t
92866748Seric # undef LOG			/* syslog not available */
92966748Seric # define NEEDFSYNC	1	/* no fsync in system library */
93066748Seric # define GETSHORT	_getshort
93166748Seric #endif
93265820Seric 
93366748Seric 
93466776Seric /*
93566776Seric **  NCR 3000 Series (SysVr4)
93666776Seric **
93767434Seric **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
93866776Seric */
93966748Seric 
94066776Seric #ifdef NCR3000
94166776Seric # define __svr4__
94266776Seric # undef BSD
94366776Seric # define LA_AVENRUN	"avenrun"
94466776Seric #endif
94566748Seric 
94666776Seric 
94767434Seric /*
94867434Seric **  Tandem NonStop-UX SVR4
94967434Seric **
95067434Seric **	From Rick McCarty <mccarty@mpd.tandem.com>.
95167434Seric */
95266776Seric 
95367434Seric #ifdef NonStop_UX_BXX
95467434Seric # define __svr4__
95567434Seric #endif
95666776Seric 
95767434Seric 
95867488Seric /*
95967488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
96067488Seric **
96167488Seric **	Tested for 1.04 and 1.03
96267488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
96367488Seric */
96467434Seric 
96567488Seric #ifdef __H3050R
96667488Seric # define SYSTEM5	1	/* include all the System V defines */
96767488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
96867488Seric # define setreuid(r, e)	setresuid(r, e, -1)
96967488Seric # define LA_TYPE	LA_FLOAT
97067488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
97167488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
97267488Seric # ifndef GIDSET_T
97367488Seric #  define GIDSET_T	gid_t
97467488Seric # endif
97567488Seric # ifndef _PATH_UNIX
97667488Seric #  define _PATH_UNIX	"/HI-UX"
97767488Seric # endif
97867488Seric # ifndef _PATH_SENDMAILCF
97967488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
98067488Seric # endif
98167488Seric # ifndef IDENTPROTO
98267488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
98367488Seric # endif
98467488Seric # ifndef HASGETUSERSHELL
98567488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
98667488Seric # endif
98767488Seric 
98867488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
98967488Seric # undef m_flags
99067488Seric 
99167488Seric # ifdef __STDC__
99267488Seric extern int	syslog(int, char *, ...);
99367488Seric # endif
99467488Seric 
99567488Seric #endif
99667488Seric 
99767488Seric 
99868099Seric /*
99968099Seric **  Amdahl UTS System V 2.1.5 (SVr3-based)
100068099Seric **
100168099Seric **    From: Janet Jackson <janet@dialix.oz.au>.
100268099Seric */
100367488Seric 
100468099Seric #ifdef _UTS
100568099Seric # include <sys/sysmacros.h>
100668099Seric # undef HASLSTAT	/* has symlinks, but they cause problems */
100768099Seric # define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
100868099Seric # define SYS5SIGNALS	1	/* System V signal semantics */
100968099Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
101068099Seric # define HASUNAME	1	/* use System V uname(2) system call */
101168099Seric # define HASINITGROUPS	1	/* has initgroups(3) function */
101268099Seric # define HASSETVBUF	1	/* has setvbuf(3) function */
101368099Seric # define HASSIGSETMASK	0	/* does not have sigsetmask(2) function */
101468099Seric # ifndef HASGETUSERSHELL
101568099Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
101668099Seric # endif
101768099Seric # define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
101868099Seric # define LA_TYPE	LA_ZERO		/* doesn't have load average */
101968099Seric # define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
102068099Seric # define _PATH_UNIX	"/unix"
102168099Seric # ifndef _PATH_SENDMAILCF
102268099Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
102368099Seric # endif
102468099Seric #endif
102568099Seric 
102668099Seric 
102768099Seric 
102868099Seric 
102963902Seric /**********************************************************************
103063787Seric **  End of Per-Operating System defines
103163902Seric **********************************************************************/
103263787Seric 
103363949Seric /**********************************************************************
103463949Seric **  More general defines
103563949Seric **********************************************************************/
103663949Seric 
103763962Seric /* general BSD defines */
103863962Seric #ifdef BSD
103964035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
104064035Seric # define HASSETREUID	1	/* has setreuid(2) call */
104167742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
104267430Seric # ifndef HASSETRLIMIT
104367430Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
104467430Seric # endif
104565830Seric # ifndef HASFLOCK
104665830Seric #  define HASFLOCK	1	/* has flock(2) call */
104765830Seric # endif
104867602Seric # ifndef TZ_TYPE
104967608Seric #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
105067602Seric # endif
105163962Seric #endif
105263962Seric 
105365189Seric /* general System V Release 4 defines */
105465189Seric #ifdef __svr4__
105565189Seric # define SYSTEM5	1
105665189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
105767742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
105867742Seric # ifndef HASSETRLIMIT
105967742Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
106067742Seric # endif
106165211Seric # ifndef HASGETUSERSHELL
106265211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
106365210Seric # endif
106465189Seric # define setreuid(r, e)	seteuid(e)
106565189Seric 
106665189Seric # ifndef _PATH_UNIX
106765189Seric #  define _PATH_UNIX		"/unix"
106865189Seric # endif
106965189Seric # ifndef _PATH_SENDMAILCF
107065189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
107165189Seric # endif
107265189Seric # ifndef _PATH_SENDMAILPID
107365189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
107465189Seric # endif
107565189Seric # ifndef SYSLOG_BUFSIZE
107665189Seric #  define SYSLOG_BUFSIZE	128
107765189Seric # endif
107867159Seric # ifndef SFS_TYPE
107967159Seric #  define SFS_TYPE		SFS_STATVFS
108067159Seric # endif
108165189Seric #endif
108265189Seric 
108363787Seric /* general System V defines */
108466298Seric #ifdef SYSTEM5
108564813Seric # include <sys/sysmacros.h>
108663949Seric # define HASUNAME	1	/* use System V uname(2) system call */
108764705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
108864962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
108967430Seric # ifndef HASULIMIT
109067430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
109167430Seric # endif
109263962Seric # ifndef LA_TYPE
109365749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
109463962Seric # endif
109565749Seric # ifndef SFS_TYPE
109665749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
109765749Seric # endif
109867602Seric # ifndef TZ_TYPE
109967608Seric #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
110067602Seric # endif
110168040Seric # ifndef ALTOS_SYS_V
110268040Seric #  define bcopy(s, d, l)	(memmove((d), (s), (l)))
110368040Seric #  define bzero(d, l)		(memset((d), '\0', (l)))
110468040Seric #  define bcmp(s, d, l)		(memcmp((s), (d), (l)))
110568040Seric # endif
110666298Seric #endif
110763787Seric 
110863949Seric /* general POSIX defines */
110963949Seric #ifdef _POSIX_VERSION
111064718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
111164718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
111263949Seric #endif
111363949Seric 
111463787Seric /*
111563937Seric **  If no type for argument two of getgroups call is defined, assume
111663937Seric **  it's an integer -- unfortunately, there seem to be several choices
111763937Seric **  here.
111863937Seric */
111963937Seric 
112063937Seric #ifndef GIDSET_T
112163937Seric # define GIDSET_T	int
112263937Seric #endif
112363937Seric 
112464939Seric /*
112564939Seric **  Tweaking for systems that (for example) claim to be BSD but
112664939Seric **  don't have all the standard BSD routines (boo hiss).
112764939Seric */
112864439Seric 
112964939Seric #ifdef titan
113064939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
113164939Seric #endif
113264939Seric 
113365830Seric 
113465167Seric /*
113565167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
113665167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
113765167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
113865167Seric **  are closed.  Some firewalls return this error if you try to connect
113965167Seric **  to the IDENT port (113), so you can't receive email from these hosts
114065167Seric **  on these systems.  The firewall really should use a more specific
114165167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
114265167Seric **  not explicitly set to zero above, default it on.
114365167Seric */
114464939Seric 
114565167Seric #ifndef IDENTPROTO
114665167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
114765167Seric #endif
114865167Seric 
114965211Seric #ifndef HASGETUSERSHELL
115065211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
115165210Seric #endif
115265167Seric 
115365830Seric #ifndef HASFLOCK
115465830Seric # define HASFLOCK	0	/* assume no flock(2) support */
115565830Seric #endif
115665210Seric 
115767430Seric #ifndef HASSETRLIMIT
115867430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
115967430Seric #endif
116067430Seric 
116167430Seric #ifndef HASULIMIT
116267430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
116367430Seric #endif
116467430Seric 
116566843Seric #ifndef OLD_NEWDB
116666843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
116766843Seric #endif
116865830Seric 
116968099Seric /* heuristic setting of HASSETSIGMASK; can override above */
117068099Seric #ifndef HASSIGSETMASK
117168099Seric # ifdef SIGVTALRM
117268099Seric #  define HASSETSIGMASK	1
117368099Seric # else
117468099Seric #  define HASSETSIGMASK	0
117568099Seric # endif
117668099Seric #endif
117766843Seric 
117868099Seric 
117964439Seric /**********************************************************************
118059023Seric **  Remaining definitions should never have to be changed.  They are
118159023Seric **  primarily to provide back compatibility for older systems -- for
118259287Seric **  example, it includes some POSIX compatibility definitions
118364439Seric **********************************************************************/
118459023Seric 
118559388Seric /* System 5 compatibility */
118659388Seric #ifndef S_ISREG
118764944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
118859388Seric #endif
118964944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
119064944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
119164944Seric #endif
119259388Seric #ifndef S_IWGRP
119359388Seric #define S_IWGRP		020
119459388Seric #endif
119559388Seric #ifndef S_IWOTH
119659388Seric #define S_IWOTH		002
119759388Seric #endif
119859388Seric 
119959023Seric /*
120050537Seric **  Older systems don't have this error code -- it should be in
120150537Seric **  /usr/include/sysexits.h.
120250537Seric */
120350537Seric 
120450537Seric # ifndef EX_CONFIG
120550537Seric # define EX_CONFIG	78	/* configuration error */
120650537Seric # endif
120756852Seric 
120864718Seric /* pseudo-code used in server SMTP */
120964718Seric # define EX_QUIT	22	/* drop out of server immediately */
121064718Seric 
121164718Seric 
121263993Seric /*
121363993Seric **  These are used in a few cases where we need some special
121463993Seric **  error codes, but where the system doesn't provide something
121563993Seric **  reasonable.  They are printed in errstring.
121663993Seric */
121763993Seric 
121863993Seric #ifndef E_PSEUDOBASE
121963993Seric # define E_PSEUDOBASE	256
122063993Seric #endif
122163993Seric 
122263993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
122363993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
122463993Seric 
122563970Seric /* type of arbitrary pointer */
122663970Seric #ifndef ARBPTR_T
122763970Seric # define ARBPTR_T	void *
122863970Seric #endif
122963970Seric 
123060568Seric #ifndef __P
123160568Seric # include "cdefs.h"
123260568Seric #endif
123360568Seric 
123467421Seric #if NAMED_BIND
123567421Seric # include <arpa/nameser.h>
123667434Seric # ifdef __svr4__
123767434Seric #  ifdef NOERROR
123867434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
123967434Seric #  endif
124067434Seric # endif
124167421Seric #endif
124267421Seric 
124356852Seric /*
124467419Seric **  The size of an IP address -- can't use sizeof because of problems
124567419Seric **  on Crays, where everything is 64 bits.  This will break if/when
124667419Seric **  IP addresses are expanded to eight bytes.
124767419Seric */
124867419Seric 
124967421Seric #ifndef INADDRSZ
125067421Seric # define INADDRSZ	4
125167421Seric #endif
125267419Seric 
125367419Seric /*
125467421Seric **  The size of various known types -- for reading network protocols.
125567421Seric **  Again, we can't use sizeof because of compiler randomness.
125667421Seric */
125767421Seric 
125867421Seric #ifndef INT16SZ
125967421Seric # define INT16SZ	2
126067421Seric #endif
126167421Seric #ifndef INT32SZ
126267421Seric # define INT32SZ	4
126367421Seric #endif
126467421Seric 
126567421Seric /*
126658778Seric **  Do some required dependencies
126758778Seric */
126858778Seric 
126958778Seric #if defined(NETINET) || defined(NETISO)
127059107Seric # define SMTP		1	/* enable user and server SMTP */
127159107Seric # define QUEUE		1	/* enable queueing */
127259107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
127358778Seric #endif
127458778Seric 
127558778Seric 
127658778Seric /*
127756852Seric **  Arrange to use either varargs or stdargs
127856852Seric */
127956852Seric 
128056852Seric # ifdef __STDC__
128156852Seric 
128256852Seric # include <stdarg.h>
128356852Seric 
128456852Seric # define VA_LOCAL_DECL	va_list ap;
128556852Seric # define VA_START(f)	va_start(ap, f)
128656852Seric # define VA_END		va_end(ap)
128756852Seric 
128856852Seric # else
128956852Seric 
129056852Seric # include <varargs.h>
129156852Seric 
129256852Seric # define VA_LOCAL_DECL	va_list ap;
129356852Seric # define VA_START(f)	va_start(ap)
129456852Seric # define VA_END		va_end(ap)
129556852Seric 
129656852Seric # endif
129757631Seric 
129857943Seric #ifdef HASUNAME
129957631Seric # include <sys/utsname.h>
130057631Seric # ifdef newstr
130157631Seric #  undef newstr
130257631Seric # endif
130357943Seric #else /* ! HASUNAME */
130457631Seric # define NODE_LENGTH 32
130557631Seric struct utsname
130657631Seric {
130757631Seric 	char nodename[NODE_LENGTH+1];
130857631Seric };
130957943Seric #endif /* HASUNAME */
131057642Seric 
131168040Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
131263838Seric # define MAXHOSTNAMELEN	256
131357735Seric #endif
131458153Seric 
131558153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
131658153Seric # define SIGCHLD	SIGCLD
131758153Seric #endif
131858153Seric 
131958153Seric #ifndef STDIN_FILENO
132058153Seric #define STDIN_FILENO	0
132158153Seric #endif
132258153Seric 
132358153Seric #ifndef STDOUT_FILENO
132458153Seric #define STDOUT_FILENO	1
132558153Seric #endif
132658153Seric 
132758153Seric #ifndef STDERR_FILENO
132858153Seric #define STDERR_FILENO	2
132958153Seric #endif
133058689Seric 
133164072Seric #ifndef LOCK_SH
133264035Seric # define LOCK_SH	0x01	/* shared lock */
133364035Seric # define LOCK_EX	0x02	/* exclusive lock */
133464035Seric # define LOCK_NB	0x04	/* non-blocking lock */
133564035Seric # define LOCK_UN	0x08	/* unlock */
133664035Seric #endif
133758692Seric 
133864035Seric #ifndef SIG_ERR
133964035Seric # define SIG_ERR	((void (*)()) -1)
134058689Seric #endif
134158702Seric 
134264500Seric #ifndef WEXITSTATUS
134364500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
134464500Seric #endif
134564500Seric #ifndef WIFEXITED
134664500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
134764500Seric #endif
134864500Seric 
134964561Seric #ifndef SIGFUNC_DEFINED
135064561Seric typedef void		(*sigfunc_t) __P((int));
135164561Seric #endif
135264561Seric 
135365053Seric /* size of syslog buffer */
135465053Seric #ifndef SYSLOG_BUFSIZE
135565053Seric # define SYSLOG_BUFSIZE	1024
135665053Seric #endif
135765053Seric 
135858702Seric /*
135958702Seric **  Size of tobuf (deliver.c)
136058702Seric **	Tweak this to match your syslog implementation.  It will have to
136158702Seric **	allow for the extra information printed.
136258702Seric */
136358702Seric 
136458702Seric #ifndef TOBUFSIZE
136565053Seric # if (SYSLOG_BUFSIZE) > 512
136665053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
136765053Seric # else
136865053Seric #  define TOBUFSIZE	256
136965053Seric # endif
137058702Seric #endif
137160219Seric 
137265015Seric /*
137365015Seric **  Size of prescan buffer.
137465015Seric **	Despite comments in the _sendmail_ book, this probably should
137565015Seric **	not be changed; there are some hard-to-define dependencies.
137665015Seric */
137765015Seric 
137865015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
137960219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
138060219Seric # ifndef FORK
138160219Seric # define FORK		vfork		/* function to call to fork mailer */
138260219Seric # endif
138365955Seric 
138465955Seric /*
138565955Seric **  If we are going to link scanf anyway, use it in readcf
138665955Seric */
138765955Seric 
138865955Seric #if !defined(HASUNAME) && !defined(SCANF)
138965955Seric # define SCANF		1
139065955Seric #endif
1391