xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 65211)
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*65211Seric  *	@(#)conf.h	8.69 (Berkeley) 12/26/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 /*
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 /*
10063902Seric **  HP-UX -- tested for 8.07
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 */
10864314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
10964035Seric # define HASSETREUID	1	/* has setreuid(2) call */
11063902Seric # define setreuid(r, e)		setresuid(r, e, -1)
11163962Seric # define LA_TYPE	LA_FLOAT
11263962Seric # define _PATH_UNIX	"/hp-ux"
11365167Seric # ifndef IDENTPROTO
11465167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
11556823Seric # endif
11665167Seric # endif
11756823Seric 
11864314Seric 
11963902Seric /*
12063902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
12163902Seric */
12263902Seric 
12360224Seric # ifdef _AIX3
12464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
12564840Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
12664840Seric # define HASUNAME	1	/* use System V uname(2) system call */
127*65211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
12860219Seric # define FORK		fork	/* no vfork primitive available */
12964494Seric # undef  SETPROCTITLE		/* setproctitle confuses AIX */
13060219Seric # endif
13160219Seric 
13264314Seric 
13363902Seric /*
13463902Seric **  Silicon Graphics IRIX
13563902Seric **
13663965Seric **	Compiles on 4.0.1.
13763902Seric */
13863902Seric 
13963753Seric # ifdef IRIX
14064727Seric # include <sys/sysmacros.h>
14164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
14264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
14364314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
144*65211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
14563753Seric # define FORK		fork	/* no vfork primitive available */
14664562Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
14764155Seric # define setpgid	BSDsetpgrp
14863937Seric # define GIDSET_T	gid_t
14963753Seric # endif
15063753Seric 
15163902Seric 
15263902Seric /*
15364813Seric **  SunOS and Solaris
15464813Seric **
15564813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
15664813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
15763902Seric */
15863902Seric 
15963787Seric #if defined(sun) && !defined(BSD)
16059074Seric 
16163962Seric # define LA_TYPE	LA_INT
16264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
16364813Seric # define HASUNAME	1	/* use System V uname(2) system call */
164*65211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
16560564Seric 
16664842Seric # ifdef SOLARIS_2_3
16764842Seric #  define SOLARIS
16864842Seric # endif
16964842Seric 
17060602Seric # ifdef SOLARIS
17163902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
17265189Seric 			/* see also __svr4__ defines below */
17363787Seric #  include <sys/time.h>
17464832Seric #  define gethostbyname	solaris_gethostbyname	/* get working version */
17564832Seric #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
17665172Seric #  define GIDSET_T	gid_t
17765189Seric #  ifndef _PATH_UNIX
17865189Seric #   define _PATH_UNIX	"/kernel/unix"
17965189Seric #  endif
18063962Seric #  ifndef _PATH_SENDMAILCF
18163962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
18264072Seric #  endif
18364072Seric #  ifndef _PATH_SENDMAILPID
18463962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
18563962Seric #  endif
18663787Seric 
18760602Seric # else
18865105Seric 			/* SunOS 4.0.3 or 4.1.x */
18965189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
19060602Seric #  define HASSTATFS	1	/* has the statfs(2) syscall */
19164831Seric #  define HASFLOCK	1	/* has flock(2) call */
19260564Seric #  include <vfork.h>
19363787Seric 
19465105Seric #  ifdef SUNOS403
19565105Seric 			/* special tweaking for SunOS 4.0.3 */
19665105Seric #   include <malloc.h>
19765105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
19865105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
19965105Seric #   undef WIFEXITED
20065105Seric #   undef WEXITSTATUS
20165105Seric #   undef HASUNAME
20265105Seric #   define setpgid	setpgrp
20365105Seric typedef int		pid_t;
20465105Seric extern char		*getenv();
20565105Seric 
20665105Seric #  endif
20760564Seric # endif
20859023Seric #endif
20959023Seric 
21064718Seric /*
21164813Seric **  DG/UX
21264813Seric **
21364813Seric **	Tested on 5.4.2
21464718Seric */
21564314Seric 
21664718Seric #ifdef	DGUX
21764718Seric # define SYSTEM5	1
21864718Seric # define LA_TYPE	LA_SUBR
21964718Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
22064718Seric # define HASSETREUID	1	/* has setreuid(2) call */
22164718Seric # define HASUNAME	1	/* use System V uname(2) system call */
22264718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
22364718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
22465167Seric # ifndef IDENTPROTO
22565167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
22665167Seric # endif
22764718Seric # undef SETPROCTITLE
22864813Seric 
22964813Seric /* these include files must be included early on DG/UX */
23064813Seric # include <netinet/in.h>
23164813Seric # include <arpa/inet.h>
23264813Seric 
23364718Seric # define inet_addr	dgux_inet_addr
23464718Seric extern long	dgux_inet_addr();
23564718Seric #endif
23664718Seric 
23764718Seric 
23863902Seric /*
23963902Seric **  Digital Ultrix 4.2A or 4.3
24064264Seric **
24164264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
24264264Seric **	not dropped when the process exits.  This causes major problems,
24364264Seric **	so flock is the only alternative.
24463902Seric */
24563902Seric 
24660564Seric #ifdef ultrix
24760564Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
24864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
24963962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
25064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
25164264Seric # define HASFLOCK	1	/* has flock(2) call */
252*65211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
25365135Seric # ifdef vax
25465135Seric #  define LA_TYPE	LA_FLOAT
25565135Seric # else
25665135Seric #  define LA_TYPE	LA_INT
25765135Seric #  define LA_AVENRUN	"avenrun"
25865135Seric # endif
25965167Seric # ifndef IDENTPROTO
26065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
26165167Seric # endif
26260564Seric #endif
26360564Seric 
26464314Seric 
26563902Seric /*
26663902Seric **  OSF/1 (tested on Alpha)
26763902Seric */
26863902Seric 
26963787Seric #ifdef __osf__
27064314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
27163962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
27264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
27364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
27464831Seric # define HASFLOCK	1	/* has flock(2) call */
27563962Seric # define LA_TYPE	LA_INT
27664813Seric # ifndef _PATH_SENDMAILPID
27764813Seric #  define _PATH_SENDMAILPID	"/var/run/sendmial.pid"
27864813Seric # endif
27959287Seric #endif
28059287Seric 
28164314Seric 
28263902Seric /*
28363902Seric **  NeXTstep
28463902Seric */
28563902Seric 
28664076Seric #ifdef NeXT
28764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
28864035Seric # define HASFLOCK	1	/* has flock(2) call */
28964125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
29064314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
29164563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
29263753Seric # define sleep		sleepX
29364155Seric # define setpgid	setpgrp
29464295Seric # ifndef LA_TYPE
29564295Seric #  define LA_TYPE	LA_MACH
29664295Seric # endif
29764500Seric # ifndef _POSIX_SOURCE
29864035Seric typedef int		pid_t;
29964500Seric #  undef WEXITSTATUS
30064500Seric #  undef WIFEXITED
30164500Seric # endif
30264072Seric # ifndef _PATH_SENDMAILCF
30364072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
30464072Seric # endif
30564072Seric # ifndef _PATH_SENDMAILPID
30664072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
30764072Seric # endif
30859288Seric #endif
30959288Seric 
31064314Seric 
31163902Seric /*
31263962Seric **  4.4 BSD
31364831Seric **
31464831Seric **	See also BSD defines.
31563902Seric */
31663902Seric 
31760568Seric #ifdef BSD4_4
31864072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
31964314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
32060568Seric # include <sys/cdefs.h>
32163838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
32264072Seric # ifndef LA_TYPE
32364072Seric #  define LA_TYPE	LA_SUBR
32464072Seric # endif
32560568Seric #endif
32660568Seric 
32764314Seric 
32863902Seric /*
32965049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
33064733Seric **
33164733Seric **  4.3BSD clone, closer to 4.4BSD
33264831Seric **
33364831Seric **	See also BSD defines.
33464733Seric */
33564733Seric 
33665049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
33764733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
33864733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
33964733Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
34064733Seric # include <sys/cdefs.h>
34164733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
34264733Seric # ifndef LA_TYPE
34364733Seric #  define LA_TYPE	LA_SUBR
34464733Seric # endif
34564733Seric #endif
34664733Seric 
34764733Seric 
34864733Seric /*
34964813Seric **  Mach386
35064813Seric **
35164813Seric **	For mt Xinu's Mach386 system.
35264813Seric */
35364813Seric 
35464813Seric #if defined(MACH) && defined(i386)
35564813Seric # define MACH386	1
35664813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
35764813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
35864813Seric # define HASFLOCK	1	/* has flock(2) call */
35964813Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
36064813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
36164813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
36264813Seric # define setpgid	setpgrp
36364813Seric # ifndef LA_TYPE
36464813Seric #  define LA_TYPE	LA_FLOAT
36564813Seric # endif
36664962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
36764813Seric # undef WEXITSTATUS
36864813Seric # undef WIFEXITED
36964813Seric # ifndef _PATH_SENDMAILCF
37064813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
37164813Seric # endif
37264813Seric # ifndef _PATH_SENDMAILPID
37364813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
37464813Seric # endif
37564813Seric #endif
37664813Seric 
37764813Seric 
37864813Seric /*
37963969Seric **  4.3 BSD -- this is for very old systems
38063969Seric **
38163969Seric **	You'll also have to install a new resolver library.
38263969Seric **	I don't guarantee that support for this environment is complete.
38363969Seric */
38463969Seric 
38563969Seric #ifdef oldBSD43
38663969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
38763969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
38863970Seric # define ARBPTR_T	char *
38964155Seric # define setpgid	setpgrp
39063969Seric # ifndef LA_TYPE
39163969Seric #  define LA_TYPE	LA_FLOAT
39263969Seric # endif
39363969Seric # ifndef _PATH_SENDMAILCF
39463969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
39563969Seric # endif
39665167Seric # ifndef IDENTPROTO
39765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
39865167Seric # endif
39964834Seric # undef WEXITSTATUS
40064834Seric # undef WIFEXITED
40164834Seric typedef short		pid_t;
40264834Seric extern int		errno;
40363969Seric #endif
40463969Seric 
40564314Seric 
40663969Seric /*
40763902Seric **  SCO Unix
40865087Seric **
40965087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
41065087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
41165087Seric **	The second is, I believe, for an older version.
41263902Seric */
41363902Seric 
41465087Seric #ifdef _SCO_unix_4_2
41565087Seric # define _SCO_unix_
41665087Seric # define HASSETREUID	1	/* has setreuid(2) call */
41765087Seric # define _PATH_UNIX	"/unix"
41865087Seric # ifndef _PATH_SENDMAILCF
41965087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
42065087Seric # endif
42165087Seric # ifndef _PATH_SENDMAILPID
42265087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
42365087Seric # endif
42465087Seric #endif
42565087Seric 
42663838Seric #ifdef _SCO_unix_
42763838Seric # define SYSTEM5	1	/* include all the System V defines */
42864035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
42963987Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
43063838Seric # define FORK		fork
43163838Seric # define MAXPATHLEN	PATHSIZE
43264718Seric # define LA_TYPE	LA_SHORT
43364813Seric # undef NETUNIX			/* no unix domain socket support */
43463838Seric #endif
43563838Seric 
43664314Seric 
43763962Seric /*
43863962Seric **  ConvexOS 11.0 and later
43963962Seric */
44063962Seric 
44163962Seric #ifdef _CONVEX_SOURCE
44263977Seric # define BSD		1	/* include all the BSD defines */
44363977Seric # define HASUNAME	1	/* use System V uname(2) system call */
44463962Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
44563962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
44663977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
44763962Seric # define LA_TYPE	LA_FLOAT
44865167Seric # ifndef IDENTPROTO
44965167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
45065167Seric # endif
45163962Seric #endif
45263962Seric 
45364314Seric 
45463962Seric /*
45564999Seric **  RISC/os 4.52
45663962Seric **
45764999Seric **	Gives a ton of warning messages, but otherwise compiles.
45863962Seric */
45963962Seric 
46063965Seric #ifdef RISCOS
46164999Seric 
46263962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
46364831Seric # define HASFLOCK	1	/* has flock(2) call */
46464999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
46564999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
46663962Seric # define LA_TYPE	LA_INT
46763962Seric # define LA_AVENRUN	"avenrun"
46863962Seric # define _PATH_UNIX	"/unix"
46964999Seric # undef WIFEXITED
47064999Seric 
47164999Seric # define setpgid	setpgrp
47264999Seric 
47364999Seric extern int		errno;
47464999Seric typedef int		pid_t;
47564999Seric #define			SIGFUNC_DEFINED
47664999Seric typedef int		(*sigfunc_t)();
47764999Seric extern char		*getenv();
47864999Seric extern void		*malloc();
47964999Seric 
48063962Seric #endif
48163962Seric 
48264314Seric 
48364155Seric /*
48464155Seric **  Linux 0.99pl10 and above...
48564155Seric **	From Karl London <karl@borg.demon.co.uk>.
48664155Seric */
48764155Seric 
48864770Seric #ifdef __linux__
48964155Seric # define BSD		1	/* pretend to be BSD based today */
49064155Seric # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
49164155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
49264380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
49364155Seric # ifndef LA_TYPE
49464155Seric #  define LA_TYPE	LA_FLOAT
49564155Seric # endif
49664763Seric # include <sys/sysmacros.h>
49765046Seric # define GIDSET_T	gid_t
49864155Seric #endif
49964155Seric 
50064155Seric 
50164345Seric /*
50264345Seric **  DELL SVR4 Issue 2.2, and others
50364345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
50464345Seric **
50564345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
50664345Seric **	defined, and the definitions conflict.
50764924Seric **
50864924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
50964924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
51064924Seric **	(SVR4.0/386 version 3.0).
51164345Seric */
51264345Seric 
51364345Seric #ifdef DELL_SVR4
51465189Seric 				/* no changes necessary */
51565189Seric 				/* see general __svr4__ defines below */
51664345Seric #endif
51764345Seric 
51864345Seric 
51964380Seric /*
52064380Seric **  Apple A/UX 3.0
52164380Seric */
52264345Seric 
52364380Seric #ifdef _AUX_SOURCE
52464729Seric # include <sys/sysmacros.h>
52564380Seric # define BSD			/* has BSD routines */
52664380Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
52764380Seric # define HASUNAME	1	/* use System V uname(2) system call */
52864380Seric # define HASUSTAT	1	/* use System V ustat(2) syscall */
52964380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
53064561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
53165167Seric # ifndef IDENTPROTO
53265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
53365167Seric # endif
53464380Seric # define FORK		fork
53564380Seric # ifndef _PATH_SENDMAILCF
53664380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
53764380Seric # endif
53864380Seric # ifndef LA_TYPE
53964380Seric #  define LA_TYPE	LA_ZERO
54064380Seric # endif
54164560Seric # undef WIFEXITED
54264560Seric # undef WEXITSTATUS
54364380Seric #endif
54464380Seric 
54564380Seric 
54664705Seric /*
54764705Seric **  Encore UMAX V
54864705Seric **
54964705Seric **	Not extensively tested.
55064705Seric */
55164380Seric 
55264705Seric #ifdef UMAXV
55364705Seric # include <limits.h>
55464705Seric # define HASUNAME	1	/* use System V uname(2) system call */
55564705Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
55664705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
55764705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
558*65211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
55964705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
56064705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
56164705Seric # define FORK		fork	/* no vfork(2) primitive available */
56264705Seric # define MAXPATHLEN	PATH_MAX
56364705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
56464705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
56564705Seric # undef WIFEXITED
56664705Seric # undef WEXITSTATUS
56764705Seric #endif
56864705Seric 
56964705Seric 
57064939Seric /*
57164939Seric **  Stardent Titan 3000 running TitanOS 4.2.
57264939Seric **
57364939Seric **	Must be compiled in "cc -43" mode.
57464939Seric **
57564944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
57664939Seric **
57764939Seric **	Note the tweaking below after the BSD defines are set.
57864939Seric */
57964705Seric 
58064939Seric #ifdef titan
58164939Seric # define setpgid	setpgrp
58264939Seric typedef int		pid_t;
58364939Seric # undef WIFEXITED
58464939Seric # undef WEXITSTATUS
58564939Seric #endif
58664939Seric 
58764939Seric 
58864962Seric /*
58964962Seric **  Sequent DYNIX 3.2.0
59064962Seric **
59164962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
59264962Seric */
59364939Seric 
59464962Seric #ifdef sequent
59564962Seric # define BSD		1
59664962Seric # define HASUNSETENV	1
59764962Seric # define BSD4_3		1	/* to get signal() in conf.c */
59864962Seric # define WAITUNION	1
59964962Seric # define LA_TYPE	LA_FLOAT
60064962Seric # ifdef	_POSIX_VERSION
60164962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
60264962Seric # endif
60364962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
60464962Seric # define setpgid	setpgrp
60564962Seric 
60664962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
60764962Seric # undef	WIFEXITED
60864962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
60964962Seric 			 ((union wait*)&(s))->w_termsig == 0)
61064962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
61164962Seric typedef int		pid_t;
61264962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
61364962Seric 
61464962Seric # ifndef _PATH_UNIX
61564962Seric #  define _PATH_UNIX	"/dynix"
61664962Seric # endif
61764962Seric # ifndef _PATH_SENDMAILCF
61864962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
61964962Seric # endif
62064962Seric 
62164962Seric #endif
62264962Seric 
62364962Seric 
62464962Seric 
62564962Seric 
62663902Seric /**********************************************************************
62763787Seric **  End of Per-Operating System defines
62863902Seric **********************************************************************/
62963787Seric 
63063949Seric /**********************************************************************
63163949Seric **  More general defines
63263949Seric **********************************************************************/
63363949Seric 
63463962Seric /* general BSD defines */
63563962Seric #ifdef BSD
63664035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
63764035Seric # define HASSETREUID	1	/* has setreuid(2) call */
63864035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
63964035Seric # define HASFLOCK	1	/* has flock(2) call */
64063962Seric #endif
64163962Seric 
64265189Seric /* general System V Release 4 defines */
64365189Seric #ifdef __svr4__
64465189Seric # define SYSTEM5	1
64565189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
646*65211Seric # ifndef HASGETUSERSHELL
647*65211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
64865210Seric # endif
64965189Seric # define setreuid(r, e)	seteuid(e)
65065189Seric 
65165189Seric # ifndef _PATH_UNIX
65265189Seric #  define _PATH_UNIX		"/unix"
65365189Seric # endif
65465189Seric # ifndef _PATH_SENDMAILCF
65565189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
65665189Seric # endif
65765189Seric # ifndef _PATH_SENDMAILPID
65865189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
65965189Seric # endif
66065189Seric # ifndef SYSLOG_BUFSIZE
66165189Seric #  define SYSLOG_BUFSIZE	128
66265189Seric # endif
66365189Seric #endif
66465189Seric 
66563787Seric /* general System V defines */
66663787Seric # ifdef SYSTEM5
66764813Seric # include <sys/sysmacros.h>
66863949Seric # define HASUNAME	1	/* use System V uname(2) system call */
66963949Seric # define HASUSTAT	1	/* use System V ustat(2) syscall */
67064705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
67164962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
67263962Seric # ifndef LA_TYPE
67363962Seric #  define LA_TYPE	LA_INT
67463962Seric # endif
67563949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
67663949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
67763949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
67863787Seric # endif
67963787Seric 
68063949Seric /* general POSIX defines */
68163949Seric #ifdef _POSIX_VERSION
68264718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
68364718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
68463949Seric #endif
68563949Seric 
68663787Seric /*
68763937Seric **  If no type for argument two of getgroups call is defined, assume
68863937Seric **  it's an integer -- unfortunately, there seem to be several choices
68963937Seric **  here.
69063937Seric */
69163937Seric 
69263937Seric #ifndef GIDSET_T
69363937Seric # define GIDSET_T	int
69463937Seric #endif
69563937Seric 
69664939Seric /*
69764939Seric **  Tweaking for systems that (for example) claim to be BSD but
69864939Seric **  don't have all the standard BSD routines (boo hiss).
69964939Seric */
70064439Seric 
70164939Seric #ifdef titan
70264939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
70364939Seric #endif
70464939Seric 
70565167Seric /*
70665167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
70765167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
70865167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
70965167Seric **  are closed.  Some firewalls return this error if you try to connect
71065167Seric **  to the IDENT port (113), so you can't receive email from these hosts
71165167Seric **  on these systems.  The firewall really should use a more specific
71265167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
71365167Seric **  not explicitly set to zero above, default it on.
71465167Seric */
71564939Seric 
71665167Seric #ifndef IDENTPROTO
71765167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
71865167Seric #endif
71965167Seric 
720*65211Seric #ifndef HASGETUSERSHELL
721*65211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
72265210Seric #endif
72365167Seric 
72465210Seric 
72564439Seric /**********************************************************************
72659023Seric **  Remaining definitions should never have to be changed.  They are
72759023Seric **  primarily to provide back compatibility for older systems -- for
72859287Seric **  example, it includes some POSIX compatibility definitions
72964439Seric **********************************************************************/
73059023Seric 
73159388Seric /* System 5 compatibility */
73259388Seric #ifndef S_ISREG
73364944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
73459388Seric #endif
73564944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
73664944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
73764944Seric #endif
73859388Seric #ifndef S_IWGRP
73959388Seric #define S_IWGRP		020
74059388Seric #endif
74159388Seric #ifndef S_IWOTH
74259388Seric #define S_IWOTH		002
74359388Seric #endif
74459388Seric 
74559023Seric /*
74650537Seric **  Older systems don't have this error code -- it should be in
74750537Seric **  /usr/include/sysexits.h.
74850537Seric */
74950537Seric 
75050537Seric # ifndef EX_CONFIG
75150537Seric # define EX_CONFIG	78	/* configuration error */
75250537Seric # endif
75356852Seric 
75464718Seric /* pseudo-code used in server SMTP */
75564718Seric # define EX_QUIT	22	/* drop out of server immediately */
75664718Seric 
75764718Seric 
75863993Seric /*
75963993Seric **  These are used in a few cases where we need some special
76063993Seric **  error codes, but where the system doesn't provide something
76163993Seric **  reasonable.  They are printed in errstring.
76263993Seric */
76363993Seric 
76463993Seric #ifndef E_PSEUDOBASE
76563993Seric # define E_PSEUDOBASE	256
76663993Seric #endif
76763993Seric 
76863993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
76963993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
77063993Seric 
77163970Seric /* type of arbitrary pointer */
77263970Seric #ifndef ARBPTR_T
77363970Seric # define ARBPTR_T	void *
77463970Seric #endif
77563970Seric 
77660568Seric #ifndef __P
77760568Seric # include "cdefs.h"
77860568Seric #endif
77960568Seric 
78056852Seric /*
78158778Seric **  Do some required dependencies
78258778Seric */
78358778Seric 
78458778Seric #if defined(NETINET) || defined(NETISO)
78559107Seric # define SMTP		1	/* enable user and server SMTP */
78659107Seric # define QUEUE		1	/* enable queueing */
78759107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
78858778Seric #endif
78958778Seric 
79058778Seric 
79158778Seric /*
79256852Seric **  Arrange to use either varargs or stdargs
79356852Seric */
79456852Seric 
79556852Seric # ifdef __STDC__
79656852Seric 
79756852Seric # include <stdarg.h>
79856852Seric 
79956852Seric # define VA_LOCAL_DECL	va_list ap;
80056852Seric # define VA_START(f)	va_start(ap, f)
80156852Seric # define VA_END		va_end(ap)
80256852Seric 
80356852Seric # else
80456852Seric 
80556852Seric # include <varargs.h>
80656852Seric 
80756852Seric # define VA_LOCAL_DECL	va_list ap;
80856852Seric # define VA_START(f)	va_start(ap)
80956852Seric # define VA_END		va_end(ap)
81056852Seric 
81156852Seric # endif
81257631Seric 
81357943Seric #ifdef HASUNAME
81457631Seric # include <sys/utsname.h>
81557631Seric # ifdef newstr
81657631Seric #  undef newstr
81757631Seric # endif
81857943Seric #else /* ! HASUNAME */
81957631Seric # define NODE_LENGTH 32
82057631Seric struct utsname
82157631Seric {
82257631Seric 	char nodename[NODE_LENGTH+1];
82357631Seric };
82457943Seric #endif /* HASUNAME */
82557642Seric 
82663838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
82763838Seric # define MAXHOSTNAMELEN	256
82857735Seric #endif
82958153Seric 
83058153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
83158153Seric # define SIGCHLD	SIGCLD
83258153Seric #endif
83358153Seric 
83458153Seric #ifndef STDIN_FILENO
83558153Seric #define STDIN_FILENO	0
83658153Seric #endif
83758153Seric 
83858153Seric #ifndef STDOUT_FILENO
83958153Seric #define STDOUT_FILENO	1
84058153Seric #endif
84158153Seric 
84258153Seric #ifndef STDERR_FILENO
84358153Seric #define STDERR_FILENO	2
84458153Seric #endif
84558689Seric 
84664072Seric #ifndef LOCK_SH
84764035Seric # define LOCK_SH	0x01	/* shared lock */
84864035Seric # define LOCK_EX	0x02	/* exclusive lock */
84964035Seric # define LOCK_NB	0x04	/* non-blocking lock */
85064035Seric # define LOCK_UN	0x08	/* unlock */
85164035Seric #endif
85258692Seric 
85364035Seric #ifndef SIG_ERR
85464035Seric # define SIG_ERR	((void (*)()) -1)
85558689Seric #endif
85658702Seric 
85764500Seric #ifndef WEXITSTATUS
85864500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
85964500Seric #endif
86064500Seric #ifndef WIFEXITED
86164500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
86264500Seric #endif
86364500Seric 
86464561Seric #ifndef SIGFUNC_DEFINED
86564561Seric typedef void		(*sigfunc_t) __P((int));
86664561Seric #endif
86764561Seric 
86865053Seric /* size of syslog buffer */
86965053Seric #ifndef SYSLOG_BUFSIZE
87065053Seric # define SYSLOG_BUFSIZE	1024
87165053Seric #endif
87265053Seric 
87358702Seric /*
87458702Seric **  Size of tobuf (deliver.c)
87558702Seric **	Tweak this to match your syslog implementation.  It will have to
87658702Seric **	allow for the extra information printed.
87758702Seric */
87858702Seric 
87958702Seric #ifndef TOBUFSIZE
88065053Seric # if (SYSLOG_BUFSIZE) > 512
88165053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
88265053Seric # else
88365053Seric #  define TOBUFSIZE	256
88465053Seric # endif
88558702Seric #endif
88660219Seric 
88765015Seric /*
88865015Seric **  Size of prescan buffer.
88965015Seric **	Despite comments in the _sendmail_ book, this probably should
89065015Seric **	not be changed; there are some hard-to-define dependencies.
89165015Seric */
89265015Seric 
89365015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
89460219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
89560219Seric # ifndef FORK
89660219Seric # define FORK		vfork		/* function to call to fork mailer */
89760219Seric # endif
898