xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 64939)
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*64939Seric  *	@(#)conf.h	8.53 (Berkeley) 11/25/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 */
4159303Seric # define PSBUFSIZE	(MAXLINE + MAXATOM)	/* size of prescan buffer */
4257143Seric 
4357143Seric # ifndef QUEUESIZE
4457143Seric # define QUEUESIZE	1000		/* max # of jobs per queue run */
4557143Seric # endif
4657143Seric 
4763902Seric /**********************************************************************
489147Seric **  Compilation options.
4925673Seric **
5025673Seric **	#define these if they are available; comment them out otherwise.
5163902Seric **********************************************************************/
529147Seric 
5325673Seric # define LOG		1	/* enable logging */
5425673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
5564813Seric # define NETUNIX	1	/* include unix domain support */
5658778Seric # define NETINET	1	/* include internet support */
5725673Seric # define SETPROCTITLE	1	/* munge argv to display current status */
5835651Seric # define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
5953735Seric # define MATCHGECOS	1	/* match user names from gecos field */
6063753Seric # define XDEBUG		1	/* enable extended debugging */
6136483Sbostic 
6256337Seric # ifdef NEWDB
6356337Seric # define USERDB		1	/* look in user database (requires NEWDB) */
6456337Seric # endif
6556337Seric 
6664032Seric /*
6764032Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
6864032Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
6964032Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
7064032Seric **  are closed.  Some firewalls return this error if you try to connect
7164032Seric **  to the IDENT port (113), so you can't receive email from these hosts
7264032Seric **  on these systems.  The firewall really should use a more specific
7364032Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  This
7464032Seric **  will get #undefed below as needed.
7564032Seric */
7664032Seric 
7764929Seric #ifndef IDENTPROTO
7864032Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
7964929Seric #endif
8064032Seric 
8163902Seric /**********************************************************************
8259023Seric **  Operating system configuration.
8359023Seric **
8459023Seric **	Unless you are porting to a new OS, you shouldn't have to
8559023Seric **	change these.
8663902Seric **********************************************************************/
8756823Seric 
8863787Seric /*
8963787Seric **  Per-Operating System defines
9063787Seric */
9163787Seric 
9264314Seric 
9363902Seric /*
9463902Seric **  HP-UX -- tested for 8.07
9563902Seric */
9663902Seric 
9759348Seric # ifdef __hpux
9864727Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
9964727Seric # undef m_flags
10063787Seric # define SYSTEM5	1	/* include all the System V defines */
10164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
10264314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
10364035Seric # define HASSETREUID	1	/* has setreuid(2) call */
10463902Seric # define setreuid(r, e)		setresuid(r, e, -1)
10563962Seric # define LA_TYPE	LA_FLOAT
10663962Seric # define _PATH_UNIX	"/hp-ux"
10764358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
10856823Seric # endif
10956823Seric 
11064314Seric 
11163902Seric /*
11263902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
11363902Seric */
11463902Seric 
11560224Seric # ifdef _AIX3
11664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
11764840Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
11864840Seric # define HASUNAME	1	/* use System V uname(2) system call */
11960219Seric # define FORK		fork	/* no vfork primitive available */
12064494Seric # undef  SETPROCTITLE		/* setproctitle confuses AIX */
12160219Seric # endif
12260219Seric 
12364314Seric 
12463902Seric /*
12563902Seric **  Silicon Graphics IRIX
12663902Seric **
12763965Seric **	Compiles on 4.0.1.
12863902Seric */
12963902Seric 
13063753Seric # ifdef IRIX
13164727Seric # include <sys/sysmacros.h>
13264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
13364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
13464314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
13563753Seric # define FORK		fork	/* no vfork primitive available */
13664562Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
13764155Seric # define setpgid	BSDsetpgrp
13863937Seric # define GIDSET_T	gid_t
13963753Seric # endif
14063753Seric 
14163902Seric 
14263902Seric /*
14364813Seric **  SunOS and Solaris
14464813Seric **
14564813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
14664813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
14763902Seric */
14863902Seric 
14963787Seric #if defined(sun) && !defined(BSD)
15059074Seric 
15163962Seric # define LA_TYPE	LA_INT
15264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
15364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
15464813Seric # define HASUNAME	1	/* use System V uname(2) system call */
15560564Seric 
15664842Seric # ifdef SOLARIS_2_3
15764842Seric #  define SOLARIS
15864842Seric # endif
15964842Seric 
16060602Seric # ifdef SOLARIS
16163902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
16263949Seric #  define SYSTEM5	1	/* use System V definitions */
16363977Seric #  define setreuid(r, e)	seteuid(e)
16463787Seric #  include <sys/time.h>
16564832Seric #  define gethostbyname	solaris_gethostbyname	/* get working version */
16664832Seric #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
16763962Seric #  define _PATH_UNIX	"/kernel/unix"
16863962Seric #  ifndef _PATH_SENDMAILCF
16963962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
17064072Seric #  endif
17164072Seric #  ifndef _PATH_SENDMAILPID
17263962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
17363962Seric #  endif
17463787Seric 
17560602Seric # else
17663787Seric 			/* SunOS 4.1.x */
17760602Seric #  define HASSTATFS	1	/* has the statfs(2) syscall */
17864831Seric #  define HASFLOCK	1	/* has flock(2) call */
17960564Seric #  include <vfork.h>
18063787Seric 
18160564Seric # endif
18259023Seric #endif
18359023Seric 
18464718Seric /*
18564813Seric **  DG/UX
18664813Seric **
18764813Seric **	Tested on 5.4.2
18864718Seric */
18964314Seric 
19064718Seric #ifdef	DGUX
19164718Seric # define SYSTEM5	1
19264718Seric # define LA_TYPE	LA_SUBR
19364718Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
19464718Seric # define HASSETREUID	1	/* has setreuid(2) call */
19564718Seric # define HASUNAME	1	/* use System V uname(2) system call */
19664718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
19764718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
19864718Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
19964718Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
20064718Seric # undef SETPROCTITLE
20164813Seric 
20264813Seric /* these include files must be included early on DG/UX */
20364813Seric # include <netinet/in.h>
20464813Seric # include <arpa/inet.h>
20564813Seric 
20664718Seric # define inet_addr	dgux_inet_addr
20764718Seric extern long	dgux_inet_addr();
20864718Seric #endif
20964718Seric 
21064718Seric 
21163902Seric /*
21263902Seric **  Digital Ultrix 4.2A or 4.3
21364264Seric **
21464264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
21564264Seric **	not dropped when the process exits.  This causes major problems,
21664264Seric **	so flock is the only alternative.
21763902Seric */
21863902Seric 
21960564Seric #ifdef ultrix
22060564Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
22164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
22263962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
22364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
22464264Seric # define HASFLOCK	1	/* has flock(2) call */
22563962Seric # define LA_TYPE	LA_INT
22663962Seric # define LA_AVENRUN	"avenrun"
22764358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
22860564Seric #endif
22960564Seric 
23064314Seric 
23163902Seric /*
23263902Seric **  OSF/1 (tested on Alpha)
23363902Seric */
23463902Seric 
23563787Seric #ifdef __osf__
23664314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
23763962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
23864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
23964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
24064831Seric # define HASFLOCK	1	/* has flock(2) call */
24163962Seric # define LA_TYPE	LA_INT
24264813Seric # ifndef _PATH_SENDMAILPID
24364813Seric #  define _PATH_SENDMAILPID	"/var/run/sendmial.pid"
24464813Seric # endif
24559287Seric #endif
24659287Seric 
24764314Seric 
24863902Seric /*
24963902Seric **  NeXTstep
25063902Seric */
25163902Seric 
25264076Seric #ifdef NeXT
25364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
25464035Seric # define HASFLOCK	1	/* has flock(2) call */
25564125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
25664314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
25764563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
25863753Seric # define sleep		sleepX
25964155Seric # define setpgid	setpgrp
26064295Seric # ifndef LA_TYPE
26164295Seric #  define LA_TYPE	LA_MACH
26264295Seric # endif
26364500Seric # ifndef _POSIX_SOURCE
26464035Seric typedef int		pid_t;
26564500Seric #  undef WEXITSTATUS
26664500Seric #  undef WIFEXITED
26764500Seric # endif
26864072Seric # ifndef _PATH_SENDMAILCF
26964072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
27064072Seric # endif
27164072Seric # ifndef _PATH_SENDMAILPID
27264072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
27364072Seric # endif
27459288Seric #endif
27559288Seric 
27664314Seric 
27763902Seric /*
27863962Seric **  4.4 BSD
27964831Seric **
28064831Seric **	See also BSD defines.
28163902Seric */
28263902Seric 
28360568Seric #ifdef BSD4_4
28464072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
28564314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
28660568Seric # include <sys/cdefs.h>
28763838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
28864072Seric # ifndef LA_TYPE
28964072Seric #  define LA_TYPE	LA_SUBR
29064072Seric # endif
29160568Seric #endif
29260568Seric 
29364314Seric 
29463902Seric /*
29564733Seric **  386BSD / FreeBSD 1.0E (works) / NetBSD (not tested)
29664733Seric **
29764733Seric **  4.3BSD clone, closer to 4.4BSD
29864831Seric **
29964831Seric **	See also BSD defines.
30064733Seric */
30164733Seric 
30264733Seric #ifdef __386BSD__
30364733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
30464733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
30564733Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
30664733Seric # include <sys/cdefs.h>
30764733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
30864733Seric # ifndef LA_TYPE
30964733Seric #  define LA_TYPE	LA_SUBR
31064733Seric # endif
31164733Seric #endif
31264733Seric 
31364733Seric 
31464733Seric /*
31564813Seric **  Mach386
31664813Seric **
31764813Seric **	For mt Xinu's Mach386 system.
31864813Seric */
31964813Seric 
32064813Seric #if defined(MACH) && defined(i386)
32164813Seric # define MACH386	1
32264813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
32364813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
32464813Seric # define HASFLOCK	1	/* has flock(2) call */
32564813Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
32664813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
32764813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
32864813Seric # define setpgid	setpgrp
32964813Seric # ifndef LA_TYPE
33064813Seric #  define LA_TYPE	LA_FLOAT
33164813Seric # endif
33264813Seric # undef WEXITSTATUS
33364813Seric # undef WIFEXITED
33464813Seric # ifndef _PATH_SENDMAILCF
33564813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
33664813Seric # endif
33764813Seric # ifndef _PATH_SENDMAILPID
33864813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
33964813Seric # endif
34064813Seric #endif
34164813Seric 
34264813Seric 
34364813Seric /*
34463969Seric **  4.3 BSD -- this is for very old systems
34563969Seric **
34663969Seric **	You'll also have to install a new resolver library.
34763969Seric **	I don't guarantee that support for this environment is complete.
34863969Seric */
34963969Seric 
35063969Seric #ifdef oldBSD43
35163969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
35263969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
35363970Seric # define ARBPTR_T	char *
35464155Seric # define setpgid	setpgrp
35563969Seric # ifndef LA_TYPE
35663969Seric #  define LA_TYPE	LA_FLOAT
35763969Seric # endif
35863969Seric # ifndef _PATH_SENDMAILCF
35963969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
36063969Seric # endif
36164358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
36264834Seric # undef WEXITSTATUS
36364834Seric # undef WIFEXITED
36464834Seric typedef short		pid_t;
36564834Seric extern int		errno;
36663969Seric #endif
36763969Seric 
36864314Seric 
36963969Seric /*
37063902Seric **  SCO Unix
37163902Seric */
37263902Seric 
37363838Seric #ifdef _SCO_unix_
37463838Seric # define SYSTEM5	1	/* include all the System V defines */
37564035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
37663987Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
37763838Seric # define FORK		fork
37863838Seric # define MAXPATHLEN	PATHSIZE
37964718Seric # define LA_TYPE	LA_SHORT
38064813Seric # undef NETUNIX			/* no unix domain socket support */
38163838Seric #endif
38263838Seric 
38364314Seric 
38463962Seric /*
38563962Seric **  ConvexOS 11.0 and later
38663962Seric */
38763962Seric 
38863962Seric #ifdef _CONVEX_SOURCE
38963977Seric # define BSD		1	/* include all the BSD defines */
39063977Seric # define HASUNAME	1	/* use System V uname(2) system call */
39163962Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
39263962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
39363977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
39463962Seric # define LA_TYPE	LA_FLOAT
39564032Seric # undef IDENTPROTO
39663962Seric #endif
39763962Seric 
39864314Seric 
39963962Seric /*
40063962Seric **  RISC/os 4.51
40163962Seric **
40263962Seric **	Untested...
40363962Seric */
40463962Seric 
40563965Seric #ifdef RISCOS
40663962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
40764831Seric # define HASFLOCK	1	/* has flock(2) call */
40863962Seric # define LA_TYPE	LA_INT
40963962Seric # define LA_AVENRUN	"avenrun"
41063962Seric # define _PATH_UNIX	"/unix"
41163962Seric #endif
41263962Seric 
41364314Seric 
41464155Seric /*
41564155Seric **  Linux 0.99pl10 and above...
41664155Seric **	From Karl London <karl@borg.demon.co.uk>.
41764155Seric */
41864155Seric 
41964770Seric #ifdef __linux__
42064155Seric # define BSD		1	/* pretend to be BSD based today */
42164155Seric # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
42264155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
42364380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
42464155Seric # ifndef LA_TYPE
42564155Seric #  define LA_TYPE	LA_FLOAT
42664155Seric # endif
42764763Seric # include <sys/sysmacros.h>
42864155Seric #endif
42964155Seric 
43064155Seric 
43164345Seric /*
43264345Seric **  DELL SVR4 Issue 2.2, and others
43364345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
43464345Seric **
43564345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
43664345Seric **	defined, and the definitions conflict.
43764924Seric **
43864924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
43964924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
44064924Seric **	(SVR4.0/386 version 3.0).
44164345Seric */
44264345Seric 
44364345Seric #ifdef DELL_SVR4
44464345Seric # define SYSTEM5	1
44564924Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
44664924Seric # define setreuid(r, e)	seteuid(e)
44764345Seric /* # include <sys/time.h> */
44864345Seric # define _PATH_UNIX	"/unix"
44964345Seric # ifndef _PATH_SENDMAILCF
45064345Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
45164345Seric # endif
45264345Seric # ifndef _PATH_SENDMAILPID
45364345Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
45464345Seric # endif
45564345Seric #endif
45664345Seric 
45764345Seric 
45864380Seric /*
45964380Seric **  Apple A/UX 3.0
46064380Seric */
46164345Seric 
46264380Seric #ifdef _AUX_SOURCE
46364729Seric # include <sys/sysmacros.h>
46464380Seric # define BSD			/* has BSD routines */
46564380Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
46664380Seric # define HASUNAME	1	/* use System V uname(2) system call */
46764380Seric # define HASUSTAT	1	/* use System V ustat(2) syscall */
46864380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
46964561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
47064718Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
47164380Seric # define FORK		fork
47264380Seric # ifndef _PATH_SENDMAILCF
47364380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
47464380Seric # endif
47564380Seric # ifndef LA_TYPE
47664380Seric #  define LA_TYPE	LA_ZERO
47764380Seric # endif
47864560Seric # undef WIFEXITED
47964560Seric # undef WEXITSTATUS
48064380Seric #endif
48164380Seric 
48264380Seric 
48364705Seric /*
48464705Seric **  Encore UMAX V
48564705Seric **
48664705Seric **	Not extensively tested.
48764705Seric */
48864380Seric 
48964705Seric #ifdef UMAXV
49064705Seric # include <limits.h>
49164705Seric # define HASUNAME	1	/* use System V uname(2) system call */
49264705Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
49364705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
49464705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
49564705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
49664705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
49764705Seric # define FORK		fork	/* no vfork(2) primitive available */
49864705Seric # define MAXPATHLEN	PATH_MAX
49964705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
50064705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
50164705Seric # undef WIFEXITED
50264705Seric # undef WEXITSTATUS
50364705Seric #endif
50464705Seric 
50564705Seric 
506*64939Seric /*
507*64939Seric **  Stardent Titan 3000 running TitanOS 4.2.
508*64939Seric **
509*64939Seric **	Must be compiled in "cc -43" mode.
510*64939Seric **
511*64939Seric **	From Kate HedStrom <kate@ahab.rutgers.edu>.
512*64939Seric **
513*64939Seric **	Note the tweaking below after the BSD defines are set.
514*64939Seric */
51564705Seric 
516*64939Seric #ifdef titan
517*64939Seric # define setpgid	setpgrp
518*64939Seric typedef int		pid_t;
519*64939Seric # undef WIFEXITED
520*64939Seric # undef WEXITSTATUS
521*64939Seric #endif
522*64939Seric 
523*64939Seric 
524*64939Seric 
52563902Seric /**********************************************************************
52663787Seric **  End of Per-Operating System defines
52763902Seric **********************************************************************/
52863787Seric 
52963949Seric /**********************************************************************
53063949Seric **  More general defines
53163949Seric **********************************************************************/
53263949Seric 
53363962Seric /* general BSD defines */
53463962Seric #ifdef BSD
53564035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
53664035Seric # define HASSETREUID	1	/* has setreuid(2) call */
53764035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
53864035Seric # define HASFLOCK	1	/* has flock(2) call */
53963962Seric #endif
54063962Seric 
54163787Seric /* general System V defines */
54263787Seric # ifdef SYSTEM5
54364813Seric # include <sys/sysmacros.h>
54463949Seric # define HASUNAME	1	/* use System V uname(2) system call */
54563949Seric # define HASUSTAT	1	/* use System V ustat(2) syscall */
54664705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
54763962Seric # ifndef LA_TYPE
54863962Seric #  define LA_TYPE	LA_INT
54963962Seric # endif
55063949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
55163949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
55263949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
55363787Seric # endif
55463787Seric 
55563949Seric /* general "standard C" defines */
55664813Seric #if (defined(__STDC__) && !defined(MACH386)) || defined(SYSTEM5)
55763949Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
55863949Seric #endif
55963949Seric 
56063949Seric /* general POSIX defines */
56163949Seric #ifdef _POSIX_VERSION
56264718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
56364718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
56463949Seric #endif
56563949Seric 
56663787Seric /*
56763937Seric **  If no type for argument two of getgroups call is defined, assume
56863937Seric **  it's an integer -- unfortunately, there seem to be several choices
56963937Seric **  here.
57063937Seric */
57163937Seric 
57263937Seric #ifndef GIDSET_T
57363937Seric # define GIDSET_T	int
57463937Seric #endif
57563937Seric 
576*64939Seric /*
577*64939Seric **  Tweaking for systems that (for example) claim to be BSD but
578*64939Seric **  don't have all the standard BSD routines (boo hiss).
579*64939Seric */
58064439Seric 
581*64939Seric #ifdef titan
582*64939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
583*64939Seric #endif
584*64939Seric 
585*64939Seric 
58664439Seric /**********************************************************************
58759023Seric **  Remaining definitions should never have to be changed.  They are
58859023Seric **  primarily to provide back compatibility for older systems -- for
58959287Seric **  example, it includes some POSIX compatibility definitions
59064439Seric **********************************************************************/
59159023Seric 
59259388Seric /* System 5 compatibility */
59359388Seric #ifndef S_ISREG
59459388Seric #define S_ISREG(foo)	((foo & S_IFREG) == S_IFREG)
59559388Seric #endif
59659388Seric #ifndef S_IWGRP
59759388Seric #define S_IWGRP		020
59859388Seric #endif
59959388Seric #ifndef S_IWOTH
60059388Seric #define S_IWOTH		002
60159388Seric #endif
60259388Seric 
60359023Seric /*
60450537Seric **  Older systems don't have this error code -- it should be in
60550537Seric **  /usr/include/sysexits.h.
60650537Seric */
60750537Seric 
60850537Seric # ifndef EX_CONFIG
60950537Seric # define EX_CONFIG	78	/* configuration error */
61050537Seric # endif
61156852Seric 
61264718Seric /* pseudo-code used in server SMTP */
61364718Seric # define EX_QUIT	22	/* drop out of server immediately */
61464718Seric 
61564718Seric 
61663993Seric /*
61763993Seric **  These are used in a few cases where we need some special
61863993Seric **  error codes, but where the system doesn't provide something
61963993Seric **  reasonable.  They are printed in errstring.
62063993Seric */
62163993Seric 
62263993Seric #ifndef E_PSEUDOBASE
62363993Seric # define E_PSEUDOBASE	256
62463993Seric #endif
62563993Seric 
62663993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
62763993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
62863993Seric 
62963970Seric /* type of arbitrary pointer */
63063970Seric #ifndef ARBPTR_T
63163970Seric # define ARBPTR_T	void *
63263970Seric #endif
63363970Seric 
63460568Seric #ifndef __P
63560568Seric # include "cdefs.h"
63660568Seric #endif
63760568Seric 
63856852Seric /*
63958778Seric **  Do some required dependencies
64058778Seric */
64158778Seric 
64258778Seric #if defined(NETINET) || defined(NETISO)
64359107Seric # define SMTP		1	/* enable user and server SMTP */
64459107Seric # define QUEUE		1	/* enable queueing */
64559107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
64658778Seric #endif
64758778Seric 
64858778Seric 
64958778Seric /*
65056852Seric **  Arrange to use either varargs or stdargs
65156852Seric */
65256852Seric 
65356852Seric # ifdef __STDC__
65456852Seric 
65556852Seric # include <stdarg.h>
65656852Seric 
65756852Seric # define VA_LOCAL_DECL	va_list ap;
65856852Seric # define VA_START(f)	va_start(ap, f)
65956852Seric # define VA_END		va_end(ap)
66056852Seric 
66156852Seric # else
66256852Seric 
66356852Seric # include <varargs.h>
66456852Seric 
66556852Seric # define VA_LOCAL_DECL	va_list ap;
66656852Seric # define VA_START(f)	va_start(ap)
66756852Seric # define VA_END		va_end(ap)
66856852Seric 
66956852Seric # endif
67057631Seric 
67157943Seric #ifdef HASUNAME
67257631Seric # include <sys/utsname.h>
67357631Seric # ifdef newstr
67457631Seric #  undef newstr
67557631Seric # endif
67657943Seric #else /* ! HASUNAME */
67757631Seric # define NODE_LENGTH 32
67857631Seric struct utsname
67957631Seric {
68057631Seric 	char nodename[NODE_LENGTH+1];
68157631Seric };
68257943Seric #endif /* HASUNAME */
68357642Seric 
68463838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
68563838Seric # define MAXHOSTNAMELEN	256
68657735Seric #endif
68758153Seric 
68858153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
68958153Seric # define SIGCHLD	SIGCLD
69058153Seric #endif
69158153Seric 
69258153Seric #ifndef STDIN_FILENO
69358153Seric #define STDIN_FILENO	0
69458153Seric #endif
69558153Seric 
69658153Seric #ifndef STDOUT_FILENO
69758153Seric #define STDOUT_FILENO	1
69858153Seric #endif
69958153Seric 
70058153Seric #ifndef STDERR_FILENO
70158153Seric #define STDERR_FILENO	2
70258153Seric #endif
70358689Seric 
70464072Seric #ifndef LOCK_SH
70564035Seric # define LOCK_SH	0x01	/* shared lock */
70664035Seric # define LOCK_EX	0x02	/* exclusive lock */
70764035Seric # define LOCK_NB	0x04	/* non-blocking lock */
70864035Seric # define LOCK_UN	0x08	/* unlock */
70964035Seric #endif
71058692Seric 
71164035Seric #ifndef SIG_ERR
71264035Seric # define SIG_ERR	((void (*)()) -1)
71358689Seric #endif
71458702Seric 
71564500Seric #ifndef WEXITSTATUS
71664500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
71764500Seric #endif
71864500Seric #ifndef WIFEXITED
71964500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
72064500Seric #endif
72164500Seric 
72264561Seric #ifndef SIGFUNC_DEFINED
72364561Seric typedef void		(*sigfunc_t) __P((int));
72464561Seric #endif
72564561Seric 
72658702Seric /*
72758702Seric **  Size of tobuf (deliver.c)
72858702Seric **	Tweak this to match your syslog implementation.  It will have to
72958702Seric **	allow for the extra information printed.
73058702Seric */
73158702Seric 
73258702Seric #ifndef TOBUFSIZE
73358702Seric # define TOBUFSIZE (1024 - 256)
73458702Seric #endif
73560219Seric 
73660219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
73760219Seric # ifndef FORK
73860219Seric # define FORK		vfork		/* function to call to fork mailer */
73960219Seric # endif
74064929Seric 
74164929Seric #ifndef IDENTPROTO
74264929Seric # define IDENTPROTO	0		/* don't use RFC 1413 */
74364929Seric #endif
744