xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 67626)
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*67626Seric  *	@(#)conf.h	8.116 (Berkeley) 08/09/94
933728Sbostic  */
109147Seric 
1122726Sdist /*
1222726Sdist **  CONF.H -- All user-configurable parameters for sendmail
1322726Sdist */
149147Seric 
1557232Seric # include <sys/param.h>
1664705Seric # include <sys/types.h>
1759389Seric # include <sys/stat.h>
1864380Seric # include <sys/file.h>
1964500Seric # include <sys/wait.h>
2058689Seric # include <fcntl.h>
2164035Seric # include <signal.h>
2257232Seric 
2363902Seric /**********************************************************************
249147Seric **  Table sizes, etc....
259147Seric **	There shouldn't be much need to change these....
2663902Seric **********************************************************************/
279147Seric 
2859303Seric # define MAXLINE	2048		/* max line length */
2924945Seric # define MAXNAME	256		/* max length of a name */
309147Seric # define MAXPV		40		/* max # of parms to mailers */
3159303Seric # define MAXATOM	200		/* max atoms per address */
329147Seric # define MAXMAILERS	25		/* maximum mailers known to system */
3357143Seric # define MAXRWSETS	100		/* max # of sets of rewriting rules */
349147Seric # define MAXPRIORITIES	25		/* max values for Precedence: field */
3557143Seric # define MAXMXHOSTS	20		/* max # of MX records */
3652106Seric # define SMTPLINELIM	990		/* maximum SMTP line length */
3757232Seric # define MAXKEY		128		/* maximum size of a database key */
3857232Seric # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
3959056Seric # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
4059667Seric # define MAXALIASDB	12		/* max # of alias databases */
4157143Seric 
4257143Seric # ifndef QUEUESIZE
4357143Seric # define QUEUESIZE	1000		/* max # of jobs per queue run */
4457143Seric # endif
4557143Seric 
4663902Seric /**********************************************************************
479147Seric **  Compilation options.
4825673Seric **
4925673Seric **	#define these if they are available; comment them out otherwise.
5063902Seric **********************************************************************/
519147Seric 
5225673Seric # define LOG		1	/* enable logging */
5325673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
5464813Seric # define NETUNIX	1	/* include unix domain support */
5558778Seric # define NETINET	1	/* include internet support */
5625673Seric # define SETPROCTITLE	1	/* munge argv to display current status */
5753735Seric # define MATCHGECOS	1	/* match user names from gecos field */
5863753Seric # define XDEBUG		1	/* enable extended debugging */
5956337Seric # ifdef NEWDB
6056337Seric # define USERDB		1	/* look in user database (requires NEWDB) */
6156337Seric # endif
6256337Seric 
6366334Seric /**********************************************************************
6466334Seric **  0/1 Compilation options.
6566334Seric **	#define these to 1 if they are available;
6666334Seric **	#define them to 0 otherwise.
6766334Seric **********************************************************************/
6866334Seric 
6966334Seric # ifndef NAMED_BIND
7066334Seric #  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
7166334Seric # endif
7266334Seric 
7364032Seric /*
7464944Seric **  Most systems have symbolic links today, so default them on.  You
7564944Seric **  can turn them off by #undef'ing this below.
7664944Seric */
7764944Seric 
7864944Seric # define HASLSTAT	1	/* has lstat(2) call */
7964944Seric 
8064962Seric /*
8164962Seric **  General "standard C" defines.
8264962Seric **
8364962Seric **	These may be undone later, to cope with systems that claim to
8464962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
8564962Seric **	doesn't realize that the library is part of the language.
8664962Seric **
8764962Seric **	Life would be much easier if we could get rid of this sort
8864962Seric **	of bozo problems.
8964962Seric */
9064962Seric 
9164962Seric #ifdef __STDC__
9264962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
9364962Seric #endif
9464962Seric 
9563902Seric /**********************************************************************
9659023Seric **  Operating system configuration.
9759023Seric **
9859023Seric **	Unless you are porting to a new OS, you shouldn't have to
9959023Seric **	change these.
10063902Seric **********************************************************************/
10156823Seric 
10263787Seric /*
10363787Seric **  Per-Operating System defines
10463787Seric */
10563787Seric 
10664314Seric 
10763902Seric /*
10865565Seric **  HP-UX -- tested for 8.07, 9.00, and 9.01.
10963902Seric */
11063902Seric 
111*67626Seric #ifdef __hpux
11264727Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
11364727Seric # undef m_flags
11463787Seric # define SYSTEM5	1	/* include all the System V defines */
11564035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
11664035Seric # define HASSETREUID	1	/* has setreuid(2) call */
11765982Seric # define setreuid(r, e)		setresuid(r, e, -1)
11863962Seric # define LA_TYPE	LA_FLOAT
11965749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
12065354Seric # define GIDSET_T	gid_t
12163962Seric # define _PATH_UNIX	"/hp-ux"
12265354Seric # ifndef _PATH_SENDMAILCF
12365354Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
12465354Seric # endif
12565167Seric # ifndef IDENTPROTO
12665167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
12756823Seric # endif
12865581Seric # ifndef HASGETUSERSHELL
12965581Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
13065581Seric # endif
13165504Seric # define syslog		hard_syslog
13265581Seric # ifdef __STDC__
13365581Seric extern int	syslog(int, char *, ...);
13465167Seric # endif
135*67626Seric #endif
13656823Seric 
13764314Seric 
13863902Seric /*
13963902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
14063902Seric */
14163902Seric 
142*67626Seric #ifdef _AIX3
14364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
14464840Seric # define HASUNAME	1	/* use System V uname(2) system call */
14565211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
14660219Seric # define FORK		fork	/* no vfork primitive available */
14765749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
148*67626Seric #endif
14960219Seric 
15064314Seric 
15163902Seric /*
15263902Seric **  Silicon Graphics IRIX
15363902Seric **
15463965Seric **	Compiles on 4.0.1.
15563902Seric */
15663902Seric 
157*67626Seric #ifdef IRIX
15866763Seric # define SYSTEM5	1	/* this is a System-V derived system */
15964035Seric # define HASSETREUID	1	/* has setreuid(2) call */
16064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
16165211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
16263753Seric # define FORK		fork	/* no vfork primitive available */
16364562Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
16464155Seric # define setpgid	BSDsetpgrp
16563937Seric # define GIDSET_T	gid_t
16665749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
16766763Seric # define LA_TYPE	LA_INT
16867435Seric # define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
169*67626Seric #endif
17063753Seric 
17163902Seric 
17263902Seric /*
17364813Seric **  SunOS and Solaris
17464813Seric **
17564813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
17664813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
17763902Seric */
17863902Seric 
17963787Seric #if defined(sun) && !defined(BSD)
18059074Seric 
18164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
18264813Seric # define HASUNAME	1	/* use System V uname(2) system call */
18365211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
18465749Seric # define LA_TYPE	LA_INT
18560564Seric 
18664842Seric # ifdef SOLARIS_2_3
18764842Seric #  define SOLARIS
18864842Seric # endif
18964842Seric 
19060602Seric # ifdef SOLARIS
19163902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
19265222Seric #  ifndef __svr4__
19365222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
19465222Seric #  endif
19563787Seric #  include <sys/time.h>
19664832Seric #  define gethostbyname	solaris_gethostbyname	/* get working version */
19764832Seric #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
19865172Seric #  define GIDSET_T	gid_t
19965189Seric #  ifndef _PATH_UNIX
20067129Seric #   define _PATH_UNIX	"/dev/ksyms"
20165189Seric #  endif
20263962Seric #  ifndef _PATH_SENDMAILCF
20363962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
20464072Seric #  endif
20564072Seric #  ifndef _PATH_SENDMAILPID
20663962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
20763962Seric #  endif
20866022Seric #  ifndef SYSLOG_BUFSIZE
20966022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
21066022Seric #  endif
21163787Seric 
21260602Seric # else
21365105Seric 			/* SunOS 4.0.3 or 4.1.x */
21465189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
21565830Seric #  ifndef HASFLOCK
21665830Seric #   define HASFLOCK	1	/* has flock(2) call */
21765830Seric #  endif
21865749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
21960564Seric #  include <vfork.h>
22063787Seric 
22165105Seric #  ifdef SUNOS403
22265105Seric 			/* special tweaking for SunOS 4.0.3 */
22365105Seric #   include <malloc.h>
22465105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
22565105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
22665105Seric #   undef WIFEXITED
22765105Seric #   undef WEXITSTATUS
22865105Seric #   undef HASUNAME
22965105Seric #   define setpgid	setpgrp
23065105Seric typedef int		pid_t;
23165105Seric extern char		*getenv();
23265105Seric 
23366732Seric #  else
23466732Seric 			/* 4.1.x specifics */
23566732Seric #   define HASSETSID	1	/* has Posix setsid(2) call */
23666732Seric #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
23766732Seric 
23865105Seric #  endif
23960564Seric # endif
24059023Seric #endif
24159023Seric 
24264718Seric /*
24364813Seric **  DG/UX
24464813Seric **
24567427Seric **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
24667427Seric **	older support.
24767427Seric **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
24864718Seric */
24964314Seric 
25067427Seric #ifdef DGUX_5_4_2
25167427Seric # define DGUX		1
25267427Seric #endif
25367427Seric 
25464718Seric #ifdef	DGUX
25564718Seric # define SYSTEM5	1
25664718Seric # define LA_TYPE	LA_SUBR
25764718Seric # define HASSETREUID	1	/* has setreuid(2) call */
25864718Seric # define HASUNAME	1	/* use System V uname(2) system call */
25964718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
26064718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
26166036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
26265167Seric # ifndef IDENTPROTO
26365167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
26465167Seric # endif
26564718Seric # undef SETPROCTITLE
26665749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
26764813Seric 
26864813Seric /* these include files must be included early on DG/UX */
26964813Seric # include <netinet/in.h>
27064813Seric # include <arpa/inet.h>
27164813Seric 
27267427Seric # ifdef DGUX_5_4_2
27367427Seric #  define inet_addr	dgux_inet_addr
27464718Seric extern long	dgux_inet_addr();
27567427Seric # endif
27664718Seric #endif
27764718Seric 
27864718Seric 
27963902Seric /*
28063902Seric **  Digital Ultrix 4.2A or 4.3
28164264Seric **
28264264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
28364264Seric **	not dropped when the process exits.  This causes major problems,
28464264Seric **	so flock is the only alternative.
28563902Seric */
28663902Seric 
28760564Seric #ifdef ultrix
28864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
28963962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
29064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
29166242Seric # define HASUNAME	1	/* use System V uname(2) system call */
29265830Seric # ifndef HASFLOCK
29365830Seric #  define HASFLOCK	1	/* has flock(2) call */
29465830Seric # endif
29565211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
29666318Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
29765135Seric # ifdef vax
29865135Seric #  define LA_TYPE	LA_FLOAT
29965135Seric # else
30065135Seric #  define LA_TYPE	LA_INT
30165135Seric #  define LA_AVENRUN	"avenrun"
30265135Seric # endif
30365749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
30465167Seric # ifndef IDENTPROTO
30565167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
30665167Seric # endif
30760564Seric #endif
30860564Seric 
30964314Seric 
31063902Seric /*
31163902Seric **  OSF/1 (tested on Alpha)
31263902Seric */
31363902Seric 
31463787Seric #ifdef __osf__
31563962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
31664035Seric # define HASSETREUID	1	/* has setreuid(2) call */
31764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
31866226Seric # ifndef HASFLOCK
31965830Seric #  define HASFLOCK	1	/* has flock(2) call */
32065830Seric # endif
32163962Seric # define LA_TYPE	LA_INT
32265749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
32364813Seric # ifndef _PATH_SENDMAILPID
32465504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
32564813Seric # endif
32659287Seric #endif
32759287Seric 
32864314Seric 
32963902Seric /*
33063902Seric **  NeXTstep
33163902Seric */
33263902Seric 
33364076Seric #ifdef NeXT
33464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
33565830Seric # ifndef HASFLOCK
33665830Seric #  define HASFLOCK	1	/* has flock(2) call */
33765830Seric # endif
33864125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
33964563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
34063753Seric # define sleep		sleepX
34164155Seric # define setpgid	setpgrp
34264295Seric # ifndef LA_TYPE
34364295Seric #  define LA_TYPE	LA_MACH
34464295Seric # endif
34565749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
34664500Seric # ifndef _POSIX_SOURCE
34764035Seric typedef int		pid_t;
34864500Seric #  undef WEXITSTATUS
34964500Seric #  undef WIFEXITED
35064500Seric # endif
35164072Seric # ifndef _PATH_SENDMAILCF
35264072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
35364072Seric # endif
35464072Seric # ifndef _PATH_SENDMAILPID
35564072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
35664072Seric # endif
35759288Seric #endif
35859288Seric 
35964314Seric 
36063902Seric /*
36163962Seric **  4.4 BSD
36264831Seric **
36364831Seric **	See also BSD defines.
36463902Seric */
36563902Seric 
36660568Seric #ifdef BSD4_4
36764072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
36860568Seric # include <sys/cdefs.h>
36963838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
37064072Seric # ifndef LA_TYPE
37164072Seric #  define LA_TYPE	LA_SUBR
37264072Seric # endif
37365749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
37460568Seric #endif
37560568Seric 
37664314Seric 
37763902Seric /*
37865982Seric **  BSD/386 (all versions)
37965982Seric **	From Tony Sanders, BSDI
38065982Seric */
38165982Seric 
38265982Seric #ifdef __bsdi__
38365982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
38465982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
38566843Seric # include <sys/cdefs.h>
38666843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
38766030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
38866843Seric # ifndef LA_TYPE
38966843Seric #  define LA_TYPE	LA_SUBR
39066843Seric # endif
39165982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
39266843Seric 			/* version 1.1 or later */
39365982Seric #  define HASSETPROCTITLE 1	/* setproctitle is in libc */
39466732Seric #  undef SETPROCTITLE		/* so don't redefine it in conf.c */
39566843Seric # else
39666843Seric 			/* version 1.0 or earlier */
39766843Seric #  ifndef OLD_NEWDB
39866843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
39966843Seric #  endif
40065982Seric # endif
40165982Seric #endif
40265982Seric 
40365982Seric 
40465982Seric 
40565982Seric /*
40665049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
40764733Seric **
40864733Seric **  4.3BSD clone, closer to 4.4BSD
40964831Seric **
41064831Seric **	See also BSD defines.
41164733Seric */
41264733Seric 
41365049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
41464733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
41564733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
41666754Seric # ifdef __NetBSD__
41766754Seric #  define HASUNAME	1	/* has uname(2) syscall */
41866754Seric # endif
41964733Seric # include <sys/cdefs.h>
42064733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
42164733Seric # ifndef LA_TYPE
42264733Seric #  define LA_TYPE	LA_SUBR
42364733Seric # endif
42465749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
42564733Seric #endif
42664733Seric 
42764733Seric 
42864733Seric /*
42964813Seric **  Mach386
43064813Seric **
43164813Seric **	For mt Xinu's Mach386 system.
43264813Seric */
43364813Seric 
43464813Seric #if defined(MACH) && defined(i386)
43564813Seric # define MACH386	1
43664813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
43764813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
43866226Seric # ifndef HASFLOCK
43965830Seric #  define HASFLOCK	1	/* has flock(2) call */
44065830Seric # endif
44164813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
44264813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
44364813Seric # define setpgid	setpgrp
44464813Seric # ifndef LA_TYPE
44564813Seric #  define LA_TYPE	LA_FLOAT
44664813Seric # endif
44765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
44864962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
44964813Seric # undef WEXITSTATUS
45064813Seric # undef WIFEXITED
45164813Seric # ifndef _PATH_SENDMAILCF
45264813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
45364813Seric # endif
45464813Seric # ifndef _PATH_SENDMAILPID
45564813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
45664813Seric # endif
45764813Seric #endif
45864813Seric 
45964813Seric 
46064813Seric /*
46163969Seric **  4.3 BSD -- this is for very old systems
46263969Seric **
46365949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
46465949Seric **
46563969Seric **	You'll also have to install a new resolver library.
46663969Seric **	I don't guarantee that support for this environment is complete.
46763969Seric */
46863969Seric 
46965949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
47063969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
47163969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
47263970Seric # define ARBPTR_T	char *
47364155Seric # define setpgid	setpgrp
47463969Seric # ifndef LA_TYPE
47563969Seric #  define LA_TYPE	LA_FLOAT
47663969Seric # endif
47763969Seric # ifndef _PATH_SENDMAILCF
47863969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
47963969Seric # endif
48065167Seric # ifndef IDENTPROTO
48165167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
48265167Seric # endif
48364834Seric # undef WEXITSTATUS
48464834Seric # undef WIFEXITED
48564834Seric typedef short		pid_t;
48664834Seric extern int		errno;
48763969Seric #endif
48863969Seric 
48964314Seric 
49063969Seric /*
49163902Seric **  SCO Unix
49265087Seric **
49365087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
49465087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
49565087Seric **	The second is, I believe, for an older version.
49663902Seric */
49763902Seric 
49865087Seric #ifdef _SCO_unix_4_2
49965087Seric # define _SCO_unix_
50065087Seric # define HASSETREUID	1	/* has setreuid(2) call */
50166757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
50265087Seric # define _PATH_UNIX	"/unix"
50365087Seric # ifndef _PATH_SENDMAILCF
50465087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
50565087Seric # endif
50665087Seric # ifndef _PATH_SENDMAILPID
50765087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
50865087Seric # endif
50965087Seric #endif
51065087Seric 
51163838Seric #ifdef _SCO_unix_
51263838Seric # define SYSTEM5	1	/* include all the System V defines */
51364035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
51465212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
51563838Seric # define FORK		fork
51663838Seric # define MAXPATHLEN	PATHSIZE
51764718Seric # define LA_TYPE	LA_SHORT
51865749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
51967608Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
52064813Seric # undef NETUNIX			/* no unix domain socket support */
52163838Seric #endif
52263838Seric 
52364314Seric 
52463962Seric /*
52563962Seric **  ConvexOS 11.0 and later
52665949Seric **
52765949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
52865949Seric **	works on 9.1 as well.
52963962Seric */
53063962Seric 
53163962Seric #ifdef _CONVEX_SOURCE
53263977Seric # define BSD		1	/* include all the BSD defines */
53363977Seric # define HASUNAME	1	/* use System V uname(2) system call */
53463962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
53563977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
53663962Seric # define LA_TYPE	LA_FLOAT
53765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
53865949Seric # ifndef _PATH_SENDMAILCF
53965949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
54065949Seric # endif
54165949Seric # ifndef S_IREAD
54265949Seric #  define S_IREAD	_S_IREAD
54365949Seric #  define S_IWRITE	_S_IWRITE
54465949Seric #  define S_IEXEC	_S_IEXEC
54565949Seric #  define S_IFMT	_S_IFMT
54665949Seric #  define S_IFCHR	_S_IFCHR
54765949Seric #  define S_IFBLK	_S_IFBLK
54865949Seric # endif
54965167Seric # ifndef IDENTPROTO
55065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
55165167Seric # endif
55263962Seric #endif
55363962Seric 
55464314Seric 
55563962Seric /*
55664999Seric **  RISC/os 4.52
55763962Seric **
55864999Seric **	Gives a ton of warning messages, but otherwise compiles.
55963962Seric */
56063962Seric 
56163965Seric #ifdef RISCOS
56264999Seric 
56363962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
56466226Seric # ifndef HASFLOCK
56565830Seric #  define HASFLOCK	1	/* has flock(2) call */
56665830Seric # endif
56764999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
56864999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
56963962Seric # define LA_TYPE	LA_INT
57063962Seric # define LA_AVENRUN	"avenrun"
57163962Seric # define _PATH_UNIX	"/unix"
57264999Seric # undef WIFEXITED
57364999Seric 
57464999Seric # define setpgid	setpgrp
57564999Seric 
57664999Seric extern int		errno;
57764999Seric typedef int		pid_t;
57864999Seric #define			SIGFUNC_DEFINED
57964999Seric typedef int		(*sigfunc_t)();
58064999Seric extern char		*getenv();
58164999Seric extern void		*malloc();
58264999Seric 
58363962Seric #endif
58463962Seric 
58564314Seric 
58664155Seric /*
58764155Seric **  Linux 0.99pl10 and above...
58866300Seric **
58966300Seric **  Thanks to, in reverse order of contact:
59066300Seric **
59166300Seric **	John Kennedy <warlock@csuchico.edu>
59266300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
59366300Seric **	Karl London <karl@borg.demon.co.uk>
59466300Seric **
59566300Seric **  Last compiled against:	[03/02/94 @ 05:34 PM (Wednesday)]
59666300Seric **	sendmail 8.6.6.b9	named 4.9.2-931205-p1	db-1.73
59766300Seric **	gcc 2.5.8		libc.so.4.5.19
59866300Seric **	slackware 1.1.2		linux 0.99.15
59964155Seric */
60064155Seric 
60164770Seric #ifdef __linux__
60266298Seric # define BSD		1	/* include BSD defines */
60364155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
60466298Seric # define HASUNAME	1	/* use System V uname(2) system call */
60564380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
60666298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
60766300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
60864155Seric # ifndef LA_TYPE
60966301Seric #  define LA_TYPE	LA_PROCSTR
61064155Seric # endif
61166300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
61264763Seric # include <sys/sysmacros.h>
61366300Seric # undef atol			/* wounded in <stdlib.h> */
61464155Seric #endif
61564155Seric 
61664155Seric 
61764345Seric /*
61864345Seric **  DELL SVR4 Issue 2.2, and others
61964345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
62064345Seric **
62164345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
62264345Seric **	defined, and the definitions conflict.
62364924Seric **
62464924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
62564924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
62664924Seric **	(SVR4.0/386 version 3.0).
62764345Seric */
62864345Seric 
62964345Seric #ifdef DELL_SVR4
63065189Seric 				/* no changes necessary */
63165189Seric 				/* see general __svr4__ defines below */
63264345Seric #endif
63364345Seric 
63464345Seric 
63564380Seric /*
63664380Seric **  Apple A/UX 3.0
63764380Seric */
63864345Seric 
63964380Seric #ifdef _AUX_SOURCE
64064729Seric # include <sys/sysmacros.h>
64164380Seric # define BSD			/* has BSD routines */
64264380Seric # define HASUNAME	1	/* use System V uname(2) system call */
64364380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
64464561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
64565167Seric # ifndef IDENTPROTO
64665167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
64765167Seric # endif
64864380Seric # define FORK		fork
64964380Seric # ifndef _PATH_SENDMAILCF
65064380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
65164380Seric # endif
65264380Seric # ifndef LA_TYPE
65364380Seric #  define LA_TYPE	LA_ZERO
65464380Seric # endif
65565749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
65664560Seric # undef WIFEXITED
65764560Seric # undef WEXITSTATUS
65864380Seric #endif
65964380Seric 
66064380Seric 
66164705Seric /*
66264705Seric **  Encore UMAX V
66364705Seric **
66464705Seric **	Not extensively tested.
66564705Seric */
66664380Seric 
66764705Seric #ifdef UMAXV
66864705Seric # include <limits.h>
66964705Seric # define HASUNAME	1	/* use System V uname(2) system call */
67064705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
67164705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
67265211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
67364705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
67464705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
67564705Seric # define FORK		fork	/* no vfork(2) primitive available */
67665749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
67764705Seric # define MAXPATHLEN	PATH_MAX
67864705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
67964705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
68064705Seric # undef WIFEXITED
68164705Seric # undef WEXITSTATUS
68264705Seric #endif
68364705Seric 
68464705Seric 
68564939Seric /*
68664939Seric **  Stardent Titan 3000 running TitanOS 4.2.
68764939Seric **
68864939Seric **	Must be compiled in "cc -43" mode.
68964939Seric **
69064944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
69164939Seric **
69264939Seric **	Note the tweaking below after the BSD defines are set.
69364939Seric */
69464705Seric 
69564939Seric #ifdef titan
69664939Seric # define setpgid	setpgrp
69764939Seric typedef int		pid_t;
69864939Seric # undef WIFEXITED
69964939Seric # undef WEXITSTATUS
70064939Seric #endif
70164939Seric 
70264939Seric 
70364962Seric /*
70464962Seric **  Sequent DYNIX 3.2.0
70564962Seric **
70664962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
70764962Seric */
70864939Seric 
70964962Seric #ifdef sequent
71066038Seric 
71164962Seric # define BSD		1
71264962Seric # define HASUNSETENV	1
71364962Seric # define BSD4_3		1	/* to get signal() in conf.c */
71464962Seric # define WAITUNION	1
71564962Seric # define LA_TYPE	LA_FLOAT
71664962Seric # ifdef	_POSIX_VERSION
71764962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
71864962Seric # endif
71964962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
72064962Seric # define setpgid	setpgrp
72164962Seric 
72264962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
72364962Seric # undef	WIFEXITED
72464962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
72564962Seric 			 ((union wait*)&(s))->w_termsig == 0)
72664962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
72764962Seric typedef int		pid_t;
72864962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
72964962Seric 
73066144Seric # ifndef IDENTPROTO
73166144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
73266144Seric # endif
73366144Seric 
73464962Seric # ifndef _PATH_UNIX
73564962Seric #  define _PATH_UNIX	"/dynix"
73664962Seric # endif
73764962Seric # ifndef _PATH_SENDMAILCF
73864962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
73964962Seric # endif
74064962Seric 
74164962Seric #endif
74264962Seric 
74364962Seric 
74465748Seric /*
74566038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
74666038Seric **
74766038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
74866038Seric **
74966038Seric **	From Tim Wright <timw@sequent.com>.
75066038Seric */
75166038Seric 
75266038Seric #ifdef _SEQUENT_
75366038Seric # define SYSTEM5	1	/* include all the System V defines */
75466038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
75566038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
75666038Seric # define HASSETREUID	1	/* has setreuid(2) call */
75766038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
75866038Seric # define GIDSET_T	gid_t
75966038Seric # define LA_TYPE	LA_INT
76066038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
76166038Seric # undef SETPROCTITLE
76266144Seric # ifndef IDENTPROTO
76366144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
76466144Seric # endif
76566038Seric # ifndef _PATH_SENDMAILCF
76666038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
76766038Seric # endif
76866038Seric # ifndef _PATH_SENDMAILPID
76966038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
77066038Seric # endif
77166038Seric #endif
77266038Seric 
77366038Seric 
77466038Seric /*
77565748Seric **  Cray Unicos
77665748Seric **
77765748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
77865748Seric */
77964962Seric 
78065748Seric #ifdef UNICOS
78165748Seric # define SYSTEM5	1	/* include all the System V defines */
78265748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
78365748Seric # define MAXPATHLEN	PATHSIZE
78465748Seric # define LA_TYPE	LA_ZERO
78565749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
78665748Seric #endif
78764962Seric 
78865748Seric 
78965820Seric /*
79065820Seric **  Apollo DomainOS
79165820Seric **
79265820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
79365982Seric **
79465820Seric **  15 Jan 1994
79565820Seric **
79665820Seric */
79765748Seric 
79865820Seric #ifdef apollo
79965820Seric # define HASSETREUID	1	/* has setreuid(2) call */
80065820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
80165820Seric # undef  SETPROCTITLE
80265820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
80366044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
80465820Seric # ifndef _PATH_SENDMAILCF
80565820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
80665820Seric # endif
80765820Seric # ifndef _PATH_SENDMAILPID
80865820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
80965820Seric # endif
81065820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
81165820Seric # undef  S_IFIFO
81265820Seric # define S_IFIFO	0010000
81365820Seric # ifndef IDENTPROTO
81465820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
81565820Seric # endif
81665982Seric #endif
81765820Seric 
81865820Seric 
81966748Seric /*
82066752Seric **  UnixWare
82166752Seric **
82266752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
82366752Seric */
82466752Seric 
82566752Seric #ifdef UNIXWARE
82666752Seric # define SYSTEM5		1
82766752Seric # ifndef HASGETUSERSHELL
82866752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
82966752Seric # endif
83066752Seric # define GIDSET_T		int
83166752Seric # define SLEEP_T		int
83266752Seric # define SFS_TYPE		SFS_STATVFS
83366752Seric # define LA_TYPE		LA_ZERO
83466752Seric # undef WIFEXITED
83566752Seric # undef WEXITSTATUS
83666752Seric # define _PATH_UNIX		"/unix"
83766752Seric # ifndef _PATH_SENDMAILCF
83866752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
83966752Seric # endif
84066752Seric # ifndef _PATH_SENDMAILPID
84166752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
84266752Seric # endif
84366752Seric # define SYSLOG_BUFSIZE	128
84466752Seric #endif
84566752Seric 
84666752Seric 
84766752Seric /*
84866748Seric **  Intergraph CLIX 3.1
84966748Seric **
85066748Seric **	From Paul Southworth <pauls@locust.cic.net>
85166748Seric */
85265820Seric 
85366748Seric #ifdef CLIX
85466748Seric # define SYSTEM5	1	/* looks like System V */
85566752Seric # ifndef HASGETUSERSHELL
85666752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
85766752Seric # endif
85866748Seric # define DEV_BSIZE	512	/* device block size not defined */
85966748Seric # define GIDSET_T	gid_t
86066748Seric # undef LOG			/* syslog not available */
86166748Seric # define NEEDFSYNC	1	/* no fsync in system library */
86266748Seric # define GETSHORT	_getshort
86366748Seric #endif
86465820Seric 
86566748Seric 
86666776Seric /*
86766776Seric **  NCR 3000 Series (SysVr4)
86866776Seric **
86967434Seric **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
87066776Seric */
87166748Seric 
87266776Seric #ifdef NCR3000
87366776Seric # define __svr4__
87466776Seric # undef BSD
87566776Seric # define LA_AVENRUN	"avenrun"
87666776Seric #endif
87766748Seric 
87866776Seric 
87967434Seric /*
88067434Seric **  Tandem NonStop-UX SVR4
88167434Seric **
88267434Seric **	From Rick McCarty <mccarty@mpd.tandem.com>.
88367434Seric */
88466776Seric 
88567434Seric #ifdef NonStop_UX_BXX
88667434Seric # define __svr4__
88767434Seric #endif
88866776Seric 
88967434Seric 
89067488Seric /*
89167488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
89267488Seric **
89367488Seric **	Tested for 1.04 and 1.03
89467488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
89567488Seric */
89667434Seric 
89767488Seric #ifdef __H3050R
89867488Seric # define SYSTEM5	1	/* include all the System V defines */
89967488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
90067488Seric # define setreuid(r, e)	setresuid(r, e, -1)
90167488Seric # define LA_TYPE	LA_FLOAT
90267488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
90367488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
90467488Seric # ifndef GIDSET_T
90567488Seric #  define GIDSET_T	gid_t
90667488Seric # endif
90767488Seric # ifndef _PATH_UNIX
90867488Seric #  define _PATH_UNIX	"/HI-UX"
90967488Seric # endif
91067488Seric # ifndef _PATH_SENDMAILCF
91167488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
91267488Seric # endif
91367488Seric # ifndef IDENTPROTO
91467488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
91567488Seric # endif
91667488Seric # ifndef HASGETUSERSHELL
91767488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
91867488Seric # endif
91967488Seric 
92067488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
92167488Seric # undef m_flags
92267488Seric 
92367488Seric # ifdef __STDC__
92467488Seric extern int	syslog(int, char *, ...);
92567488Seric # endif
92667488Seric 
92767488Seric #endif
92867488Seric 
92967488Seric 
93067488Seric 
93163902Seric /**********************************************************************
93263787Seric **  End of Per-Operating System defines
93363902Seric **********************************************************************/
93463787Seric 
93563949Seric /**********************************************************************
93663949Seric **  More general defines
93763949Seric **********************************************************************/
93863949Seric 
93963962Seric /* general BSD defines */
94063962Seric #ifdef BSD
94164035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
94264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
94364035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
94467430Seric # ifndef HASSETRLIMIT
94567430Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
94667430Seric # endif
94765830Seric # ifndef HASFLOCK
94865830Seric #  define HASFLOCK	1	/* has flock(2) call */
94965830Seric # endif
95067602Seric # ifndef TZ_TYPE
95167608Seric #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
95267602Seric # endif
95363962Seric #endif
95463962Seric 
95565189Seric /* general System V Release 4 defines */
95665189Seric #ifdef __svr4__
95765189Seric # define SYSTEM5	1
95865189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
95965211Seric # ifndef HASGETUSERSHELL
96065211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
96165210Seric # endif
96265189Seric # define setreuid(r, e)	seteuid(e)
96365189Seric 
96465189Seric # ifndef _PATH_UNIX
96565189Seric #  define _PATH_UNIX		"/unix"
96665189Seric # endif
96765189Seric # ifndef _PATH_SENDMAILCF
96865189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
96965189Seric # endif
97065189Seric # ifndef _PATH_SENDMAILPID
97165189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
97265189Seric # endif
97365189Seric # ifndef SYSLOG_BUFSIZE
97465189Seric #  define SYSLOG_BUFSIZE	128
97565189Seric # endif
97667159Seric # ifndef SFS_TYPE
97767159Seric #  define SFS_TYPE		SFS_STATVFS
97867159Seric # endif
97965189Seric #endif
98065189Seric 
98163787Seric /* general System V defines */
98266298Seric #ifdef SYSTEM5
98364813Seric # include <sys/sysmacros.h>
98463949Seric # define HASUNAME	1	/* use System V uname(2) system call */
98564705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
98664962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
98767430Seric # ifndef HASULIMIT
98867430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
98967430Seric # endif
99063962Seric # ifndef LA_TYPE
99165749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
99263962Seric # endif
99365749Seric # ifndef SFS_TYPE
99465749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
99565749Seric # endif
99667602Seric # ifndef TZ_TYPE
99767608Seric #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
99867602Seric # endif
99963949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
100063949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
100163949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
100266298Seric #endif
100363787Seric 
100463949Seric /* general POSIX defines */
100563949Seric #ifdef _POSIX_VERSION
100664718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
100764718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
100863949Seric #endif
100963949Seric 
101063787Seric /*
101163937Seric **  If no type for argument two of getgroups call is defined, assume
101263937Seric **  it's an integer -- unfortunately, there seem to be several choices
101363937Seric **  here.
101463937Seric */
101563937Seric 
101663937Seric #ifndef GIDSET_T
101763937Seric # define GIDSET_T	int
101863937Seric #endif
101963937Seric 
102064939Seric /*
102164939Seric **  Tweaking for systems that (for example) claim to be BSD but
102264939Seric **  don't have all the standard BSD routines (boo hiss).
102364939Seric */
102464439Seric 
102564939Seric #ifdef titan
102664939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
102764939Seric #endif
102864939Seric 
102965830Seric 
103065167Seric /*
103165167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
103265167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
103365167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
103465167Seric **  are closed.  Some firewalls return this error if you try to connect
103565167Seric **  to the IDENT port (113), so you can't receive email from these hosts
103665167Seric **  on these systems.  The firewall really should use a more specific
103765167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
103865167Seric **  not explicitly set to zero above, default it on.
103965167Seric */
104064939Seric 
104165167Seric #ifndef IDENTPROTO
104265167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
104365167Seric #endif
104465167Seric 
104565211Seric #ifndef HASGETUSERSHELL
104665211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
104765210Seric #endif
104865167Seric 
104965830Seric #ifndef HASFLOCK
105065830Seric # define HASFLOCK	0	/* assume no flock(2) support */
105165830Seric #endif
105265210Seric 
105367430Seric #ifndef HASSETRLIMIT
105467430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
105567430Seric #endif
105667430Seric 
105767430Seric #ifndef HASULIMIT
105867430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
105967430Seric #endif
106067430Seric 
106166843Seric #ifndef OLD_NEWDB
106266843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
106366843Seric #endif
106465830Seric 
106566843Seric 
106664439Seric /**********************************************************************
106759023Seric **  Remaining definitions should never have to be changed.  They are
106859023Seric **  primarily to provide back compatibility for older systems -- for
106959287Seric **  example, it includes some POSIX compatibility definitions
107064439Seric **********************************************************************/
107159023Seric 
107259388Seric /* System 5 compatibility */
107359388Seric #ifndef S_ISREG
107464944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
107559388Seric #endif
107664944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
107764944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
107864944Seric #endif
107959388Seric #ifndef S_IWGRP
108059388Seric #define S_IWGRP		020
108159388Seric #endif
108259388Seric #ifndef S_IWOTH
108359388Seric #define S_IWOTH		002
108459388Seric #endif
108559388Seric 
108659023Seric /*
108750537Seric **  Older systems don't have this error code -- it should be in
108850537Seric **  /usr/include/sysexits.h.
108950537Seric */
109050537Seric 
109150537Seric # ifndef EX_CONFIG
109250537Seric # define EX_CONFIG	78	/* configuration error */
109350537Seric # endif
109456852Seric 
109564718Seric /* pseudo-code used in server SMTP */
109664718Seric # define EX_QUIT	22	/* drop out of server immediately */
109764718Seric 
109864718Seric 
109963993Seric /*
110063993Seric **  These are used in a few cases where we need some special
110163993Seric **  error codes, but where the system doesn't provide something
110263993Seric **  reasonable.  They are printed in errstring.
110363993Seric */
110463993Seric 
110563993Seric #ifndef E_PSEUDOBASE
110663993Seric # define E_PSEUDOBASE	256
110763993Seric #endif
110863993Seric 
110963993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
111063993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
111163993Seric 
111263970Seric /* type of arbitrary pointer */
111363970Seric #ifndef ARBPTR_T
111463970Seric # define ARBPTR_T	void *
111563970Seric #endif
111663970Seric 
111760568Seric #ifndef __P
111860568Seric # include "cdefs.h"
111960568Seric #endif
112060568Seric 
112167421Seric #if NAMED_BIND
112267421Seric # include <arpa/nameser.h>
112367434Seric # ifdef __svr4__
112467434Seric #  ifdef NOERROR
112567434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
112667434Seric #  endif
112767434Seric # endif
112867421Seric #endif
112967421Seric 
113056852Seric /*
113167419Seric **  The size of an IP address -- can't use sizeof because of problems
113267419Seric **  on Crays, where everything is 64 bits.  This will break if/when
113367419Seric **  IP addresses are expanded to eight bytes.
113467419Seric */
113567419Seric 
113667421Seric #ifndef INADDRSZ
113767421Seric # define INADDRSZ	4
113867421Seric #endif
113967419Seric 
114067419Seric /*
114167421Seric **  The size of various known types -- for reading network protocols.
114267421Seric **  Again, we can't use sizeof because of compiler randomness.
114367421Seric */
114467421Seric 
114567421Seric #ifndef INT16SZ
114667421Seric # define INT16SZ	2
114767421Seric #endif
114867421Seric #ifndef INT32SZ
114967421Seric # define INT32SZ	4
115067421Seric #endif
115167421Seric 
115267421Seric /*
115358778Seric **  Do some required dependencies
115458778Seric */
115558778Seric 
115658778Seric #if defined(NETINET) || defined(NETISO)
115759107Seric # define SMTP		1	/* enable user and server SMTP */
115859107Seric # define QUEUE		1	/* enable queueing */
115959107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
116058778Seric #endif
116158778Seric 
116258778Seric 
116358778Seric /*
116456852Seric **  Arrange to use either varargs or stdargs
116556852Seric */
116656852Seric 
116756852Seric # ifdef __STDC__
116856852Seric 
116956852Seric # include <stdarg.h>
117056852Seric 
117156852Seric # define VA_LOCAL_DECL	va_list ap;
117256852Seric # define VA_START(f)	va_start(ap, f)
117356852Seric # define VA_END		va_end(ap)
117456852Seric 
117556852Seric # else
117656852Seric 
117756852Seric # include <varargs.h>
117856852Seric 
117956852Seric # define VA_LOCAL_DECL	va_list ap;
118056852Seric # define VA_START(f)	va_start(ap)
118156852Seric # define VA_END		va_end(ap)
118256852Seric 
118356852Seric # endif
118457631Seric 
118557943Seric #ifdef HASUNAME
118657631Seric # include <sys/utsname.h>
118757631Seric # ifdef newstr
118857631Seric #  undef newstr
118957631Seric # endif
119057943Seric #else /* ! HASUNAME */
119157631Seric # define NODE_LENGTH 32
119257631Seric struct utsname
119357631Seric {
119457631Seric 	char nodename[NODE_LENGTH+1];
119557631Seric };
119657943Seric #endif /* HASUNAME */
119757642Seric 
119867434Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX)
119963838Seric # define MAXHOSTNAMELEN	256
120057735Seric #endif
120158153Seric 
120258153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
120358153Seric # define SIGCHLD	SIGCLD
120458153Seric #endif
120558153Seric 
120658153Seric #ifndef STDIN_FILENO
120758153Seric #define STDIN_FILENO	0
120858153Seric #endif
120958153Seric 
121058153Seric #ifndef STDOUT_FILENO
121158153Seric #define STDOUT_FILENO	1
121258153Seric #endif
121358153Seric 
121458153Seric #ifndef STDERR_FILENO
121558153Seric #define STDERR_FILENO	2
121658153Seric #endif
121758689Seric 
121864072Seric #ifndef LOCK_SH
121964035Seric # define LOCK_SH	0x01	/* shared lock */
122064035Seric # define LOCK_EX	0x02	/* exclusive lock */
122164035Seric # define LOCK_NB	0x04	/* non-blocking lock */
122264035Seric # define LOCK_UN	0x08	/* unlock */
122364035Seric #endif
122458692Seric 
122564035Seric #ifndef SIG_ERR
122664035Seric # define SIG_ERR	((void (*)()) -1)
122758689Seric #endif
122858702Seric 
122964500Seric #ifndef WEXITSTATUS
123064500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
123164500Seric #endif
123264500Seric #ifndef WIFEXITED
123364500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
123464500Seric #endif
123564500Seric 
123664561Seric #ifndef SIGFUNC_DEFINED
123764561Seric typedef void		(*sigfunc_t) __P((int));
123864561Seric #endif
123964561Seric 
124065053Seric /* size of syslog buffer */
124165053Seric #ifndef SYSLOG_BUFSIZE
124265053Seric # define SYSLOG_BUFSIZE	1024
124365053Seric #endif
124465053Seric 
124558702Seric /*
124658702Seric **  Size of tobuf (deliver.c)
124758702Seric **	Tweak this to match your syslog implementation.  It will have to
124858702Seric **	allow for the extra information printed.
124958702Seric */
125058702Seric 
125158702Seric #ifndef TOBUFSIZE
125265053Seric # if (SYSLOG_BUFSIZE) > 512
125365053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
125465053Seric # else
125565053Seric #  define TOBUFSIZE	256
125665053Seric # endif
125758702Seric #endif
125860219Seric 
125965015Seric /*
126065015Seric **  Size of prescan buffer.
126165015Seric **	Despite comments in the _sendmail_ book, this probably should
126265015Seric **	not be changed; there are some hard-to-define dependencies.
126365015Seric */
126465015Seric 
126565015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
126660219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
126760219Seric # ifndef FORK
126860219Seric # define FORK		vfork		/* function to call to fork mailer */
126960219Seric # endif
127065955Seric 
127165955Seric /*
127265955Seric **  If we are going to link scanf anyway, use it in readcf
127365955Seric */
127465955Seric 
127565955Seric #if !defined(HASUNAME) && !defined(SCANF)
127665955Seric # define SCANF		1
127765955Seric #endif
1278