xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 67488)
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*67488Seric  *	@(#)conf.h	8.113 (Berkeley) 07/04/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 
11159348Seric # 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
13565581Seric # endif
13656823Seric 
13764314Seric 
13863902Seric /*
13963902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
14063902Seric */
14163902Seric 
14260224Seric # 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 */
14764494Seric # undef  SETPROCTITLE		/* setproctitle confuses AIX */
14865749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
14960219Seric # endif
15060219Seric 
15164314Seric 
15263902Seric /*
15363902Seric **  Silicon Graphics IRIX
15463902Seric **
15563965Seric **	Compiles on 4.0.1.
15663902Seric */
15763902Seric 
15863753Seric # ifdef IRIX
15966763Seric # define SYSTEM5	1	/* this is a System-V derived system */
16064035Seric # define HASSETREUID	1	/* has setreuid(2) call */
16164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
16265211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
16363753Seric # define FORK		fork	/* no vfork primitive available */
16464562Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
16564155Seric # define setpgid	BSDsetpgrp
16663937Seric # define GIDSET_T	gid_t
16765749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
16866763Seric # define LA_TYPE	LA_INT
16967435Seric # define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
17063753Seric # endif
17163753Seric 
17263902Seric 
17363902Seric /*
17464813Seric **  SunOS and Solaris
17564813Seric **
17664813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
17764813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
17863902Seric */
17963902Seric 
18063787Seric #if defined(sun) && !defined(BSD)
18159074Seric 
18264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
18364813Seric # define HASUNAME	1	/* use System V uname(2) system call */
18465211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
18565749Seric # define LA_TYPE	LA_INT
18660564Seric 
18764842Seric # ifdef SOLARIS_2_3
18864842Seric #  define SOLARIS
18964842Seric # endif
19064842Seric 
19160602Seric # ifdef SOLARIS
19263902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
19365222Seric #  ifndef __svr4__
19465222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
19565222Seric #  endif
19663787Seric #  include <sys/time.h>
19764832Seric #  define gethostbyname	solaris_gethostbyname	/* get working version */
19864832Seric #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
19965172Seric #  define GIDSET_T	gid_t
20065189Seric #  ifndef _PATH_UNIX
20167129Seric #   define _PATH_UNIX	"/dev/ksyms"
20265189Seric #  endif
20363962Seric #  ifndef _PATH_SENDMAILCF
20463962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
20564072Seric #  endif
20664072Seric #  ifndef _PATH_SENDMAILPID
20763962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
20863962Seric #  endif
20966022Seric #  ifndef SYSLOG_BUFSIZE
21066022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
21166022Seric #  endif
21263787Seric 
21360602Seric # else
21465105Seric 			/* SunOS 4.0.3 or 4.1.x */
21565189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
21665830Seric #  ifndef HASFLOCK
21765830Seric #   define HASFLOCK	1	/* has flock(2) call */
21865830Seric #  endif
21965749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
22060564Seric #  include <vfork.h>
22163787Seric 
22265105Seric #  ifdef SUNOS403
22365105Seric 			/* special tweaking for SunOS 4.0.3 */
22465105Seric #   include <malloc.h>
22565105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
22665105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
22765105Seric #   undef WIFEXITED
22865105Seric #   undef WEXITSTATUS
22965105Seric #   undef HASUNAME
23065105Seric #   define setpgid	setpgrp
23165105Seric typedef int		pid_t;
23265105Seric extern char		*getenv();
23365105Seric 
23466732Seric #  else
23566732Seric 			/* 4.1.x specifics */
23666732Seric #   define HASSETSID	1	/* has Posix setsid(2) call */
23766732Seric #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
23866732Seric 
23965105Seric #  endif
24060564Seric # endif
24159023Seric #endif
24259023Seric 
24364718Seric /*
24464813Seric **  DG/UX
24564813Seric **
24667427Seric **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
24767427Seric **	older support.
24867427Seric **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
24964718Seric */
25064314Seric 
25167427Seric #ifdef DGUX_5_4_2
25267427Seric # define DGUX		1
25367427Seric #endif
25467427Seric 
25564718Seric #ifdef	DGUX
25664718Seric # define SYSTEM5	1
25764718Seric # define LA_TYPE	LA_SUBR
25864718Seric # define HASSETREUID	1	/* has setreuid(2) call */
25964718Seric # define HASUNAME	1	/* use System V uname(2) system call */
26064718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
26164718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
26266036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
26365167Seric # ifndef IDENTPROTO
26465167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
26565167Seric # endif
26664718Seric # undef SETPROCTITLE
26765749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
26864813Seric 
26964813Seric /* these include files must be included early on DG/UX */
27064813Seric # include <netinet/in.h>
27164813Seric # include <arpa/inet.h>
27264813Seric 
27367427Seric # ifdef DGUX_5_4_2
27467427Seric #  define inet_addr	dgux_inet_addr
27564718Seric extern long	dgux_inet_addr();
27667427Seric # endif
27764718Seric #endif
27864718Seric 
27964718Seric 
28063902Seric /*
28163902Seric **  Digital Ultrix 4.2A or 4.3
28264264Seric **
28364264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
28464264Seric **	not dropped when the process exits.  This causes major problems,
28564264Seric **	so flock is the only alternative.
28663902Seric */
28763902Seric 
28860564Seric #ifdef ultrix
28964035Seric # define HASSETREUID	1	/* has setreuid(2) call */
29063962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
29164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
29266242Seric # define HASUNAME	1	/* use System V uname(2) system call */
29365830Seric # ifndef HASFLOCK
29465830Seric #  define HASFLOCK	1	/* has flock(2) call */
29565830Seric # endif
29665211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
29766318Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
29865135Seric # ifdef vax
29965135Seric #  define LA_TYPE	LA_FLOAT
30065135Seric # else
30165135Seric #  define LA_TYPE	LA_INT
30265135Seric #  define LA_AVENRUN	"avenrun"
30365135Seric # endif
30465749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
30565167Seric # ifndef IDENTPROTO
30665167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
30765167Seric # endif
30860564Seric #endif
30960564Seric 
31064314Seric 
31163902Seric /*
31263902Seric **  OSF/1 (tested on Alpha)
31363902Seric */
31463902Seric 
31563787Seric #ifdef __osf__
31663962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
31764035Seric # define HASSETREUID	1	/* has setreuid(2) call */
31864035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
31966226Seric # ifndef HASFLOCK
32065830Seric #  define HASFLOCK	1	/* has flock(2) call */
32165830Seric # endif
32263962Seric # define LA_TYPE	LA_INT
32365749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
32464813Seric # ifndef _PATH_SENDMAILPID
32565504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
32664813Seric # endif
32759287Seric #endif
32859287Seric 
32964314Seric 
33063902Seric /*
33163902Seric **  NeXTstep
33263902Seric */
33363902Seric 
33464076Seric #ifdef NeXT
33564035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
33665830Seric # ifndef HASFLOCK
33765830Seric #  define HASFLOCK	1	/* has flock(2) call */
33865830Seric # endif
33964125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
34064563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
34163753Seric # define sleep		sleepX
34264155Seric # define setpgid	setpgrp
34364295Seric # ifndef LA_TYPE
34464295Seric #  define LA_TYPE	LA_MACH
34564295Seric # endif
34665749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
34764500Seric # ifndef _POSIX_SOURCE
34864035Seric typedef int		pid_t;
34964500Seric #  undef WEXITSTATUS
35064500Seric #  undef WIFEXITED
35164500Seric # endif
35264072Seric # ifndef _PATH_SENDMAILCF
35364072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
35464072Seric # endif
35564072Seric # ifndef _PATH_SENDMAILPID
35664072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
35764072Seric # endif
35859288Seric #endif
35959288Seric 
36064314Seric 
36163902Seric /*
36263962Seric **  4.4 BSD
36364831Seric **
36464831Seric **	See also BSD defines.
36563902Seric */
36663902Seric 
36760568Seric #ifdef BSD4_4
36864072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
36960568Seric # include <sys/cdefs.h>
37063838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
37164072Seric # ifndef LA_TYPE
37264072Seric #  define LA_TYPE	LA_SUBR
37364072Seric # endif
37465749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
37560568Seric #endif
37660568Seric 
37764314Seric 
37863902Seric /*
37965982Seric **  BSD/386 (all versions)
38065982Seric **	From Tony Sanders, BSDI
38165982Seric */
38265982Seric 
38365982Seric #ifdef __bsdi__
38465982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
38565982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
38666843Seric # include <sys/cdefs.h>
38766843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
38866030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
38966843Seric # ifndef LA_TYPE
39066843Seric #  define LA_TYPE	LA_SUBR
39166843Seric # endif
39265982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
39366843Seric 			/* version 1.1 or later */
39465982Seric #  define HASSETPROCTITLE 1	/* setproctitle is in libc */
39566732Seric #  undef SETPROCTITLE		/* so don't redefine it in conf.c */
39666843Seric # else
39766843Seric 			/* version 1.0 or earlier */
39866843Seric #  ifndef OLD_NEWDB
39966843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
40066843Seric #  endif
40165982Seric # endif
40265982Seric #endif
40365982Seric 
40465982Seric 
40565982Seric 
40665982Seric /*
40765049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
40864733Seric **
40964733Seric **  4.3BSD clone, closer to 4.4BSD
41064831Seric **
41164831Seric **	See also BSD defines.
41264733Seric */
41364733Seric 
41465049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
41564733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
41664733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
41766754Seric # ifdef __NetBSD__
41866754Seric #  define HASUNAME	1	/* has uname(2) syscall */
41966754Seric # endif
42064733Seric # include <sys/cdefs.h>
42164733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
42264733Seric # ifndef LA_TYPE
42364733Seric #  define LA_TYPE	LA_SUBR
42464733Seric # endif
42565749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
42664733Seric #endif
42764733Seric 
42864733Seric 
42964733Seric /*
43064813Seric **  Mach386
43164813Seric **
43264813Seric **	For mt Xinu's Mach386 system.
43364813Seric */
43464813Seric 
43564813Seric #if defined(MACH) && defined(i386)
43664813Seric # define MACH386	1
43764813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
43864813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
43966226Seric # ifndef HASFLOCK
44065830Seric #  define HASFLOCK	1	/* has flock(2) call */
44165830Seric # endif
44264813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
44364813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
44464813Seric # define setpgid	setpgrp
44564813Seric # ifndef LA_TYPE
44664813Seric #  define LA_TYPE	LA_FLOAT
44764813Seric # endif
44865749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
44964962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
45064813Seric # undef WEXITSTATUS
45164813Seric # undef WIFEXITED
45264813Seric # ifndef _PATH_SENDMAILCF
45364813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
45464813Seric # endif
45564813Seric # ifndef _PATH_SENDMAILPID
45664813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
45764813Seric # endif
45864813Seric #endif
45964813Seric 
46064813Seric 
46164813Seric /*
46263969Seric **  4.3 BSD -- this is for very old systems
46363969Seric **
46465949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
46565949Seric **
46663969Seric **	You'll also have to install a new resolver library.
46763969Seric **	I don't guarantee that support for this environment is complete.
46863969Seric */
46963969Seric 
47065949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
47163969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
47263969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
47363970Seric # define ARBPTR_T	char *
47464155Seric # define setpgid	setpgrp
47563969Seric # ifndef LA_TYPE
47663969Seric #  define LA_TYPE	LA_FLOAT
47763969Seric # endif
47863969Seric # ifndef _PATH_SENDMAILCF
47963969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
48063969Seric # endif
48165167Seric # ifndef IDENTPROTO
48265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
48365167Seric # endif
48464834Seric # undef WEXITSTATUS
48564834Seric # undef WIFEXITED
48664834Seric typedef short		pid_t;
48764834Seric extern int		errno;
48863969Seric #endif
48963969Seric 
49064314Seric 
49163969Seric /*
49263902Seric **  SCO Unix
49365087Seric **
49465087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
49565087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
49665087Seric **	The second is, I believe, for an older version.
49763902Seric */
49863902Seric 
49965087Seric #ifdef _SCO_unix_4_2
50065087Seric # define _SCO_unix_
50165087Seric # define HASSETREUID	1	/* has setreuid(2) call */
50266757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
50365087Seric # define _PATH_UNIX	"/unix"
50465087Seric # ifndef _PATH_SENDMAILCF
50565087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
50665087Seric # endif
50765087Seric # ifndef _PATH_SENDMAILPID
50865087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
50965087Seric # endif
51065087Seric #endif
51165087Seric 
51263838Seric #ifdef _SCO_unix_
51363838Seric # define SYSTEM5	1	/* include all the System V defines */
51464035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
51565212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
51663838Seric # define FORK		fork
51763838Seric # define MAXPATHLEN	PATHSIZE
51864718Seric # define LA_TYPE	LA_SHORT
51965749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
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 
890*67488Seric /*
891*67488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
892*67488Seric **
893*67488Seric **	Tested for 1.04 and 1.03
894*67488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
895*67488Seric */
89667434Seric 
897*67488Seric #ifdef __H3050R
898*67488Seric # define SYSTEM5	1	/* include all the System V defines */
899*67488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
900*67488Seric # define setreuid(r, e)	setresuid(r, e, -1)
901*67488Seric # define LA_TYPE	LA_FLOAT
902*67488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
903*67488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
904*67488Seric # ifndef GIDSET_T
905*67488Seric #  define GIDSET_T	gid_t
906*67488Seric # endif
907*67488Seric # ifndef _PATH_UNIX
908*67488Seric #  define _PATH_UNIX	"/HI-UX"
909*67488Seric # endif
910*67488Seric # ifndef _PATH_SENDMAILCF
911*67488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
912*67488Seric # endif
913*67488Seric # ifndef IDENTPROTO
914*67488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
915*67488Seric # endif
916*67488Seric # ifndef HASGETUSERSHELL
917*67488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
918*67488Seric # endif
919*67488Seric 
920*67488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
921*67488Seric # undef m_flags
922*67488Seric 
923*67488Seric # ifdef __STDC__
924*67488Seric extern int	syslog(int, char *, ...);
925*67488Seric # endif
926*67488Seric 
927*67488Seric #endif
928*67488Seric 
929*67488Seric 
930*67488Seric 
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
95063962Seric #endif
95163962Seric 
95265189Seric /* general System V Release 4 defines */
95365189Seric #ifdef __svr4__
95465189Seric # define SYSTEM5	1
95565189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
95665211Seric # ifndef HASGETUSERSHELL
95765211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
95865210Seric # endif
95965189Seric # define setreuid(r, e)	seteuid(e)
96065189Seric 
96165189Seric # ifndef _PATH_UNIX
96265189Seric #  define _PATH_UNIX		"/unix"
96365189Seric # endif
96465189Seric # ifndef _PATH_SENDMAILCF
96565189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
96665189Seric # endif
96765189Seric # ifndef _PATH_SENDMAILPID
96865189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
96965189Seric # endif
97065189Seric # ifndef SYSLOG_BUFSIZE
97165189Seric #  define SYSLOG_BUFSIZE	128
97265189Seric # endif
97367159Seric # ifndef SFS_TYPE
97467159Seric #  define SFS_TYPE		SFS_STATVFS
97567159Seric # endif
97665189Seric #endif
97765189Seric 
97863787Seric /* general System V defines */
97966298Seric #ifdef SYSTEM5
98064813Seric # include <sys/sysmacros.h>
98163949Seric # define HASUNAME	1	/* use System V uname(2) system call */
98264705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
98364962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
98467430Seric # ifndef HASULIMIT
98567430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
98667430Seric # endif
98763962Seric # ifndef LA_TYPE
98865749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
98963962Seric # endif
99065749Seric # ifndef SFS_TYPE
99165749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
99265749Seric # endif
99363949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
99463949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
99563949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
99666298Seric #endif
99763787Seric 
99863949Seric /* general POSIX defines */
99963949Seric #ifdef _POSIX_VERSION
100064718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
100164718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
100263949Seric #endif
100363949Seric 
100463787Seric /*
100563937Seric **  If no type for argument two of getgroups call is defined, assume
100663937Seric **  it's an integer -- unfortunately, there seem to be several choices
100763937Seric **  here.
100863937Seric */
100963937Seric 
101063937Seric #ifndef GIDSET_T
101163937Seric # define GIDSET_T	int
101263937Seric #endif
101363937Seric 
101464939Seric /*
101564939Seric **  Tweaking for systems that (for example) claim to be BSD but
101664939Seric **  don't have all the standard BSD routines (boo hiss).
101764939Seric */
101864439Seric 
101964939Seric #ifdef titan
102064939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
102164939Seric #endif
102264939Seric 
102365830Seric 
102465167Seric /*
102565167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
102665167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
102765167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
102865167Seric **  are closed.  Some firewalls return this error if you try to connect
102965167Seric **  to the IDENT port (113), so you can't receive email from these hosts
103065167Seric **  on these systems.  The firewall really should use a more specific
103165167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
103265167Seric **  not explicitly set to zero above, default it on.
103365167Seric */
103464939Seric 
103565167Seric #ifndef IDENTPROTO
103665167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
103765167Seric #endif
103865167Seric 
103965211Seric #ifndef HASGETUSERSHELL
104065211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
104165210Seric #endif
104265167Seric 
104365830Seric #ifndef HASFLOCK
104465830Seric # define HASFLOCK	0	/* assume no flock(2) support */
104565830Seric #endif
104665210Seric 
104767430Seric #ifndef HASSETRLIMIT
104867430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
104967430Seric #endif
105067430Seric 
105167430Seric #ifndef HASULIMIT
105267430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
105367430Seric #endif
105467430Seric 
105566843Seric #ifndef OLD_NEWDB
105666843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
105766843Seric #endif
105865830Seric 
105966843Seric 
106064439Seric /**********************************************************************
106159023Seric **  Remaining definitions should never have to be changed.  They are
106259023Seric **  primarily to provide back compatibility for older systems -- for
106359287Seric **  example, it includes some POSIX compatibility definitions
106464439Seric **********************************************************************/
106559023Seric 
106659388Seric /* System 5 compatibility */
106759388Seric #ifndef S_ISREG
106864944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
106959388Seric #endif
107064944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
107164944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
107264944Seric #endif
107359388Seric #ifndef S_IWGRP
107459388Seric #define S_IWGRP		020
107559388Seric #endif
107659388Seric #ifndef S_IWOTH
107759388Seric #define S_IWOTH		002
107859388Seric #endif
107959388Seric 
108059023Seric /*
108150537Seric **  Older systems don't have this error code -- it should be in
108250537Seric **  /usr/include/sysexits.h.
108350537Seric */
108450537Seric 
108550537Seric # ifndef EX_CONFIG
108650537Seric # define EX_CONFIG	78	/* configuration error */
108750537Seric # endif
108856852Seric 
108964718Seric /* pseudo-code used in server SMTP */
109064718Seric # define EX_QUIT	22	/* drop out of server immediately */
109164718Seric 
109264718Seric 
109363993Seric /*
109463993Seric **  These are used in a few cases where we need some special
109563993Seric **  error codes, but where the system doesn't provide something
109663993Seric **  reasonable.  They are printed in errstring.
109763993Seric */
109863993Seric 
109963993Seric #ifndef E_PSEUDOBASE
110063993Seric # define E_PSEUDOBASE	256
110163993Seric #endif
110263993Seric 
110363993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
110463993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
110563993Seric 
110663970Seric /* type of arbitrary pointer */
110763970Seric #ifndef ARBPTR_T
110863970Seric # define ARBPTR_T	void *
110963970Seric #endif
111063970Seric 
111160568Seric #ifndef __P
111260568Seric # include "cdefs.h"
111360568Seric #endif
111460568Seric 
111567421Seric #if NAMED_BIND
111667421Seric # include <arpa/nameser.h>
111767434Seric # ifdef __svr4__
111867434Seric #  ifdef NOERROR
111967434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
112067434Seric #  endif
112167434Seric # endif
112267421Seric #endif
112367421Seric 
112456852Seric /*
112567419Seric **  The size of an IP address -- can't use sizeof because of problems
112667419Seric **  on Crays, where everything is 64 bits.  This will break if/when
112767419Seric **  IP addresses are expanded to eight bytes.
112867419Seric */
112967419Seric 
113067421Seric #ifndef INADDRSZ
113167421Seric # define INADDRSZ	4
113267421Seric #endif
113367419Seric 
113467419Seric /*
113567421Seric **  The size of various known types -- for reading network protocols.
113667421Seric **  Again, we can't use sizeof because of compiler randomness.
113767421Seric */
113867421Seric 
113967421Seric #ifndef INT16SZ
114067421Seric # define INT16SZ	2
114167421Seric #endif
114267421Seric #ifndef INT32SZ
114367421Seric # define INT32SZ	4
114467421Seric #endif
114567421Seric 
114667421Seric /*
114758778Seric **  Do some required dependencies
114858778Seric */
114958778Seric 
115058778Seric #if defined(NETINET) || defined(NETISO)
115159107Seric # define SMTP		1	/* enable user and server SMTP */
115259107Seric # define QUEUE		1	/* enable queueing */
115359107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
115458778Seric #endif
115558778Seric 
115658778Seric 
115758778Seric /*
115856852Seric **  Arrange to use either varargs or stdargs
115956852Seric */
116056852Seric 
116156852Seric # ifdef __STDC__
116256852Seric 
116356852Seric # include <stdarg.h>
116456852Seric 
116556852Seric # define VA_LOCAL_DECL	va_list ap;
116656852Seric # define VA_START(f)	va_start(ap, f)
116756852Seric # define VA_END		va_end(ap)
116856852Seric 
116956852Seric # else
117056852Seric 
117156852Seric # include <varargs.h>
117256852Seric 
117356852Seric # define VA_LOCAL_DECL	va_list ap;
117456852Seric # define VA_START(f)	va_start(ap)
117556852Seric # define VA_END		va_end(ap)
117656852Seric 
117756852Seric # endif
117857631Seric 
117957943Seric #ifdef HASUNAME
118057631Seric # include <sys/utsname.h>
118157631Seric # ifdef newstr
118257631Seric #  undef newstr
118357631Seric # endif
118457943Seric #else /* ! HASUNAME */
118557631Seric # define NODE_LENGTH 32
118657631Seric struct utsname
118757631Seric {
118857631Seric 	char nodename[NODE_LENGTH+1];
118957631Seric };
119057943Seric #endif /* HASUNAME */
119157642Seric 
119267434Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX)
119363838Seric # define MAXHOSTNAMELEN	256
119457735Seric #endif
119558153Seric 
119658153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
119758153Seric # define SIGCHLD	SIGCLD
119858153Seric #endif
119958153Seric 
120058153Seric #ifndef STDIN_FILENO
120158153Seric #define STDIN_FILENO	0
120258153Seric #endif
120358153Seric 
120458153Seric #ifndef STDOUT_FILENO
120558153Seric #define STDOUT_FILENO	1
120658153Seric #endif
120758153Seric 
120858153Seric #ifndef STDERR_FILENO
120958153Seric #define STDERR_FILENO	2
121058153Seric #endif
121158689Seric 
121264072Seric #ifndef LOCK_SH
121364035Seric # define LOCK_SH	0x01	/* shared lock */
121464035Seric # define LOCK_EX	0x02	/* exclusive lock */
121564035Seric # define LOCK_NB	0x04	/* non-blocking lock */
121664035Seric # define LOCK_UN	0x08	/* unlock */
121764035Seric #endif
121858692Seric 
121964035Seric #ifndef SIG_ERR
122064035Seric # define SIG_ERR	((void (*)()) -1)
122158689Seric #endif
122258702Seric 
122364500Seric #ifndef WEXITSTATUS
122464500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
122564500Seric #endif
122664500Seric #ifndef WIFEXITED
122764500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
122864500Seric #endif
122964500Seric 
123064561Seric #ifndef SIGFUNC_DEFINED
123164561Seric typedef void		(*sigfunc_t) __P((int));
123264561Seric #endif
123364561Seric 
123465053Seric /* size of syslog buffer */
123565053Seric #ifndef SYSLOG_BUFSIZE
123665053Seric # define SYSLOG_BUFSIZE	1024
123765053Seric #endif
123865053Seric 
123958702Seric /*
124058702Seric **  Size of tobuf (deliver.c)
124158702Seric **	Tweak this to match your syslog implementation.  It will have to
124258702Seric **	allow for the extra information printed.
124358702Seric */
124458702Seric 
124558702Seric #ifndef TOBUFSIZE
124665053Seric # if (SYSLOG_BUFSIZE) > 512
124765053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
124865053Seric # else
124965053Seric #  define TOBUFSIZE	256
125065053Seric # endif
125158702Seric #endif
125260219Seric 
125365015Seric /*
125465015Seric **  Size of prescan buffer.
125565015Seric **	Despite comments in the _sendmail_ book, this probably should
125665015Seric **	not be changed; there are some hard-to-define dependencies.
125765015Seric */
125865015Seric 
125965015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
126060219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
126160219Seric # ifndef FORK
126260219Seric # define FORK		vfork		/* function to call to fork mailer */
126360219Seric # endif
126465955Seric 
126565955Seric /*
126665955Seric **  If we are going to link scanf anyway, use it in readcf
126765955Seric */
126865955Seric 
126965955Seric #if !defined(HASUNAME) && !defined(SCANF)
127065955Seric # define SCANF		1
127165955Seric #endif
1272