xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 65087)
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*65087Seric  *	@(#)conf.h	8.61 (Berkeley) 12/11/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
19763787Seric 			/* SunOS 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 
20260564Seric # endif
20359023Seric #endif
20459023Seric 
20564718Seric /*
20664813Seric **  DG/UX
20764813Seric **
20864813Seric **	Tested on 5.4.2
20964718Seric */
21064314Seric 
21164718Seric #ifdef	DGUX
21264718Seric # define SYSTEM5	1
21364718Seric # define LA_TYPE	LA_SUBR
21464718Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
21564718Seric # define HASSETREUID	1	/* has setreuid(2) call */
21664718Seric # define HASUNAME	1	/* use System V uname(2) system call */
21764718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
21864718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
21964718Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
22064718Seric # undef SETPROCTITLE
22164813Seric 
22264813Seric /* these include files must be included early on DG/UX */
22364813Seric # include <netinet/in.h>
22464813Seric # include <arpa/inet.h>
22564813Seric 
22664718Seric # define inet_addr	dgux_inet_addr
22764718Seric extern long	dgux_inet_addr();
22864718Seric #endif
22964718Seric 
23064718Seric 
23163902Seric /*
23263902Seric **  Digital Ultrix 4.2A or 4.3
23364264Seric **
23464264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
23564264Seric **	not dropped when the process exits.  This causes major problems,
23664264Seric **	so flock is the only alternative.
23763902Seric */
23863902Seric 
23960564Seric #ifdef ultrix
24060564Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
24164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
24263962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
24364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
24464264Seric # define HASFLOCK	1	/* has flock(2) call */
24563962Seric # define LA_TYPE	LA_INT
24663962Seric # define LA_AVENRUN	"avenrun"
24764358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
24860564Seric #endif
24960564Seric 
25064314Seric 
25163902Seric /*
25263902Seric **  OSF/1 (tested on Alpha)
25363902Seric */
25463902Seric 
25563787Seric #ifdef __osf__
25664314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
25763962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
25864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
25964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
26064831Seric # define HASFLOCK	1	/* has flock(2) call */
26163962Seric # define LA_TYPE	LA_INT
26264813Seric # ifndef _PATH_SENDMAILPID
26364813Seric #  define _PATH_SENDMAILPID	"/var/run/sendmial.pid"
26464813Seric # endif
26559287Seric #endif
26659287Seric 
26764314Seric 
26863902Seric /*
26963902Seric **  NeXTstep
27063902Seric */
27163902Seric 
27264076Seric #ifdef NeXT
27364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
27464035Seric # define HASFLOCK	1	/* has flock(2) call */
27564125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
27664314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
27764563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
27863753Seric # define sleep		sleepX
27964155Seric # define setpgid	setpgrp
28064295Seric # ifndef LA_TYPE
28164295Seric #  define LA_TYPE	LA_MACH
28264295Seric # endif
28364500Seric # ifndef _POSIX_SOURCE
28464035Seric typedef int		pid_t;
28564500Seric #  undef WEXITSTATUS
28664500Seric #  undef WIFEXITED
28764500Seric # endif
28864072Seric # ifndef _PATH_SENDMAILCF
28964072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
29064072Seric # endif
29164072Seric # ifndef _PATH_SENDMAILPID
29264072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
29364072Seric # endif
29459288Seric #endif
29559288Seric 
29664314Seric 
29763902Seric /*
29863962Seric **  4.4 BSD
29964831Seric **
30064831Seric **	See also BSD defines.
30163902Seric */
30263902Seric 
30360568Seric #ifdef BSD4_4
30464072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
30564314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
30660568Seric # include <sys/cdefs.h>
30763838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
30864072Seric # ifndef LA_TYPE
30964072Seric #  define LA_TYPE	LA_SUBR
31064072Seric # endif
31160568Seric #endif
31260568Seric 
31364314Seric 
31463902Seric /*
31565049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
31664733Seric **
31764733Seric **  4.3BSD clone, closer to 4.4BSD
31864831Seric **
31964831Seric **	See also BSD defines.
32064733Seric */
32164733Seric 
32265049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
32364733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
32464733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
32564733Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
32664733Seric # include <sys/cdefs.h>
32764733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
32864733Seric # ifndef LA_TYPE
32964733Seric #  define LA_TYPE	LA_SUBR
33064733Seric # endif
33164733Seric #endif
33264733Seric 
33364733Seric 
33464733Seric /*
33564813Seric **  Mach386
33664813Seric **
33764813Seric **	For mt Xinu's Mach386 system.
33864813Seric */
33964813Seric 
34064813Seric #if defined(MACH) && defined(i386)
34164813Seric # define MACH386	1
34264813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
34364813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
34464813Seric # define HASFLOCK	1	/* has flock(2) call */
34564813Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
34664813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
34764813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
34864813Seric # define setpgid	setpgrp
34964813Seric # ifndef LA_TYPE
35064813Seric #  define LA_TYPE	LA_FLOAT
35164813Seric # endif
35264962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
35364813Seric # undef WEXITSTATUS
35464813Seric # undef WIFEXITED
35564813Seric # ifndef _PATH_SENDMAILCF
35664813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
35764813Seric # endif
35864813Seric # ifndef _PATH_SENDMAILPID
35964813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
36064813Seric # endif
36164813Seric #endif
36264813Seric 
36364813Seric 
36464813Seric /*
36563969Seric **  4.3 BSD -- this is for very old systems
36663969Seric **
36763969Seric **	You'll also have to install a new resolver library.
36863969Seric **	I don't guarantee that support for this environment is complete.
36963969Seric */
37063969Seric 
37163969Seric #ifdef oldBSD43
37263969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
37363969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
37463970Seric # define ARBPTR_T	char *
37564155Seric # define setpgid	setpgrp
37663969Seric # ifndef LA_TYPE
37763969Seric #  define LA_TYPE	LA_FLOAT
37863969Seric # endif
37963969Seric # ifndef _PATH_SENDMAILCF
38063969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
38163969Seric # endif
38264358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
38364834Seric # undef WEXITSTATUS
38464834Seric # undef WIFEXITED
38564834Seric typedef short		pid_t;
38664834Seric extern int		errno;
38763969Seric #endif
38863969Seric 
38964314Seric 
39063969Seric /*
39163902Seric **  SCO Unix
392*65087Seric **
393*65087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
394*65087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
395*65087Seric **	The second is, I believe, for an older version.
39663902Seric */
39763902Seric 
398*65087Seric #ifdef _SCO_unix_4_2
399*65087Seric # define _SCO_unix_
400*65087Seric # define HASSETREUID	1	/* has setreuid(2) call */
401*65087Seric # define _PATH_UNIX	"/unix"
402*65087Seric # ifndef _PATH_SENDMAILCF
403*65087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
404*65087Seric # endif
405*65087Seric # ifndef _PATH_SENDMAILPID
406*65087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
407*65087Seric # endif
408*65087Seric #endif
409*65087Seric 
41063838Seric #ifdef _SCO_unix_
41163838Seric # define SYSTEM5	1	/* include all the System V defines */
41264035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
41363987Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
41463838Seric # define FORK		fork
41563838Seric # define MAXPATHLEN	PATHSIZE
41664718Seric # define LA_TYPE	LA_SHORT
41764813Seric # undef NETUNIX			/* no unix domain socket support */
41863838Seric #endif
41963838Seric 
42064314Seric 
42163962Seric /*
42263962Seric **  ConvexOS 11.0 and later
42363962Seric */
42463962Seric 
42563962Seric #ifdef _CONVEX_SOURCE
42663977Seric # define BSD		1	/* include all the BSD defines */
42763977Seric # define HASUNAME	1	/* use System V uname(2) system call */
42863962Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
42963962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
43063977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
43163962Seric # define LA_TYPE	LA_FLOAT
43264032Seric # undef IDENTPROTO
43363962Seric #endif
43463962Seric 
43564314Seric 
43663962Seric /*
43764999Seric **  RISC/os 4.52
43863962Seric **
43964999Seric **	Gives a ton of warning messages, but otherwise compiles.
44063962Seric */
44163962Seric 
44263965Seric #ifdef RISCOS
44364999Seric 
44463962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
44564831Seric # define HASFLOCK	1	/* has flock(2) call */
44664999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
44764999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
44863962Seric # define LA_TYPE	LA_INT
44963962Seric # define LA_AVENRUN	"avenrun"
45063962Seric # define _PATH_UNIX	"/unix"
45164999Seric # undef WIFEXITED
45264999Seric 
45364999Seric # define setpgid	setpgrp
45464999Seric 
45564999Seric extern int		errno;
45664999Seric typedef int		pid_t;
45764999Seric #define			SIGFUNC_DEFINED
45864999Seric typedef int		(*sigfunc_t)();
45964999Seric extern char		*getenv();
46064999Seric extern void		*malloc();
46164999Seric 
46263962Seric #endif
46363962Seric 
46464314Seric 
46564155Seric /*
46664155Seric **  Linux 0.99pl10 and above...
46764155Seric **	From Karl London <karl@borg.demon.co.uk>.
46864155Seric */
46964155Seric 
47064770Seric #ifdef __linux__
47164155Seric # define BSD		1	/* pretend to be BSD based today */
47264155Seric # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
47364155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
47464380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
47564155Seric # ifndef LA_TYPE
47664155Seric #  define LA_TYPE	LA_FLOAT
47764155Seric # endif
47864763Seric # include <sys/sysmacros.h>
47965046Seric # define GIDSET_T	gid_t
48064155Seric #endif
48164155Seric 
48264155Seric 
48364345Seric /*
48464345Seric **  DELL SVR4 Issue 2.2, and others
48564345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
48664345Seric **
48764345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
48864345Seric **	defined, and the definitions conflict.
48964924Seric **
49064924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
49164924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
49264924Seric **	(SVR4.0/386 version 3.0).
49364345Seric */
49464345Seric 
49564345Seric #ifdef DELL_SVR4
49664345Seric # define SYSTEM5	1
49764924Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
49864924Seric # define setreuid(r, e)	seteuid(e)
49964345Seric /* # include <sys/time.h> */
50064345Seric # define _PATH_UNIX	"/unix"
50164345Seric # ifndef _PATH_SENDMAILCF
50264345Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
50364345Seric # endif
50464345Seric # ifndef _PATH_SENDMAILPID
50564345Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
50664345Seric # endif
50764345Seric #endif
50864345Seric 
50964345Seric 
51064380Seric /*
51164380Seric **  Apple A/UX 3.0
51264380Seric */
51364345Seric 
51464380Seric #ifdef _AUX_SOURCE
51564729Seric # include <sys/sysmacros.h>
51664380Seric # define BSD			/* has BSD routines */
51764380Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
51864380Seric # define HASUNAME	1	/* use System V uname(2) system call */
51964380Seric # define HASUSTAT	1	/* use System V ustat(2) syscall */
52064380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
52164561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
52264718Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
52364380Seric # define FORK		fork
52464380Seric # ifndef _PATH_SENDMAILCF
52564380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
52664380Seric # endif
52764380Seric # ifndef LA_TYPE
52864380Seric #  define LA_TYPE	LA_ZERO
52964380Seric # endif
53064560Seric # undef WIFEXITED
53164560Seric # undef WEXITSTATUS
53264380Seric #endif
53364380Seric 
53464380Seric 
53564705Seric /*
53664705Seric **  Encore UMAX V
53764705Seric **
53864705Seric **	Not extensively tested.
53964705Seric */
54064380Seric 
54164705Seric #ifdef UMAXV
54264705Seric # include <limits.h>
54364705Seric # define HASUNAME	1	/* use System V uname(2) system call */
54464705Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
54564705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
54664705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
54764705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
54864705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
54964705Seric # define FORK		fork	/* no vfork(2) primitive available */
55064705Seric # define MAXPATHLEN	PATH_MAX
55164705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
55264705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
55364705Seric # undef WIFEXITED
55464705Seric # undef WEXITSTATUS
55564705Seric #endif
55664705Seric 
55764705Seric 
55864939Seric /*
55964939Seric **  Stardent Titan 3000 running TitanOS 4.2.
56064939Seric **
56164939Seric **	Must be compiled in "cc -43" mode.
56264939Seric **
56364944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
56464939Seric **
56564939Seric **	Note the tweaking below after the BSD defines are set.
56664939Seric */
56764705Seric 
56864939Seric #ifdef titan
56964939Seric # define setpgid	setpgrp
57064939Seric typedef int		pid_t;
57164939Seric # undef WIFEXITED
57264939Seric # undef WEXITSTATUS
57364939Seric #endif
57464939Seric 
57564939Seric 
57664962Seric /*
57764962Seric **  Sequent DYNIX 3.2.0
57864962Seric **
57964962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
58064962Seric */
58164939Seric 
58264962Seric #ifdef sequent
58364962Seric # define BSD		1
58464962Seric # define HASUNSETENV	1
58564962Seric # define BSD4_3		1	/* to get signal() in conf.c */
58664962Seric # define WAITUNION	1
58764962Seric # define LA_TYPE	LA_FLOAT
58864962Seric # ifdef	_POSIX_VERSION
58964962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
59064962Seric # endif
59164962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
59264962Seric # define setpgid	setpgrp
59364962Seric 
59464962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
59564962Seric # undef	WIFEXITED
59664962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
59764962Seric 			 ((union wait*)&(s))->w_termsig == 0)
59864962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
59964962Seric typedef int		pid_t;
60064962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
60164962Seric 
60264962Seric # ifndef _PATH_UNIX
60364962Seric #  define _PATH_UNIX	"/dynix"
60464962Seric # endif
60564962Seric # ifndef _PATH_SENDMAILCF
60664962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
60764962Seric # endif
60864962Seric 
60964962Seric #endif
61064962Seric 
61164962Seric 
61264962Seric 
61364962Seric 
61463902Seric /**********************************************************************
61563787Seric **  End of Per-Operating System defines
61663902Seric **********************************************************************/
61763787Seric 
61863949Seric /**********************************************************************
61963949Seric **  More general defines
62063949Seric **********************************************************************/
62163949Seric 
62263962Seric /* general BSD defines */
62363962Seric #ifdef BSD
62464035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
62564035Seric # define HASSETREUID	1	/* has setreuid(2) call */
62664035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
62764035Seric # define HASFLOCK	1	/* has flock(2) call */
62863962Seric #endif
62963962Seric 
63063787Seric /* general System V defines */
63163787Seric # ifdef SYSTEM5
63264813Seric # include <sys/sysmacros.h>
63363949Seric # define HASUNAME	1	/* use System V uname(2) system call */
63463949Seric # define HASUSTAT	1	/* use System V ustat(2) syscall */
63564705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
63664962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
63763962Seric # ifndef LA_TYPE
63863962Seric #  define LA_TYPE	LA_INT
63963962Seric # endif
64063949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
64163949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
64263949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
64363787Seric # endif
64463787Seric 
64563949Seric /* general POSIX defines */
64663949Seric #ifdef _POSIX_VERSION
64764718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
64864718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
64963949Seric #endif
65063949Seric 
65163787Seric /*
65263937Seric **  If no type for argument two of getgroups call is defined, assume
65363937Seric **  it's an integer -- unfortunately, there seem to be several choices
65463937Seric **  here.
65563937Seric */
65663937Seric 
65763937Seric #ifndef GIDSET_T
65863937Seric # define GIDSET_T	int
65963937Seric #endif
66063937Seric 
66164939Seric /*
66264939Seric **  Tweaking for systems that (for example) claim to be BSD but
66364939Seric **  don't have all the standard BSD routines (boo hiss).
66464939Seric */
66564439Seric 
66664939Seric #ifdef titan
66764939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
66864939Seric #endif
66964939Seric 
67064939Seric 
67164439Seric /**********************************************************************
67259023Seric **  Remaining definitions should never have to be changed.  They are
67359023Seric **  primarily to provide back compatibility for older systems -- for
67459287Seric **  example, it includes some POSIX compatibility definitions
67564439Seric **********************************************************************/
67659023Seric 
67759388Seric /* System 5 compatibility */
67859388Seric #ifndef S_ISREG
67964944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
68059388Seric #endif
68164944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
68264944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
68364944Seric #endif
68459388Seric #ifndef S_IWGRP
68559388Seric #define S_IWGRP		020
68659388Seric #endif
68759388Seric #ifndef S_IWOTH
68859388Seric #define S_IWOTH		002
68959388Seric #endif
69059388Seric 
69159023Seric /*
69250537Seric **  Older systems don't have this error code -- it should be in
69350537Seric **  /usr/include/sysexits.h.
69450537Seric */
69550537Seric 
69650537Seric # ifndef EX_CONFIG
69750537Seric # define EX_CONFIG	78	/* configuration error */
69850537Seric # endif
69956852Seric 
70064718Seric /* pseudo-code used in server SMTP */
70164718Seric # define EX_QUIT	22	/* drop out of server immediately */
70264718Seric 
70364718Seric 
70463993Seric /*
70563993Seric **  These are used in a few cases where we need some special
70663993Seric **  error codes, but where the system doesn't provide something
70763993Seric **  reasonable.  They are printed in errstring.
70863993Seric */
70963993Seric 
71063993Seric #ifndef E_PSEUDOBASE
71163993Seric # define E_PSEUDOBASE	256
71263993Seric #endif
71363993Seric 
71463993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
71563993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
71663993Seric 
71763970Seric /* type of arbitrary pointer */
71863970Seric #ifndef ARBPTR_T
71963970Seric # define ARBPTR_T	void *
72063970Seric #endif
72163970Seric 
72260568Seric #ifndef __P
72360568Seric # include "cdefs.h"
72460568Seric #endif
72560568Seric 
72656852Seric /*
72758778Seric **  Do some required dependencies
72858778Seric */
72958778Seric 
73058778Seric #if defined(NETINET) || defined(NETISO)
73159107Seric # define SMTP		1	/* enable user and server SMTP */
73259107Seric # define QUEUE		1	/* enable queueing */
73359107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
73458778Seric #endif
73558778Seric 
73658778Seric 
73758778Seric /*
73856852Seric **  Arrange to use either varargs or stdargs
73956852Seric */
74056852Seric 
74156852Seric # ifdef __STDC__
74256852Seric 
74356852Seric # include <stdarg.h>
74456852Seric 
74556852Seric # define VA_LOCAL_DECL	va_list ap;
74656852Seric # define VA_START(f)	va_start(ap, f)
74756852Seric # define VA_END		va_end(ap)
74856852Seric 
74956852Seric # else
75056852Seric 
75156852Seric # include <varargs.h>
75256852Seric 
75356852Seric # define VA_LOCAL_DECL	va_list ap;
75456852Seric # define VA_START(f)	va_start(ap)
75556852Seric # define VA_END		va_end(ap)
75656852Seric 
75756852Seric # endif
75857631Seric 
75957943Seric #ifdef HASUNAME
76057631Seric # include <sys/utsname.h>
76157631Seric # ifdef newstr
76257631Seric #  undef newstr
76357631Seric # endif
76457943Seric #else /* ! HASUNAME */
76557631Seric # define NODE_LENGTH 32
76657631Seric struct utsname
76757631Seric {
76857631Seric 	char nodename[NODE_LENGTH+1];
76957631Seric };
77057943Seric #endif /* HASUNAME */
77157642Seric 
77263838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
77363838Seric # define MAXHOSTNAMELEN	256
77457735Seric #endif
77558153Seric 
77658153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
77758153Seric # define SIGCHLD	SIGCLD
77858153Seric #endif
77958153Seric 
78058153Seric #ifndef STDIN_FILENO
78158153Seric #define STDIN_FILENO	0
78258153Seric #endif
78358153Seric 
78458153Seric #ifndef STDOUT_FILENO
78558153Seric #define STDOUT_FILENO	1
78658153Seric #endif
78758153Seric 
78858153Seric #ifndef STDERR_FILENO
78958153Seric #define STDERR_FILENO	2
79058153Seric #endif
79158689Seric 
79264072Seric #ifndef LOCK_SH
79364035Seric # define LOCK_SH	0x01	/* shared lock */
79464035Seric # define LOCK_EX	0x02	/* exclusive lock */
79564035Seric # define LOCK_NB	0x04	/* non-blocking lock */
79664035Seric # define LOCK_UN	0x08	/* unlock */
79764035Seric #endif
79858692Seric 
79964035Seric #ifndef SIG_ERR
80064035Seric # define SIG_ERR	((void (*)()) -1)
80158689Seric #endif
80258702Seric 
80364500Seric #ifndef WEXITSTATUS
80464500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
80564500Seric #endif
80664500Seric #ifndef WIFEXITED
80764500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
80864500Seric #endif
80964500Seric 
81064561Seric #ifndef SIGFUNC_DEFINED
81164561Seric typedef void		(*sigfunc_t) __P((int));
81264561Seric #endif
81364561Seric 
81465053Seric /* size of syslog buffer */
81565053Seric #ifndef SYSLOG_BUFSIZE
81665053Seric # define SYSLOG_BUFSIZE	1024
81765053Seric #endif
81865053Seric 
81958702Seric /*
82058702Seric **  Size of tobuf (deliver.c)
82158702Seric **	Tweak this to match your syslog implementation.  It will have to
82258702Seric **	allow for the extra information printed.
82358702Seric */
82458702Seric 
82558702Seric #ifndef TOBUFSIZE
82665053Seric # if (SYSLOG_BUFSIZE) > 512
82765053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
82865053Seric # else
82965053Seric #  define TOBUFSIZE	256
83065053Seric # endif
83158702Seric #endif
83260219Seric 
83365015Seric /*
83465015Seric **  Size of prescan buffer.
83565015Seric **	Despite comments in the _sendmail_ book, this probably should
83665015Seric **	not be changed; there are some hard-to-define dependencies.
83765015Seric */
83865015Seric 
83965015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
84060219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
84160219Seric # ifndef FORK
84260219Seric # define FORK		vfork		/* function to call to fork mailer */
84360219Seric # endif
84464929Seric 
84564929Seric #ifndef IDENTPROTO
84664929Seric # define IDENTPROTO	0		/* don't use RFC 1413 */
84764929Seric #endif
848