xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 65135)
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*65135Seric  *	@(#)conf.h	8.63 (Berkeley) 12/14/93
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 /*
6664032Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
6764032Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
6864032Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
6964032Seric **  are closed.  Some firewalls return this error if you try to connect
7064032Seric **  to the IDENT port (113), so you can't receive email from these hosts
7164032Seric **  on these systems.  The firewall really should use a more specific
7264032Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  This
7364032Seric **  will get #undefed below as needed.
7464032Seric */
7564032Seric 
7664929Seric #ifndef IDENTPROTO
7764032Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
7864929Seric #endif
7964032Seric 
8064944Seric /*
8164944Seric **  Most systems have symbolic links today, so default them on.  You
8264944Seric **  can turn them off by #undef'ing this below.
8364944Seric */
8464944Seric 
8564944Seric # define HASLSTAT	1	/* has lstat(2) call */
8664944Seric 
8764962Seric /*
8864962Seric **  General "standard C" defines.
8964962Seric **
9064962Seric **	These may be undone later, to cope with systems that claim to
9164962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
9264962Seric **	doesn't realize that the library is part of the language.
9364962Seric **
9464962Seric **	Life would be much easier if we could get rid of this sort
9564962Seric **	of bozo problems.
9664962Seric */
9764962Seric 
9864962Seric #ifdef __STDC__
9964962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
10064962Seric #endif
10164962Seric 
10263902Seric /**********************************************************************
10359023Seric **  Operating system configuration.
10459023Seric **
10559023Seric **	Unless you are porting to a new OS, you shouldn't have to
10659023Seric **	change these.
10763902Seric **********************************************************************/
10856823Seric 
10963787Seric /*
11063787Seric **  Per-Operating System defines
11163787Seric */
11263787Seric 
11364314Seric 
11463902Seric /*
11563902Seric **  HP-UX -- tested for 8.07
11663902Seric */
11763902Seric 
11859348Seric # ifdef __hpux
11964727Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
12064727Seric # undef m_flags
12163787Seric # define SYSTEM5	1	/* include all the System V defines */
12264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
12364314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
12464035Seric # define HASSETREUID	1	/* has setreuid(2) call */
12563902Seric # define setreuid(r, e)		setresuid(r, e, -1)
12663962Seric # define LA_TYPE	LA_FLOAT
12763962Seric # define _PATH_UNIX	"/hp-ux"
12864358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
12956823Seric # endif
13056823Seric 
13164314Seric 
13263902Seric /*
13363902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
13463902Seric */
13563902Seric 
13660224Seric # ifdef _AIX3
13764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
13864840Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
13964840Seric # define HASUNAME	1	/* use System V uname(2) system call */
14060219Seric # define FORK		fork	/* no vfork primitive available */
14164494Seric # undef  SETPROCTITLE		/* setproctitle confuses AIX */
14260219Seric # endif
14360219Seric 
14464314Seric 
14563902Seric /*
14663902Seric **  Silicon Graphics IRIX
14763902Seric **
14863965Seric **	Compiles on 4.0.1.
14963902Seric */
15063902Seric 
15163753Seric # ifdef IRIX
15264727Seric # include <sys/sysmacros.h>
15364035Seric # define HASSETREUID	1	/* has setreuid(2) call */
15464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
15564314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
15663753Seric # define FORK		fork	/* no vfork primitive available */
15764562Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
15864155Seric # define setpgid	BSDsetpgrp
15963937Seric # define GIDSET_T	gid_t
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 
17263962Seric # define LA_TYPE	LA_INT
17364035Seric # define HASSETREUID	1	/* has setreuid(2) call */
17464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
17564813Seric # define HASUNAME	1	/* use System V uname(2) system call */
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) */
18363949Seric #  define SYSTEM5	1	/* use System V definitions */
18463977Seric #  define setreuid(r, e)	seteuid(e)
18563787Seric #  include <sys/time.h>
18664832Seric #  define gethostbyname	solaris_gethostbyname	/* get working version */
18764832Seric #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
18863962Seric #  define _PATH_UNIX	"/kernel/unix"
18963962Seric #  ifndef _PATH_SENDMAILCF
19063962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
19164072Seric #  endif
19264072Seric #  ifndef _PATH_SENDMAILPID
19363962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
19463962Seric #  endif
19563787Seric 
19660602Seric # else
19765105Seric 			/* SunOS 4.0.3 or 4.1.x */
19860602Seric #  define HASSTATFS	1	/* has the statfs(2) syscall */
19964831Seric #  define HASFLOCK	1	/* has flock(2) call */
20060564Seric #  include <vfork.h>
20163787Seric 
20265105Seric #  ifdef SUNOS403
20365105Seric 			/* special tweaking for SunOS 4.0.3 */
20465105Seric #   include <malloc.h>
20565105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
20665105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
20765105Seric #   undef WIFEXITED
20865105Seric #   undef WEXITSTATUS
20965105Seric #   undef HASUNAME
21065105Seric #   define setpgid	setpgrp
21165105Seric typedef int		pid_t;
21265105Seric extern char		*getenv();
21365105Seric 
21465105Seric #  endif
21560564Seric # endif
21659023Seric #endif
21759023Seric 
21864718Seric /*
21964813Seric **  DG/UX
22064813Seric **
22164813Seric **	Tested on 5.4.2
22264718Seric */
22364314Seric 
22464718Seric #ifdef	DGUX
22564718Seric # define SYSTEM5	1
22664718Seric # define LA_TYPE	LA_SUBR
22764718Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
22864718Seric # define HASSETREUID	1	/* has setreuid(2) call */
22964718Seric # define HASUNAME	1	/* use System V uname(2) system call */
23064718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
23164718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
23264718Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
23364718Seric # undef SETPROCTITLE
23464813Seric 
23564813Seric /* these include files must be included early on DG/UX */
23664813Seric # include <netinet/in.h>
23764813Seric # include <arpa/inet.h>
23864813Seric 
23964718Seric # define inet_addr	dgux_inet_addr
24064718Seric extern long	dgux_inet_addr();
24164718Seric #endif
24264718Seric 
24364718Seric 
24463902Seric /*
24563902Seric **  Digital Ultrix 4.2A or 4.3
24664264Seric **
24764264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
24864264Seric **	not dropped when the process exits.  This causes major problems,
24964264Seric **	so flock is the only alternative.
25063902Seric */
25163902Seric 
25260564Seric #ifdef ultrix
25360564Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
25464035Seric # define HASSETREUID	1	/* has setreuid(2) call */
25563962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
25664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
25764264Seric # define HASFLOCK	1	/* has flock(2) call */
258*65135Seric # ifdef vax
259*65135Seric #  define LA_TYPE	LA_FLOAT
260*65135Seric # else
261*65135Seric #  define LA_TYPE	LA_INT
262*65135Seric #  define LA_AVENRUN	"avenrun"
263*65135Seric # endif
26464358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
26560564Seric #endif
26660564Seric 
26764314Seric 
26863902Seric /*
26963902Seric **  OSF/1 (tested on Alpha)
27063902Seric */
27163902Seric 
27263787Seric #ifdef __osf__
27364314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
27463962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
27564035Seric # define HASSETREUID	1	/* has setreuid(2) call */
27664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
27764831Seric # define HASFLOCK	1	/* has flock(2) call */
27863962Seric # define LA_TYPE	LA_INT
27964813Seric # ifndef _PATH_SENDMAILPID
28064813Seric #  define _PATH_SENDMAILPID	"/var/run/sendmial.pid"
28164813Seric # endif
28259287Seric #endif
28359287Seric 
28464314Seric 
28563902Seric /*
28663902Seric **  NeXTstep
28763902Seric */
28863902Seric 
28964076Seric #ifdef NeXT
29064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
29164035Seric # define HASFLOCK	1	/* has flock(2) call */
29264125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
29364314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
29464563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
29563753Seric # define sleep		sleepX
29664155Seric # define setpgid	setpgrp
29764295Seric # ifndef LA_TYPE
29864295Seric #  define LA_TYPE	LA_MACH
29964295Seric # endif
30064500Seric # ifndef _POSIX_SOURCE
30164035Seric typedef int		pid_t;
30264500Seric #  undef WEXITSTATUS
30364500Seric #  undef WIFEXITED
30464500Seric # endif
30564072Seric # ifndef _PATH_SENDMAILCF
30664072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
30764072Seric # endif
30864072Seric # ifndef _PATH_SENDMAILPID
30964072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
31064072Seric # endif
31159288Seric #endif
31259288Seric 
31364314Seric 
31463902Seric /*
31563962Seric **  4.4 BSD
31664831Seric **
31764831Seric **	See also BSD defines.
31863902Seric */
31963902Seric 
32060568Seric #ifdef BSD4_4
32164072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
32264314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
32360568Seric # include <sys/cdefs.h>
32463838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
32564072Seric # ifndef LA_TYPE
32664072Seric #  define LA_TYPE	LA_SUBR
32764072Seric # endif
32860568Seric #endif
32960568Seric 
33064314Seric 
33163902Seric /*
33265049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
33364733Seric **
33464733Seric **  4.3BSD clone, closer to 4.4BSD
33564831Seric **
33664831Seric **	See also BSD defines.
33764733Seric */
33864733Seric 
33965049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
34064733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
34164733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
34264733Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
34364733Seric # include <sys/cdefs.h>
34464733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
34564733Seric # ifndef LA_TYPE
34664733Seric #  define LA_TYPE	LA_SUBR
34764733Seric # endif
34864733Seric #endif
34964733Seric 
35064733Seric 
35164733Seric /*
35264813Seric **  Mach386
35364813Seric **
35464813Seric **	For mt Xinu's Mach386 system.
35564813Seric */
35664813Seric 
35764813Seric #if defined(MACH) && defined(i386)
35864813Seric # define MACH386	1
35964813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
36064813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
36164813Seric # define HASFLOCK	1	/* has flock(2) call */
36264813Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
36364813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
36464813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
36564813Seric # define setpgid	setpgrp
36664813Seric # ifndef LA_TYPE
36764813Seric #  define LA_TYPE	LA_FLOAT
36864813Seric # endif
36964962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
37064813Seric # undef WEXITSTATUS
37164813Seric # undef WIFEXITED
37264813Seric # ifndef _PATH_SENDMAILCF
37364813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
37464813Seric # endif
37564813Seric # ifndef _PATH_SENDMAILPID
37664813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
37764813Seric # endif
37864813Seric #endif
37964813Seric 
38064813Seric 
38164813Seric /*
38263969Seric **  4.3 BSD -- this is for very old systems
38363969Seric **
38463969Seric **	You'll also have to install a new resolver library.
38563969Seric **	I don't guarantee that support for this environment is complete.
38663969Seric */
38763969Seric 
38863969Seric #ifdef oldBSD43
38963969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
39063969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
39163970Seric # define ARBPTR_T	char *
39264155Seric # define setpgid	setpgrp
39363969Seric # ifndef LA_TYPE
39463969Seric #  define LA_TYPE	LA_FLOAT
39563969Seric # endif
39663969Seric # ifndef _PATH_SENDMAILCF
39763969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
39863969Seric # endif
39964358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
40064834Seric # undef WEXITSTATUS
40164834Seric # undef WIFEXITED
40264834Seric typedef short		pid_t;
40364834Seric extern int		errno;
40463969Seric #endif
40563969Seric 
40664314Seric 
40763969Seric /*
40863902Seric **  SCO Unix
40965087Seric **
41065087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
41165087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
41265087Seric **	The second is, I believe, for an older version.
41363902Seric */
41463902Seric 
41565087Seric #ifdef _SCO_unix_4_2
41665087Seric # define _SCO_unix_
41765087Seric # define HASSETREUID	1	/* has setreuid(2) call */
41865087Seric # define _PATH_UNIX	"/unix"
41965087Seric # ifndef _PATH_SENDMAILCF
42065087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
42165087Seric # endif
42265087Seric # ifndef _PATH_SENDMAILPID
42365087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
42465087Seric # endif
42565087Seric #endif
42665087Seric 
42763838Seric #ifdef _SCO_unix_
42863838Seric # define SYSTEM5	1	/* include all the System V defines */
42964035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
43063987Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
43163838Seric # define FORK		fork
43263838Seric # define MAXPATHLEN	PATHSIZE
43364718Seric # define LA_TYPE	LA_SHORT
43464813Seric # undef NETUNIX			/* no unix domain socket support */
43563838Seric #endif
43663838Seric 
43764314Seric 
43863962Seric /*
43963962Seric **  ConvexOS 11.0 and later
44063962Seric */
44163962Seric 
44263962Seric #ifdef _CONVEX_SOURCE
44363977Seric # define BSD		1	/* include all the BSD defines */
44463977Seric # define HASUNAME	1	/* use System V uname(2) system call */
44563962Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
44663962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
44763977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
44863962Seric # define LA_TYPE	LA_FLOAT
44964032Seric # undef IDENTPROTO
45063962Seric #endif
45163962Seric 
45264314Seric 
45363962Seric /*
45464999Seric **  RISC/os 4.52
45563962Seric **
45664999Seric **	Gives a ton of warning messages, but otherwise compiles.
45763962Seric */
45863962Seric 
45963965Seric #ifdef RISCOS
46064999Seric 
46163962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
46264831Seric # define HASFLOCK	1	/* has flock(2) call */
46364999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
46464999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
46563962Seric # define LA_TYPE	LA_INT
46663962Seric # define LA_AVENRUN	"avenrun"
46763962Seric # define _PATH_UNIX	"/unix"
46864999Seric # undef WIFEXITED
46964999Seric 
47064999Seric # define setpgid	setpgrp
47164999Seric 
47264999Seric extern int		errno;
47364999Seric typedef int		pid_t;
47464999Seric #define			SIGFUNC_DEFINED
47564999Seric typedef int		(*sigfunc_t)();
47664999Seric extern char		*getenv();
47764999Seric extern void		*malloc();
47864999Seric 
47963962Seric #endif
48063962Seric 
48164314Seric 
48264155Seric /*
48364155Seric **  Linux 0.99pl10 and above...
48464155Seric **	From Karl London <karl@borg.demon.co.uk>.
48564155Seric */
48664155Seric 
48764770Seric #ifdef __linux__
48864155Seric # define BSD		1	/* pretend to be BSD based today */
48964155Seric # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
49064155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
49164380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
49264155Seric # ifndef LA_TYPE
49364155Seric #  define LA_TYPE	LA_FLOAT
49464155Seric # endif
49564763Seric # include <sys/sysmacros.h>
49665046Seric # define GIDSET_T	gid_t
49764155Seric #endif
49864155Seric 
49964155Seric 
50064345Seric /*
50164345Seric **  DELL SVR4 Issue 2.2, and others
50264345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
50364345Seric **
50464345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
50564345Seric **	defined, and the definitions conflict.
50664924Seric **
50764924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
50864924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
50964924Seric **	(SVR4.0/386 version 3.0).
51064345Seric */
51164345Seric 
51264345Seric #ifdef DELL_SVR4
51364345Seric # define SYSTEM5	1
51464924Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
51564924Seric # define setreuid(r, e)	seteuid(e)
51664345Seric /* # include <sys/time.h> */
51764345Seric # define _PATH_UNIX	"/unix"
51864345Seric # ifndef _PATH_SENDMAILCF
51964345Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
52064345Seric # endif
52164345Seric # ifndef _PATH_SENDMAILPID
52264345Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
52364345Seric # endif
52465105Seric # ifndef SYSLOG_BUFSIZE
52565105Seric #  define SYSLOG_BUFSIZE	128
52665105Seric # endif
52764345Seric #endif
52864345Seric 
52964345Seric 
53064380Seric /*
53164380Seric **  Apple A/UX 3.0
53264380Seric */
53364345Seric 
53464380Seric #ifdef _AUX_SOURCE
53564729Seric # include <sys/sysmacros.h>
53664380Seric # define BSD			/* has BSD routines */
53764380Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
53864380Seric # define HASUNAME	1	/* use System V uname(2) system call */
53964380Seric # define HASUSTAT	1	/* use System V ustat(2) syscall */
54064380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
54164561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
54264718Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
54364380Seric # define FORK		fork
54464380Seric # ifndef _PATH_SENDMAILCF
54564380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
54664380Seric # endif
54764380Seric # ifndef LA_TYPE
54864380Seric #  define LA_TYPE	LA_ZERO
54964380Seric # endif
55064560Seric # undef WIFEXITED
55164560Seric # undef WEXITSTATUS
55264380Seric #endif
55364380Seric 
55464380Seric 
55564705Seric /*
55664705Seric **  Encore UMAX V
55764705Seric **
55864705Seric **	Not extensively tested.
55964705Seric */
56064380Seric 
56164705Seric #ifdef UMAXV
56264705Seric # include <limits.h>
56364705Seric # define HASUNAME	1	/* use System V uname(2) system call */
56464705Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
56564705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
56664705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
56764705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
56864705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
56964705Seric # define FORK		fork	/* no vfork(2) primitive available */
57064705Seric # define MAXPATHLEN	PATH_MAX
57164705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
57264705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
57364705Seric # undef WIFEXITED
57464705Seric # undef WEXITSTATUS
57564705Seric #endif
57664705Seric 
57764705Seric 
57864939Seric /*
57964939Seric **  Stardent Titan 3000 running TitanOS 4.2.
58064939Seric **
58164939Seric **	Must be compiled in "cc -43" mode.
58264939Seric **
58364944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
58464939Seric **
58564939Seric **	Note the tweaking below after the BSD defines are set.
58664939Seric */
58764705Seric 
58864939Seric #ifdef titan
58964939Seric # define setpgid	setpgrp
59064939Seric typedef int		pid_t;
59164939Seric # undef WIFEXITED
59264939Seric # undef WEXITSTATUS
59364939Seric #endif
59464939Seric 
59564939Seric 
59664962Seric /*
59764962Seric **  Sequent DYNIX 3.2.0
59864962Seric **
59964962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
60064962Seric */
60164939Seric 
60264962Seric #ifdef sequent
60364962Seric # define BSD		1
60464962Seric # define HASUNSETENV	1
60564962Seric # define BSD4_3		1	/* to get signal() in conf.c */
60664962Seric # define WAITUNION	1
60764962Seric # define LA_TYPE	LA_FLOAT
60864962Seric # ifdef	_POSIX_VERSION
60964962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
61064962Seric # endif
61164962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
61264962Seric # define setpgid	setpgrp
61364962Seric 
61464962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
61564962Seric # undef	WIFEXITED
61664962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
61764962Seric 			 ((union wait*)&(s))->w_termsig == 0)
61864962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
61964962Seric typedef int		pid_t;
62064962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
62164962Seric 
62264962Seric # ifndef _PATH_UNIX
62364962Seric #  define _PATH_UNIX	"/dynix"
62464962Seric # endif
62564962Seric # ifndef _PATH_SENDMAILCF
62664962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
62764962Seric # endif
62864962Seric 
62964962Seric #endif
63064962Seric 
63164962Seric 
63264962Seric 
63364962Seric 
63463902Seric /**********************************************************************
63563787Seric **  End of Per-Operating System defines
63663902Seric **********************************************************************/
63763787Seric 
63863949Seric /**********************************************************************
63963949Seric **  More general defines
64063949Seric **********************************************************************/
64163949Seric 
64263962Seric /* general BSD defines */
64363962Seric #ifdef BSD
64464035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
64564035Seric # define HASSETREUID	1	/* has setreuid(2) call */
64664035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
64764035Seric # define HASFLOCK	1	/* has flock(2) call */
64863962Seric #endif
64963962Seric 
65063787Seric /* general System V defines */
65163787Seric # ifdef SYSTEM5
65264813Seric # include <sys/sysmacros.h>
65363949Seric # define HASUNAME	1	/* use System V uname(2) system call */
65463949Seric # define HASUSTAT	1	/* use System V ustat(2) syscall */
65564705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
65664962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
65763962Seric # ifndef LA_TYPE
65863962Seric #  define LA_TYPE	LA_INT
65963962Seric # endif
66063949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
66163949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
66263949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
66363787Seric # endif
66463787Seric 
66563949Seric /* general POSIX defines */
66663949Seric #ifdef _POSIX_VERSION
66764718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
66864718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
66963949Seric #endif
67063949Seric 
67163787Seric /*
67263937Seric **  If no type for argument two of getgroups call is defined, assume
67363937Seric **  it's an integer -- unfortunately, there seem to be several choices
67463937Seric **  here.
67563937Seric */
67663937Seric 
67763937Seric #ifndef GIDSET_T
67863937Seric # define GIDSET_T	int
67963937Seric #endif
68063937Seric 
68164939Seric /*
68264939Seric **  Tweaking for systems that (for example) claim to be BSD but
68364939Seric **  don't have all the standard BSD routines (boo hiss).
68464939Seric */
68564439Seric 
68664939Seric #ifdef titan
68764939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
68864939Seric #endif
68964939Seric 
69064939Seric 
69164439Seric /**********************************************************************
69259023Seric **  Remaining definitions should never have to be changed.  They are
69359023Seric **  primarily to provide back compatibility for older systems -- for
69459287Seric **  example, it includes some POSIX compatibility definitions
69564439Seric **********************************************************************/
69659023Seric 
69759388Seric /* System 5 compatibility */
69859388Seric #ifndef S_ISREG
69964944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
70059388Seric #endif
70164944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
70264944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
70364944Seric #endif
70459388Seric #ifndef S_IWGRP
70559388Seric #define S_IWGRP		020
70659388Seric #endif
70759388Seric #ifndef S_IWOTH
70859388Seric #define S_IWOTH		002
70959388Seric #endif
71059388Seric 
71159023Seric /*
71250537Seric **  Older systems don't have this error code -- it should be in
71350537Seric **  /usr/include/sysexits.h.
71450537Seric */
71550537Seric 
71650537Seric # ifndef EX_CONFIG
71750537Seric # define EX_CONFIG	78	/* configuration error */
71850537Seric # endif
71956852Seric 
72064718Seric /* pseudo-code used in server SMTP */
72164718Seric # define EX_QUIT	22	/* drop out of server immediately */
72264718Seric 
72364718Seric 
72463993Seric /*
72563993Seric **  These are used in a few cases where we need some special
72663993Seric **  error codes, but where the system doesn't provide something
72763993Seric **  reasonable.  They are printed in errstring.
72863993Seric */
72963993Seric 
73063993Seric #ifndef E_PSEUDOBASE
73163993Seric # define E_PSEUDOBASE	256
73263993Seric #endif
73363993Seric 
73463993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
73563993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
73663993Seric 
73763970Seric /* type of arbitrary pointer */
73863970Seric #ifndef ARBPTR_T
73963970Seric # define ARBPTR_T	void *
74063970Seric #endif
74163970Seric 
74260568Seric #ifndef __P
74360568Seric # include "cdefs.h"
74460568Seric #endif
74560568Seric 
74656852Seric /*
74758778Seric **  Do some required dependencies
74858778Seric */
74958778Seric 
75058778Seric #if defined(NETINET) || defined(NETISO)
75159107Seric # define SMTP		1	/* enable user and server SMTP */
75259107Seric # define QUEUE		1	/* enable queueing */
75359107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
75458778Seric #endif
75558778Seric 
75658778Seric 
75758778Seric /*
75856852Seric **  Arrange to use either varargs or stdargs
75956852Seric */
76056852Seric 
76156852Seric # ifdef __STDC__
76256852Seric 
76356852Seric # include <stdarg.h>
76456852Seric 
76556852Seric # define VA_LOCAL_DECL	va_list ap;
76656852Seric # define VA_START(f)	va_start(ap, f)
76756852Seric # define VA_END		va_end(ap)
76856852Seric 
76956852Seric # else
77056852Seric 
77156852Seric # include <varargs.h>
77256852Seric 
77356852Seric # define VA_LOCAL_DECL	va_list ap;
77456852Seric # define VA_START(f)	va_start(ap)
77556852Seric # define VA_END		va_end(ap)
77656852Seric 
77756852Seric # endif
77857631Seric 
77957943Seric #ifdef HASUNAME
78057631Seric # include <sys/utsname.h>
78157631Seric # ifdef newstr
78257631Seric #  undef newstr
78357631Seric # endif
78457943Seric #else /* ! HASUNAME */
78557631Seric # define NODE_LENGTH 32
78657631Seric struct utsname
78757631Seric {
78857631Seric 	char nodename[NODE_LENGTH+1];
78957631Seric };
79057943Seric #endif /* HASUNAME */
79157642Seric 
79263838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
79363838Seric # define MAXHOSTNAMELEN	256
79457735Seric #endif
79558153Seric 
79658153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
79758153Seric # define SIGCHLD	SIGCLD
79858153Seric #endif
79958153Seric 
80058153Seric #ifndef STDIN_FILENO
80158153Seric #define STDIN_FILENO	0
80258153Seric #endif
80358153Seric 
80458153Seric #ifndef STDOUT_FILENO
80558153Seric #define STDOUT_FILENO	1
80658153Seric #endif
80758153Seric 
80858153Seric #ifndef STDERR_FILENO
80958153Seric #define STDERR_FILENO	2
81058153Seric #endif
81158689Seric 
81264072Seric #ifndef LOCK_SH
81364035Seric # define LOCK_SH	0x01	/* shared lock */
81464035Seric # define LOCK_EX	0x02	/* exclusive lock */
81564035Seric # define LOCK_NB	0x04	/* non-blocking lock */
81664035Seric # define LOCK_UN	0x08	/* unlock */
81764035Seric #endif
81858692Seric 
81964035Seric #ifndef SIG_ERR
82064035Seric # define SIG_ERR	((void (*)()) -1)
82158689Seric #endif
82258702Seric 
82364500Seric #ifndef WEXITSTATUS
82464500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
82564500Seric #endif
82664500Seric #ifndef WIFEXITED
82764500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
82864500Seric #endif
82964500Seric 
83064561Seric #ifndef SIGFUNC_DEFINED
83164561Seric typedef void		(*sigfunc_t) __P((int));
83264561Seric #endif
83364561Seric 
83465053Seric /* size of syslog buffer */
83565053Seric #ifndef SYSLOG_BUFSIZE
83665053Seric # define SYSLOG_BUFSIZE	1024
83765053Seric #endif
83865053Seric 
83958702Seric /*
84058702Seric **  Size of tobuf (deliver.c)
84158702Seric **	Tweak this to match your syslog implementation.  It will have to
84258702Seric **	allow for the extra information printed.
84358702Seric */
84458702Seric 
84558702Seric #ifndef TOBUFSIZE
84665053Seric # if (SYSLOG_BUFSIZE) > 512
84765053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
84865053Seric # else
84965053Seric #  define TOBUFSIZE	256
85065053Seric # endif
85158702Seric #endif
85260219Seric 
85365015Seric /*
85465015Seric **  Size of prescan buffer.
85565015Seric **	Despite comments in the _sendmail_ book, this probably should
85665015Seric **	not be changed; there are some hard-to-define dependencies.
85765015Seric */
85865015Seric 
85965015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
86060219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
86160219Seric # ifndef FORK
86260219Seric # define FORK		vfork		/* function to call to fork mailer */
86360219Seric # endif
86464929Seric 
86564929Seric #ifndef IDENTPROTO
86664929Seric # define IDENTPROTO	0		/* don't use RFC 1413 */
86764929Seric #endif
868