xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 67419)
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*67419Seric  *	@(#)conf.h	8.107 (Berkeley) 06/17/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
16963753Seric # 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 **
24564813Seric **	Tested on 5.4.2
24664718Seric */
24764314Seric 
24864718Seric #ifdef	DGUX
24964718Seric # define SYSTEM5	1
25064718Seric # define LA_TYPE	LA_SUBR
25164718Seric # define HASSETREUID	1	/* has setreuid(2) call */
25264718Seric # define HASUNAME	1	/* use System V uname(2) system call */
25364718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
25464718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
25566036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
25665167Seric # ifndef IDENTPROTO
25765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
25865167Seric # endif
25964718Seric # undef SETPROCTITLE
26065749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
26164813Seric 
26264813Seric /* these include files must be included early on DG/UX */
26364813Seric # include <netinet/in.h>
26464813Seric # include <arpa/inet.h>
26564813Seric 
26664718Seric # define inet_addr	dgux_inet_addr
26764718Seric extern long	dgux_inet_addr();
26864718Seric #endif
26964718Seric 
27064718Seric 
27163902Seric /*
27263902Seric **  Digital Ultrix 4.2A or 4.3
27364264Seric **
27464264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
27564264Seric **	not dropped when the process exits.  This causes major problems,
27664264Seric **	so flock is the only alternative.
27763902Seric */
27863902Seric 
27960564Seric #ifdef ultrix
28064035Seric # define HASSETREUID	1	/* has setreuid(2) call */
28163962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
28264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
28366242Seric # define HASUNAME	1	/* use System V uname(2) system call */
28465830Seric # ifndef HASFLOCK
28565830Seric #  define HASFLOCK	1	/* has flock(2) call */
28665830Seric # endif
28765211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
28866318Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
28965135Seric # ifdef vax
29065135Seric #  define LA_TYPE	LA_FLOAT
29165135Seric # else
29265135Seric #  define LA_TYPE	LA_INT
29365135Seric #  define LA_AVENRUN	"avenrun"
29465135Seric # endif
29565749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
29665167Seric # ifndef IDENTPROTO
29765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
29865167Seric # endif
29960564Seric #endif
30060564Seric 
30164314Seric 
30263902Seric /*
30363902Seric **  OSF/1 (tested on Alpha)
30463902Seric */
30563902Seric 
30663787Seric #ifdef __osf__
30763962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
30864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
30964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
31066226Seric # ifndef HASFLOCK
31165830Seric #  define HASFLOCK	1	/* has flock(2) call */
31265830Seric # endif
31363962Seric # define LA_TYPE	LA_INT
31465749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
31564813Seric # ifndef _PATH_SENDMAILPID
31665504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
31764813Seric # endif
31859287Seric #endif
31959287Seric 
32064314Seric 
32163902Seric /*
32263902Seric **  NeXTstep
32363902Seric */
32463902Seric 
32564076Seric #ifdef NeXT
32664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
32765830Seric # ifndef HASFLOCK
32865830Seric #  define HASFLOCK	1	/* has flock(2) call */
32965830Seric # endif
33064125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
33164563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
33263753Seric # define sleep		sleepX
33364155Seric # define setpgid	setpgrp
33464295Seric # ifndef LA_TYPE
33564295Seric #  define LA_TYPE	LA_MACH
33664295Seric # endif
33765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
33864500Seric # ifndef _POSIX_SOURCE
33964035Seric typedef int		pid_t;
34064500Seric #  undef WEXITSTATUS
34164500Seric #  undef WIFEXITED
34264500Seric # endif
34364072Seric # ifndef _PATH_SENDMAILCF
34464072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
34564072Seric # endif
34664072Seric # ifndef _PATH_SENDMAILPID
34764072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
34864072Seric # endif
34959288Seric #endif
35059288Seric 
35164314Seric 
35263902Seric /*
35363962Seric **  4.4 BSD
35464831Seric **
35564831Seric **	See also BSD defines.
35663902Seric */
35763902Seric 
35860568Seric #ifdef BSD4_4
35964072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
36060568Seric # include <sys/cdefs.h>
36163838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
36264072Seric # ifndef LA_TYPE
36364072Seric #  define LA_TYPE	LA_SUBR
36464072Seric # endif
36565749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
36660568Seric #endif
36760568Seric 
36864314Seric 
36963902Seric /*
37065982Seric **  BSD/386 (all versions)
37165982Seric **	From Tony Sanders, BSDI
37265982Seric */
37365982Seric 
37465982Seric #ifdef __bsdi__
37565982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
37665982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
37766843Seric # include <sys/cdefs.h>
37866843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
37966030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
38066843Seric # ifndef LA_TYPE
38166843Seric #  define LA_TYPE	LA_SUBR
38266843Seric # endif
38365982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
38466843Seric 			/* version 1.1 or later */
38565982Seric #  define HASSETPROCTITLE 1	/* setproctitle is in libc */
38666732Seric #  undef SETPROCTITLE		/* so don't redefine it in conf.c */
38766843Seric # else
38866843Seric 			/* version 1.0 or earlier */
38966843Seric #  ifndef OLD_NEWDB
39066843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
39166843Seric #  endif
39265982Seric # endif
39365982Seric #endif
39465982Seric 
39565982Seric 
39665982Seric 
39765982Seric /*
39865049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
39964733Seric **
40064733Seric **  4.3BSD clone, closer to 4.4BSD
40164831Seric **
40264831Seric **	See also BSD defines.
40364733Seric */
40464733Seric 
40565049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
40664733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
40764733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
40866754Seric # ifdef __NetBSD__
40966754Seric #  define HASUNAME	1	/* has uname(2) syscall */
41066754Seric # endif
41164733Seric # include <sys/cdefs.h>
41264733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
41364733Seric # ifndef LA_TYPE
41464733Seric #  define LA_TYPE	LA_SUBR
41564733Seric # endif
41665749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
41764733Seric #endif
41864733Seric 
41964733Seric 
42064733Seric /*
42164813Seric **  Mach386
42264813Seric **
42364813Seric **	For mt Xinu's Mach386 system.
42464813Seric */
42564813Seric 
42664813Seric #if defined(MACH) && defined(i386)
42764813Seric # define MACH386	1
42864813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
42964813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
43066226Seric # ifndef HASFLOCK
43165830Seric #  define HASFLOCK	1	/* has flock(2) call */
43265830Seric # endif
43364813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
43464813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
43564813Seric # define setpgid	setpgrp
43664813Seric # ifndef LA_TYPE
43764813Seric #  define LA_TYPE	LA_FLOAT
43864813Seric # endif
43965749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
44064962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
44164813Seric # undef WEXITSTATUS
44264813Seric # undef WIFEXITED
44364813Seric # ifndef _PATH_SENDMAILCF
44464813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
44564813Seric # endif
44664813Seric # ifndef _PATH_SENDMAILPID
44764813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
44864813Seric # endif
44964813Seric #endif
45064813Seric 
45164813Seric 
45264813Seric /*
45363969Seric **  4.3 BSD -- this is for very old systems
45463969Seric **
45565949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
45665949Seric **
45763969Seric **	You'll also have to install a new resolver library.
45863969Seric **	I don't guarantee that support for this environment is complete.
45963969Seric */
46063969Seric 
46165949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
46263969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
46363969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
46463970Seric # define ARBPTR_T	char *
46564155Seric # define setpgid	setpgrp
46663969Seric # ifndef LA_TYPE
46763969Seric #  define LA_TYPE	LA_FLOAT
46863969Seric # endif
46963969Seric # ifndef _PATH_SENDMAILCF
47063969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
47163969Seric # endif
47265167Seric # ifndef IDENTPROTO
47365167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
47465167Seric # endif
47564834Seric # undef WEXITSTATUS
47664834Seric # undef WIFEXITED
47764834Seric typedef short		pid_t;
47864834Seric extern int		errno;
47963969Seric #endif
48063969Seric 
48164314Seric 
48263969Seric /*
48363902Seric **  SCO Unix
48465087Seric **
48565087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
48665087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
48765087Seric **	The second is, I believe, for an older version.
48863902Seric */
48963902Seric 
49065087Seric #ifdef _SCO_unix_4_2
49165087Seric # define _SCO_unix_
49265087Seric # define HASSETREUID	1	/* has setreuid(2) call */
49366757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
49465087Seric # define _PATH_UNIX	"/unix"
49565087Seric # ifndef _PATH_SENDMAILCF
49665087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
49765087Seric # endif
49865087Seric # ifndef _PATH_SENDMAILPID
49965087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
50065087Seric # endif
50165087Seric #endif
50265087Seric 
50363838Seric #ifdef _SCO_unix_
50463838Seric # define SYSTEM5	1	/* include all the System V defines */
50564035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
50665212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
50763838Seric # define FORK		fork
50863838Seric # define MAXPATHLEN	PATHSIZE
50964718Seric # define LA_TYPE	LA_SHORT
51065749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
51164813Seric # undef NETUNIX			/* no unix domain socket support */
51263838Seric #endif
51363838Seric 
51464314Seric 
51563962Seric /*
51663962Seric **  ConvexOS 11.0 and later
51765949Seric **
51865949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
51965949Seric **	works on 9.1 as well.
52063962Seric */
52163962Seric 
52263962Seric #ifdef _CONVEX_SOURCE
52363977Seric # define BSD		1	/* include all the BSD defines */
52463977Seric # define HASUNAME	1	/* use System V uname(2) system call */
52563962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
52663977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
52763962Seric # define LA_TYPE	LA_FLOAT
52865749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
52965949Seric # ifndef _PATH_SENDMAILCF
53065949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
53165949Seric # endif
53265949Seric # ifndef S_IREAD
53365949Seric #  define S_IREAD	_S_IREAD
53465949Seric #  define S_IWRITE	_S_IWRITE
53565949Seric #  define S_IEXEC	_S_IEXEC
53665949Seric #  define S_IFMT	_S_IFMT
53765949Seric #  define S_IFCHR	_S_IFCHR
53865949Seric #  define S_IFBLK	_S_IFBLK
53965949Seric # endif
54065167Seric # ifndef IDENTPROTO
54165167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
54265167Seric # endif
54363962Seric #endif
54463962Seric 
54564314Seric 
54663962Seric /*
54764999Seric **  RISC/os 4.52
54863962Seric **
54964999Seric **	Gives a ton of warning messages, but otherwise compiles.
55063962Seric */
55163962Seric 
55263965Seric #ifdef RISCOS
55364999Seric 
55463962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
55566226Seric # ifndef HASFLOCK
55665830Seric #  define HASFLOCK	1	/* has flock(2) call */
55765830Seric # endif
55864999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
55964999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
56063962Seric # define LA_TYPE	LA_INT
56163962Seric # define LA_AVENRUN	"avenrun"
56263962Seric # define _PATH_UNIX	"/unix"
56364999Seric # undef WIFEXITED
56464999Seric 
56564999Seric # define setpgid	setpgrp
56664999Seric 
56764999Seric extern int		errno;
56864999Seric typedef int		pid_t;
56964999Seric #define			SIGFUNC_DEFINED
57064999Seric typedef int		(*sigfunc_t)();
57164999Seric extern char		*getenv();
57264999Seric extern void		*malloc();
57364999Seric 
57463962Seric #endif
57563962Seric 
57664314Seric 
57764155Seric /*
57864155Seric **  Linux 0.99pl10 and above...
57966300Seric **
58066300Seric **  Thanks to, in reverse order of contact:
58166300Seric **
58266300Seric **	John Kennedy <warlock@csuchico.edu>
58366300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
58466300Seric **	Karl London <karl@borg.demon.co.uk>
58566300Seric **
58666300Seric **  Last compiled against:	[03/02/94 @ 05:34 PM (Wednesday)]
58766300Seric **	sendmail 8.6.6.b9	named 4.9.2-931205-p1	db-1.73
58866300Seric **	gcc 2.5.8		libc.so.4.5.19
58966300Seric **	slackware 1.1.2		linux 0.99.15
59064155Seric */
59164155Seric 
59264770Seric #ifdef __linux__
59366298Seric # define BSD		1	/* include BSD defines */
59464155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
59566298Seric # define HASUNAME	1	/* use System V uname(2) system call */
59664380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
59766298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
59866300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
59964155Seric # ifndef LA_TYPE
60066301Seric #  define LA_TYPE	LA_PROCSTR
60164155Seric # endif
60266300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
60364763Seric # include <sys/sysmacros.h>
60466300Seric # undef atol			/* wounded in <stdlib.h> */
60564155Seric #endif
60664155Seric 
60764155Seric 
60864345Seric /*
60964345Seric **  DELL SVR4 Issue 2.2, and others
61064345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
61164345Seric **
61264345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
61364345Seric **	defined, and the definitions conflict.
61464924Seric **
61564924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
61664924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
61764924Seric **	(SVR4.0/386 version 3.0).
61864345Seric */
61964345Seric 
62064345Seric #ifdef DELL_SVR4
62165189Seric 				/* no changes necessary */
62265189Seric 				/* see general __svr4__ defines below */
62364345Seric #endif
62464345Seric 
62564345Seric 
62664380Seric /*
62764380Seric **  Apple A/UX 3.0
62864380Seric */
62964345Seric 
63064380Seric #ifdef _AUX_SOURCE
63164729Seric # include <sys/sysmacros.h>
63264380Seric # define BSD			/* has BSD routines */
63364380Seric # define HASUNAME	1	/* use System V uname(2) system call */
63464380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
63564561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
63665167Seric # ifndef IDENTPROTO
63765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
63865167Seric # endif
63964380Seric # define FORK		fork
64064380Seric # ifndef _PATH_SENDMAILCF
64164380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
64264380Seric # endif
64364380Seric # ifndef LA_TYPE
64464380Seric #  define LA_TYPE	LA_ZERO
64564380Seric # endif
64665749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
64764560Seric # undef WIFEXITED
64864560Seric # undef WEXITSTATUS
64964380Seric #endif
65064380Seric 
65164380Seric 
65264705Seric /*
65364705Seric **  Encore UMAX V
65464705Seric **
65564705Seric **	Not extensively tested.
65664705Seric */
65764380Seric 
65864705Seric #ifdef UMAXV
65964705Seric # include <limits.h>
66064705Seric # define HASUNAME	1	/* use System V uname(2) system call */
66164705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
66264705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
66365211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
66464705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
66564705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
66664705Seric # define FORK		fork	/* no vfork(2) primitive available */
66765749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
66864705Seric # define MAXPATHLEN	PATH_MAX
66964705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
67064705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
67164705Seric # undef WIFEXITED
67264705Seric # undef WEXITSTATUS
67364705Seric #endif
67464705Seric 
67564705Seric 
67664939Seric /*
67764939Seric **  Stardent Titan 3000 running TitanOS 4.2.
67864939Seric **
67964939Seric **	Must be compiled in "cc -43" mode.
68064939Seric **
68164944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
68264939Seric **
68364939Seric **	Note the tweaking below after the BSD defines are set.
68464939Seric */
68564705Seric 
68664939Seric #ifdef titan
68764939Seric # define setpgid	setpgrp
68864939Seric typedef int		pid_t;
68964939Seric # undef WIFEXITED
69064939Seric # undef WEXITSTATUS
69164939Seric #endif
69264939Seric 
69364939Seric 
69464962Seric /*
69564962Seric **  Sequent DYNIX 3.2.0
69664962Seric **
69764962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
69864962Seric */
69964939Seric 
70064962Seric #ifdef sequent
70166038Seric 
70264962Seric # define BSD		1
70364962Seric # define HASUNSETENV	1
70464962Seric # define BSD4_3		1	/* to get signal() in conf.c */
70564962Seric # define WAITUNION	1
70664962Seric # define LA_TYPE	LA_FLOAT
70764962Seric # ifdef	_POSIX_VERSION
70864962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
70964962Seric # endif
71064962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
71164962Seric # define setpgid	setpgrp
71264962Seric 
71364962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
71464962Seric # undef	WIFEXITED
71564962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
71664962Seric 			 ((union wait*)&(s))->w_termsig == 0)
71764962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
71864962Seric typedef int		pid_t;
71964962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
72064962Seric 
72166144Seric # ifndef IDENTPROTO
72266144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
72366144Seric # endif
72466144Seric 
72564962Seric # ifndef _PATH_UNIX
72664962Seric #  define _PATH_UNIX	"/dynix"
72764962Seric # endif
72864962Seric # ifndef _PATH_SENDMAILCF
72964962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
73064962Seric # endif
73164962Seric 
73264962Seric #endif
73364962Seric 
73464962Seric 
73565748Seric /*
73666038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
73766038Seric **
73866038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
73966038Seric **
74066038Seric **	From Tim Wright <timw@sequent.com>.
74166038Seric */
74266038Seric 
74366038Seric #ifdef _SEQUENT_
74466038Seric # define SYSTEM5	1	/* include all the System V defines */
74566038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
74666038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
74766038Seric # define HASSETREUID	1	/* has setreuid(2) call */
74866038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
74966038Seric # define GIDSET_T	gid_t
75066038Seric # define LA_TYPE	LA_INT
75166038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
75266038Seric # undef SETPROCTITLE
75366144Seric # ifndef IDENTPROTO
75466144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
75566144Seric # endif
75666038Seric # ifndef _PATH_SENDMAILCF
75766038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
75866038Seric # endif
75966038Seric # ifndef _PATH_SENDMAILPID
76066038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
76166038Seric # endif
76266038Seric #endif
76366038Seric 
76466038Seric 
76566038Seric /*
76665748Seric **  Cray Unicos
76765748Seric **
76865748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
76965748Seric */
77064962Seric 
77165748Seric #ifdef UNICOS
77265748Seric # define SYSTEM5	1	/* include all the System V defines */
77365748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
77465748Seric # define MAXPATHLEN	PATHSIZE
77565748Seric # define LA_TYPE	LA_ZERO
77665749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
77765748Seric #endif
77864962Seric 
77965748Seric 
78065820Seric /*
78165820Seric **  Apollo DomainOS
78265820Seric **
78365820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
78465982Seric **
78565820Seric **  15 Jan 1994
78665820Seric **
78765820Seric */
78865748Seric 
78965820Seric #ifdef apollo
79065820Seric # define HASSETREUID	1	/* has setreuid(2) call */
79165820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
79265820Seric # undef  SETPROCTITLE
79365820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
79466044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
79565820Seric # ifndef _PATH_SENDMAILCF
79665820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
79765820Seric # endif
79865820Seric # ifndef _PATH_SENDMAILPID
79965820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
80065820Seric # endif
80165820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
80265820Seric # undef  S_IFIFO
80365820Seric # define S_IFIFO	0010000
80465820Seric # ifndef IDENTPROTO
80565820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
80665820Seric # endif
80765982Seric #endif
80865820Seric 
80965820Seric 
81066748Seric /*
81166752Seric **  UnixWare
81266752Seric **
81366752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
81466752Seric */
81566752Seric 
81666752Seric #ifdef UNIXWARE
81766752Seric # define SYSTEM5		1
81866752Seric # ifndef HASGETUSERSHELL
81966752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
82066752Seric # endif
82166752Seric # define GIDSET_T		int
82266752Seric # define SLEEP_T		int
82366752Seric # define SFS_TYPE		SFS_STATVFS
82466752Seric # define LA_TYPE		LA_ZERO
82566752Seric # undef WIFEXITED
82666752Seric # undef WEXITSTATUS
82766752Seric # define _PATH_UNIX		"/unix"
82866752Seric # ifndef _PATH_SENDMAILCF
82966752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
83066752Seric # endif
83166752Seric # ifndef _PATH_SENDMAILPID
83266752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
83366752Seric # endif
83466752Seric # define SYSLOG_BUFSIZE	128
83566752Seric #endif
83666752Seric 
83766752Seric 
83866752Seric /*
83966748Seric **  Intergraph CLIX 3.1
84066748Seric **
84166748Seric **	From Paul Southworth <pauls@locust.cic.net>
84266748Seric */
84365820Seric 
84466748Seric #ifdef CLIX
84566748Seric # define SYSTEM5	1	/* looks like System V */
84666752Seric # ifndef HASGETUSERSHELL
84766752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
84866752Seric # endif
84966748Seric # define DEV_BSIZE	512	/* device block size not defined */
85066748Seric # define GIDSET_T	gid_t
85166748Seric # undef LOG			/* syslog not available */
85266748Seric # define NEEDFSYNC	1	/* no fsync in system library */
85366748Seric # define GETSHORT	_getshort
85466748Seric #endif
85565820Seric 
85666748Seric 
85766776Seric /*
85866776Seric **  NCR 3000 Series (SysVr4)
85966776Seric **
86066776Seric **	From From: Kevin Darcy <kevin@tech.mis.cfc.com>.
86166776Seric */
86266748Seric 
86366776Seric #ifdef NCR3000
86466776Seric # define __svr4__
86566776Seric # undef BSD
86666776Seric # define LA_AVENRUN	"avenrun"
86766776Seric #endif
86866776Seric 
86966748Seric 
87066776Seric 
87166776Seric 
87266776Seric 
87363902Seric /**********************************************************************
87463787Seric **  End of Per-Operating System defines
87563902Seric **********************************************************************/
87663787Seric 
87763949Seric /**********************************************************************
87863949Seric **  More general defines
87963949Seric **********************************************************************/
88063949Seric 
88163962Seric /* general BSD defines */
88263962Seric #ifdef BSD
88364035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
88464035Seric # define HASSETREUID	1	/* has setreuid(2) call */
88564035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
88665830Seric # ifndef HASFLOCK
88765830Seric #  define HASFLOCK	1	/* has flock(2) call */
88865830Seric # endif
88963962Seric #endif
89063962Seric 
89165189Seric /* general System V Release 4 defines */
89265189Seric #ifdef __svr4__
89365189Seric # define SYSTEM5	1
89465189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
89565211Seric # ifndef HASGETUSERSHELL
89665211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
89765210Seric # endif
89865189Seric # define setreuid(r, e)	seteuid(e)
89965189Seric 
90065189Seric # ifndef _PATH_UNIX
90165189Seric #  define _PATH_UNIX		"/unix"
90265189Seric # endif
90365189Seric # ifndef _PATH_SENDMAILCF
90465189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
90565189Seric # endif
90665189Seric # ifndef _PATH_SENDMAILPID
90765189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
90865189Seric # endif
90965189Seric # ifndef SYSLOG_BUFSIZE
91065189Seric #  define SYSLOG_BUFSIZE	128
91165189Seric # endif
91267159Seric # ifndef SFS_TYPE
91367159Seric #  define SFS_TYPE		SFS_STATVFS
91467159Seric # endif
91565189Seric #endif
91665189Seric 
91763787Seric /* general System V defines */
91866298Seric #ifdef SYSTEM5
91964813Seric # include <sys/sysmacros.h>
92063949Seric # define HASUNAME	1	/* use System V uname(2) system call */
92164705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
92264962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
92363962Seric # ifndef LA_TYPE
92465749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
92563962Seric # endif
92665749Seric # ifndef SFS_TYPE
92765749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
92865749Seric # endif
92963949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
93063949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
93163949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
93266298Seric #endif
93363787Seric 
93463949Seric /* general POSIX defines */
93563949Seric #ifdef _POSIX_VERSION
93664718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
93764718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
93863949Seric #endif
93963949Seric 
94063787Seric /*
94163937Seric **  If no type for argument two of getgroups call is defined, assume
94263937Seric **  it's an integer -- unfortunately, there seem to be several choices
94363937Seric **  here.
94463937Seric */
94563937Seric 
94663937Seric #ifndef GIDSET_T
94763937Seric # define GIDSET_T	int
94863937Seric #endif
94963937Seric 
95064939Seric /*
95164939Seric **  Tweaking for systems that (for example) claim to be BSD but
95264939Seric **  don't have all the standard BSD routines (boo hiss).
95364939Seric */
95464439Seric 
95564939Seric #ifdef titan
95664939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
95764939Seric #endif
95864939Seric 
95965830Seric 
96065167Seric /*
96165167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
96265167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
96365167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
96465167Seric **  are closed.  Some firewalls return this error if you try to connect
96565167Seric **  to the IDENT port (113), so you can't receive email from these hosts
96665167Seric **  on these systems.  The firewall really should use a more specific
96765167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
96865167Seric **  not explicitly set to zero above, default it on.
96965167Seric */
97064939Seric 
97165167Seric #ifndef IDENTPROTO
97265167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
97365167Seric #endif
97465167Seric 
97565211Seric #ifndef HASGETUSERSHELL
97665211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
97765210Seric #endif
97865167Seric 
97965830Seric #ifndef HASFLOCK
98065830Seric # define HASFLOCK	0	/* assume no flock(2) support */
98165830Seric #endif
98265210Seric 
98366843Seric #ifndef OLD_NEWDB
98466843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
98566843Seric #endif
98665830Seric 
98766843Seric 
98864439Seric /**********************************************************************
98959023Seric **  Remaining definitions should never have to be changed.  They are
99059023Seric **  primarily to provide back compatibility for older systems -- for
99159287Seric **  example, it includes some POSIX compatibility definitions
99264439Seric **********************************************************************/
99359023Seric 
99459388Seric /* System 5 compatibility */
99559388Seric #ifndef S_ISREG
99664944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
99759388Seric #endif
99864944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
99964944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
100064944Seric #endif
100159388Seric #ifndef S_IWGRP
100259388Seric #define S_IWGRP		020
100359388Seric #endif
100459388Seric #ifndef S_IWOTH
100559388Seric #define S_IWOTH		002
100659388Seric #endif
100759388Seric 
100859023Seric /*
100950537Seric **  Older systems don't have this error code -- it should be in
101050537Seric **  /usr/include/sysexits.h.
101150537Seric */
101250537Seric 
101350537Seric # ifndef EX_CONFIG
101450537Seric # define EX_CONFIG	78	/* configuration error */
101550537Seric # endif
101656852Seric 
101764718Seric /* pseudo-code used in server SMTP */
101864718Seric # define EX_QUIT	22	/* drop out of server immediately */
101964718Seric 
102064718Seric 
102163993Seric /*
102263993Seric **  These are used in a few cases where we need some special
102363993Seric **  error codes, but where the system doesn't provide something
102463993Seric **  reasonable.  They are printed in errstring.
102563993Seric */
102663993Seric 
102763993Seric #ifndef E_PSEUDOBASE
102863993Seric # define E_PSEUDOBASE	256
102963993Seric #endif
103063993Seric 
103163993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
103263993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
103363993Seric 
103463970Seric /* type of arbitrary pointer */
103563970Seric #ifndef ARBPTR_T
103663970Seric # define ARBPTR_T	void *
103763970Seric #endif
103863970Seric 
103960568Seric #ifndef __P
104060568Seric # include "cdefs.h"
104160568Seric #endif
104260568Seric 
104356852Seric /*
1044*67419Seric **  The size of an IP address -- can't use sizeof because of problems
1045*67419Seric **  on Crays, where everything is 64 bits.  This will break if/when
1046*67419Seric **  IP addresses are expanded to eight bytes.
1047*67419Seric */
1048*67419Seric 
1049*67419Seric #define IPADDRSIZE	4
1050*67419Seric 
1051*67419Seric /*
105258778Seric **  Do some required dependencies
105358778Seric */
105458778Seric 
105558778Seric #if defined(NETINET) || defined(NETISO)
105659107Seric # define SMTP		1	/* enable user and server SMTP */
105759107Seric # define QUEUE		1	/* enable queueing */
105859107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
105958778Seric #endif
106058778Seric 
106158778Seric 
106258778Seric /*
106356852Seric **  Arrange to use either varargs or stdargs
106456852Seric */
106556852Seric 
106656852Seric # ifdef __STDC__
106756852Seric 
106856852Seric # include <stdarg.h>
106956852Seric 
107056852Seric # define VA_LOCAL_DECL	va_list ap;
107156852Seric # define VA_START(f)	va_start(ap, f)
107256852Seric # define VA_END		va_end(ap)
107356852Seric 
107456852Seric # else
107556852Seric 
107656852Seric # include <varargs.h>
107756852Seric 
107856852Seric # define VA_LOCAL_DECL	va_list ap;
107956852Seric # define VA_START(f)	va_start(ap)
108056852Seric # define VA_END		va_end(ap)
108156852Seric 
108256852Seric # endif
108357631Seric 
108457943Seric #ifdef HASUNAME
108557631Seric # include <sys/utsname.h>
108657631Seric # ifdef newstr
108757631Seric #  undef newstr
108857631Seric # endif
108957943Seric #else /* ! HASUNAME */
109057631Seric # define NODE_LENGTH 32
109157631Seric struct utsname
109257631Seric {
109357631Seric 	char nodename[NODE_LENGTH+1];
109457631Seric };
109557943Seric #endif /* HASUNAME */
109657642Seric 
109763838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
109863838Seric # define MAXHOSTNAMELEN	256
109957735Seric #endif
110058153Seric 
110158153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
110258153Seric # define SIGCHLD	SIGCLD
110358153Seric #endif
110458153Seric 
110558153Seric #ifndef STDIN_FILENO
110658153Seric #define STDIN_FILENO	0
110758153Seric #endif
110858153Seric 
110958153Seric #ifndef STDOUT_FILENO
111058153Seric #define STDOUT_FILENO	1
111158153Seric #endif
111258153Seric 
111358153Seric #ifndef STDERR_FILENO
111458153Seric #define STDERR_FILENO	2
111558153Seric #endif
111658689Seric 
111764072Seric #ifndef LOCK_SH
111864035Seric # define LOCK_SH	0x01	/* shared lock */
111964035Seric # define LOCK_EX	0x02	/* exclusive lock */
112064035Seric # define LOCK_NB	0x04	/* non-blocking lock */
112164035Seric # define LOCK_UN	0x08	/* unlock */
112264035Seric #endif
112358692Seric 
112464035Seric #ifndef SIG_ERR
112564035Seric # define SIG_ERR	((void (*)()) -1)
112658689Seric #endif
112758702Seric 
112864500Seric #ifndef WEXITSTATUS
112964500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
113064500Seric #endif
113164500Seric #ifndef WIFEXITED
113264500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
113364500Seric #endif
113464500Seric 
113564561Seric #ifndef SIGFUNC_DEFINED
113664561Seric typedef void		(*sigfunc_t) __P((int));
113764561Seric #endif
113864561Seric 
113965053Seric /* size of syslog buffer */
114065053Seric #ifndef SYSLOG_BUFSIZE
114165053Seric # define SYSLOG_BUFSIZE	1024
114265053Seric #endif
114365053Seric 
114458702Seric /*
114558702Seric **  Size of tobuf (deliver.c)
114658702Seric **	Tweak this to match your syslog implementation.  It will have to
114758702Seric **	allow for the extra information printed.
114858702Seric */
114958702Seric 
115058702Seric #ifndef TOBUFSIZE
115165053Seric # if (SYSLOG_BUFSIZE) > 512
115265053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
115365053Seric # else
115465053Seric #  define TOBUFSIZE	256
115565053Seric # endif
115658702Seric #endif
115760219Seric 
115865015Seric /*
115965015Seric **  Size of prescan buffer.
116065015Seric **	Despite comments in the _sendmail_ book, this probably should
116165015Seric **	not be changed; there are some hard-to-define dependencies.
116265015Seric */
116365015Seric 
116465015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
116560219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
116660219Seric # ifndef FORK
116760219Seric # define FORK		vfork		/* function to call to fork mailer */
116860219Seric # endif
116965955Seric 
117065955Seric /*
117165955Seric **  If we are going to link scanf anyway, use it in readcf
117265955Seric */
117365955Seric 
117465955Seric #if !defined(HASUNAME) && !defined(SCANF)
117565955Seric # define SCANF		1
117665955Seric #endif
1177