xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 65955)
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*65955Seric  *	@(#)conf.h	8.82 (Berkeley) 01/31/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 */
10963902Seric # 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
19963787Seric 
20060602Seric # else
20165105Seric 			/* SunOS 4.0.3 or 4.1.x */
20265189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
20365830Seric #  ifndef HASFLOCK
20465830Seric #   define HASFLOCK	1	/* has flock(2) call */
20565830Seric #  endif
20665749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
20760564Seric #  include <vfork.h>
20863787Seric 
20965105Seric #  ifdef SUNOS403
21065105Seric 			/* special tweaking for SunOS 4.0.3 */
21165105Seric #   include <malloc.h>
21265105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
21365105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
21465105Seric #   undef WIFEXITED
21565105Seric #   undef WEXITSTATUS
21665105Seric #   undef HASUNAME
21765105Seric #   define setpgid	setpgrp
21865105Seric typedef int		pid_t;
21965105Seric extern char		*getenv();
22065105Seric 
22165105Seric #  endif
22260564Seric # endif
22359023Seric #endif
22459023Seric 
22564718Seric /*
22664813Seric **  DG/UX
22764813Seric **
22864813Seric **	Tested on 5.4.2
22964718Seric */
23064314Seric 
23164718Seric #ifdef	DGUX
23264718Seric # define SYSTEM5	1
23364718Seric # define LA_TYPE	LA_SUBR
23464718Seric # define HASSETREUID	1	/* has setreuid(2) call */
23564718Seric # define HASUNAME	1	/* use System V uname(2) system call */
23664718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
23764718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
23865167Seric # ifndef IDENTPROTO
23965167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
24065167Seric # endif
24164718Seric # undef SETPROCTITLE
24265749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
24364813Seric 
24464813Seric /* these include files must be included early on DG/UX */
24564813Seric # include <netinet/in.h>
24664813Seric # include <arpa/inet.h>
24764813Seric 
24864718Seric # define inet_addr	dgux_inet_addr
24964718Seric extern long	dgux_inet_addr();
25064718Seric #endif
25164718Seric 
25264718Seric 
25363902Seric /*
25463902Seric **  Digital Ultrix 4.2A or 4.3
25564264Seric **
25664264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
25764264Seric **	not dropped when the process exits.  This causes major problems,
25864264Seric **	so flock is the only alternative.
25963902Seric */
26063902Seric 
26160564Seric #ifdef ultrix
26264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
26363962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
26464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
26565830Seric # ifndef HASFLOCK
26665830Seric #  define HASFLOCK	1	/* has flock(2) call */
26765830Seric # endif
26865211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
26965135Seric # ifdef vax
27065135Seric #  define LA_TYPE	LA_FLOAT
27165135Seric # else
27265135Seric #  define LA_TYPE	LA_INT
27365135Seric #  define LA_AVENRUN	"avenrun"
27465135Seric # endif
27565749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
27665167Seric # ifndef IDENTPROTO
27765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
27865167Seric # endif
27960564Seric #endif
28060564Seric 
28164314Seric 
28263902Seric /*
28363902Seric **  OSF/1 (tested on Alpha)
28463902Seric */
28563902Seric 
28663787Seric #ifdef __osf__
28763962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
28864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
28964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
29065830Seric # ifdef HASFLOCK
29165830Seric #  define HASFLOCK	1	/* has flock(2) call */
29265830Seric # endif
29363962Seric # define LA_TYPE	LA_INT
29465749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
29564813Seric # ifndef _PATH_SENDMAILPID
29665504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
29764813Seric # endif
29859287Seric #endif
29959287Seric 
30064314Seric 
30163902Seric /*
30263902Seric **  NeXTstep
30363902Seric */
30463902Seric 
30564076Seric #ifdef NeXT
30664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
30765830Seric # ifndef HASFLOCK
30865830Seric #  define HASFLOCK	1	/* has flock(2) call */
30965830Seric # endif
31064125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
31164563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
31263753Seric # define sleep		sleepX
31364155Seric # define setpgid	setpgrp
31464295Seric # ifndef LA_TYPE
31564295Seric #  define LA_TYPE	LA_MACH
31664295Seric # endif
31765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
31864500Seric # ifndef _POSIX_SOURCE
31964035Seric typedef int		pid_t;
32064500Seric #  undef WEXITSTATUS
32164500Seric #  undef WIFEXITED
32264500Seric # endif
32364072Seric # ifndef _PATH_SENDMAILCF
32464072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
32564072Seric # endif
32664072Seric # ifndef _PATH_SENDMAILPID
32764072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
32864072Seric # endif
32959288Seric #endif
33059288Seric 
33164314Seric 
33263902Seric /*
33363962Seric **  4.4 BSD
33464831Seric **
33564831Seric **	See also BSD defines.
33663902Seric */
33763902Seric 
33860568Seric #ifdef BSD4_4
33964072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
34060568Seric # include <sys/cdefs.h>
34163838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
34264072Seric # ifndef LA_TYPE
34364072Seric #  define LA_TYPE	LA_SUBR
34464072Seric # endif
34565749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
34660568Seric #endif
34760568Seric 
34864314Seric 
34963902Seric /*
35065049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
35164733Seric **
35264733Seric **  4.3BSD clone, closer to 4.4BSD
35364831Seric **
35464831Seric **	See also BSD defines.
35564733Seric */
35664733Seric 
35765049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
35864733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
35964733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
36064733Seric # include <sys/cdefs.h>
36164733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
36264733Seric # ifndef LA_TYPE
36364733Seric #  define LA_TYPE	LA_SUBR
36464733Seric # endif
36565749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
36664733Seric #endif
36764733Seric 
36864733Seric 
36964733Seric /*
37064813Seric **  Mach386
37164813Seric **
37264813Seric **	For mt Xinu's Mach386 system.
37364813Seric */
37464813Seric 
37564813Seric #if defined(MACH) && defined(i386)
37664813Seric # define MACH386	1
37764813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
37864813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
37965830Seric # ifdef HASFLOCK
38065830Seric #  define HASFLOCK	1	/* has flock(2) call */
38165830Seric # endif
38264813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
38364813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
38464813Seric # define setpgid	setpgrp
38564813Seric # ifndef LA_TYPE
38664813Seric #  define LA_TYPE	LA_FLOAT
38764813Seric # endif
38865749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
38964962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
39064813Seric # undef WEXITSTATUS
39164813Seric # undef WIFEXITED
39264813Seric # ifndef _PATH_SENDMAILCF
39364813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
39464813Seric # endif
39564813Seric # ifndef _PATH_SENDMAILPID
39664813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
39764813Seric # endif
39864813Seric #endif
39964813Seric 
40064813Seric 
40164813Seric /*
40263969Seric **  4.3 BSD -- this is for very old systems
40363969Seric **
40465949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
40565949Seric **
40663969Seric **	You'll also have to install a new resolver library.
40763969Seric **	I don't guarantee that support for this environment is complete.
40863969Seric */
40963969Seric 
41065949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
41163969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
41263969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
41363970Seric # define ARBPTR_T	char *
41464155Seric # define setpgid	setpgrp
41563969Seric # ifndef LA_TYPE
41663969Seric #  define LA_TYPE	LA_FLOAT
41763969Seric # endif
41863969Seric # ifndef _PATH_SENDMAILCF
41963969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
42063969Seric # endif
42165167Seric # ifndef IDENTPROTO
42265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
42365167Seric # endif
42464834Seric # undef WEXITSTATUS
42564834Seric # undef WIFEXITED
42664834Seric typedef short		pid_t;
42764834Seric extern int		errno;
42863969Seric #endif
42963969Seric 
43064314Seric 
43163969Seric /*
43263902Seric **  SCO Unix
43365087Seric **
43465087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
43565087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
43665087Seric **	The second is, I believe, for an older version.
43763902Seric */
43863902Seric 
43965087Seric #ifdef _SCO_unix_4_2
44065087Seric # define _SCO_unix_
44165087Seric # define HASSETREUID	1	/* has setreuid(2) call */
44265087Seric # define _PATH_UNIX	"/unix"
44365087Seric # ifndef _PATH_SENDMAILCF
44465087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
44565087Seric # endif
44665087Seric # ifndef _PATH_SENDMAILPID
44765087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
44865087Seric # endif
44965087Seric #endif
45065087Seric 
45163838Seric #ifdef _SCO_unix_
45263838Seric # define SYSTEM5	1	/* include all the System V defines */
45364035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
45465212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
45563838Seric # define FORK		fork
45663838Seric # define MAXPATHLEN	PATHSIZE
45764718Seric # define LA_TYPE	LA_SHORT
45865749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
45964813Seric # undef NETUNIX			/* no unix domain socket support */
46063838Seric #endif
46163838Seric 
46264314Seric 
46363962Seric /*
46463962Seric **  ConvexOS 11.0 and later
46565949Seric **
46665949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
46765949Seric **	works on 9.1 as well.
46863962Seric */
46963962Seric 
47063962Seric #ifdef _CONVEX_SOURCE
47163977Seric # define BSD		1	/* include all the BSD defines */
47263977Seric # define HASUNAME	1	/* use System V uname(2) system call */
47363962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
47463977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
47563962Seric # define LA_TYPE	LA_FLOAT
47665749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
47765949Seric # ifndef _PATH_SENDMAILCF
47865949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
47965949Seric # endif
48065949Seric # ifndef S_IREAD
48165949Seric #  define S_IREAD	_S_IREAD
48265949Seric #  define S_IWRITE	_S_IWRITE
48365949Seric #  define S_IEXEC	_S_IEXEC
48465949Seric #  define S_IFMT	_S_IFMT
48565949Seric #  define S_IFCHR	_S_IFCHR
48665949Seric #  define S_IFBLK	_S_IFBLK
48765949Seric # endif
48865167Seric # ifndef IDENTPROTO
48965167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
49065167Seric # endif
49163962Seric #endif
49263962Seric 
49364314Seric 
49463962Seric /*
49564999Seric **  RISC/os 4.52
49663962Seric **
49764999Seric **	Gives a ton of warning messages, but otherwise compiles.
49863962Seric */
49963962Seric 
50063965Seric #ifdef RISCOS
50164999Seric 
50263962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
50365830Seric # ifdef HASFLOCK
50465830Seric #  define HASFLOCK	1	/* has flock(2) call */
50565830Seric # endif
50664999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
50764999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
50863962Seric # define LA_TYPE	LA_INT
50963962Seric # define LA_AVENRUN	"avenrun"
51063962Seric # define _PATH_UNIX	"/unix"
51164999Seric # undef WIFEXITED
51264999Seric 
51364999Seric # define setpgid	setpgrp
51464999Seric 
51564999Seric extern int		errno;
51664999Seric typedef int		pid_t;
51764999Seric #define			SIGFUNC_DEFINED
51864999Seric typedef int		(*sigfunc_t)();
51964999Seric extern char		*getenv();
52064999Seric extern void		*malloc();
52164999Seric 
52263962Seric #endif
52363962Seric 
52464314Seric 
52564155Seric /*
52664155Seric **  Linux 0.99pl10 and above...
52764155Seric **	From Karl London <karl@borg.demon.co.uk>.
52864155Seric */
52964155Seric 
53064770Seric #ifdef __linux__
53164155Seric # define BSD		1	/* pretend to be BSD based today */
53264155Seric # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
53364155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
53464380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
53564155Seric # ifndef LA_TYPE
53664155Seric #  define LA_TYPE	LA_FLOAT
53764155Seric # endif
53864763Seric # include <sys/sysmacros.h>
53965046Seric # define GIDSET_T	gid_t
54064155Seric #endif
54164155Seric 
54264155Seric 
54364345Seric /*
54464345Seric **  DELL SVR4 Issue 2.2, and others
54564345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
54664345Seric **
54764345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
54864345Seric **	defined, and the definitions conflict.
54964924Seric **
55064924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
55164924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
55264924Seric **	(SVR4.0/386 version 3.0).
55364345Seric */
55464345Seric 
55564345Seric #ifdef DELL_SVR4
55665189Seric 				/* no changes necessary */
55765189Seric 				/* see general __svr4__ defines below */
55864345Seric #endif
55964345Seric 
56064345Seric 
56164380Seric /*
56264380Seric **  Apple A/UX 3.0
56364380Seric */
56464345Seric 
56564380Seric #ifdef _AUX_SOURCE
56664729Seric # include <sys/sysmacros.h>
56764380Seric # define BSD			/* has BSD routines */
56864380Seric # define HASUNAME	1	/* use System V uname(2) system call */
56964380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
57064561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
57165167Seric # ifndef IDENTPROTO
57265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
57365167Seric # endif
57464380Seric # define FORK		fork
57564380Seric # ifndef _PATH_SENDMAILCF
57664380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
57764380Seric # endif
57864380Seric # ifndef LA_TYPE
57964380Seric #  define LA_TYPE	LA_ZERO
58064380Seric # endif
58165749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
58264560Seric # undef WIFEXITED
58364560Seric # undef WEXITSTATUS
58464380Seric #endif
58564380Seric 
58664380Seric 
58764705Seric /*
58864705Seric **  Encore UMAX V
58964705Seric **
59064705Seric **	Not extensively tested.
59164705Seric */
59264380Seric 
59364705Seric #ifdef UMAXV
59464705Seric # include <limits.h>
59564705Seric # define HASUNAME	1	/* use System V uname(2) system call */
59664705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
59764705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
59865211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
59964705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
60064705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
60164705Seric # define FORK		fork	/* no vfork(2) primitive available */
60265749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
60364705Seric # define MAXPATHLEN	PATH_MAX
60464705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
60564705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
60664705Seric # undef WIFEXITED
60764705Seric # undef WEXITSTATUS
60864705Seric #endif
60964705Seric 
61064705Seric 
61164939Seric /*
61264939Seric **  Stardent Titan 3000 running TitanOS 4.2.
61364939Seric **
61464939Seric **	Must be compiled in "cc -43" mode.
61564939Seric **
61664944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
61764939Seric **
61864939Seric **	Note the tweaking below after the BSD defines are set.
61964939Seric */
62064705Seric 
62164939Seric #ifdef titan
62264939Seric # define setpgid	setpgrp
62364939Seric typedef int		pid_t;
62464939Seric # undef WIFEXITED
62564939Seric # undef WEXITSTATUS
62664939Seric #endif
62764939Seric 
62864939Seric 
62964962Seric /*
63064962Seric **  Sequent DYNIX 3.2.0
63164962Seric **
63264962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
63364962Seric */
63464939Seric 
63564962Seric #ifdef sequent
63664962Seric # define BSD		1
63764962Seric # define HASUNSETENV	1
63864962Seric # define BSD4_3		1	/* to get signal() in conf.c */
63964962Seric # define WAITUNION	1
64064962Seric # define LA_TYPE	LA_FLOAT
64164962Seric # ifdef	_POSIX_VERSION
64264962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
64364962Seric # endif
64464962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
64564962Seric # define setpgid	setpgrp
64664962Seric 
64764962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
64864962Seric # undef	WIFEXITED
64964962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
65064962Seric 			 ((union wait*)&(s))->w_termsig == 0)
65164962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
65264962Seric typedef int		pid_t;
65364962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
65464962Seric 
65564962Seric # ifndef _PATH_UNIX
65664962Seric #  define _PATH_UNIX	"/dynix"
65764962Seric # endif
65864962Seric # ifndef _PATH_SENDMAILCF
65964962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
66064962Seric # endif
66164962Seric 
66264962Seric #endif
66364962Seric 
66464962Seric 
66565748Seric /*
66665748Seric **  Cray Unicos
66765748Seric **
66865748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
66965748Seric */
67064962Seric 
67165748Seric #ifdef UNICOS
67265748Seric # define SYSTEM5	1	/* include all the System V defines */
67365748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
67465748Seric # define MAXPATHLEN	PATHSIZE
67565748Seric # define LA_TYPE	LA_ZERO
67665749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
67765748Seric #endif
67864962Seric 
67965748Seric 
68065820Seric /*
68165820Seric **  Apollo DomainOS
68265820Seric **
68365820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
68465820Seric **
68565820Seric **  15 Jan 1994
68665820Seric **
68765820Seric */
68865748Seric 
68965820Seric #ifdef apollo
69065820Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
69165820Seric # define HASSETREUID	1	/* has setreuid(2) call */
69265820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
69365820Seric # undef  SETPROCTITLE
69465820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
69565820Seric # define SFS_TYPE	SFS_MOUNT
69665820Seric # ifndef _PATH_SENDMAILCF
69765820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
69865820Seric # endif
69965820Seric # ifndef _PATH_SENDMAILPID
70065820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
70165820Seric # endif
70265820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
70365820Seric # undef  S_IFIFO
70465820Seric # define S_IFIFO	0010000
70565820Seric # ifndef IDENTPROTO
70665820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
70765820Seric # endif
70865820Seric #endif
70965820Seric 
71065820Seric 
71165820Seric 
71265820Seric 
71363902Seric /**********************************************************************
71463787Seric **  End of Per-Operating System defines
71563902Seric **********************************************************************/
71663787Seric 
71763949Seric /**********************************************************************
71863949Seric **  More general defines
71963949Seric **********************************************************************/
72063949Seric 
72163962Seric /* general BSD defines */
72263962Seric #ifdef BSD
72364035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
72464035Seric # define HASSETREUID	1	/* has setreuid(2) call */
72564035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
72665830Seric # ifndef HASFLOCK
72765830Seric #  define HASFLOCK	1	/* has flock(2) call */
72865830Seric # endif
72963962Seric #endif
73063962Seric 
73165189Seric /* general System V Release 4 defines */
73265189Seric #ifdef __svr4__
73365189Seric # define SYSTEM5	1
73465189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
73565211Seric # ifndef HASGETUSERSHELL
73665211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
73765210Seric # endif
73865189Seric # define setreuid(r, e)	seteuid(e)
73965189Seric 
74065189Seric # ifndef _PATH_UNIX
74165189Seric #  define _PATH_UNIX		"/unix"
74265189Seric # endif
74365189Seric # ifndef _PATH_SENDMAILCF
74465189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
74565189Seric # endif
74665189Seric # ifndef _PATH_SENDMAILPID
74765189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
74865189Seric # endif
74965189Seric # ifndef SYSLOG_BUFSIZE
75065189Seric #  define SYSLOG_BUFSIZE	128
75165189Seric # endif
75265189Seric #endif
75365189Seric 
75463787Seric /* general System V defines */
75563787Seric # ifdef SYSTEM5
75664813Seric # include <sys/sysmacros.h>
75763949Seric # define HASUNAME	1	/* use System V uname(2) system call */
75864705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
75964962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
76063962Seric # ifndef LA_TYPE
76165749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
76263962Seric # endif
76365749Seric # ifndef SFS_TYPE
76465749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
76565749Seric # endif
76663949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
76763949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
76863949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
76963787Seric # endif
77063787Seric 
77163949Seric /* general POSIX defines */
77263949Seric #ifdef _POSIX_VERSION
77364718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
77464718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
77563949Seric #endif
77663949Seric 
77763787Seric /*
77863937Seric **  If no type for argument two of getgroups call is defined, assume
77963937Seric **  it's an integer -- unfortunately, there seem to be several choices
78063937Seric **  here.
78163937Seric */
78263937Seric 
78363937Seric #ifndef GIDSET_T
78463937Seric # define GIDSET_T	int
78563937Seric #endif
78663937Seric 
78764939Seric /*
78864939Seric **  Tweaking for systems that (for example) claim to be BSD but
78964939Seric **  don't have all the standard BSD routines (boo hiss).
79064939Seric */
79164439Seric 
79264939Seric #ifdef titan
79364939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
79464939Seric #endif
79564939Seric 
79665830Seric 
79765167Seric /*
79865167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
79965167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
80065167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
80165167Seric **  are closed.  Some firewalls return this error if you try to connect
80265167Seric **  to the IDENT port (113), so you can't receive email from these hosts
80365167Seric **  on these systems.  The firewall really should use a more specific
80465167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
80565167Seric **  not explicitly set to zero above, default it on.
80665167Seric */
80764939Seric 
80865167Seric #ifndef IDENTPROTO
80965167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
81065167Seric #endif
81165167Seric 
81265211Seric #ifndef HASGETUSERSHELL
81365211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
81465210Seric #endif
81565167Seric 
81665830Seric #ifndef HASFLOCK
81765830Seric # define HASFLOCK	0	/* assume no flock(2) support */
81865830Seric #endif
81965210Seric 
82065830Seric 
82164439Seric /**********************************************************************
82259023Seric **  Remaining definitions should never have to be changed.  They are
82359023Seric **  primarily to provide back compatibility for older systems -- for
82459287Seric **  example, it includes some POSIX compatibility definitions
82564439Seric **********************************************************************/
82659023Seric 
82759388Seric /* System 5 compatibility */
82859388Seric #ifndef S_ISREG
82964944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
83059388Seric #endif
83164944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
83264944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
83364944Seric #endif
83459388Seric #ifndef S_IWGRP
83559388Seric #define S_IWGRP		020
83659388Seric #endif
83759388Seric #ifndef S_IWOTH
83859388Seric #define S_IWOTH		002
83959388Seric #endif
84059388Seric 
84159023Seric /*
84250537Seric **  Older systems don't have this error code -- it should be in
84350537Seric **  /usr/include/sysexits.h.
84450537Seric */
84550537Seric 
84650537Seric # ifndef EX_CONFIG
84750537Seric # define EX_CONFIG	78	/* configuration error */
84850537Seric # endif
84956852Seric 
85064718Seric /* pseudo-code used in server SMTP */
85164718Seric # define EX_QUIT	22	/* drop out of server immediately */
85264718Seric 
85364718Seric 
85463993Seric /*
85563993Seric **  These are used in a few cases where we need some special
85663993Seric **  error codes, but where the system doesn't provide something
85763993Seric **  reasonable.  They are printed in errstring.
85863993Seric */
85963993Seric 
86063993Seric #ifndef E_PSEUDOBASE
86163993Seric # define E_PSEUDOBASE	256
86263993Seric #endif
86363993Seric 
86463993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
86563993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
86663993Seric 
86763970Seric /* type of arbitrary pointer */
86863970Seric #ifndef ARBPTR_T
86963970Seric # define ARBPTR_T	void *
87063970Seric #endif
87163970Seric 
87260568Seric #ifndef __P
87360568Seric # include "cdefs.h"
87460568Seric #endif
87560568Seric 
87656852Seric /*
87758778Seric **  Do some required dependencies
87858778Seric */
87958778Seric 
88058778Seric #if defined(NETINET) || defined(NETISO)
88159107Seric # define SMTP		1	/* enable user and server SMTP */
88259107Seric # define QUEUE		1	/* enable queueing */
88359107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
88458778Seric #endif
88558778Seric 
88658778Seric 
88758778Seric /*
88856852Seric **  Arrange to use either varargs or stdargs
88956852Seric */
89056852Seric 
89156852Seric # ifdef __STDC__
89256852Seric 
89356852Seric # include <stdarg.h>
89456852Seric 
89556852Seric # define VA_LOCAL_DECL	va_list ap;
89656852Seric # define VA_START(f)	va_start(ap, f)
89756852Seric # define VA_END		va_end(ap)
89856852Seric 
89956852Seric # else
90056852Seric 
90156852Seric # include <varargs.h>
90256852Seric 
90356852Seric # define VA_LOCAL_DECL	va_list ap;
90456852Seric # define VA_START(f)	va_start(ap)
90556852Seric # define VA_END		va_end(ap)
90656852Seric 
90756852Seric # endif
90857631Seric 
90957943Seric #ifdef HASUNAME
91057631Seric # include <sys/utsname.h>
91157631Seric # ifdef newstr
91257631Seric #  undef newstr
91357631Seric # endif
91457943Seric #else /* ! HASUNAME */
91557631Seric # define NODE_LENGTH 32
91657631Seric struct utsname
91757631Seric {
91857631Seric 	char nodename[NODE_LENGTH+1];
91957631Seric };
92057943Seric #endif /* HASUNAME */
92157642Seric 
92263838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
92363838Seric # define MAXHOSTNAMELEN	256
92457735Seric #endif
92558153Seric 
92658153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
92758153Seric # define SIGCHLD	SIGCLD
92858153Seric #endif
92958153Seric 
93058153Seric #ifndef STDIN_FILENO
93158153Seric #define STDIN_FILENO	0
93258153Seric #endif
93358153Seric 
93458153Seric #ifndef STDOUT_FILENO
93558153Seric #define STDOUT_FILENO	1
93658153Seric #endif
93758153Seric 
93858153Seric #ifndef STDERR_FILENO
93958153Seric #define STDERR_FILENO	2
94058153Seric #endif
94158689Seric 
94264072Seric #ifndef LOCK_SH
94364035Seric # define LOCK_SH	0x01	/* shared lock */
94464035Seric # define LOCK_EX	0x02	/* exclusive lock */
94564035Seric # define LOCK_NB	0x04	/* non-blocking lock */
94664035Seric # define LOCK_UN	0x08	/* unlock */
94764035Seric #endif
94858692Seric 
94964035Seric #ifndef SIG_ERR
95064035Seric # define SIG_ERR	((void (*)()) -1)
95158689Seric #endif
95258702Seric 
95364500Seric #ifndef WEXITSTATUS
95464500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
95564500Seric #endif
95664500Seric #ifndef WIFEXITED
95764500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
95864500Seric #endif
95964500Seric 
96064561Seric #ifndef SIGFUNC_DEFINED
96164561Seric typedef void		(*sigfunc_t) __P((int));
96264561Seric #endif
96364561Seric 
96465053Seric /* size of syslog buffer */
96565053Seric #ifndef SYSLOG_BUFSIZE
96665053Seric # define SYSLOG_BUFSIZE	1024
96765053Seric #endif
96865053Seric 
96958702Seric /*
97058702Seric **  Size of tobuf (deliver.c)
97158702Seric **	Tweak this to match your syslog implementation.  It will have to
97258702Seric **	allow for the extra information printed.
97358702Seric */
97458702Seric 
97558702Seric #ifndef TOBUFSIZE
97665053Seric # if (SYSLOG_BUFSIZE) > 512
97765053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
97865053Seric # else
97965053Seric #  define TOBUFSIZE	256
98065053Seric # endif
98158702Seric #endif
98260219Seric 
98365015Seric /*
98465015Seric **  Size of prescan buffer.
98565015Seric **	Despite comments in the _sendmail_ book, this probably should
98665015Seric **	not be changed; there are some hard-to-define dependencies.
98765015Seric */
98865015Seric 
98965015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
99060219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
99160219Seric # ifndef FORK
99260219Seric # define FORK		vfork		/* function to call to fork mailer */
99360219Seric # endif
994*65955Seric 
995*65955Seric /*
996*65955Seric **  If we are going to link scanf anyway, use it in readcf
997*65955Seric */
998*65955Seric 
999*65955Seric #if !defined(HASUNAME) && !defined(SCANF)
1000*65955Seric # define SCANF		1
1001*65955Seric #endif
1002