xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 68705)
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*68705Seric  *	@(#)conf.h	8.144 (Berkeley) 03/31/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>
2268693Seric # include <netdb.h>
2368693Seric # include <pwd.h>
2457232Seric 
2563902Seric /**********************************************************************
269147Seric **  Table sizes, etc....
279147Seric **	There shouldn't be much need to change these....
2863902Seric **********************************************************************/
299147Seric 
3059303Seric # define MAXLINE	2048		/* max line length */
3124945Seric # define MAXNAME	256		/* max length of a name */
329147Seric # define MAXPV		40		/* max # of parms to mailers */
3359303Seric # define MAXATOM	200		/* max atoms per address */
349147Seric # define MAXMAILERS	25		/* maximum mailers known to system */
3568384Seric # define MAXRWSETS	200		/* max # of sets of rewriting rules */
369147Seric # define MAXPRIORITIES	25		/* max values for Precedence: field */
3757143Seric # define MAXMXHOSTS	20		/* max # of MX records */
3852106Seric # define SMTPLINELIM	990		/* maximum SMTP line length */
3957232Seric # define MAXKEY		128		/* maximum size of a database key */
4057232Seric # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
4159056Seric # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
4259667Seric # define MAXALIASDB	12		/* max # of alias databases */
4367729Seric # define MAXMAPSTACK	12		/* max # of stacked or sequenced maps */
4467729Seric # define MAXTOCLASS	8		/* max # of message timeout classes */
4568517Seric # define MAXMIMEARGS	20		/* max args in Content-Type: */
4668517Seric # define MAXMIMENESTING	20		/* max MIME multipart nesting */
4757143Seric 
4857143Seric # ifndef QUEUESIZE
4957143Seric # define QUEUESIZE	1000		/* max # of jobs per queue run */
5057143Seric # endif
5157143Seric 
5263902Seric /**********************************************************************
539147Seric **  Compilation options.
5425673Seric **
5525673Seric **	#define these if they are available; comment them out otherwise.
5663902Seric **********************************************************************/
579147Seric 
5825673Seric # define LOG		1	/* enable logging */
5925673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
6064813Seric # define NETUNIX	1	/* include unix domain support */
6158778Seric # define NETINET	1	/* include internet support */
6253735Seric # define MATCHGECOS	1	/* match user names from gecos field */
6363753Seric # define XDEBUG		1	/* enable extended debugging */
6456337Seric # ifdef NEWDB
6556337Seric # define USERDB		1	/* look in user database (requires NEWDB) */
6656337Seric # endif
6756337Seric 
6866334Seric /**********************************************************************
6966334Seric **  0/1 Compilation options.
7066334Seric **	#define these to 1 if they are available;
7166334Seric **	#define them to 0 otherwise.
7266334Seric **********************************************************************/
7366334Seric 
7466334Seric # ifndef NAMED_BIND
7566334Seric #  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
7666334Seric # endif
7766334Seric 
7864032Seric /*
7964944Seric **  Most systems have symbolic links today, so default them on.  You
8064944Seric **  can turn them off by #undef'ing this below.
8164944Seric */
8264944Seric 
8364944Seric # define HASLSTAT	1	/* has lstat(2) call */
8464944Seric 
8564962Seric /*
8664962Seric **  General "standard C" defines.
8764962Seric **
8864962Seric **	These may be undone later, to cope with systems that claim to
8964962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
9064962Seric **	doesn't realize that the library is part of the language.
9164962Seric **
9264962Seric **	Life would be much easier if we could get rid of this sort
9364962Seric **	of bozo problems.
9464962Seric */
9564962Seric 
9664962Seric #ifdef __STDC__
9764962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
9864962Seric #endif
9964962Seric 
10063902Seric /**********************************************************************
10159023Seric **  Operating system configuration.
10259023Seric **
10359023Seric **	Unless you are porting to a new OS, you shouldn't have to
10459023Seric **	change these.
10563902Seric **********************************************************************/
10656823Seric 
10763787Seric /*
10863787Seric **  Per-Operating System defines
10963787Seric */
11063787Seric 
11164314Seric 
11263902Seric /*
11365565Seric **  HP-UX -- tested for 8.07, 9.00, and 9.01.
11463902Seric */
11563902Seric 
11667626Seric #ifdef __hpux
11764727Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
11864727Seric # undef m_flags
11963787Seric # define SYSTEM5	1	/* include all the System V defines */
12064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
12164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
12265982Seric # define setreuid(r, e)		setresuid(r, e, -1)
12368294Seric # define LA_TYPE	LA_SUBR
12465749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
12565354Seric # define GIDSET_T	gid_t
12663962Seric # define _PATH_UNIX	"/hp-ux"
12765354Seric # ifndef _PATH_SENDMAILCF
12865354Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
12965354Seric # endif
13065167Seric # ifndef IDENTPROTO
13165167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
13256823Seric # endif
13365581Seric # ifndef HASGETUSERSHELL
13465581Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
13565581Seric # endif
13665504Seric # define syslog		hard_syslog
13765581Seric # ifdef __STDC__
13865581Seric extern int	syslog(int, char *, ...);
13965167Seric # endif
14067626Seric #endif
14156823Seric 
14264314Seric 
14363902Seric /*
14463902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
14563902Seric */
14663902Seric 
14767626Seric #ifdef _AIX3
14864035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
14964840Seric # define HASUNAME	1	/* use System V uname(2) system call */
15065211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
15160219Seric # define FORK		fork	/* no vfork primitive available */
15265749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
15367771Seric # define SPT_PADCHAR	'\0'	/* pad process title with nulls */
15468145Seric # define LA_TYPE	LA_INT
15567626Seric #endif
15660219Seric 
15764314Seric 
15863902Seric /*
15963902Seric **  Silicon Graphics IRIX
16063902Seric **
16163965Seric **	Compiles on 4.0.1.
16267967Seric **
16368686Seric **	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
16468686Seric **	Use IRIX5 instead of IRIX for IRIX 5.x.
16567967Seric **
16667967Seric **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
16768686Seric **	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
16863902Seric */
16963902Seric 
17068686Seric #if defined(IRIX64) || defined(IRIX5)
17167967Seric # define IRIX
17267967Seric #endif
17367967Seric 
17467626Seric #ifdef IRIX
17566763Seric # define SYSTEM5	1	/* this is a System-V derived system */
17664035Seric # define HASSETREUID	1	/* has setreuid(2) call */
17764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
17865211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
17963753Seric # define FORK		fork	/* no vfork primitive available */
18068686Seric # if !defined(IRIX64) && !defined(IRIX5)
18168225Seric #  define WAITUNION	1	/* use "union wait" as wait argument type */
18268225Seric # endif
18364155Seric # define setpgid	BSDsetpgrp
18463937Seric # define GIDSET_T	gid_t
185*68705Seric # define ARGV_T		const char **
18665749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
18768439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
18866763Seric # define LA_TYPE	LA_INT
18967967Seric # ifdef IRIX64
19067967Seric #  define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
19167967Seric # else
19267967Seric #  define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
19367967Seric # endif
19467626Seric #endif
19563753Seric 
19663902Seric 
19763902Seric /*
19864813Seric **  SunOS and Solaris
19964813Seric **
20064813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
20164813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
20263902Seric */
20363902Seric 
20463787Seric #if defined(sun) && !defined(BSD)
20559074Seric 
20664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
20764813Seric # define HASUNAME	1	/* use System V uname(2) system call */
20865211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
20965749Seric # define LA_TYPE	LA_INT
21060564Seric 
21164842Seric # ifdef SOLARIS_2_3
21268486Seric #  define SOLARIS		/* for back compat only -- use -DSOLARIS=203 */
21364842Seric # endif
21464842Seric 
21560602Seric # ifdef SOLARIS
21663902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
21765222Seric #  ifndef __svr4__
21865222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
21965222Seric #  endif
22063787Seric #  include <sys/time.h>
22165172Seric #  define GIDSET_T	gid_t
22265189Seric #  ifndef _PATH_UNIX
22367129Seric #   define _PATH_UNIX	"/dev/ksyms"
22465189Seric #  endif
22563962Seric #  ifndef _PATH_SENDMAILCF
22663962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
22764072Seric #  endif
22864072Seric #  ifndef _PATH_SENDMAILPID
22963962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
23063962Seric #  endif
23166022Seric #  ifndef SYSLOG_BUFSIZE
23266022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
23366022Seric #  endif
23468486Seric #  if SOLARIS < 204
23568486Seric #   define gethostbyname	solaris_gethostbyname	/* get good version */
23668486Seric #   define gethostbyaddr	solaris_gethostbyaddr	/* get good version */
23768486Seric #  endif
23863787Seric 
23960602Seric # else
24065105Seric 			/* SunOS 4.0.3 or 4.1.x */
24165189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
24265830Seric #  ifndef HASFLOCK
24365830Seric #   define HASFLOCK	1	/* has flock(2) call */
24465830Seric #  endif
24565749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
24660564Seric #  include <vfork.h>
24763787Seric 
24865105Seric #  ifdef SUNOS403
24965105Seric 			/* special tweaking for SunOS 4.0.3 */
25065105Seric #   include <malloc.h>
25165105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
25265105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
25365105Seric #   undef WIFEXITED
25465105Seric #   undef WEXITSTATUS
25565105Seric #   undef HASUNAME
25665105Seric #   define setpgid	setpgrp
25765105Seric typedef int		pid_t;
25865105Seric extern char		*getenv();
25965105Seric 
26066732Seric #  else
26166732Seric 			/* 4.1.x specifics */
26266732Seric #   define HASSETSID	1	/* has Posix setsid(2) call */
26366732Seric #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
26466732Seric 
26565105Seric #  endif
26660564Seric # endif
26759023Seric #endif
26859023Seric 
26964718Seric /*
27064813Seric **  DG/UX
27164813Seric **
27267427Seric **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
27367427Seric **	older support.
27467427Seric **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
27564718Seric */
27664314Seric 
27767427Seric #ifdef DGUX_5_4_2
27867427Seric # define DGUX		1
27967427Seric #endif
28067427Seric 
28164718Seric #ifdef	DGUX
28264718Seric # define SYSTEM5	1
28364718Seric # define LA_TYPE	LA_SUBR
28464718Seric # define HASSETREUID	1	/* has setreuid(2) call */
28564718Seric # define HASUNAME	1	/* use System V uname(2) system call */
28664718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
28764718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
28866036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
28965167Seric # ifndef IDENTPROTO
29065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
29165167Seric # endif
29267771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
29365749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
29464813Seric 
29564813Seric /* these include files must be included early on DG/UX */
29664813Seric # include <netinet/in.h>
29764813Seric # include <arpa/inet.h>
29864813Seric 
29967427Seric # ifdef DGUX_5_4_2
30067427Seric #  define inet_addr	dgux_inet_addr
30164718Seric extern long	dgux_inet_addr();
30267427Seric # endif
30364718Seric #endif
30464718Seric 
30564718Seric 
30663902Seric /*
30763902Seric **  Digital Ultrix 4.2A or 4.3
30864264Seric **
30964264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
31064264Seric **	not dropped when the process exits.  This causes major problems,
31164264Seric **	so flock is the only alternative.
31263902Seric */
31363902Seric 
31460564Seric #ifdef ultrix
31564035Seric # define HASSETREUID	1	/* has setreuid(2) call */
31663962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
31764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
31866242Seric # define HASUNAME	1	/* use System V uname(2) system call */
31965830Seric # ifndef HASFLOCK
32065830Seric #  define HASFLOCK	1	/* has flock(2) call */
32165830Seric # endif
32265211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
32366318Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
32465135Seric # ifdef vax
32565135Seric #  define LA_TYPE	LA_FLOAT
32665135Seric # else
32765135Seric #  define LA_TYPE	LA_INT
32865135Seric #  define LA_AVENRUN	"avenrun"
32965135Seric # endif
33065749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
33165167Seric # ifndef IDENTPROTO
33265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
33365167Seric # endif
33460564Seric #endif
33560564Seric 
33664314Seric 
33763902Seric /*
33868072Seric **  OSF/1 for Intel Paragon.
33968072Seric **
34068082Seric **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
34168082Seric **	of Intel Scalable Systems Divison.
34268072Seric */
34368072Seric 
34468072Seric #ifdef __PARAGON__
34568072Seric # define __osf__	1	/* get OSF/1 defines below */
34668072Seric # ifndef _PATH_SENDMAILCF
34768072Seric #  define _PATH_SENDMAILCF	"/var/adm/sendmail/sendmail.cf"
34868072Seric # endif
34968072Seric #endif
35068072Seric 
35168072Seric 
35268072Seric /*
35363902Seric **  OSF/1 (tested on Alpha)
35463902Seric */
35563902Seric 
35663787Seric #ifdef __osf__
35763962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
35864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
35964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
36066226Seric # ifndef HASFLOCK
36165830Seric #  define HASFLOCK	1	/* has flock(2) call */
36265830Seric # endif
36363962Seric # define LA_TYPE	LA_INT
36465749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
36564813Seric # ifndef _PATH_SENDMAILPID
36665504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
36764813Seric # endif
36859287Seric #endif
36959287Seric 
37064314Seric 
37163902Seric /*
37263902Seric **  NeXTstep
37363902Seric */
37463902Seric 
37564076Seric #ifdef NeXT
37664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
37765830Seric # ifndef HASFLOCK
37865830Seric #  define HASFLOCK	1	/* has flock(2) call */
37965830Seric # endif
38064125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
38164563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
382*68705Seric # define UID_T		int	/* compiler gripes on uid_t */
38363753Seric # define sleep		sleepX
38464155Seric # define setpgid	setpgrp
38564295Seric # ifndef LA_TYPE
38664295Seric #  define LA_TYPE	LA_MACH
38764295Seric # endif
38865749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
38964500Seric # ifndef _POSIX_SOURCE
39064035Seric typedef int		pid_t;
39164500Seric #  undef WEXITSTATUS
39264500Seric #  undef WIFEXITED
39364500Seric # endif
39464072Seric # ifndef _PATH_SENDMAILCF
39564072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
39664072Seric # endif
39764072Seric # ifndef _PATH_SENDMAILPID
39864072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
39964072Seric # endif
40059288Seric #endif
40159288Seric 
40264314Seric 
40363902Seric /*
40463962Seric **  4.4 BSD
40564831Seric **
40664831Seric **	See also BSD defines.
40763902Seric */
40863902Seric 
40960568Seric #ifdef BSD4_4
41064072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
41160568Seric # include <sys/cdefs.h>
41263838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
41364072Seric # ifndef LA_TYPE
41464072Seric #  define LA_TYPE	LA_SUBR
41564072Seric # endif
41665749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
41767771Seric # define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
41860568Seric #endif
41960568Seric 
42064314Seric 
42163902Seric /*
42265982Seric **  BSD/386 (all versions)
42365982Seric **	From Tony Sanders, BSDI
42465982Seric */
42565982Seric 
42665982Seric #ifdef __bsdi__
42765982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
42865982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
42966843Seric # include <sys/cdefs.h>
43066843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
43166030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
43266843Seric # ifndef LA_TYPE
43366843Seric #  define LA_TYPE	LA_SUBR
43466843Seric # endif
43565982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
43666843Seric 			/* version 1.1 or later */
43767771Seric #  undef SPT_TYPE
43867771Seric #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
43966843Seric # else
44066843Seric 			/* version 1.0 or earlier */
44166843Seric #  ifndef OLD_NEWDB
44266843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
44366843Seric #  endif
44467771Seric #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
44565982Seric # endif
44665982Seric #endif
44765982Seric 
44865982Seric 
44965982Seric 
45065982Seric /*
45165049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
45264733Seric **
45364733Seric **  4.3BSD clone, closer to 4.4BSD
45464831Seric **
45564831Seric **	See also BSD defines.
45664733Seric */
45764733Seric 
45865049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
45964733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
46064733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
46166754Seric # ifdef __NetBSD__
46266754Seric #  define HASUNAME	1	/* has uname(2) syscall */
46366754Seric # endif
46464733Seric # include <sys/cdefs.h>
46564733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
46664733Seric # ifndef LA_TYPE
46764733Seric #  define LA_TYPE	LA_SUBR
46864733Seric # endif
46965749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
47064733Seric #endif
47164733Seric 
47264733Seric 
47364733Seric /*
47464813Seric **  Mach386
47564813Seric **
47664813Seric **	For mt Xinu's Mach386 system.
47764813Seric */
47864813Seric 
47964813Seric #if defined(MACH) && defined(i386)
48064813Seric # define MACH386	1
48164813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
48264813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
48366226Seric # ifndef HASFLOCK
48465830Seric #  define HASFLOCK	1	/* has flock(2) call */
48565830Seric # endif
48664813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
48764813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
48864813Seric # define setpgid	setpgrp
48964813Seric # ifndef LA_TYPE
49064813Seric #  define LA_TYPE	LA_FLOAT
49164813Seric # endif
49265749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
49364962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
49464813Seric # undef WEXITSTATUS
49564813Seric # undef WIFEXITED
49664813Seric # ifndef _PATH_SENDMAILCF
49764813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
49864813Seric # endif
49964813Seric # ifndef _PATH_SENDMAILPID
50064813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
50164813Seric # endif
50264813Seric #endif
50364813Seric 
50464813Seric 
50564813Seric /*
50663969Seric **  4.3 BSD -- this is for very old systems
50763969Seric **
50865949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
50965949Seric **
51063969Seric **	You'll also have to install a new resolver library.
51163969Seric **	I don't guarantee that support for this environment is complete.
51263969Seric */
51363969Seric 
51465949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
51563969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
51663969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
51763970Seric # define ARBPTR_T	char *
51864155Seric # define setpgid	setpgrp
51963969Seric # ifndef LA_TYPE
52063969Seric #  define LA_TYPE	LA_FLOAT
52163969Seric # endif
52263969Seric # ifndef _PATH_SENDMAILCF
52363969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
52463969Seric # endif
52565167Seric # ifndef IDENTPROTO
52665167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
52765167Seric # endif
52864834Seric # undef WEXITSTATUS
52964834Seric # undef WIFEXITED
53064834Seric typedef short		pid_t;
53164834Seric extern int		errno;
53263969Seric #endif
53363969Seric 
53464314Seric 
53563969Seric /*
53663902Seric **  SCO Unix
53765087Seric **
53865087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
53965087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
54065087Seric **	The second is, I believe, for an older version.
54163902Seric */
54263902Seric 
54365087Seric #ifdef _SCO_unix_4_2
54465087Seric # define _SCO_unix_
54565087Seric # define HASSETREUID	1	/* has setreuid(2) call */
54666757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
54765087Seric # define _PATH_UNIX	"/unix"
54865087Seric # ifndef _PATH_SENDMAILCF
54965087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
55065087Seric # endif
55165087Seric # ifndef _PATH_SENDMAILPID
55265087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
55365087Seric # endif
55465087Seric #endif
55565087Seric 
55663838Seric #ifdef _SCO_unix_
55763838Seric # define SYSTEM5	1	/* include all the System V defines */
55864035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
55965212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
56063838Seric # define FORK		fork
56163838Seric # define MAXPATHLEN	PATHSIZE
56264718Seric # define LA_TYPE	LA_SHORT
56367812Seric # define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
56468439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
56567608Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
56664813Seric # undef NETUNIX			/* no unix domain socket support */
56763838Seric #endif
56863838Seric 
56964314Seric 
57063962Seric /*
57168442Seric **  ISC (SunSoft) Unix.
57268442Seric **
57368442Seric **	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
57468442Seric */
57568442Seric 
57668442Seric #ifdef ISC_UNIX
57768442Seric # include <net/errno.h>
57868442Seric # define SYSTEM5	1	/* include all the System V defines */
57968442Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
58068442Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
58168442Seric # define HASSETREUID	1	/* has setreuid(2) call */
58268442Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
58368442Seric # undef NETUNIX			/* no unix domain socket support */
58468442Seric # define FORK		fork
58568442Seric # define MAXPATHLEN	1024
58668442Seric # define LA_TYPE	LA_SHORT
58768442Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
58868442Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
58968442Seric # define _PATH_UNIX	"/unix"
59068442Seric # ifndef _PATH_SENDMAILCF
59168442Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
59268442Seric # endif
59368442Seric # ifndef _PATH_SENDMAILPID
59468442Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
59568442Seric # endif
59668442Seric 
59768442Seric typedef short		pid_t;
59868442Seric 
59968442Seric #endif
60068442Seric 
60168442Seric 
60268442Seric /*
60368040Seric **  Altos System V.
60468040Seric **	Contributed by Tim Rice <timr@crl.com>.
60568040Seric */
60668040Seric 
60768040Seric #ifdef ALTOS_SYS_V
60868040Seric # include <limits.h>
60968040Seric # define SYSTEM5	1	/* include all the System V defines */
61068040Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
61168040Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
61268040Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
61368040Seric # define NEEDFSYNC	1	/* no fsync(2) in system library */
61468040Seric # define FORK		fork
61568040Seric # define MAXPATHLEN	PATHSIZE
61668040Seric # define LA_TYPE	LA_SHORT
61768040Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
61868439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
61968040Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
62068040Seric # undef NETUNIX			/* no unix domain socket support */
62168040Seric # undef WIFEXITED
62268040Seric # undef WEXITSTATUS
62368040Seric # define strtoul	strtol	/* gcc library bogosity */
62468040Seric 
62568040Seric typedef unsigned short	uid_t;
62668040Seric typedef unsigned short	gid_t;
62768040Seric typedef short		pid_t;
62868040Seric #endif
62968040Seric 
63068040Seric 
63168040Seric /*
63263962Seric **  ConvexOS 11.0 and later
63365949Seric **
63465949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
63565949Seric **	works on 9.1 as well.
63663962Seric */
63763962Seric 
63863962Seric #ifdef _CONVEX_SOURCE
63963977Seric # define BSD		1	/* include all the BSD defines */
64063977Seric # define HASUNAME	1	/* use System V uname(2) system call */
64163962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
64263977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
64363962Seric # define LA_TYPE	LA_FLOAT
64465749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
64565949Seric # ifndef _PATH_SENDMAILCF
64665949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
64765949Seric # endif
64865949Seric # ifndef S_IREAD
64965949Seric #  define S_IREAD	_S_IREAD
65065949Seric #  define S_IWRITE	_S_IWRITE
65165949Seric #  define S_IEXEC	_S_IEXEC
65265949Seric #  define S_IFMT	_S_IFMT
65365949Seric #  define S_IFCHR	_S_IFCHR
65465949Seric #  define S_IFBLK	_S_IFBLK
65565949Seric # endif
65665167Seric # ifndef IDENTPROTO
65765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
65865167Seric # endif
65963962Seric #endif
66063962Seric 
66164314Seric 
66263962Seric /*
66364999Seric **  RISC/os 4.52
66463962Seric **
66564999Seric **	Gives a ton of warning messages, but otherwise compiles.
66663962Seric */
66763962Seric 
66863965Seric #ifdef RISCOS
66964999Seric 
67063962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
67166226Seric # ifndef HASFLOCK
67265830Seric #  define HASFLOCK	1	/* has flock(2) call */
67365830Seric # endif
67464999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
67564999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
67663962Seric # define LA_TYPE	LA_INT
67763962Seric # define LA_AVENRUN	"avenrun"
67863962Seric # define _PATH_UNIX	"/unix"
67964999Seric # undef WIFEXITED
68064999Seric 
68164999Seric # define setpgid	setpgrp
68264999Seric 
68364999Seric extern int		errno;
68464999Seric typedef int		pid_t;
68564999Seric #define			SIGFUNC_DEFINED
68664999Seric typedef int		(*sigfunc_t)();
68764999Seric extern char		*getenv();
68864999Seric extern void		*malloc();
68964999Seric 
69063962Seric #endif
69163962Seric 
69264314Seric 
69364155Seric /*
69464155Seric **  Linux 0.99pl10 and above...
69566300Seric **
69666300Seric **  Thanks to, in reverse order of contact:
69766300Seric **
69868093Seric **	John Kennedy <warlock@csuchico.edu>
69967885Seric **	Andrew Pam <avatar@aus.xanadu.com>
70066300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
70166300Seric **	Karl London <karl@borg.demon.co.uk>
70266300Seric **
70368093Seric **  Last compiled against:	[12/14/94 @ 11:38:41 PM (Wednesday)]
70468093Seric **	sendmail 8.7.a.5	named 4.9.3-beta12-p1	db-1.85
70568093Seric **	gcc 2.6.2		libc.so.4.6.20
70668093Seric **	slackware 2.1.0		linux 1.1.70
70764155Seric */
70864155Seric 
70964770Seric #ifdef __linux__
71066298Seric # define BSD		1	/* include BSD defines */
71164155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
71266298Seric # define HASUNAME	1	/* use System V uname(2) system call */
71364380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
71466298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
71566300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
71667885Seric # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
71768518Seric # ifndef HASFLOCK
71868518Seric #  define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
71968518Seric # endif
72064155Seric # ifndef LA_TYPE
72166301Seric #  define LA_TYPE	LA_PROCSTR
72264155Seric # endif
72366300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
72468093Seric # ifndef _PATH_SENDMAILPID
72568093Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
72668093Seric # endif
72768093Seric # define TZ_TYPE	TZ_TNAME
72864763Seric # include <sys/sysmacros.h>
72966300Seric # undef atol			/* wounded in <stdlib.h> */
73064155Seric #endif
73164155Seric 
73264155Seric 
73364345Seric /*
73464345Seric **  DELL SVR4 Issue 2.2, and others
73564345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
73664345Seric **
73764345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
73864345Seric **	defined, and the definitions conflict.
73964924Seric **
74064924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
74164924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
74264924Seric **	(SVR4.0/386 version 3.0).
74364345Seric */
74464345Seric 
74564345Seric #ifdef DELL_SVR4
74665189Seric 				/* no changes necessary */
74765189Seric 				/* see general __svr4__ defines below */
74864345Seric #endif
74964345Seric 
75064345Seric 
75164380Seric /*
75264380Seric **  Apple A/UX 3.0
75364380Seric */
75464345Seric 
75564380Seric #ifdef _AUX_SOURCE
75664729Seric # include <sys/sysmacros.h>
75764380Seric # define BSD			/* has BSD routines */
75864380Seric # define HASUNAME	1	/* use System V uname(2) system call */
75964380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
76064561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
76165167Seric # ifndef IDENTPROTO
76265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
76365167Seric # endif
76464380Seric # define FORK		fork
76564380Seric # ifndef _PATH_SENDMAILCF
76664380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
76764380Seric # endif
76864380Seric # ifndef LA_TYPE
76964380Seric #  define LA_TYPE	LA_ZERO
77064380Seric # endif
77165749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
77264560Seric # undef WIFEXITED
77364560Seric # undef WEXITSTATUS
77464380Seric #endif
77564380Seric 
77664380Seric 
77764705Seric /*
77864705Seric **  Encore UMAX V
77964705Seric **
78064705Seric **	Not extensively tested.
78164705Seric */
78264380Seric 
78364705Seric #ifdef UMAXV
78464705Seric # include <limits.h>
78564705Seric # define HASUNAME	1	/* use System V uname(2) system call */
78664705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
78764705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
78865211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
78964705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
79064705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
79164705Seric # define FORK		fork	/* no vfork(2) primitive available */
79265749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
79364705Seric # define MAXPATHLEN	PATH_MAX
79464705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
79564705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
79664705Seric # undef WIFEXITED
79764705Seric # undef WEXITSTATUS
79864705Seric #endif
79964705Seric 
80064705Seric 
80164939Seric /*
80264939Seric **  Stardent Titan 3000 running TitanOS 4.2.
80364939Seric **
80464939Seric **	Must be compiled in "cc -43" mode.
80564939Seric **
80664944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
80764939Seric **
80864939Seric **	Note the tweaking below after the BSD defines are set.
80964939Seric */
81064705Seric 
81164939Seric #ifdef titan
81264939Seric # define setpgid	setpgrp
81364939Seric typedef int		pid_t;
81464939Seric # undef WIFEXITED
81564939Seric # undef WEXITSTATUS
81664939Seric #endif
81764939Seric 
81864939Seric 
81964962Seric /*
82064962Seric **  Sequent DYNIX 3.2.0
82164962Seric **
82264962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
82364962Seric */
82464939Seric 
82564962Seric #ifdef sequent
82666038Seric 
82764962Seric # define BSD		1
82864962Seric # define HASUNSETENV	1
82964962Seric # define BSD4_3		1	/* to get signal() in conf.c */
83064962Seric # define WAITUNION	1
83164962Seric # define LA_TYPE	LA_FLOAT
83264962Seric # ifdef	_POSIX_VERSION
83364962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
83464962Seric # endif
83564962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
83664962Seric # define setpgid	setpgrp
83764962Seric 
83864962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
83964962Seric # undef	WIFEXITED
84064962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
84164962Seric 			 ((union wait*)&(s))->w_termsig == 0)
84264962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
84364962Seric typedef int		pid_t;
84464962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
84564962Seric 
84666144Seric # ifndef IDENTPROTO
84766144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
84866144Seric # endif
84966144Seric 
85064962Seric # ifndef _PATH_UNIX
85164962Seric #  define _PATH_UNIX	"/dynix"
85264962Seric # endif
85364962Seric # ifndef _PATH_SENDMAILCF
85464962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
85564962Seric # endif
85664962Seric 
85764962Seric #endif
85864962Seric 
85964962Seric 
86065748Seric /*
86166038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
86266038Seric **
86366038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
86466038Seric **
86566038Seric **	From Tim Wright <timw@sequent.com>.
86666038Seric */
86766038Seric 
86866038Seric #ifdef _SEQUENT_
86966038Seric # define SYSTEM5	1	/* include all the System V defines */
87066038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
87166038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
87266038Seric # define HASSETREUID	1	/* has setreuid(2) call */
87366038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
87466038Seric # define GIDSET_T	gid_t
87566038Seric # define LA_TYPE	LA_INT
87666038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
87767771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
87866144Seric # ifndef IDENTPROTO
87966144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
88066144Seric # endif
88166038Seric # ifndef _PATH_SENDMAILCF
88266038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
88366038Seric # endif
88466038Seric # ifndef _PATH_SENDMAILPID
88566038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
88666038Seric # endif
88766038Seric #endif
88866038Seric 
88966038Seric 
89066038Seric /*
89165748Seric **  Cray Unicos
89265748Seric **
89365748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
89465748Seric */
89564962Seric 
89665748Seric #ifdef UNICOS
89765748Seric # define SYSTEM5	1	/* include all the System V defines */
89865748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
89965748Seric # define MAXPATHLEN	PATHSIZE
90065748Seric # define LA_TYPE	LA_ZERO
90165749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
90268439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
90365748Seric #endif
90464962Seric 
90565748Seric 
90665820Seric /*
90765820Seric **  Apollo DomainOS
90865820Seric **
90965820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
91065982Seric **
91165820Seric **  15 Jan 1994
91265820Seric **
91365820Seric */
91465748Seric 
91565820Seric #ifdef apollo
91665820Seric # define HASSETREUID	1	/* has setreuid(2) call */
91765820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
91867771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
91965820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
92066044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
92168439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
92265820Seric # ifndef _PATH_SENDMAILCF
92365820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
92465820Seric # endif
92565820Seric # ifndef _PATH_SENDMAILPID
92665820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
92765820Seric # endif
92865820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
92965820Seric # undef  S_IFIFO
93065820Seric # define S_IFIFO	0010000
93165820Seric # ifndef IDENTPROTO
93265820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
93365820Seric # endif
93465982Seric #endif
93565820Seric 
93665820Seric 
93766748Seric /*
93867745Seric **  UnixWare 1.1.2.
93966752Seric **
94066752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
94166752Seric */
94266752Seric 
94366752Seric #ifdef UNIXWARE
94466752Seric # define SYSTEM5		1
94567745Seric # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
94667745Seric # define HASGETDTABLESIZE	1
94767745Seric # define HASSETREUID		1
94867745Seric # define HASSETSID		1
94967745Seric # define HASINITGROUPS		1
95067745Seric # define GIDSET_T		gid_t
95167745Seric # define SLEEP_T		unsigned
95266752Seric # define SFS_TYPE		SFS_STATVFS
95366752Seric # define LA_TYPE		LA_ZERO
95466752Seric # undef WIFEXITED
95566752Seric # undef WEXITSTATUS
95666752Seric # define _PATH_UNIX		"/unix"
95766752Seric # ifndef _PATH_SENDMAILCF
95866752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
95966752Seric # endif
96066752Seric # ifndef _PATH_SENDMAILPID
96166752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
96266752Seric # endif
96366752Seric # define SYSLOG_BUFSIZE	128
96466752Seric #endif
96566752Seric 
96666752Seric 
96766752Seric /*
96866748Seric **  Intergraph CLIX 3.1
96966748Seric **
97066748Seric **	From Paul Southworth <pauls@locust.cic.net>
97166748Seric */
97265820Seric 
97366748Seric #ifdef CLIX
97466748Seric # define SYSTEM5	1	/* looks like System V */
97566752Seric # ifndef HASGETUSERSHELL
97666752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
97766752Seric # endif
97866748Seric # define DEV_BSIZE	512	/* device block size not defined */
97966748Seric # define GIDSET_T	gid_t
98066748Seric # undef LOG			/* syslog not available */
98166748Seric # define NEEDFSYNC	1	/* no fsync in system library */
98266748Seric # define GETSHORT	_getshort
98366748Seric #endif
98465820Seric 
98566748Seric 
98666776Seric /*
98766776Seric **  NCR 3000 Series (SysVr4)
98866776Seric **
98967434Seric **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
99066776Seric */
99166748Seric 
99266776Seric #ifdef NCR3000
99366776Seric # define __svr4__
99466776Seric # undef BSD
99566776Seric # define LA_AVENRUN	"avenrun"
99666776Seric #endif
99766748Seric 
99866776Seric 
99967434Seric /*
100067434Seric **  Tandem NonStop-UX SVR4
100167434Seric **
100267434Seric **	From Rick McCarty <mccarty@mpd.tandem.com>.
100367434Seric */
100466776Seric 
100567434Seric #ifdef NonStop_UX_BXX
100667434Seric # define __svr4__
100767434Seric #endif
100866776Seric 
100967434Seric 
101067488Seric /*
101167488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
101267488Seric **
101367488Seric **	Tested for 1.04 and 1.03
101467488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
101567488Seric */
101667434Seric 
101767488Seric #ifdef __H3050R
101867488Seric # define SYSTEM5	1	/* include all the System V defines */
101967488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
102067488Seric # define setreuid(r, e)	setresuid(r, e, -1)
102167488Seric # define LA_TYPE	LA_FLOAT
102267488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
102367488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
102467488Seric # ifndef GIDSET_T
102567488Seric #  define GIDSET_T	gid_t
102667488Seric # endif
102767488Seric # ifndef _PATH_UNIX
102867488Seric #  define _PATH_UNIX	"/HI-UX"
102967488Seric # endif
103067488Seric # ifndef _PATH_SENDMAILCF
103167488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
103267488Seric # endif
103367488Seric # ifndef IDENTPROTO
103467488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
103567488Seric # endif
103667488Seric # ifndef HASGETUSERSHELL
103767488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
103867488Seric # endif
103967488Seric 
104067488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
104167488Seric # undef m_flags
104267488Seric 
104367488Seric # ifdef __STDC__
104467488Seric extern int	syslog(int, char *, ...);
104567488Seric # endif
104667488Seric 
104767488Seric #endif
104867488Seric 
104967488Seric 
105068099Seric /*
105168099Seric **  Amdahl UTS System V 2.1.5 (SVr3-based)
105268099Seric **
105368099Seric **    From: Janet Jackson <janet@dialix.oz.au>.
105468099Seric */
105567488Seric 
105668099Seric #ifdef _UTS
105768099Seric # include <sys/sysmacros.h>
105868099Seric # undef HASLSTAT	/* has symlinks, but they cause problems */
105968099Seric # define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
106068099Seric # define SYS5SIGNALS	1	/* System V signal semantics */
106168099Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
106268099Seric # define HASUNAME	1	/* use System V uname(2) system call */
106368099Seric # define HASINITGROUPS	1	/* has initgroups(3) function */
106468099Seric # define HASSETVBUF	1	/* has setvbuf(3) function */
106568099Seric # define HASSIGSETMASK	0	/* does not have sigsetmask(2) function */
106668099Seric # ifndef HASGETUSERSHELL
106768099Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
106868099Seric # endif
106968099Seric # define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
107068099Seric # define LA_TYPE	LA_ZERO		/* doesn't have load average */
107168099Seric # define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
107268439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
107368099Seric # define _PATH_UNIX	"/unix"
107468099Seric # ifndef _PATH_SENDMAILCF
107568099Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
107668099Seric # endif
107768099Seric #endif
107868099Seric 
107968357Seric /*
108068357Seric **  Cray Computer Corporation's CSOS
108168357Seric **
108268357Seric **	Contributed by Scott Bolte <scott@craycos.com>.
108368357Seric */
108468099Seric 
108568357Seric #ifdef _CRAYCOM
108668357Seric # define SYSTEM5	1	/* include all the System V defines */
108768357Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
108868357Seric # define NEEDFSYNC	1	/* no fsync in system library */
108968357Seric # define MAXPATHLEN	PATHSIZE
109068357Seric # define LA_TYPE	LA_ZERO
109168357Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
109268439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
109368357Seric # define _POSIX_CHOWN_RESTRICTED	-1
109468357Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
109568357Seric #endif
109668099Seric 
109768099Seric 
109863902Seric /**********************************************************************
109963787Seric **  End of Per-Operating System defines
110063902Seric **********************************************************************/
110163787Seric 
110263949Seric /**********************************************************************
110363949Seric **  More general defines
110463949Seric **********************************************************************/
110563949Seric 
110663962Seric /* general BSD defines */
110763962Seric #ifdef BSD
110864035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
110964035Seric # define HASSETREUID	1	/* has setreuid(2) call */
111067742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
111167430Seric # ifndef HASSETRLIMIT
111267430Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
111367430Seric # endif
111465830Seric # ifndef HASFLOCK
111565830Seric #  define HASFLOCK	1	/* has flock(2) call */
111665830Seric # endif
111767602Seric # ifndef TZ_TYPE
111867608Seric #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
111967602Seric # endif
112063962Seric #endif
112163962Seric 
112265189Seric /* general System V Release 4 defines */
112365189Seric #ifdef __svr4__
112465189Seric # define SYSTEM5	1
112565189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
112667742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
112767742Seric # ifndef HASSETRLIMIT
112867742Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
112967742Seric # endif
113065211Seric # ifndef HASGETUSERSHELL
113165211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
113265210Seric # endif
113365189Seric # define setreuid(r, e)	seteuid(e)
113465189Seric 
113565189Seric # ifndef _PATH_UNIX
113665189Seric #  define _PATH_UNIX		"/unix"
113765189Seric # endif
113865189Seric # ifndef _PATH_SENDMAILCF
113965189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
114065189Seric # endif
114165189Seric # ifndef _PATH_SENDMAILPID
114265189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
114365189Seric # endif
114465189Seric # ifndef SYSLOG_BUFSIZE
114565189Seric #  define SYSLOG_BUFSIZE	128
114665189Seric # endif
114767159Seric # ifndef SFS_TYPE
114867159Seric #  define SFS_TYPE		SFS_STATVFS
114967159Seric # endif
115065189Seric #endif
115165189Seric 
115263787Seric /* general System V defines */
115366298Seric #ifdef SYSTEM5
115464813Seric # include <sys/sysmacros.h>
115563949Seric # define HASUNAME	1	/* use System V uname(2) system call */
115664705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
115764962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
115867430Seric # ifndef HASULIMIT
115967430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
116067430Seric # endif
116163962Seric # ifndef LA_TYPE
116265749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
116363962Seric # endif
116465749Seric # ifndef SFS_TYPE
116565749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
116665749Seric # endif
116767602Seric # ifndef TZ_TYPE
116867608Seric #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
116967602Seric # endif
117068442Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
117168442Seric # define bzero(d, l)		(memset((d), '\0', (l)))
117268442Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
117366298Seric #endif
117463787Seric 
117563949Seric /* general POSIX defines */
117663949Seric #ifdef _POSIX_VERSION
117764718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
117864718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
117963949Seric #endif
118063949Seric 
118163787Seric /*
118263937Seric **  If no type for argument two of getgroups call is defined, assume
118363937Seric **  it's an integer -- unfortunately, there seem to be several choices
118463937Seric **  here.
118563937Seric */
118663937Seric 
118763937Seric #ifndef GIDSET_T
118863937Seric # define GIDSET_T	int
118963937Seric #endif
119063937Seric 
119164939Seric /*
119268357Seric **  Tweaking for systems that (for example) claim to be BSD or POSIX
119368357Seric **  but don't have all the standard BSD or POSIX routines (boo hiss).
119464939Seric */
119564439Seric 
119664939Seric #ifdef titan
119764939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
119864939Seric #endif
119964939Seric 
120068357Seric #ifdef _CRAYCOM
120168357Seric # undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
120268357Seric #endif
120365830Seric 
120468442Seric #ifdef ISC_UNIX
120568442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
120668442Seric #endif
120768357Seric 
120868442Seric #ifdef ALTOS_SYS_V
120968442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
121068442Seric # undef bzero			/* despite SystemV claim, uses BSD bzero */
121168442Seric # undef bcmp			/* despite SystemV claim, uses BSD bcmp */
121268442Seric #endif
121368442Seric 
121468442Seric 
121565167Seric /*
121665167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
121765167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
121865167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
121965167Seric **  are closed.  Some firewalls return this error if you try to connect
122065167Seric **  to the IDENT port (113), so you can't receive email from these hosts
122165167Seric **  on these systems.  The firewall really should use a more specific
122265167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
122365167Seric **  not explicitly set to zero above, default it on.
122465167Seric */
122564939Seric 
122665167Seric #ifndef IDENTPROTO
122765167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
122865167Seric #endif
122965167Seric 
123065211Seric #ifndef HASGETUSERSHELL
123165211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
123265210Seric #endif
123365167Seric 
123465830Seric #ifndef HASFLOCK
123565830Seric # define HASFLOCK	0	/* assume no flock(2) support */
123665830Seric #endif
123765210Seric 
123867430Seric #ifndef HASSETRLIMIT
123967430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
124067430Seric #endif
124167430Seric 
124267430Seric #ifndef HASULIMIT
124367430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
124467430Seric #endif
124567430Seric 
124666843Seric #ifndef OLD_NEWDB
124766843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
124866843Seric #endif
124965830Seric 
125068099Seric /* heuristic setting of HASSETSIGMASK; can override above */
125168099Seric #ifndef HASSIGSETMASK
125268099Seric # ifdef SIGVTALRM
125368099Seric #  define HASSETSIGMASK	1
125468099Seric # else
125568099Seric #  define HASSETSIGMASK	0
125668099Seric # endif
125768099Seric #endif
125866843Seric 
1259*68705Seric #ifndef UID_T
1260*68705Seric # define UID_T		uid_t
1261*68705Seric #endif
126268099Seric 
1263*68705Seric #ifndef ARGV_T
1264*68705Seric # define ARGV_T		char **
1265*68705Seric #endif
1266*68705Seric 
1267*68705Seric 
126864439Seric /**********************************************************************
126959023Seric **  Remaining definitions should never have to be changed.  They are
127059023Seric **  primarily to provide back compatibility for older systems -- for
127159287Seric **  example, it includes some POSIX compatibility definitions
127264439Seric **********************************************************************/
127359023Seric 
127459388Seric /* System 5 compatibility */
127559388Seric #ifndef S_ISREG
127664944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
127759388Seric #endif
127864944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
127964944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
128064944Seric #endif
128168494Seric #ifndef S_IWUSR
128268494Seric # define S_IWUSR		0200
128368494Seric #endif
128459388Seric #ifndef S_IWGRP
128568494Seric # define S_IWGRP		0020
128659388Seric #endif
128759388Seric #ifndef S_IWOTH
128868494Seric # define S_IWOTH		0002
128959388Seric #endif
129059388Seric 
129159023Seric /*
129250537Seric **  Older systems don't have this error code -- it should be in
129350537Seric **  /usr/include/sysexits.h.
129450537Seric */
129550537Seric 
129650537Seric # ifndef EX_CONFIG
129750537Seric # define EX_CONFIG	78	/* configuration error */
129850537Seric # endif
129956852Seric 
130064718Seric /* pseudo-code used in server SMTP */
130164718Seric # define EX_QUIT	22	/* drop out of server immediately */
130264718Seric 
130364718Seric 
130463993Seric /*
130563993Seric **  These are used in a few cases where we need some special
130663993Seric **  error codes, but where the system doesn't provide something
130763993Seric **  reasonable.  They are printed in errstring.
130863993Seric */
130963993Seric 
131063993Seric #ifndef E_PSEUDOBASE
131163993Seric # define E_PSEUDOBASE	256
131263993Seric #endif
131363993Seric 
131463993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
131563993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
131663993Seric 
131763970Seric /* type of arbitrary pointer */
131863970Seric #ifndef ARBPTR_T
131963970Seric # define ARBPTR_T	void *
132063970Seric #endif
132163970Seric 
132260568Seric #ifndef __P
132360568Seric # include "cdefs.h"
132460568Seric #endif
132560568Seric 
132667421Seric #if NAMED_BIND
132767421Seric # include <arpa/nameser.h>
132867434Seric # ifdef __svr4__
132967434Seric #  ifdef NOERROR
133067434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
133167434Seric #  endif
133267434Seric # endif
133367421Seric #endif
133467421Seric 
133556852Seric /*
133667419Seric **  The size of an IP address -- can't use sizeof because of problems
133767419Seric **  on Crays, where everything is 64 bits.  This will break if/when
133867419Seric **  IP addresses are expanded to eight bytes.
133967419Seric */
134067419Seric 
134167421Seric #ifndef INADDRSZ
134267421Seric # define INADDRSZ	4
134367421Seric #endif
134467419Seric 
134567419Seric /*
134667421Seric **  The size of various known types -- for reading network protocols.
134767421Seric **  Again, we can't use sizeof because of compiler randomness.
134867421Seric */
134967421Seric 
135067421Seric #ifndef INT16SZ
135167421Seric # define INT16SZ	2
135267421Seric #endif
135367421Seric #ifndef INT32SZ
135467421Seric # define INT32SZ	4
135567421Seric #endif
135667421Seric 
135767421Seric /*
135858778Seric **  Do some required dependencies
135958778Seric */
136058778Seric 
136158778Seric #if defined(NETINET) || defined(NETISO)
136259107Seric # define SMTP		1	/* enable user and server SMTP */
136359107Seric # define QUEUE		1	/* enable queueing */
136459107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
136558778Seric #endif
136658778Seric 
136758778Seric 
136858778Seric /*
136956852Seric **  Arrange to use either varargs or stdargs
137056852Seric */
137156852Seric 
137256852Seric # ifdef __STDC__
137356852Seric 
137456852Seric # include <stdarg.h>
137556852Seric 
137656852Seric # define VA_LOCAL_DECL	va_list ap;
137756852Seric # define VA_START(f)	va_start(ap, f)
137856852Seric # define VA_END		va_end(ap)
137956852Seric 
138056852Seric # else
138156852Seric 
138256852Seric # include <varargs.h>
138356852Seric 
138456852Seric # define VA_LOCAL_DECL	va_list ap;
138556852Seric # define VA_START(f)	va_start(ap)
138656852Seric # define VA_END		va_end(ap)
138756852Seric 
138856852Seric # endif
138957631Seric 
139057943Seric #ifdef HASUNAME
139157631Seric # include <sys/utsname.h>
139257631Seric # ifdef newstr
139357631Seric #  undef newstr
139457631Seric # endif
139557943Seric #else /* ! HASUNAME */
139657631Seric # define NODE_LENGTH 32
139757631Seric struct utsname
139857631Seric {
139957631Seric 	char nodename[NODE_LENGTH+1];
140057631Seric };
140157943Seric #endif /* HASUNAME */
140257642Seric 
140368040Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
140463838Seric # define MAXHOSTNAMELEN	256
140557735Seric #endif
140658153Seric 
140758153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
140858153Seric # define SIGCHLD	SIGCLD
140958153Seric #endif
141058153Seric 
141158153Seric #ifndef STDIN_FILENO
141258153Seric #define STDIN_FILENO	0
141358153Seric #endif
141458153Seric 
141558153Seric #ifndef STDOUT_FILENO
141658153Seric #define STDOUT_FILENO	1
141758153Seric #endif
141858153Seric 
141958153Seric #ifndef STDERR_FILENO
142058153Seric #define STDERR_FILENO	2
142158153Seric #endif
142258689Seric 
142364072Seric #ifndef LOCK_SH
142464035Seric # define LOCK_SH	0x01	/* shared lock */
142564035Seric # define LOCK_EX	0x02	/* exclusive lock */
142664035Seric # define LOCK_NB	0x04	/* non-blocking lock */
142764035Seric # define LOCK_UN	0x08	/* unlock */
142864035Seric #endif
142958692Seric 
143064035Seric #ifndef SIG_ERR
143164035Seric # define SIG_ERR	((void (*)()) -1)
143258689Seric #endif
143358702Seric 
143464500Seric #ifndef WEXITSTATUS
143564500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
143664500Seric #endif
143764500Seric #ifndef WIFEXITED
143864500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
143964500Seric #endif
144064500Seric 
144164561Seric #ifndef SIGFUNC_DEFINED
144264561Seric typedef void		(*sigfunc_t) __P((int));
144364561Seric #endif
144464561Seric 
144565053Seric /* size of syslog buffer */
144665053Seric #ifndef SYSLOG_BUFSIZE
144765053Seric # define SYSLOG_BUFSIZE	1024
144865053Seric #endif
144965053Seric 
145058702Seric /*
145158702Seric **  Size of tobuf (deliver.c)
145258702Seric **	Tweak this to match your syslog implementation.  It will have to
145358702Seric **	allow for the extra information printed.
145458702Seric */
145558702Seric 
145658702Seric #ifndef TOBUFSIZE
145765053Seric # if (SYSLOG_BUFSIZE) > 512
145865053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
145965053Seric # else
146065053Seric #  define TOBUFSIZE	256
146165053Seric # endif
146258702Seric #endif
146360219Seric 
146465015Seric /*
146565015Seric **  Size of prescan buffer.
146665015Seric **	Despite comments in the _sendmail_ book, this probably should
146765015Seric **	not be changed; there are some hard-to-define dependencies.
146865015Seric */
146965015Seric 
147065015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
147160219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
147260219Seric # ifndef FORK
147360219Seric # define FORK		vfork		/* function to call to fork mailer */
147460219Seric # endif
147565955Seric 
147665955Seric /*
147765955Seric **  If we are going to link scanf anyway, use it in readcf
147865955Seric */
147965955Seric 
148065955Seric #if !defined(HASUNAME) && !defined(SCANF)
148165955Seric # define SCANF		1
148265955Seric #endif
1483