xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 66030)
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*66030Seric  *	@(#)conf.h	8.85 (Berkeley) 02/08/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 */
5735651Seric # define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
5853735Seric # define MATCHGECOS	1	/* match user names from gecos field */
5963753Seric # define XDEBUG		1	/* enable extended debugging */
6036483Sbostic 
6156337Seric # ifdef NEWDB
6256337Seric # define USERDB		1	/* look in user database (requires NEWDB) */
6356337Seric # endif
6456337Seric 
6564032Seric /*
6664944Seric **  Most systems have symbolic links today, so default them on.  You
6764944Seric **  can turn them off by #undef'ing this below.
6864944Seric */
6964944Seric 
7064944Seric # define HASLSTAT	1	/* has lstat(2) call */
7164944Seric 
7264962Seric /*
7364962Seric **  General "standard C" defines.
7464962Seric **
7564962Seric **	These may be undone later, to cope with systems that claim to
7664962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
7764962Seric **	doesn't realize that the library is part of the language.
7864962Seric **
7964962Seric **	Life would be much easier if we could get rid of this sort
8064962Seric **	of bozo problems.
8164962Seric */
8264962Seric 
8364962Seric #ifdef __STDC__
8464962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
8564962Seric #endif
8664962Seric 
8763902Seric /**********************************************************************
8859023Seric **  Operating system configuration.
8959023Seric **
9059023Seric **	Unless you are porting to a new OS, you shouldn't have to
9159023Seric **	change these.
9263902Seric **********************************************************************/
9356823Seric 
9463787Seric /*
9563787Seric **  Per-Operating System defines
9663787Seric */
9763787Seric 
9864314Seric 
9963902Seric /*
10065565Seric **  HP-UX -- tested for 8.07, 9.00, and 9.01.
10163902Seric */
10263902Seric 
10359348Seric # ifdef __hpux
10464727Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
10564727Seric # undef m_flags
10663787Seric # define SYSTEM5	1	/* include all the System V defines */
10764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
10864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
10965982Seric # define setreuid(r, e)		setresuid(r, e, -1)
11063962Seric # define LA_TYPE	LA_FLOAT
11165749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
11265354Seric # define GIDSET_T	gid_t
11363962Seric # define _PATH_UNIX	"/hp-ux"
11465354Seric # ifndef _PATH_SENDMAILCF
11565354Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
11665354Seric # endif
11765167Seric # ifndef IDENTPROTO
11865167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
11956823Seric # endif
12065581Seric # ifndef HASGETUSERSHELL
12165581Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
12265581Seric # endif
12365504Seric # define syslog		hard_syslog
12465581Seric # ifdef __STDC__
12565581Seric extern int	syslog(int, char *, ...);
12665167Seric # endif
12765581Seric # endif
12856823Seric 
12964314Seric 
13063902Seric /*
13163902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
13263902Seric */
13363902Seric 
13460224Seric # ifdef _AIX3
13564035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
13664840Seric # define HASUNAME	1	/* use System V uname(2) system call */
13765211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
13860219Seric # define FORK		fork	/* no vfork primitive available */
13964494Seric # undef  SETPROCTITLE		/* setproctitle confuses AIX */
14065749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
14160219Seric # endif
14260219Seric 
14364314Seric 
14463902Seric /*
14563902Seric **  Silicon Graphics IRIX
14663902Seric **
14763965Seric **	Compiles on 4.0.1.
14863902Seric */
14963902Seric 
15063753Seric # ifdef IRIX
15164727Seric # include <sys/sysmacros.h>
15264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
15364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
15465211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
15563753Seric # define FORK		fork	/* no vfork primitive available */
15664562Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
15764155Seric # define setpgid	BSDsetpgrp
15863937Seric # define GIDSET_T	gid_t
15965749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
16063753Seric # endif
16163753Seric 
16263902Seric 
16363902Seric /*
16464813Seric **  SunOS and Solaris
16564813Seric **
16664813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
16764813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
16863902Seric */
16963902Seric 
17063787Seric #if defined(sun) && !defined(BSD)
17159074Seric 
17264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
17364813Seric # define HASUNAME	1	/* use System V uname(2) system call */
17465211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
17565749Seric # define LA_TYPE	LA_INT
17660564Seric 
17764842Seric # ifdef SOLARIS_2_3
17864842Seric #  define SOLARIS
17964842Seric # endif
18064842Seric 
18160602Seric # ifdef SOLARIS
18263902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
18365222Seric #  ifndef __svr4__
18465222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
18565222Seric #  endif
18663787Seric #  include <sys/time.h>
18764832Seric #  define gethostbyname	solaris_gethostbyname	/* get working version */
18864832Seric #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
18965172Seric #  define GIDSET_T	gid_t
19065189Seric #  ifndef _PATH_UNIX
19165189Seric #   define _PATH_UNIX	"/kernel/unix"
19265189Seric #  endif
19363962Seric #  ifndef _PATH_SENDMAILCF
19463962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
19564072Seric #  endif
19664072Seric #  ifndef _PATH_SENDMAILPID
19763962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
19863962Seric #  endif
19966022Seric #  ifndef SYSLOG_BUFSIZE
20066022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
20166022Seric #  endif
20263787Seric 
20360602Seric # else
20465105Seric 			/* SunOS 4.0.3 or 4.1.x */
20565189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
20665830Seric #  ifndef HASFLOCK
20765830Seric #   define HASFLOCK	1	/* has flock(2) call */
20865830Seric #  endif
20965749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
21060564Seric #  include <vfork.h>
21163787Seric 
21265105Seric #  ifdef SUNOS403
21365105Seric 			/* special tweaking for SunOS 4.0.3 */
21465105Seric #   include <malloc.h>
21565105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
21665105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
21765105Seric #   undef WIFEXITED
21865105Seric #   undef WEXITSTATUS
21965105Seric #   undef HASUNAME
22065105Seric #   define setpgid	setpgrp
22165105Seric typedef int		pid_t;
22265105Seric extern char		*getenv();
22365105Seric 
22465105Seric #  endif
22560564Seric # endif
22659023Seric #endif
22759023Seric 
22864718Seric /*
22964813Seric **  DG/UX
23064813Seric **
23164813Seric **	Tested on 5.4.2
23264718Seric */
23364314Seric 
23464718Seric #ifdef	DGUX
23564718Seric # define SYSTEM5	1
23664718Seric # define LA_TYPE	LA_SUBR
23764718Seric # define HASSETREUID	1	/* has setreuid(2) call */
23864718Seric # define HASUNAME	1	/* use System V uname(2) system call */
23964718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
24064718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
24165167Seric # ifndef IDENTPROTO
24265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
24365167Seric # endif
24464718Seric # undef SETPROCTITLE
24565749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
24664813Seric 
24764813Seric /* these include files must be included early on DG/UX */
24864813Seric # include <netinet/in.h>
24964813Seric # include <arpa/inet.h>
25064813Seric 
25164718Seric # define inet_addr	dgux_inet_addr
25264718Seric extern long	dgux_inet_addr();
25364718Seric #endif
25464718Seric 
25564718Seric 
25663902Seric /*
25763902Seric **  Digital Ultrix 4.2A or 4.3
25864264Seric **
25964264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
26064264Seric **	not dropped when the process exits.  This causes major problems,
26164264Seric **	so flock is the only alternative.
26263902Seric */
26363902Seric 
26460564Seric #ifdef ultrix
26564035Seric # define HASSETREUID	1	/* has setreuid(2) call */
26663962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
26764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
26865830Seric # ifndef HASFLOCK
26965830Seric #  define HASFLOCK	1	/* has flock(2) call */
27065830Seric # endif
27165211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
27265135Seric # ifdef vax
27365135Seric #  define LA_TYPE	LA_FLOAT
27465135Seric # else
27565135Seric #  define LA_TYPE	LA_INT
27665135Seric #  define LA_AVENRUN	"avenrun"
27765135Seric # endif
27865749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
27965167Seric # ifndef IDENTPROTO
28065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
28165167Seric # endif
28260564Seric #endif
28360564Seric 
28464314Seric 
28563902Seric /*
28663902Seric **  OSF/1 (tested on Alpha)
28763902Seric */
28863902Seric 
28963787Seric #ifdef __osf__
29063962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
29164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
29264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
29365830Seric # ifdef HASFLOCK
29465830Seric #  define HASFLOCK	1	/* has flock(2) call */
29565830Seric # endif
29663962Seric # define LA_TYPE	LA_INT
29765749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
29864813Seric # ifndef _PATH_SENDMAILPID
29965504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
30064813Seric # endif
30159287Seric #endif
30259287Seric 
30364314Seric 
30463902Seric /*
30563902Seric **  NeXTstep
30663902Seric */
30763902Seric 
30864076Seric #ifdef NeXT
30964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
31065830Seric # ifndef HASFLOCK
31165830Seric #  define HASFLOCK	1	/* has flock(2) call */
31265830Seric # endif
31364125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
31464563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
31563753Seric # define sleep		sleepX
31664155Seric # define setpgid	setpgrp
31764295Seric # ifndef LA_TYPE
31864295Seric #  define LA_TYPE	LA_MACH
31964295Seric # endif
32065749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
32164500Seric # ifndef _POSIX_SOURCE
32264035Seric typedef int		pid_t;
32364500Seric #  undef WEXITSTATUS
32464500Seric #  undef WIFEXITED
32564500Seric # endif
32664072Seric # ifndef _PATH_SENDMAILCF
32764072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
32864072Seric # endif
32964072Seric # ifndef _PATH_SENDMAILPID
33064072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
33164072Seric # endif
33259288Seric #endif
33359288Seric 
33464314Seric 
33563902Seric /*
33663962Seric **  4.4 BSD
33764831Seric **
33864831Seric **	See also BSD defines.
33963902Seric */
34063902Seric 
34160568Seric #ifdef BSD4_4
34264072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
34360568Seric # include <sys/cdefs.h>
34463838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
34564072Seric # ifndef LA_TYPE
34664072Seric #  define LA_TYPE	LA_SUBR
34764072Seric # endif
34865749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
34960568Seric #endif
35060568Seric 
35164314Seric 
35263902Seric /*
35365982Seric **  BSD/386 (all versions)
35465982Seric **	From Tony Sanders, BSDI
35565982Seric */
35665982Seric 
35765982Seric #ifdef __bsdi__
35865982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
35965982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
360*66030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
36165982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
36265982Seric #  define HASSETPROCTITLE 1	/* setproctitle is in libc */
36365982Seric # else
36465982Seric #  define SETPROCTITLE	1
36565982Seric # endif
36665982Seric # include <sys/cdefs.h>
36765982Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
36865982Seric # ifndef LA_TYPE
36965982Seric #  define LA_TYPE	LA_SUBR
37065982Seric # endif
37165982Seric #endif
37265982Seric 
37365982Seric 
37465982Seric 
37565982Seric /*
37665049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
37764733Seric **
37864733Seric **  4.3BSD clone, closer to 4.4BSD
37964831Seric **
38064831Seric **	See also BSD defines.
38164733Seric */
38264733Seric 
38365049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
38464733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
38564733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
38664733Seric # include <sys/cdefs.h>
38764733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
38864733Seric # ifndef LA_TYPE
38964733Seric #  define LA_TYPE	LA_SUBR
39064733Seric # endif
39165749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
39264733Seric #endif
39364733Seric 
39464733Seric 
39564733Seric /*
39664813Seric **  Mach386
39764813Seric **
39864813Seric **	For mt Xinu's Mach386 system.
39964813Seric */
40064813Seric 
40164813Seric #if defined(MACH) && defined(i386)
40264813Seric # define MACH386	1
40364813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
40464813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
40565830Seric # ifdef HASFLOCK
40665830Seric #  define HASFLOCK	1	/* has flock(2) call */
40765830Seric # endif
40864813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
40964813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
41064813Seric # define setpgid	setpgrp
41164813Seric # ifndef LA_TYPE
41264813Seric #  define LA_TYPE	LA_FLOAT
41364813Seric # endif
41465749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
41564962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
41664813Seric # undef WEXITSTATUS
41764813Seric # undef WIFEXITED
41864813Seric # ifndef _PATH_SENDMAILCF
41964813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
42064813Seric # endif
42164813Seric # ifndef _PATH_SENDMAILPID
42264813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
42364813Seric # endif
42464813Seric #endif
42564813Seric 
42664813Seric 
42764813Seric /*
42863969Seric **  4.3 BSD -- this is for very old systems
42963969Seric **
43065949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
43165949Seric **
43263969Seric **	You'll also have to install a new resolver library.
43363969Seric **	I don't guarantee that support for this environment is complete.
43463969Seric */
43563969Seric 
43665949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
43763969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
43863969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
43963970Seric # define ARBPTR_T	char *
44064155Seric # define setpgid	setpgrp
44163969Seric # ifndef LA_TYPE
44263969Seric #  define LA_TYPE	LA_FLOAT
44363969Seric # endif
44463969Seric # ifndef _PATH_SENDMAILCF
44563969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
44663969Seric # endif
44765167Seric # ifndef IDENTPROTO
44865167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
44965167Seric # endif
45064834Seric # undef WEXITSTATUS
45164834Seric # undef WIFEXITED
45264834Seric typedef short		pid_t;
45364834Seric extern int		errno;
45463969Seric #endif
45563969Seric 
45664314Seric 
45763969Seric /*
45863902Seric **  SCO Unix
45965087Seric **
46065087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
46165087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
46265087Seric **	The second is, I believe, for an older version.
46363902Seric */
46463902Seric 
46565087Seric #ifdef _SCO_unix_4_2
46665087Seric # define _SCO_unix_
46765087Seric # define HASSETREUID	1	/* has setreuid(2) call */
46865087Seric # define _PATH_UNIX	"/unix"
46965087Seric # ifndef _PATH_SENDMAILCF
47065087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
47165087Seric # endif
47265087Seric # ifndef _PATH_SENDMAILPID
47365087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
47465087Seric # endif
47565087Seric #endif
47665087Seric 
47763838Seric #ifdef _SCO_unix_
47863838Seric # define SYSTEM5	1	/* include all the System V defines */
47964035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
48065212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
48163838Seric # define FORK		fork
48263838Seric # define MAXPATHLEN	PATHSIZE
48364718Seric # define LA_TYPE	LA_SHORT
48465749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
48564813Seric # undef NETUNIX			/* no unix domain socket support */
48663838Seric #endif
48763838Seric 
48864314Seric 
48963962Seric /*
49063962Seric **  ConvexOS 11.0 and later
49165949Seric **
49265949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
49365949Seric **	works on 9.1 as well.
49463962Seric */
49563962Seric 
49663962Seric #ifdef _CONVEX_SOURCE
49763977Seric # define BSD		1	/* include all the BSD defines */
49863977Seric # define HASUNAME	1	/* use System V uname(2) system call */
49963962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
50063977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
50163962Seric # define LA_TYPE	LA_FLOAT
50265749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
50365949Seric # ifndef _PATH_SENDMAILCF
50465949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
50565949Seric # endif
50665949Seric # ifndef S_IREAD
50765949Seric #  define S_IREAD	_S_IREAD
50865949Seric #  define S_IWRITE	_S_IWRITE
50965949Seric #  define S_IEXEC	_S_IEXEC
51065949Seric #  define S_IFMT	_S_IFMT
51165949Seric #  define S_IFCHR	_S_IFCHR
51265949Seric #  define S_IFBLK	_S_IFBLK
51365949Seric # endif
51465167Seric # ifndef IDENTPROTO
51565167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
51665167Seric # endif
51763962Seric #endif
51863962Seric 
51964314Seric 
52063962Seric /*
52164999Seric **  RISC/os 4.52
52263962Seric **
52364999Seric **	Gives a ton of warning messages, but otherwise compiles.
52463962Seric */
52563962Seric 
52663965Seric #ifdef RISCOS
52764999Seric 
52863962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
52965830Seric # ifdef HASFLOCK
53065830Seric #  define HASFLOCK	1	/* has flock(2) call */
53165830Seric # endif
53264999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
53364999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
53463962Seric # define LA_TYPE	LA_INT
53563962Seric # define LA_AVENRUN	"avenrun"
53663962Seric # define _PATH_UNIX	"/unix"
53764999Seric # undef WIFEXITED
53864999Seric 
53964999Seric # define setpgid	setpgrp
54064999Seric 
54164999Seric extern int		errno;
54264999Seric typedef int		pid_t;
54364999Seric #define			SIGFUNC_DEFINED
54464999Seric typedef int		(*sigfunc_t)();
54564999Seric extern char		*getenv();
54664999Seric extern void		*malloc();
54764999Seric 
54863962Seric #endif
54963962Seric 
55064314Seric 
55164155Seric /*
55264155Seric **  Linux 0.99pl10 and above...
55364155Seric **	From Karl London <karl@borg.demon.co.uk>.
55464155Seric */
55564155Seric 
55664770Seric #ifdef __linux__
55764155Seric # define BSD		1	/* pretend to be BSD based today */
55864155Seric # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
55964155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
56064380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
56164155Seric # ifndef LA_TYPE
56264155Seric #  define LA_TYPE	LA_FLOAT
56364155Seric # endif
56464763Seric # include <sys/sysmacros.h>
56565046Seric # define GIDSET_T	gid_t
56664155Seric #endif
56764155Seric 
56864155Seric 
56964345Seric /*
57064345Seric **  DELL SVR4 Issue 2.2, and others
57164345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
57264345Seric **
57364345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
57464345Seric **	defined, and the definitions conflict.
57564924Seric **
57664924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
57764924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
57864924Seric **	(SVR4.0/386 version 3.0).
57964345Seric */
58064345Seric 
58164345Seric #ifdef DELL_SVR4
58265189Seric 				/* no changes necessary */
58365189Seric 				/* see general __svr4__ defines below */
58464345Seric #endif
58564345Seric 
58664345Seric 
58764380Seric /*
58864380Seric **  Apple A/UX 3.0
58964380Seric */
59064345Seric 
59164380Seric #ifdef _AUX_SOURCE
59264729Seric # include <sys/sysmacros.h>
59364380Seric # define BSD			/* has BSD routines */
59464380Seric # define HASUNAME	1	/* use System V uname(2) system call */
59564380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
59664561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
59765167Seric # ifndef IDENTPROTO
59865167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
59965167Seric # endif
60064380Seric # define FORK		fork
60164380Seric # ifndef _PATH_SENDMAILCF
60264380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
60364380Seric # endif
60464380Seric # ifndef LA_TYPE
60564380Seric #  define LA_TYPE	LA_ZERO
60664380Seric # endif
60765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
60864560Seric # undef WIFEXITED
60964560Seric # undef WEXITSTATUS
61064380Seric #endif
61164380Seric 
61264380Seric 
61364705Seric /*
61464705Seric **  Encore UMAX V
61564705Seric **
61664705Seric **	Not extensively tested.
61764705Seric */
61864380Seric 
61964705Seric #ifdef UMAXV
62064705Seric # include <limits.h>
62164705Seric # define HASUNAME	1	/* use System V uname(2) system call */
62264705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
62364705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
62465211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
62564705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
62664705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
62764705Seric # define FORK		fork	/* no vfork(2) primitive available */
62865749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
62964705Seric # define MAXPATHLEN	PATH_MAX
63064705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
63164705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
63264705Seric # undef WIFEXITED
63364705Seric # undef WEXITSTATUS
63464705Seric #endif
63564705Seric 
63664705Seric 
63764939Seric /*
63864939Seric **  Stardent Titan 3000 running TitanOS 4.2.
63964939Seric **
64064939Seric **	Must be compiled in "cc -43" mode.
64164939Seric **
64264944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
64364939Seric **
64464939Seric **	Note the tweaking below after the BSD defines are set.
64564939Seric */
64664705Seric 
64764939Seric #ifdef titan
64864939Seric # define setpgid	setpgrp
64964939Seric typedef int		pid_t;
65064939Seric # undef WIFEXITED
65164939Seric # undef WEXITSTATUS
65264939Seric #endif
65364939Seric 
65464939Seric 
65564962Seric /*
65664962Seric **  Sequent DYNIX 3.2.0
65764962Seric **
65864962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
65964962Seric */
66064939Seric 
66164962Seric #ifdef sequent
66264962Seric # define BSD		1
66364962Seric # define HASUNSETENV	1
66464962Seric # define BSD4_3		1	/* to get signal() in conf.c */
66564962Seric # define WAITUNION	1
66664962Seric # define LA_TYPE	LA_FLOAT
66764962Seric # ifdef	_POSIX_VERSION
66864962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
66964962Seric # endif
67064962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
67164962Seric # define setpgid	setpgrp
67264962Seric 
67364962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
67464962Seric # undef	WIFEXITED
67564962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
67664962Seric 			 ((union wait*)&(s))->w_termsig == 0)
67764962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
67864962Seric typedef int		pid_t;
67964962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
68064962Seric 
68164962Seric # ifndef _PATH_UNIX
68264962Seric #  define _PATH_UNIX	"/dynix"
68364962Seric # endif
68464962Seric # ifndef _PATH_SENDMAILCF
68564962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
68664962Seric # endif
68764962Seric 
68864962Seric #endif
68964962Seric 
69064962Seric 
69165748Seric /*
69265748Seric **  Cray Unicos
69365748Seric **
69465748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
69565748Seric */
69664962Seric 
69765748Seric #ifdef UNICOS
69865748Seric # define SYSTEM5	1	/* include all the System V defines */
69965748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
70065748Seric # define MAXPATHLEN	PATHSIZE
70165748Seric # define LA_TYPE	LA_ZERO
70265749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
70365748Seric #endif
70464962Seric 
70565748Seric 
70665820Seric /*
70765820Seric **  Apollo DomainOS
70865820Seric **
70965820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
71065982Seric **
71165820Seric **  15 Jan 1994
71265820Seric **
71365820Seric */
71465748Seric 
71565820Seric #ifdef apollo
71665820Seric # define HASSETREUID	1	/* has setreuid(2) call */
71765820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
71865820Seric # undef  SETPROCTITLE
71965820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
720*66030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
72165820Seric # ifndef _PATH_SENDMAILCF
72265820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
72365820Seric # endif
72465820Seric # ifndef _PATH_SENDMAILPID
72565820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
72665820Seric # endif
72765820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
72865820Seric # undef  S_IFIFO
72965820Seric # define S_IFIFO	0010000
73065820Seric # ifndef IDENTPROTO
73165820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
73265820Seric # endif
73365982Seric #endif
73465820Seric 
73565820Seric 
73665820Seric 
73765820Seric 
73863902Seric /**********************************************************************
73963787Seric **  End of Per-Operating System defines
74063902Seric **********************************************************************/
74163787Seric 
74263949Seric /**********************************************************************
74363949Seric **  More general defines
74463949Seric **********************************************************************/
74563949Seric 
74663962Seric /* general BSD defines */
74763962Seric #ifdef BSD
74864035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
74964035Seric # define HASSETREUID	1	/* has setreuid(2) call */
75064035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
75165830Seric # ifndef HASFLOCK
75265830Seric #  define HASFLOCK	1	/* has flock(2) call */
75365830Seric # endif
75463962Seric #endif
75563962Seric 
75665189Seric /* general System V Release 4 defines */
75765189Seric #ifdef __svr4__
75865189Seric # define SYSTEM5	1
75965189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
76065211Seric # ifndef HASGETUSERSHELL
76165211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
76265210Seric # endif
76365189Seric # define setreuid(r, e)	seteuid(e)
76465189Seric 
76565189Seric # ifndef _PATH_UNIX
76665189Seric #  define _PATH_UNIX		"/unix"
76765189Seric # endif
76865189Seric # ifndef _PATH_SENDMAILCF
76965189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
77065189Seric # endif
77165189Seric # ifndef _PATH_SENDMAILPID
77265189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
77365189Seric # endif
77465189Seric # ifndef SYSLOG_BUFSIZE
77565189Seric #  define SYSLOG_BUFSIZE	128
77665189Seric # endif
77765189Seric #endif
77865189Seric 
77963787Seric /* general System V defines */
78063787Seric # ifdef SYSTEM5
78164813Seric # include <sys/sysmacros.h>
78263949Seric # define HASUNAME	1	/* use System V uname(2) system call */
78364705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
78464962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
78563962Seric # ifndef LA_TYPE
78665749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
78763962Seric # endif
78865749Seric # ifndef SFS_TYPE
78965749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
79065749Seric # endif
79163949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
79263949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
79363949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
79463787Seric # endif
79563787Seric 
79663949Seric /* general POSIX defines */
79763949Seric #ifdef _POSIX_VERSION
79864718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
79964718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
80063949Seric #endif
80163949Seric 
80263787Seric /*
80363937Seric **  If no type for argument two of getgroups call is defined, assume
80463937Seric **  it's an integer -- unfortunately, there seem to be several choices
80563937Seric **  here.
80663937Seric */
80763937Seric 
80863937Seric #ifndef GIDSET_T
80963937Seric # define GIDSET_T	int
81063937Seric #endif
81163937Seric 
81264939Seric /*
81364939Seric **  Tweaking for systems that (for example) claim to be BSD but
81464939Seric **  don't have all the standard BSD routines (boo hiss).
81564939Seric */
81664439Seric 
81764939Seric #ifdef titan
81864939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
81964939Seric #endif
82064939Seric 
82165830Seric 
82265167Seric /*
82365167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
82465167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
82565167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
82665167Seric **  are closed.  Some firewalls return this error if you try to connect
82765167Seric **  to the IDENT port (113), so you can't receive email from these hosts
82865167Seric **  on these systems.  The firewall really should use a more specific
82965167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
83065167Seric **  not explicitly set to zero above, default it on.
83165167Seric */
83264939Seric 
83365167Seric #ifndef IDENTPROTO
83465167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
83565167Seric #endif
83665167Seric 
83765211Seric #ifndef HASGETUSERSHELL
83865211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
83965210Seric #endif
84065167Seric 
84165830Seric #ifndef HASFLOCK
84265830Seric # define HASFLOCK	0	/* assume no flock(2) support */
84365830Seric #endif
84465210Seric 
84565830Seric 
84664439Seric /**********************************************************************
84759023Seric **  Remaining definitions should never have to be changed.  They are
84859023Seric **  primarily to provide back compatibility for older systems -- for
84959287Seric **  example, it includes some POSIX compatibility definitions
85064439Seric **********************************************************************/
85159023Seric 
85259388Seric /* System 5 compatibility */
85359388Seric #ifndef S_ISREG
85464944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
85559388Seric #endif
85664944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
85764944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
85864944Seric #endif
85959388Seric #ifndef S_IWGRP
86059388Seric #define S_IWGRP		020
86159388Seric #endif
86259388Seric #ifndef S_IWOTH
86359388Seric #define S_IWOTH		002
86459388Seric #endif
86559388Seric 
86659023Seric /*
86750537Seric **  Older systems don't have this error code -- it should be in
86850537Seric **  /usr/include/sysexits.h.
86950537Seric */
87050537Seric 
87150537Seric # ifndef EX_CONFIG
87250537Seric # define EX_CONFIG	78	/* configuration error */
87350537Seric # endif
87456852Seric 
87564718Seric /* pseudo-code used in server SMTP */
87664718Seric # define EX_QUIT	22	/* drop out of server immediately */
87764718Seric 
87864718Seric 
87963993Seric /*
88063993Seric **  These are used in a few cases where we need some special
88163993Seric **  error codes, but where the system doesn't provide something
88263993Seric **  reasonable.  They are printed in errstring.
88363993Seric */
88463993Seric 
88563993Seric #ifndef E_PSEUDOBASE
88663993Seric # define E_PSEUDOBASE	256
88763993Seric #endif
88863993Seric 
88963993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
89063993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
89163993Seric 
89263970Seric /* type of arbitrary pointer */
89363970Seric #ifndef ARBPTR_T
89463970Seric # define ARBPTR_T	void *
89563970Seric #endif
89663970Seric 
89760568Seric #ifndef __P
89860568Seric # include "cdefs.h"
89960568Seric #endif
90060568Seric 
90156852Seric /*
90258778Seric **  Do some required dependencies
90358778Seric */
90458778Seric 
90558778Seric #if defined(NETINET) || defined(NETISO)
90659107Seric # define SMTP		1	/* enable user and server SMTP */
90759107Seric # define QUEUE		1	/* enable queueing */
90859107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
90958778Seric #endif
91058778Seric 
91158778Seric 
91258778Seric /*
91356852Seric **  Arrange to use either varargs or stdargs
91456852Seric */
91556852Seric 
91656852Seric # ifdef __STDC__
91756852Seric 
91856852Seric # include <stdarg.h>
91956852Seric 
92056852Seric # define VA_LOCAL_DECL	va_list ap;
92156852Seric # define VA_START(f)	va_start(ap, f)
92256852Seric # define VA_END		va_end(ap)
92356852Seric 
92456852Seric # else
92556852Seric 
92656852Seric # include <varargs.h>
92756852Seric 
92856852Seric # define VA_LOCAL_DECL	va_list ap;
92956852Seric # define VA_START(f)	va_start(ap)
93056852Seric # define VA_END		va_end(ap)
93156852Seric 
93256852Seric # endif
93357631Seric 
93457943Seric #ifdef HASUNAME
93557631Seric # include <sys/utsname.h>
93657631Seric # ifdef newstr
93757631Seric #  undef newstr
93857631Seric # endif
93957943Seric #else /* ! HASUNAME */
94057631Seric # define NODE_LENGTH 32
94157631Seric struct utsname
94257631Seric {
94357631Seric 	char nodename[NODE_LENGTH+1];
94457631Seric };
94557943Seric #endif /* HASUNAME */
94657642Seric 
94763838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
94863838Seric # define MAXHOSTNAMELEN	256
94957735Seric #endif
95058153Seric 
95158153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
95258153Seric # define SIGCHLD	SIGCLD
95358153Seric #endif
95458153Seric 
95558153Seric #ifndef STDIN_FILENO
95658153Seric #define STDIN_FILENO	0
95758153Seric #endif
95858153Seric 
95958153Seric #ifndef STDOUT_FILENO
96058153Seric #define STDOUT_FILENO	1
96158153Seric #endif
96258153Seric 
96358153Seric #ifndef STDERR_FILENO
96458153Seric #define STDERR_FILENO	2
96558153Seric #endif
96658689Seric 
96764072Seric #ifndef LOCK_SH
96864035Seric # define LOCK_SH	0x01	/* shared lock */
96964035Seric # define LOCK_EX	0x02	/* exclusive lock */
97064035Seric # define LOCK_NB	0x04	/* non-blocking lock */
97164035Seric # define LOCK_UN	0x08	/* unlock */
97264035Seric #endif
97358692Seric 
97464035Seric #ifndef SIG_ERR
97564035Seric # define SIG_ERR	((void (*)()) -1)
97658689Seric #endif
97758702Seric 
97864500Seric #ifndef WEXITSTATUS
97964500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
98064500Seric #endif
98164500Seric #ifndef WIFEXITED
98264500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
98364500Seric #endif
98464500Seric 
98564561Seric #ifndef SIGFUNC_DEFINED
98664561Seric typedef void		(*sigfunc_t) __P((int));
98764561Seric #endif
98864561Seric 
98965053Seric /* size of syslog buffer */
99065053Seric #ifndef SYSLOG_BUFSIZE
99165053Seric # define SYSLOG_BUFSIZE	1024
99265053Seric #endif
99365053Seric 
99458702Seric /*
99558702Seric **  Size of tobuf (deliver.c)
99658702Seric **	Tweak this to match your syslog implementation.  It will have to
99758702Seric **	allow for the extra information printed.
99858702Seric */
99958702Seric 
100058702Seric #ifndef TOBUFSIZE
100165053Seric # if (SYSLOG_BUFSIZE) > 512
100265053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
100365053Seric # else
100465053Seric #  define TOBUFSIZE	256
100565053Seric # endif
100658702Seric #endif
100760219Seric 
100865015Seric /*
100965015Seric **  Size of prescan buffer.
101065015Seric **	Despite comments in the _sendmail_ book, this probably should
101165015Seric **	not be changed; there are some hard-to-define dependencies.
101265015Seric */
101365015Seric 
101465015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
101560219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
101660219Seric # ifndef FORK
101760219Seric # define FORK		vfork		/* function to call to fork mailer */
101860219Seric # endif
101965955Seric 
102065955Seric /*
102165955Seric **  If we are going to link scanf anyway, use it in readcf
102265955Seric */
102365955Seric 
102465955Seric #if !defined(HASUNAME) && !defined(SCANF)
102565955Seric # define SCANF		1
102665955Seric #endif
1027