xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 68706)
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*68706Seric  *	@(#)conf.h	8.145 (Berkeley) 03/31/95
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>
2268693Seric # include <netdb.h>
2368693Seric # include <pwd.h>
2457232Seric 
2563902Seric /**********************************************************************
269147Seric **  Table sizes, etc....
279147Seric **	There shouldn't be much need to change these....
2863902Seric **********************************************************************/
299147Seric 
3059303Seric # define MAXLINE	2048		/* max line length */
3124945Seric # define MAXNAME	256		/* max length of a name */
329147Seric # define MAXPV		40		/* max # of parms to mailers */
3359303Seric # define MAXATOM	200		/* max atoms per address */
349147Seric # define MAXMAILERS	25		/* maximum mailers known to system */
3568384Seric # define MAXRWSETS	200		/* max # of sets of rewriting rules */
369147Seric # define MAXPRIORITIES	25		/* max values for Precedence: field */
3757143Seric # define MAXMXHOSTS	20		/* max # of MX records */
3852106Seric # define SMTPLINELIM	990		/* maximum SMTP line length */
3957232Seric # define MAXKEY		128		/* maximum size of a database key */
4057232Seric # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
4159056Seric # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
4259667Seric # define MAXALIASDB	12		/* max # of alias databases */
4367729Seric # define MAXMAPSTACK	12		/* max # of stacked or sequenced maps */
4467729Seric # define MAXTOCLASS	8		/* max # of message timeout classes */
4568517Seric # define MAXMIMEARGS	20		/* max args in Content-Type: */
4668517Seric # define MAXMIMENESTING	20		/* max MIME multipart nesting */
4757143Seric 
4857143Seric # ifndef QUEUESIZE
4957143Seric # define QUEUESIZE	1000		/* max # of jobs per queue run */
5057143Seric # endif
5157143Seric 
5263902Seric /**********************************************************************
539147Seric **  Compilation options.
5425673Seric **
5525673Seric **	#define these if they are available; comment them out otherwise.
5663902Seric **********************************************************************/
579147Seric 
5825673Seric # define LOG		1	/* enable logging */
5925673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
6064813Seric # define NETUNIX	1	/* include unix domain support */
6158778Seric # define NETINET	1	/* include internet support */
6253735Seric # define MATCHGECOS	1	/* match user names from gecos field */
6363753Seric # define XDEBUG		1	/* enable extended debugging */
6456337Seric # ifdef NEWDB
6556337Seric # define USERDB		1	/* look in user database (requires NEWDB) */
6656337Seric # endif
6756337Seric 
6866334Seric /**********************************************************************
6966334Seric **  0/1 Compilation options.
7066334Seric **	#define these to 1 if they are available;
7166334Seric **	#define them to 0 otherwise.
7266334Seric **********************************************************************/
7366334Seric 
7466334Seric # ifndef NAMED_BIND
7566334Seric #  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
7666334Seric # endif
7766334Seric 
7864032Seric /*
7964944Seric **  Most systems have symbolic links today, so default them on.  You
8064944Seric **  can turn them off by #undef'ing this below.
8164944Seric */
8264944Seric 
8364944Seric # define HASLSTAT	1	/* has lstat(2) call */
8464944Seric 
8564962Seric /*
8664962Seric **  General "standard C" defines.
8764962Seric **
8864962Seric **	These may be undone later, to cope with systems that claim to
8964962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
9064962Seric **	doesn't realize that the library is part of the language.
9164962Seric **
9264962Seric **	Life would be much easier if we could get rid of this sort
9364962Seric **	of bozo problems.
9464962Seric */
9564962Seric 
9664962Seric #ifdef __STDC__
9764962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
9864962Seric #endif
9964962Seric 
10063902Seric /**********************************************************************
10159023Seric **  Operating system configuration.
10259023Seric **
10359023Seric **	Unless you are porting to a new OS, you shouldn't have to
10459023Seric **	change these.
10563902Seric **********************************************************************/
10656823Seric 
10763787Seric /*
10863787Seric **  Per-Operating System defines
10963787Seric */
11063787Seric 
11164314Seric 
11263902Seric /*
11365565Seric **  HP-UX -- tested for 8.07, 9.00, and 9.01.
11463902Seric */
11563902Seric 
11667626Seric #ifdef __hpux
11764727Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
11864727Seric # undef m_flags
11963787Seric # define SYSTEM5	1	/* include all the System V defines */
12064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
12164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
12265982Seric # define setreuid(r, e)		setresuid(r, e, -1)
12368294Seric # define LA_TYPE	LA_SUBR
12465749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
12565354Seric # define GIDSET_T	gid_t
12663962Seric # define _PATH_UNIX	"/hp-ux"
12765354Seric # ifndef _PATH_SENDMAILCF
12865354Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
12965354Seric # endif
13065167Seric # ifndef IDENTPROTO
13165167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
13256823Seric # endif
13365581Seric # ifndef HASGETUSERSHELL
13465581Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
13565581Seric # endif
13665504Seric # define syslog		hard_syslog
13765581Seric # ifdef __STDC__
13865581Seric extern int	syslog(int, char *, ...);
13965167Seric # endif
14067626Seric #endif
14156823Seric 
14264314Seric 
14363902Seric /*
14463902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
14563902Seric */
14663902Seric 
14767626Seric #ifdef _AIX3
14864035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
14964840Seric # define HASUNAME	1	/* use System V uname(2) system call */
15065211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
15160219Seric # define FORK		fork	/* no vfork primitive available */
15265749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
15367771Seric # define SPT_PADCHAR	'\0'	/* pad process title with nulls */
15468145Seric # define LA_TYPE	LA_INT
15567626Seric #endif
15660219Seric 
15764314Seric 
15863902Seric /*
15963902Seric **  Silicon Graphics IRIX
16063902Seric **
16163965Seric **	Compiles on 4.0.1.
16267967Seric **
16368686Seric **	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
16468686Seric **	Use IRIX5 instead of IRIX for IRIX 5.x.
16567967Seric **
16667967Seric **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
16768686Seric **	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
16863902Seric */
16963902Seric 
17068686Seric #if defined(IRIX64) || defined(IRIX5)
17167967Seric # define IRIX
17267967Seric #endif
17367967Seric 
17467626Seric #ifdef IRIX
17566763Seric # define SYSTEM5	1	/* this is a System-V derived system */
17664035Seric # define HASSETREUID	1	/* has setreuid(2) call */
17764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
17865211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
17963753Seric # define FORK		fork	/* no vfork primitive available */
18068686Seric # if !defined(IRIX64) && !defined(IRIX5)
18168225Seric #  define WAITUNION	1	/* use "union wait" as wait argument type */
18268225Seric # endif
18364155Seric # define setpgid	BSDsetpgrp
18463937Seric # define GIDSET_T	gid_t
18568705Seric # define ARGV_T		const char **
18665749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
18768439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
18866763Seric # define LA_TYPE	LA_INT
18967967Seric # ifdef IRIX64
19067967Seric #  define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
19167967Seric # else
19267967Seric #  define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
19367967Seric # endif
19467626Seric #endif
19563753Seric 
19663902Seric 
19763902Seric /*
19864813Seric **  SunOS and Solaris
19964813Seric **
20064813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
20164813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
20263902Seric */
20363902Seric 
20463787Seric #if defined(sun) && !defined(BSD)
20559074Seric 
20664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
20764813Seric # define HASUNAME	1	/* use System V uname(2) system call */
20865211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
20965749Seric # define LA_TYPE	LA_INT
21060564Seric 
21164842Seric # ifdef SOLARIS_2_3
21268486Seric #  define SOLARIS		/* for back compat only -- use -DSOLARIS=203 */
21364842Seric # endif
21464842Seric 
21560602Seric # ifdef SOLARIS
21663902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
21765222Seric #  ifndef __svr4__
21865222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
21965222Seric #  endif
22063787Seric #  include <sys/time.h>
22165172Seric #  define GIDSET_T	gid_t
22265189Seric #  ifndef _PATH_UNIX
22367129Seric #   define _PATH_UNIX	"/dev/ksyms"
22465189Seric #  endif
22563962Seric #  ifndef _PATH_SENDMAILCF
22663962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
22764072Seric #  endif
22864072Seric #  ifndef _PATH_SENDMAILPID
22963962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
23063962Seric #  endif
23166022Seric #  ifndef SYSLOG_BUFSIZE
23266022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
23366022Seric #  endif
23463787Seric 
23560602Seric # else
23665105Seric 			/* SunOS 4.0.3 or 4.1.x */
23765189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
23865830Seric #  ifndef HASFLOCK
23965830Seric #   define HASFLOCK	1	/* has flock(2) call */
24065830Seric #  endif
24165749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
24260564Seric #  include <vfork.h>
24363787Seric 
24465105Seric #  ifdef SUNOS403
24565105Seric 			/* special tweaking for SunOS 4.0.3 */
24665105Seric #   include <malloc.h>
24765105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
24865105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
24965105Seric #   undef WIFEXITED
25065105Seric #   undef WEXITSTATUS
25165105Seric #   undef HASUNAME
25265105Seric #   define setpgid	setpgrp
25365105Seric typedef int		pid_t;
25465105Seric extern char		*getenv();
25565105Seric 
25666732Seric #  else
25766732Seric 			/* 4.1.x specifics */
25866732Seric #   define HASSETSID	1	/* has Posix setsid(2) call */
25966732Seric #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
26066732Seric 
26165105Seric #  endif
26260564Seric # endif
26359023Seric #endif
26459023Seric 
26564718Seric /*
26664813Seric **  DG/UX
26764813Seric **
26867427Seric **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
26967427Seric **	older support.
27067427Seric **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
27164718Seric */
27264314Seric 
27367427Seric #ifdef DGUX_5_4_2
27467427Seric # define DGUX		1
27567427Seric #endif
27667427Seric 
27764718Seric #ifdef	DGUX
27864718Seric # define SYSTEM5	1
27964718Seric # define LA_TYPE	LA_SUBR
28064718Seric # define HASSETREUID	1	/* has setreuid(2) call */
28164718Seric # define HASUNAME	1	/* use System V uname(2) system call */
28264718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
28364718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
28466036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
28565167Seric # ifndef IDENTPROTO
28665167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
28765167Seric # endif
28867771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
28965749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
29064813Seric 
29164813Seric /* these include files must be included early on DG/UX */
29264813Seric # include <netinet/in.h>
29364813Seric # include <arpa/inet.h>
29464813Seric 
29567427Seric # ifdef DGUX_5_4_2
29667427Seric #  define inet_addr	dgux_inet_addr
29764718Seric extern long	dgux_inet_addr();
29867427Seric # endif
29964718Seric #endif
30064718Seric 
30164718Seric 
30263902Seric /*
30363902Seric **  Digital Ultrix 4.2A or 4.3
30464264Seric **
30564264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
30664264Seric **	not dropped when the process exits.  This causes major problems,
30764264Seric **	so flock is the only alternative.
30863902Seric */
30963902Seric 
31060564Seric #ifdef ultrix
31164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
31263962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
31364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
31466242Seric # define HASUNAME	1	/* use System V uname(2) system call */
31565830Seric # ifndef HASFLOCK
31665830Seric #  define HASFLOCK	1	/* has flock(2) call */
31765830Seric # endif
31865211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
31966318Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
32065135Seric # ifdef vax
32165135Seric #  define LA_TYPE	LA_FLOAT
32265135Seric # else
32365135Seric #  define LA_TYPE	LA_INT
32465135Seric #  define LA_AVENRUN	"avenrun"
32565135Seric # endif
32665749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
32765167Seric # ifndef IDENTPROTO
32865167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
32965167Seric # endif
33060564Seric #endif
33160564Seric 
33264314Seric 
33363902Seric /*
33468072Seric **  OSF/1 for Intel Paragon.
33568072Seric **
33668082Seric **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
33768082Seric **	of Intel Scalable Systems Divison.
33868072Seric */
33968072Seric 
34068072Seric #ifdef __PARAGON__
34168072Seric # define __osf__	1	/* get OSF/1 defines below */
34268072Seric # ifndef _PATH_SENDMAILCF
34368072Seric #  define _PATH_SENDMAILCF	"/var/adm/sendmail/sendmail.cf"
34468072Seric # endif
34568072Seric #endif
34668072Seric 
34768072Seric 
34868072Seric /*
34963902Seric **  OSF/1 (tested on Alpha)
35063902Seric */
35163902Seric 
35263787Seric #ifdef __osf__
35363962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
35464035Seric # define HASSETREUID	1	/* has setreuid(2) call */
35564035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
35666226Seric # ifndef HASFLOCK
35765830Seric #  define HASFLOCK	1	/* has flock(2) call */
35865830Seric # endif
35963962Seric # define LA_TYPE	LA_INT
36065749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
36164813Seric # ifndef _PATH_SENDMAILPID
36265504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
36364813Seric # endif
36459287Seric #endif
36559287Seric 
36664314Seric 
36763902Seric /*
36863902Seric **  NeXTstep
36963902Seric */
37063902Seric 
37164076Seric #ifdef NeXT
37264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
37365830Seric # ifndef HASFLOCK
37465830Seric #  define HASFLOCK	1	/* has flock(2) call */
37565830Seric # endif
37664125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
37764563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
37868705Seric # define UID_T		int	/* compiler gripes on uid_t */
37963753Seric # define sleep		sleepX
38064155Seric # define setpgid	setpgrp
38164295Seric # ifndef LA_TYPE
38264295Seric #  define LA_TYPE	LA_MACH
38364295Seric # endif
38465749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
38564500Seric # ifndef _POSIX_SOURCE
38664035Seric typedef int		pid_t;
38764500Seric #  undef WEXITSTATUS
38864500Seric #  undef WIFEXITED
38964500Seric # endif
39064072Seric # ifndef _PATH_SENDMAILCF
39164072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
39264072Seric # endif
39364072Seric # ifndef _PATH_SENDMAILPID
39464072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
39564072Seric # endif
39659288Seric #endif
39759288Seric 
39864314Seric 
39963902Seric /*
40063962Seric **  4.4 BSD
40164831Seric **
40264831Seric **	See also BSD defines.
40363902Seric */
40463902Seric 
40560568Seric #ifdef BSD4_4
40664072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
40760568Seric # include <sys/cdefs.h>
40863838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
40964072Seric # ifndef LA_TYPE
41064072Seric #  define LA_TYPE	LA_SUBR
41164072Seric # endif
41265749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
41367771Seric # define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
41460568Seric #endif
41560568Seric 
41664314Seric 
41763902Seric /*
41865982Seric **  BSD/386 (all versions)
41965982Seric **	From Tony Sanders, BSDI
42065982Seric */
42165982Seric 
42265982Seric #ifdef __bsdi__
42365982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
42465982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
42566843Seric # include <sys/cdefs.h>
42666843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
42766030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
42866843Seric # ifndef LA_TYPE
42966843Seric #  define LA_TYPE	LA_SUBR
43066843Seric # endif
43165982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
43266843Seric 			/* version 1.1 or later */
43367771Seric #  undef SPT_TYPE
43467771Seric #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
43566843Seric # else
43666843Seric 			/* version 1.0 or earlier */
43766843Seric #  ifndef OLD_NEWDB
43866843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
43966843Seric #  endif
44067771Seric #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
44165982Seric # endif
44265982Seric #endif
44365982Seric 
44465982Seric 
44565982Seric 
44665982Seric /*
44765049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
44864733Seric **
44964733Seric **  4.3BSD clone, closer to 4.4BSD
45064831Seric **
45164831Seric **	See also BSD defines.
45264733Seric */
45364733Seric 
45465049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
45564733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
45664733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
45766754Seric # ifdef __NetBSD__
45866754Seric #  define HASUNAME	1	/* has uname(2) syscall */
45966754Seric # endif
46064733Seric # include <sys/cdefs.h>
46164733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
46264733Seric # ifndef LA_TYPE
46364733Seric #  define LA_TYPE	LA_SUBR
46464733Seric # endif
46565749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
46664733Seric #endif
46764733Seric 
46864733Seric 
46964733Seric /*
47064813Seric **  Mach386
47164813Seric **
47264813Seric **	For mt Xinu's Mach386 system.
47364813Seric */
47464813Seric 
47564813Seric #if defined(MACH) && defined(i386)
47664813Seric # define MACH386	1
47764813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
47864813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
47966226Seric # ifndef HASFLOCK
48065830Seric #  define HASFLOCK	1	/* has flock(2) call */
48165830Seric # endif
48264813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
48364813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
48464813Seric # define setpgid	setpgrp
48564813Seric # ifndef LA_TYPE
48664813Seric #  define LA_TYPE	LA_FLOAT
48764813Seric # endif
48865749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
48964962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
49064813Seric # undef WEXITSTATUS
49164813Seric # undef WIFEXITED
49264813Seric # ifndef _PATH_SENDMAILCF
49364813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
49464813Seric # endif
49564813Seric # ifndef _PATH_SENDMAILPID
49664813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
49764813Seric # endif
49864813Seric #endif
49964813Seric 
50064813Seric 
50164813Seric /*
50263969Seric **  4.3 BSD -- this is for very old systems
50363969Seric **
50465949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
50565949Seric **
50663969Seric **	You'll also have to install a new resolver library.
50763969Seric **	I don't guarantee that support for this environment is complete.
50863969Seric */
50963969Seric 
51065949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
51163969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
51263969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
51363970Seric # define ARBPTR_T	char *
51464155Seric # define setpgid	setpgrp
51563969Seric # ifndef LA_TYPE
51663969Seric #  define LA_TYPE	LA_FLOAT
51763969Seric # endif
51863969Seric # ifndef _PATH_SENDMAILCF
51963969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
52063969Seric # endif
52165167Seric # ifndef IDENTPROTO
52265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
52365167Seric # endif
52464834Seric # undef WEXITSTATUS
52564834Seric # undef WIFEXITED
52664834Seric typedef short		pid_t;
52764834Seric extern int		errno;
52863969Seric #endif
52963969Seric 
53064314Seric 
53163969Seric /*
53263902Seric **  SCO Unix
53365087Seric **
53465087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
53565087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
53665087Seric **	The second is, I believe, for an older version.
53763902Seric */
53863902Seric 
53965087Seric #ifdef _SCO_unix_4_2
54065087Seric # define _SCO_unix_
54165087Seric # define HASSETREUID	1	/* has setreuid(2) call */
54266757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
54365087Seric # define _PATH_UNIX	"/unix"
54465087Seric # ifndef _PATH_SENDMAILCF
54565087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
54665087Seric # endif
54765087Seric # ifndef _PATH_SENDMAILPID
54865087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
54965087Seric # endif
55065087Seric #endif
55165087Seric 
55263838Seric #ifdef _SCO_unix_
55363838Seric # define SYSTEM5	1	/* include all the System V defines */
55464035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
55565212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
55663838Seric # define FORK		fork
55763838Seric # define MAXPATHLEN	PATHSIZE
55864718Seric # define LA_TYPE	LA_SHORT
55967812Seric # define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
56068439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
56167608Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
56264813Seric # undef NETUNIX			/* no unix domain socket support */
56363838Seric #endif
56463838Seric 
56564314Seric 
56663962Seric /*
56768442Seric **  ISC (SunSoft) Unix.
56868442Seric **
56968442Seric **	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
57068442Seric */
57168442Seric 
57268442Seric #ifdef ISC_UNIX
57368442Seric # include <net/errno.h>
57468442Seric # define SYSTEM5	1	/* include all the System V defines */
57568442Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
57668442Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
57768442Seric # define HASSETREUID	1	/* has setreuid(2) call */
57868442Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
57968442Seric # undef NETUNIX			/* no unix domain socket support */
58068442Seric # define FORK		fork
58168442Seric # define MAXPATHLEN	1024
58268442Seric # define LA_TYPE	LA_SHORT
58368442Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
58468442Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
58568442Seric # define _PATH_UNIX	"/unix"
58668442Seric # ifndef _PATH_SENDMAILCF
58768442Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
58868442Seric # endif
58968442Seric # ifndef _PATH_SENDMAILPID
59068442Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
59168442Seric # endif
59268442Seric 
59368442Seric typedef short		pid_t;
59468442Seric 
59568442Seric #endif
59668442Seric 
59768442Seric 
59868442Seric /*
59968040Seric **  Altos System V.
60068040Seric **	Contributed by Tim Rice <timr@crl.com>.
60168040Seric */
60268040Seric 
60368040Seric #ifdef ALTOS_SYS_V
60468040Seric # include <limits.h>
60568040Seric # define SYSTEM5	1	/* include all the System V defines */
60668040Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
60768040Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
60868040Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
60968040Seric # define NEEDFSYNC	1	/* no fsync(2) in system library */
61068040Seric # define FORK		fork
61168040Seric # define MAXPATHLEN	PATHSIZE
61268040Seric # define LA_TYPE	LA_SHORT
61368040Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
61468439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
61568040Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
61668040Seric # undef NETUNIX			/* no unix domain socket support */
61768040Seric # undef WIFEXITED
61868040Seric # undef WEXITSTATUS
61968040Seric # define strtoul	strtol	/* gcc library bogosity */
62068040Seric 
62168040Seric typedef unsigned short	uid_t;
62268040Seric typedef unsigned short	gid_t;
62368040Seric typedef short		pid_t;
62468040Seric #endif
62568040Seric 
62668040Seric 
62768040Seric /*
62863962Seric **  ConvexOS 11.0 and later
62965949Seric **
63065949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
63165949Seric **	works on 9.1 as well.
63263962Seric */
63363962Seric 
63463962Seric #ifdef _CONVEX_SOURCE
63563977Seric # define BSD		1	/* include all the BSD defines */
63663977Seric # define HASUNAME	1	/* use System V uname(2) system call */
63763962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
63863977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
63963962Seric # define LA_TYPE	LA_FLOAT
64065749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
64165949Seric # ifndef _PATH_SENDMAILCF
64265949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
64365949Seric # endif
64465949Seric # ifndef S_IREAD
64565949Seric #  define S_IREAD	_S_IREAD
64665949Seric #  define S_IWRITE	_S_IWRITE
64765949Seric #  define S_IEXEC	_S_IEXEC
64865949Seric #  define S_IFMT	_S_IFMT
64965949Seric #  define S_IFCHR	_S_IFCHR
65065949Seric #  define S_IFBLK	_S_IFBLK
65165949Seric # endif
65265167Seric # ifndef IDENTPROTO
65365167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
65465167Seric # endif
65563962Seric #endif
65663962Seric 
65764314Seric 
65863962Seric /*
65964999Seric **  RISC/os 4.52
66063962Seric **
66164999Seric **	Gives a ton of warning messages, but otherwise compiles.
66263962Seric */
66363962Seric 
66463965Seric #ifdef RISCOS
66564999Seric 
66663962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
66766226Seric # ifndef HASFLOCK
66865830Seric #  define HASFLOCK	1	/* has flock(2) call */
66965830Seric # endif
67064999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
67164999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
67263962Seric # define LA_TYPE	LA_INT
67363962Seric # define LA_AVENRUN	"avenrun"
67463962Seric # define _PATH_UNIX	"/unix"
67564999Seric # undef WIFEXITED
67664999Seric 
67764999Seric # define setpgid	setpgrp
67864999Seric 
67964999Seric extern int		errno;
68064999Seric typedef int		pid_t;
68164999Seric #define			SIGFUNC_DEFINED
68264999Seric typedef int		(*sigfunc_t)();
68364999Seric extern char		*getenv();
68464999Seric extern void		*malloc();
68564999Seric 
68663962Seric #endif
68763962Seric 
68864314Seric 
68964155Seric /*
69064155Seric **  Linux 0.99pl10 and above...
69166300Seric **
69266300Seric **  Thanks to, in reverse order of contact:
69366300Seric **
69468093Seric **	John Kennedy <warlock@csuchico.edu>
69567885Seric **	Andrew Pam <avatar@aus.xanadu.com>
69666300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
69766300Seric **	Karl London <karl@borg.demon.co.uk>
69866300Seric **
69968093Seric **  Last compiled against:	[12/14/94 @ 11:38:41 PM (Wednesday)]
70068093Seric **	sendmail 8.7.a.5	named 4.9.3-beta12-p1	db-1.85
70168093Seric **	gcc 2.6.2		libc.so.4.6.20
70268093Seric **	slackware 2.1.0		linux 1.1.70
70364155Seric */
70464155Seric 
70564770Seric #ifdef __linux__
70666298Seric # define BSD		1	/* include BSD defines */
70764155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
70866298Seric # define HASUNAME	1	/* use System V uname(2) system call */
70964380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
71066298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
71166300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
71267885Seric # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
71368518Seric # ifndef HASFLOCK
71468518Seric #  define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
71568518Seric # endif
71664155Seric # ifndef LA_TYPE
71766301Seric #  define LA_TYPE	LA_PROCSTR
71864155Seric # endif
71966300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
72068093Seric # ifndef _PATH_SENDMAILPID
72168093Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
72268093Seric # endif
72368093Seric # define TZ_TYPE	TZ_TNAME
72464763Seric # include <sys/sysmacros.h>
72566300Seric # undef atol			/* wounded in <stdlib.h> */
72664155Seric #endif
72764155Seric 
72864155Seric 
72964345Seric /*
73064345Seric **  DELL SVR4 Issue 2.2, and others
73164345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
73264345Seric **
73364345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
73464345Seric **	defined, and the definitions conflict.
73564924Seric **
73664924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
73764924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
73864924Seric **	(SVR4.0/386 version 3.0).
73964345Seric */
74064345Seric 
74164345Seric #ifdef DELL_SVR4
74265189Seric 				/* no changes necessary */
74365189Seric 				/* see general __svr4__ defines below */
74464345Seric #endif
74564345Seric 
74664345Seric 
74764380Seric /*
74864380Seric **  Apple A/UX 3.0
74964380Seric */
75064345Seric 
75164380Seric #ifdef _AUX_SOURCE
75264729Seric # include <sys/sysmacros.h>
75364380Seric # define BSD			/* has BSD routines */
75464380Seric # define HASUNAME	1	/* use System V uname(2) system call */
75564380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
75664561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
75765167Seric # ifndef IDENTPROTO
75865167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
75965167Seric # endif
76064380Seric # define FORK		fork
76164380Seric # ifndef _PATH_SENDMAILCF
76264380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
76364380Seric # endif
76464380Seric # ifndef LA_TYPE
76564380Seric #  define LA_TYPE	LA_ZERO
76664380Seric # endif
76765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
76864560Seric # undef WIFEXITED
76964560Seric # undef WEXITSTATUS
77064380Seric #endif
77164380Seric 
77264380Seric 
77364705Seric /*
77464705Seric **  Encore UMAX V
77564705Seric **
77664705Seric **	Not extensively tested.
77764705Seric */
77864380Seric 
77964705Seric #ifdef UMAXV
78064705Seric # include <limits.h>
78164705Seric # define HASUNAME	1	/* use System V uname(2) system call */
78264705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
78364705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
78465211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
78564705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
78664705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
78764705Seric # define FORK		fork	/* no vfork(2) primitive available */
78865749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
78964705Seric # define MAXPATHLEN	PATH_MAX
79064705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
79164705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
79264705Seric # undef WIFEXITED
79364705Seric # undef WEXITSTATUS
79464705Seric #endif
79564705Seric 
79664705Seric 
79764939Seric /*
79864939Seric **  Stardent Titan 3000 running TitanOS 4.2.
79964939Seric **
80064939Seric **	Must be compiled in "cc -43" mode.
80164939Seric **
80264944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
80364939Seric **
80464939Seric **	Note the tweaking below after the BSD defines are set.
80564939Seric */
80664705Seric 
80764939Seric #ifdef titan
80864939Seric # define setpgid	setpgrp
80964939Seric typedef int		pid_t;
81064939Seric # undef WIFEXITED
81164939Seric # undef WEXITSTATUS
81264939Seric #endif
81364939Seric 
81464939Seric 
81564962Seric /*
81664962Seric **  Sequent DYNIX 3.2.0
81764962Seric **
81864962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
81964962Seric */
82064939Seric 
82164962Seric #ifdef sequent
82266038Seric 
82364962Seric # define BSD		1
82464962Seric # define HASUNSETENV	1
82564962Seric # define BSD4_3		1	/* to get signal() in conf.c */
82664962Seric # define WAITUNION	1
82764962Seric # define LA_TYPE	LA_FLOAT
82864962Seric # ifdef	_POSIX_VERSION
82964962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
83064962Seric # endif
83164962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
83264962Seric # define setpgid	setpgrp
83364962Seric 
83464962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
83564962Seric # undef	WIFEXITED
83664962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
83764962Seric 			 ((union wait*)&(s))->w_termsig == 0)
83864962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
83964962Seric typedef int		pid_t;
84064962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
84164962Seric 
84266144Seric # ifndef IDENTPROTO
84366144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
84466144Seric # endif
84566144Seric 
84664962Seric # ifndef _PATH_UNIX
84764962Seric #  define _PATH_UNIX	"/dynix"
84864962Seric # endif
84964962Seric # ifndef _PATH_SENDMAILCF
85064962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
85164962Seric # endif
85264962Seric 
85364962Seric #endif
85464962Seric 
85564962Seric 
85665748Seric /*
85766038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
85866038Seric **
85966038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
86066038Seric **
86166038Seric **	From Tim Wright <timw@sequent.com>.
86266038Seric */
86366038Seric 
86466038Seric #ifdef _SEQUENT_
86566038Seric # define SYSTEM5	1	/* include all the System V defines */
86666038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
86766038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
86866038Seric # define HASSETREUID	1	/* has setreuid(2) call */
86966038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
87066038Seric # define GIDSET_T	gid_t
87166038Seric # define LA_TYPE	LA_INT
87266038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
87367771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
87466144Seric # ifndef IDENTPROTO
87566144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
87666144Seric # endif
87766038Seric # ifndef _PATH_SENDMAILCF
87866038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
87966038Seric # endif
88066038Seric # ifndef _PATH_SENDMAILPID
88166038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
88266038Seric # endif
88366038Seric #endif
88466038Seric 
88566038Seric 
88666038Seric /*
88765748Seric **  Cray Unicos
88865748Seric **
88965748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
89065748Seric */
89164962Seric 
89265748Seric #ifdef UNICOS
89365748Seric # define SYSTEM5	1	/* include all the System V defines */
89465748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
89565748Seric # define MAXPATHLEN	PATHSIZE
89665748Seric # define LA_TYPE	LA_ZERO
89765749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
89868439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
89965748Seric #endif
90064962Seric 
90165748Seric 
90265820Seric /*
90365820Seric **  Apollo DomainOS
90465820Seric **
90565820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
90665982Seric **
90765820Seric **  15 Jan 1994
90865820Seric **
90965820Seric */
91065748Seric 
91165820Seric #ifdef apollo
91265820Seric # define HASSETREUID	1	/* has setreuid(2) call */
91365820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
91467771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
91565820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
91666044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
91768439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
91865820Seric # ifndef _PATH_SENDMAILCF
91965820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
92065820Seric # endif
92165820Seric # ifndef _PATH_SENDMAILPID
92265820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
92365820Seric # endif
92465820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
92565820Seric # undef  S_IFIFO
92665820Seric # define S_IFIFO	0010000
92765820Seric # ifndef IDENTPROTO
92865820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
92965820Seric # endif
93065982Seric #endif
93165820Seric 
93265820Seric 
93366748Seric /*
93467745Seric **  UnixWare 1.1.2.
93566752Seric **
93666752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
93766752Seric */
93866752Seric 
93966752Seric #ifdef UNIXWARE
94066752Seric # define SYSTEM5		1
94167745Seric # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
94267745Seric # define HASGETDTABLESIZE	1
94367745Seric # define HASSETREUID		1
94467745Seric # define HASSETSID		1
94567745Seric # define HASINITGROUPS		1
94667745Seric # define GIDSET_T		gid_t
94767745Seric # define SLEEP_T		unsigned
94866752Seric # define SFS_TYPE		SFS_STATVFS
94966752Seric # define LA_TYPE		LA_ZERO
95066752Seric # undef WIFEXITED
95166752Seric # undef WEXITSTATUS
95266752Seric # define _PATH_UNIX		"/unix"
95366752Seric # ifndef _PATH_SENDMAILCF
95466752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
95566752Seric # endif
95666752Seric # ifndef _PATH_SENDMAILPID
95766752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
95866752Seric # endif
95966752Seric # define SYSLOG_BUFSIZE	128
96066752Seric #endif
96166752Seric 
96266752Seric 
96366752Seric /*
96466748Seric **  Intergraph CLIX 3.1
96566748Seric **
96666748Seric **	From Paul Southworth <pauls@locust.cic.net>
96766748Seric */
96865820Seric 
96966748Seric #ifdef CLIX
97066748Seric # define SYSTEM5	1	/* looks like System V */
97166752Seric # ifndef HASGETUSERSHELL
97266752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
97366752Seric # endif
97466748Seric # define DEV_BSIZE	512	/* device block size not defined */
97566748Seric # define GIDSET_T	gid_t
97666748Seric # undef LOG			/* syslog not available */
97766748Seric # define NEEDFSYNC	1	/* no fsync in system library */
97866748Seric # define GETSHORT	_getshort
97966748Seric #endif
98065820Seric 
98166748Seric 
98266776Seric /*
98366776Seric **  NCR 3000 Series (SysVr4)
98466776Seric **
98567434Seric **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
98666776Seric */
98766748Seric 
98866776Seric #ifdef NCR3000
98966776Seric # define __svr4__
99066776Seric # undef BSD
99166776Seric # define LA_AVENRUN	"avenrun"
99266776Seric #endif
99366748Seric 
99466776Seric 
99567434Seric /*
99667434Seric **  Tandem NonStop-UX SVR4
99767434Seric **
99867434Seric **	From Rick McCarty <mccarty@mpd.tandem.com>.
99967434Seric */
100066776Seric 
100167434Seric #ifdef NonStop_UX_BXX
100267434Seric # define __svr4__
100367434Seric #endif
100466776Seric 
100567434Seric 
100667488Seric /*
100767488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
100867488Seric **
100967488Seric **	Tested for 1.04 and 1.03
101067488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
101167488Seric */
101267434Seric 
101367488Seric #ifdef __H3050R
101467488Seric # define SYSTEM5	1	/* include all the System V defines */
101567488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
101667488Seric # define setreuid(r, e)	setresuid(r, e, -1)
101767488Seric # define LA_TYPE	LA_FLOAT
101867488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
101967488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
102067488Seric # ifndef GIDSET_T
102167488Seric #  define GIDSET_T	gid_t
102267488Seric # endif
102367488Seric # ifndef _PATH_UNIX
102467488Seric #  define _PATH_UNIX	"/HI-UX"
102567488Seric # endif
102667488Seric # ifndef _PATH_SENDMAILCF
102767488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
102867488Seric # endif
102967488Seric # ifndef IDENTPROTO
103067488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
103167488Seric # endif
103267488Seric # ifndef HASGETUSERSHELL
103367488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
103467488Seric # endif
103567488Seric 
103667488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
103767488Seric # undef m_flags
103867488Seric 
103967488Seric # ifdef __STDC__
104067488Seric extern int	syslog(int, char *, ...);
104167488Seric # endif
104267488Seric 
104367488Seric #endif
104467488Seric 
104567488Seric 
104668099Seric /*
104768099Seric **  Amdahl UTS System V 2.1.5 (SVr3-based)
104868099Seric **
104968099Seric **    From: Janet Jackson <janet@dialix.oz.au>.
105068099Seric */
105167488Seric 
105268099Seric #ifdef _UTS
105368099Seric # include <sys/sysmacros.h>
105468099Seric # undef HASLSTAT	/* has symlinks, but they cause problems */
105568099Seric # define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
105668099Seric # define SYS5SIGNALS	1	/* System V signal semantics */
105768099Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
105868099Seric # define HASUNAME	1	/* use System V uname(2) system call */
105968099Seric # define HASINITGROUPS	1	/* has initgroups(3) function */
106068099Seric # define HASSETVBUF	1	/* has setvbuf(3) function */
106168099Seric # define HASSIGSETMASK	0	/* does not have sigsetmask(2) function */
106268099Seric # ifndef HASGETUSERSHELL
106368099Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
106468099Seric # endif
106568099Seric # define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
106668099Seric # define LA_TYPE	LA_ZERO		/* doesn't have load average */
106768099Seric # define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
106868439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
106968099Seric # define _PATH_UNIX	"/unix"
107068099Seric # ifndef _PATH_SENDMAILCF
107168099Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
107268099Seric # endif
107368099Seric #endif
107468099Seric 
107568357Seric /*
107668357Seric **  Cray Computer Corporation's CSOS
107768357Seric **
107868357Seric **	Contributed by Scott Bolte <scott@craycos.com>.
107968357Seric */
108068099Seric 
108168357Seric #ifdef _CRAYCOM
108268357Seric # define SYSTEM5	1	/* include all the System V defines */
108368357Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
108468357Seric # define NEEDFSYNC	1	/* no fsync in system library */
108568357Seric # define MAXPATHLEN	PATHSIZE
108668357Seric # define LA_TYPE	LA_ZERO
108768357Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
108868439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
108968357Seric # define _POSIX_CHOWN_RESTRICTED	-1
109068357Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
109168357Seric #endif
109268099Seric 
109368099Seric 
109463902Seric /**********************************************************************
109563787Seric **  End of Per-Operating System defines
109663902Seric **********************************************************************/
109763787Seric 
109863949Seric /**********************************************************************
109963949Seric **  More general defines
110063949Seric **********************************************************************/
110163949Seric 
110263962Seric /* general BSD defines */
110363962Seric #ifdef BSD
110464035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
110564035Seric # define HASSETREUID	1	/* has setreuid(2) call */
110667742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
110767430Seric # ifndef HASSETRLIMIT
110867430Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
110967430Seric # endif
111065830Seric # ifndef HASFLOCK
111165830Seric #  define HASFLOCK	1	/* has flock(2) call */
111265830Seric # endif
111367602Seric # ifndef TZ_TYPE
111467608Seric #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
111567602Seric # endif
111663962Seric #endif
111763962Seric 
111865189Seric /* general System V Release 4 defines */
111965189Seric #ifdef __svr4__
112065189Seric # define SYSTEM5	1
112165189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
112267742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
112367742Seric # ifndef HASSETRLIMIT
112467742Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
112567742Seric # endif
112665211Seric # ifndef HASGETUSERSHELL
112765211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
112865210Seric # endif
112965189Seric # define setreuid(r, e)	seteuid(e)
113065189Seric 
113165189Seric # ifndef _PATH_UNIX
113265189Seric #  define _PATH_UNIX		"/unix"
113365189Seric # endif
113465189Seric # ifndef _PATH_SENDMAILCF
113565189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
113665189Seric # endif
113765189Seric # ifndef _PATH_SENDMAILPID
113865189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
113965189Seric # endif
114065189Seric # ifndef SYSLOG_BUFSIZE
114165189Seric #  define SYSLOG_BUFSIZE	128
114265189Seric # endif
114367159Seric # ifndef SFS_TYPE
114467159Seric #  define SFS_TYPE		SFS_STATVFS
114567159Seric # endif
114665189Seric #endif
114765189Seric 
114863787Seric /* general System V defines */
114966298Seric #ifdef SYSTEM5
115064813Seric # include <sys/sysmacros.h>
115163949Seric # define HASUNAME	1	/* use System V uname(2) system call */
115264705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
115364962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
115467430Seric # ifndef HASULIMIT
115567430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
115667430Seric # endif
115763962Seric # ifndef LA_TYPE
115865749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
115963962Seric # endif
116065749Seric # ifndef SFS_TYPE
116165749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
116265749Seric # endif
116367602Seric # ifndef TZ_TYPE
116467608Seric #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
116567602Seric # endif
116668442Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
116768442Seric # define bzero(d, l)		(memset((d), '\0', (l)))
116868442Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
116966298Seric #endif
117063787Seric 
117163949Seric /* general POSIX defines */
117263949Seric #ifdef _POSIX_VERSION
117364718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
117464718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
117563949Seric #endif
117663949Seric 
117763787Seric /*
117863937Seric **  If no type for argument two of getgroups call is defined, assume
117963937Seric **  it's an integer -- unfortunately, there seem to be several choices
118063937Seric **  here.
118163937Seric */
118263937Seric 
118363937Seric #ifndef GIDSET_T
118463937Seric # define GIDSET_T	int
118563937Seric #endif
118663937Seric 
118764939Seric /*
118868357Seric **  Tweaking for systems that (for example) claim to be BSD or POSIX
118968357Seric **  but don't have all the standard BSD or POSIX routines (boo hiss).
119064939Seric */
119164439Seric 
119264939Seric #ifdef titan
119364939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
119464939Seric #endif
119564939Seric 
119668357Seric #ifdef _CRAYCOM
119768357Seric # undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
119868357Seric #endif
119965830Seric 
120068442Seric #ifdef ISC_UNIX
120168442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
120268442Seric #endif
120368357Seric 
120468442Seric #ifdef ALTOS_SYS_V
120568442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
120668442Seric # undef bzero			/* despite SystemV claim, uses BSD bzero */
120768442Seric # undef bcmp			/* despite SystemV claim, uses BSD bcmp */
120868442Seric #endif
120968442Seric 
121068442Seric 
121165167Seric /*
121265167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
121365167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
121465167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
121565167Seric **  are closed.  Some firewalls return this error if you try to connect
121665167Seric **  to the IDENT port (113), so you can't receive email from these hosts
121765167Seric **  on these systems.  The firewall really should use a more specific
121865167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
121965167Seric **  not explicitly set to zero above, default it on.
122065167Seric */
122164939Seric 
122265167Seric #ifndef IDENTPROTO
122365167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
122465167Seric #endif
122565167Seric 
122665211Seric #ifndef HASGETUSERSHELL
122765211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
122865210Seric #endif
122965167Seric 
123065830Seric #ifndef HASFLOCK
123165830Seric # define HASFLOCK	0	/* assume no flock(2) support */
123265830Seric #endif
123365210Seric 
123467430Seric #ifndef HASSETRLIMIT
123567430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
123667430Seric #endif
123767430Seric 
123867430Seric #ifndef HASULIMIT
123967430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
124067430Seric #endif
124167430Seric 
124266843Seric #ifndef OLD_NEWDB
124366843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
124466843Seric #endif
124565830Seric 
124668099Seric /* heuristic setting of HASSETSIGMASK; can override above */
124768099Seric #ifndef HASSIGSETMASK
124868099Seric # ifdef SIGVTALRM
124968099Seric #  define HASSETSIGMASK	1
125068099Seric # else
125168099Seric #  define HASSETSIGMASK	0
125268099Seric # endif
125368099Seric #endif
125466843Seric 
125568705Seric #ifndef UID_T
125668705Seric # define UID_T		uid_t
125768705Seric #endif
125868099Seric 
1259*68706Seric #ifndef SIZE_T
1260*68706Seric # define SIZE_T		size_t
1261*68706Seric #endif
1262*68706Seric 
126368705Seric #ifndef ARGV_T
126468705Seric # define ARGV_T		char **
126568705Seric #endif
126668705Seric 
126768705Seric 
126864439Seric /**********************************************************************
126959023Seric **  Remaining definitions should never have to be changed.  They are
127059023Seric **  primarily to provide back compatibility for older systems -- for
127159287Seric **  example, it includes some POSIX compatibility definitions
127264439Seric **********************************************************************/
127359023Seric 
127459388Seric /* System 5 compatibility */
127559388Seric #ifndef S_ISREG
127664944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
127759388Seric #endif
127864944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
127964944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
128064944Seric #endif
128168494Seric #ifndef S_IWUSR
128268494Seric # define S_IWUSR		0200
128368494Seric #endif
128459388Seric #ifndef S_IWGRP
128568494Seric # define S_IWGRP		0020
128659388Seric #endif
128759388Seric #ifndef S_IWOTH
128868494Seric # define S_IWOTH		0002
128959388Seric #endif
129059388Seric 
129159023Seric /*
129250537Seric **  Older systems don't have this error code -- it should be in
129350537Seric **  /usr/include/sysexits.h.
129450537Seric */
129550537Seric 
129650537Seric # ifndef EX_CONFIG
129750537Seric # define EX_CONFIG	78	/* configuration error */
129850537Seric # endif
129956852Seric 
130064718Seric /* pseudo-code used in server SMTP */
130164718Seric # define EX_QUIT	22	/* drop out of server immediately */
130264718Seric 
130364718Seric 
130463993Seric /*
130563993Seric **  These are used in a few cases where we need some special
130663993Seric **  error codes, but where the system doesn't provide something
130763993Seric **  reasonable.  They are printed in errstring.
130863993Seric */
130963993Seric 
131063993Seric #ifndef E_PSEUDOBASE
131163993Seric # define E_PSEUDOBASE	256
131263993Seric #endif
131363993Seric 
131463993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
131563993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
131663993Seric 
131763970Seric /* type of arbitrary pointer */
131863970Seric #ifndef ARBPTR_T
131963970Seric # define ARBPTR_T	void *
132063970Seric #endif
132163970Seric 
132260568Seric #ifndef __P
132360568Seric # include "cdefs.h"
132460568Seric #endif
132560568Seric 
132667421Seric #if NAMED_BIND
132767421Seric # include <arpa/nameser.h>
132867434Seric # ifdef __svr4__
132967434Seric #  ifdef NOERROR
133067434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
133167434Seric #  endif
133267434Seric # endif
133367421Seric #endif
133467421Seric 
133556852Seric /*
133667419Seric **  The size of an IP address -- can't use sizeof because of problems
133767419Seric **  on Crays, where everything is 64 bits.  This will break if/when
133867419Seric **  IP addresses are expanded to eight bytes.
133967419Seric */
134067419Seric 
134167421Seric #ifndef INADDRSZ
134267421Seric # define INADDRSZ	4
134367421Seric #endif
134467419Seric 
134567419Seric /*
134667421Seric **  The size of various known types -- for reading network protocols.
134767421Seric **  Again, we can't use sizeof because of compiler randomness.
134867421Seric */
134967421Seric 
135067421Seric #ifndef INT16SZ
135167421Seric # define INT16SZ	2
135267421Seric #endif
135367421Seric #ifndef INT32SZ
135467421Seric # define INT32SZ	4
135567421Seric #endif
135667421Seric 
135767421Seric /*
135858778Seric **  Do some required dependencies
135958778Seric */
136058778Seric 
136158778Seric #if defined(NETINET) || defined(NETISO)
136259107Seric # define SMTP		1	/* enable user and server SMTP */
136359107Seric # define QUEUE		1	/* enable queueing */
136459107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
136558778Seric #endif
136658778Seric 
136758778Seric 
136858778Seric /*
136956852Seric **  Arrange to use either varargs or stdargs
137056852Seric */
137156852Seric 
137256852Seric # ifdef __STDC__
137356852Seric 
137456852Seric # include <stdarg.h>
137556852Seric 
137656852Seric # define VA_LOCAL_DECL	va_list ap;
137756852Seric # define VA_START(f)	va_start(ap, f)
137856852Seric # define VA_END		va_end(ap)
137956852Seric 
138056852Seric # else
138156852Seric 
138256852Seric # include <varargs.h>
138356852Seric 
138456852Seric # define VA_LOCAL_DECL	va_list ap;
138556852Seric # define VA_START(f)	va_start(ap)
138656852Seric # define VA_END		va_end(ap)
138756852Seric 
138856852Seric # endif
138957631Seric 
139057943Seric #ifdef HASUNAME
139157631Seric # include <sys/utsname.h>
139257631Seric # ifdef newstr
139357631Seric #  undef newstr
139457631Seric # endif
139557943Seric #else /* ! HASUNAME */
139657631Seric # define NODE_LENGTH 32
139757631Seric struct utsname
139857631Seric {
139957631Seric 	char nodename[NODE_LENGTH+1];
140057631Seric };
140157943Seric #endif /* HASUNAME */
140257642Seric 
140368040Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
140463838Seric # define MAXHOSTNAMELEN	256
140557735Seric #endif
140658153Seric 
140758153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
140858153Seric # define SIGCHLD	SIGCLD
140958153Seric #endif
141058153Seric 
141158153Seric #ifndef STDIN_FILENO
141258153Seric #define STDIN_FILENO	0
141358153Seric #endif
141458153Seric 
141558153Seric #ifndef STDOUT_FILENO
141658153Seric #define STDOUT_FILENO	1
141758153Seric #endif
141858153Seric 
141958153Seric #ifndef STDERR_FILENO
142058153Seric #define STDERR_FILENO	2
142158153Seric #endif
142258689Seric 
142364072Seric #ifndef LOCK_SH
142464035Seric # define LOCK_SH	0x01	/* shared lock */
142564035Seric # define LOCK_EX	0x02	/* exclusive lock */
142664035Seric # define LOCK_NB	0x04	/* non-blocking lock */
142764035Seric # define LOCK_UN	0x08	/* unlock */
142864035Seric #endif
142958692Seric 
143064035Seric #ifndef SIG_ERR
143164035Seric # define SIG_ERR	((void (*)()) -1)
143258689Seric #endif
143358702Seric 
143464500Seric #ifndef WEXITSTATUS
143564500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
143664500Seric #endif
143764500Seric #ifndef WIFEXITED
143864500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
143964500Seric #endif
144064500Seric 
144164561Seric #ifndef SIGFUNC_DEFINED
144264561Seric typedef void		(*sigfunc_t) __P((int));
144364561Seric #endif
144464561Seric 
144565053Seric /* size of syslog buffer */
144665053Seric #ifndef SYSLOG_BUFSIZE
144765053Seric # define SYSLOG_BUFSIZE	1024
144865053Seric #endif
144965053Seric 
145058702Seric /*
145158702Seric **  Size of tobuf (deliver.c)
145258702Seric **	Tweak this to match your syslog implementation.  It will have to
145358702Seric **	allow for the extra information printed.
145458702Seric */
145558702Seric 
145658702Seric #ifndef TOBUFSIZE
145765053Seric # if (SYSLOG_BUFSIZE) > 512
145865053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
145965053Seric # else
146065053Seric #  define TOBUFSIZE	256
146165053Seric # endif
146258702Seric #endif
146360219Seric 
146465015Seric /*
146565015Seric **  Size of prescan buffer.
146665015Seric **	Despite comments in the _sendmail_ book, this probably should
146765015Seric **	not be changed; there are some hard-to-define dependencies.
146865015Seric */
146965015Seric 
147065015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
147160219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
147260219Seric # ifndef FORK
147360219Seric # define FORK		vfork		/* function to call to fork mailer */
147460219Seric # endif
147565955Seric 
147665955Seric /*
147765955Seric **  If we are going to link scanf anyway, use it in readcf
147865955Seric */
147965955Seric 
148065955Seric #if !defined(HASUNAME) && !defined(SCANF)
148165955Seric # define SCANF		1
148265955Seric #endif
1483