xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 69935)
1 /*
2  * Copyright (c) 1983, 1995 Eric P. Allman
3  * Copyright (c) 1988, 1993
4  *	The Regents of the University of California.  All rights reserved.
5  *
6  * %sccs.include.redist.c%
7  *
8  *	@(#)conf.h	8.191 (Berkeley) 06/19/95
9  */
10 
11 /*
12 **  CONF.H -- All user-configurable parameters for sendmail
13 **
14 **	Send updates to sendmail@CS.Berkeley.EDU so they will be
15 **	included in the next release.
16 */
17 
18 struct rusage;	/* forward declaration to get gcc to shut up in wait.h */
19 
20 # include <sys/param.h>
21 # include <sys/types.h>
22 # include <sys/stat.h>
23 # include <sys/file.h>
24 # include <sys/wait.h>
25 # include <fcntl.h>
26 # include <signal.h>
27 # include <netdb.h>
28 # include <pwd.h>
29 
30 /**********************************************************************
31 **  Table sizes, etc....
32 **	There shouldn't be much need to change these....
33 **********************************************************************/
34 
35 # define MAXLINE	2048		/* max line length */
36 # define MAXNAME	256		/* max length of a name */
37 # define MAXPV		40		/* max # of parms to mailers */
38 # define MAXATOM	200		/* max atoms per address */
39 # define MAXMAILERS	25		/* maximum mailers known to system */
40 # define MAXRWSETS	200		/* max # of sets of rewriting rules */
41 # define MAXPRIORITIES	25		/* max values for Precedence: field */
42 # define MAXMXHOSTS	20		/* max # of MX records */
43 # define SMTPLINELIM	990		/* maximum SMTP line length */
44 # define MAXKEY		128		/* maximum size of a database key */
45 # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
46 # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
47 # define MAXALIASDB	12		/* max # of alias databases */
48 # define MAXMAPSTACK	12		/* max # of stacked or sequenced maps */
49 # define MAXTOCLASS	8		/* max # of message timeout classes */
50 # define MAXMIMEARGS	20		/* max args in Content-Type: */
51 # define MAXMIMENESTING	20		/* max MIME multipart nesting */
52 # define QUEUESEGSIZE	1000		/* increment for queue size */
53 
54 /**********************************************************************
55 **  Compilation options.
56 **	#define these to 1 if they are available;
57 **	#define them to 0 otherwise.
58 **  All can be overridden from Makefile.
59 **********************************************************************/
60 
61 # ifndef NETINET
62 #  define NETINET	1	/* include internet support */
63 # endif
64 
65 # ifndef NAMED_BIND
66 #  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
67 # endif
68 
69 # ifndef XDEBUG
70 #  define XDEBUG	1	/* enable extended debugging */
71 # endif
72 
73 # ifndef MATCHGECOS
74 #  define MATCHGECOS	1	/* match user names from gecos field */
75 # endif
76 
77 # ifndef DSN
78 #  define DSN		1	/* include delivery status notification code */
79 # endif
80 
81 # if !defined(USERDB) && (defined(NEWDB) || defined(HESIOD))
82 #  define USERDB	1	/* look in user database */
83 # endif
84 
85 # ifndef MIME8TO7
86 #  define MIME8TO7	1	/* 8->7 bit MIME conversions */
87 # endif
88 
89 # ifndef MIME7TO8
90 #  define MIME7TO8	1	/* 7->8 bit MIME conversions */
91 # endif
92 
93 /**********************************************************************
94 **  "Hard" compilation options.
95 **	#define these if they are available; comment them out otherwise.
96 **  These cannot be overridden from the Makefile, and should really not
97 **  be turned off unless absolutely necessary.
98 **********************************************************************/
99 
100 # define LOG			/* enable logging -- don't turn off */
101 
102 /**********************************************************************
103 **  End of site-specific configuration.
104 **********************************************************************/
105 /*
106 **  General "standard C" defines.
107 **
108 **	These may be undone later, to cope with systems that claim to
109 **	be Standard C but aren't.  Gcc is the biggest offender -- it
110 **	doesn't realize that the library is part of the language.
111 **
112 **	Life would be much easier if we could get rid of this sort
113 **	of bozo problems.
114 */
115 
116 #ifdef __STDC__
117 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
118 #endif
119 
120 /*
121 **  Assume you have standard calls; can be #undefed below if necessary.
122 */
123 
124 # define HASLSTAT	1	/* has lstat(2) call */
125 /**********************************************************************
126 **  Operating system configuration.
127 **
128 **	Unless you are porting to a new OS, you shouldn't have to
129 **	change these.
130 **********************************************************************/
131 
132 /*
133 **  HP-UX -- tested for 8.07, 9.00, and 9.01.
134 **
135 **	If V4FS is defined, compile for HP-UX 10.0.
136 */
137 
138 #ifdef __hpux
139 		/* common definitions for HP-UX 9.x and 10.x */
140 # undef m_flags		/* conflict between db.h & sys/sysmacros.h on HP 300 */
141 # define SYSTEM5	1	/* include all the System V defines */
142 # define HASINITGROUPS	1	/* has initgroups(3) call */
143 # define USESETEUID	1	/* has useable seteuid(2) call */
144 # define seteuid(e)	setresuid(-1, e, -1)
145 # define IP_SRCROUTE	1	/* can check IP source routing */
146 # define LA_TYPE	LA_HPUX
147 # define SPT_TYPE	SPT_PSTAT
148 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
149 # define GIDSET_T	gid_t
150 # ifndef HASGETUSERSHELL
151 #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
152 # endif
153 # define syslog		hard_syslog
154 # ifdef __STDC__
155 extern void	hard_syslog(int, char *, ...);
156 # endif
157 
158 # ifdef V4FS
159 		/* HP-UX 10.x */
160 #  define _PATH_UNIX		"/stand/vmunix"
161 #  define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
162 #  ifndef _PATH_SENDMAILPID
163 #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
164 #  endif
165 #  ifndef IDENTPROTO
166 #   define IDENTPROTO	1	/* TCP/IP implementation fixed in 10.0 */
167 #  endif
168 
169 # else
170 		/* HP-UX 9.x */
171 #  define _PATH_UNIX		"/hp-ux"
172 #  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
173 #  ifndef IDENTPROTO
174 #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
175 #  endif
176 # endif
177 
178 #endif
179 
180 
181 /*
182 **  IBM AIX 3.x -- actually tested for 3.2.3
183 */
184 
185 #ifdef _AIX3
186 # include <paths.h>
187 # define HASINITGROUPS	1	/* has initgroups(3) call */
188 # define HASUNAME	1	/* use System V uname(2) system call */
189 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
190 # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
191 # define FORK		fork	/* no vfork primitive available */
192 # define GIDSET_T	gid_t
193 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
194 # define SPT_PADCHAR	'\0'	/* pad process title with nulls */
195 # define LA_TYPE	LA_INT
196 # define LA_AVENRUN	"avenrun"
197 #endif
198 
199 
200 /*
201 **  Silicon Graphics IRIX
202 **
203 **	Compiles on 4.0.1.
204 **
205 **	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
206 **	Use IRIX5 instead of IRIX for IRIX 5.x.
207 **
208 **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
209 **	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
210 */
211 
212 #if defined(IRIX64) || defined(IRIX5)
213 # define IRIX
214 #endif
215 
216 #ifdef IRIX
217 # define SYSTEM5	1	/* this is a System-V derived system */
218 # define HASSETREUID	1	/* has setreuid(2) call */
219 # define HASINITGROUPS	1	/* has initgroups(3) call */
220 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
221 # define IP_SRCROUTE	1	/* can check IP source routing */
222 # define FORK		fork	/* no vfork primitive available */
223 # define setpgid	BSDsetpgrp
224 # define GIDSET_T	gid_t
225 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
226 # define SFS_BAVAIL	f_bfree		/* alternate field name */
227 # define LA_TYPE	LA_INT
228 # ifdef IRIX64
229 #  define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
230 # else
231 #  define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
232 # endif
233 # if defined(IRIX64) || defined(IRIX5)
234 #  define ARGV_T	char *const *
235 #  define HASSETRLIMIT	1	/* has setrlimit(2) syscall */
236 # else
237 #  define ARGV_T	const char **
238 #  define WAITUNION	1	/* use "union wait" as wait argument type */
239 # endif
240 #endif
241 
242 
243 /*
244 **  SunOS and Solaris
245 **
246 **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
247 **	Solaris 2.4 (a.k.a. SunOS 5.4).
248 */
249 
250 #if defined(sun) && !defined(BSD)
251 
252 # define HASINITGROUPS	1	/* has initgroups(3) call */
253 # define HASUNAME	1	/* use System V uname(2) system call */
254 # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
255 # define IP_SRCROUTE	1	/* can check IP source routing */
256 # define LA_TYPE	LA_INT
257 
258 # ifdef SOLARIS_2_3
259 #  define SOLARIS	203	/* for back compat only -- use -DSOLARIS=203 */
260 # endif
261 
262 # ifdef SOLARIS
263 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
264 #  ifndef __svr4__
265 #   define __svr4__		/* use all System V Releae 4 defines below */
266 #  endif
267 #  include <sys/time.h>
268 #  define GIDSET_T	gid_t
269 #  ifndef _PATH_UNIX
270 #   define _PATH_UNIX		"/dev/ksyms"
271 #  endif
272 #  define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
273 #  ifndef _PATH_SENDMAILPID
274 #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
275 #  endif
276 #  ifndef _PATH_HOSTS
277 #   define _PATH_HOSTS		"/etc/inet/hosts"
278 #  endif
279 #  ifndef SYSLOG_BUFSIZE
280 #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
281 #  endif
282 
283 # else
284 			/* SunOS 4.0.3 or 4.1.x */
285 #  define HASSETREUID	1	/* has setreuid(2) call */
286 #  ifndef HASFLOCK
287 #   define HASFLOCK	1	/* has flock(2) call */
288 #  endif
289 #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
290 #  include <vfork.h>
291 
292 #  ifdef SUNOS403
293 			/* special tweaking for SunOS 4.0.3 */
294 #   include <malloc.h>
295 #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
296 #   define NEEDSTRSTR	1	/* need emulation of strstr(3) routine */
297 #   define WAITUNION	1	/* use "union wait" as wait argument type */
298 #   undef WIFEXITED
299 #   undef WEXITSTATUS
300 #   undef HASUNAME
301 #   define setpgid	setpgrp
302 typedef int		pid_t;
303 extern char		*getenv();
304 
305 #  else
306 			/* 4.1.x specifics */
307 #   define HASSETSID	1	/* has Posix setsid(2) call */
308 #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
309 
310 #  endif
311 # endif
312 #endif
313 
314 /*
315 **  DG/UX
316 **
317 **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
318 **	older support.
319 **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
320 */
321 
322 #ifdef DGUX_5_4_2
323 # define DGUX		1
324 #endif
325 
326 #ifdef	DGUX
327 # define SYSTEM5	1
328 # define LA_TYPE	LA_DGUX
329 # define HASSETREUID	1	/* has setreuid(2) call */
330 # define HASUNAME	1	/* use System V uname(2) system call */
331 # define HASSETSID	1	/* has Posix setsid(2) call */
332 # define HASINITGROUPS	1	/* has initgroups(3) call */
333 # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
334 # ifndef IDENTPROTO
335 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
336 # endif
337 # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
338 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
339 
340 /* these include files must be included early on DG/UX */
341 # include <netinet/in.h>
342 # include <arpa/inet.h>
343 
344 # ifdef DGUX_5_4_2
345 #  define inet_addr	dgux_inet_addr
346 extern long	dgux_inet_addr();
347 # endif
348 #endif
349 
350 
351 /*
352 **  Digital Ultrix 4.2A or 4.3
353 **
354 **	Apparently, fcntl locking is broken on 4.2A, in that locks are
355 **	not dropped when the process exits.  This causes major problems,
356 **	so flock is the only alternative.
357 */
358 
359 #ifdef ultrix
360 # define HASSETREUID	1	/* has setreuid(2) call */
361 # define HASUNSETENV	1	/* has unsetenv(3) call */
362 # define HASINITGROUPS	1	/* has initgroups(3) call */
363 # define HASUNAME	1	/* use System V uname(2) system call */
364 # ifndef HASFLOCK
365 #  define HASFLOCK	1	/* has flock(2) call */
366 # endif
367 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
368 # ifndef BROKEN_RES_SEARCH
369 #  define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
370 # endif
371 # ifdef vax
372 #  define LA_TYPE	LA_FLOAT
373 # else
374 #  define LA_TYPE	LA_INT
375 #  define LA_AVENRUN	"avenrun"
376 # endif
377 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
378 # ifndef IDENTPROTO
379 #  define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
380 # endif
381 #endif
382 
383 
384 /*
385 **  OSF/1 for Intel Paragon.
386 **
387 **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
388 **	of Intel Scalable Systems Divison.
389 */
390 
391 #ifdef __PARAGON__
392 # define __osf__	1	/* get OSF/1 defines below */
393 # define _PATH_VENDOR_CF	"/var/adm/sendmail/sendmail.cf"
394 #endif
395 
396 
397 /*
398 **  OSF/1 (tested on Alpha)
399 */
400 
401 #ifdef __osf__
402 # define HASUNSETENV	1	/* has unsetenv(3) call */
403 # define USESETEUID	1	/* has useable seteuid(2) call */
404 # define HASINITGROUPS	1	/* has initgroups(3) call */
405 # define IP_SRCROUTE	1	/* can check IP source routing */
406 # ifndef HASFLOCK
407 #  define HASFLOCK	1	/* has flock(2) call */
408 # endif
409 # define LA_TYPE	LA_INT
410 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
411 # ifndef _PATH_SENDMAILPID
412 #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
413 # endif
414 #endif
415 
416 
417 /*
418 **  NeXTstep
419 */
420 
421 #ifdef NeXT
422 # define HASINITGROUPS	1	/* has initgroups(3) call */
423 # define NEEDPUTENV	2	/* need putenv(3) call; no setenv(3) call */
424 # ifndef HASFLOCK
425 #  define HASFLOCK	1	/* has flock(2) call */
426 # endif
427 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
428 # define WAITUNION	1	/* use "union wait" as wait argument type */
429 # define UID_T		int	/* compiler gripes on uid_t */
430 # define sleep		sleepX
431 # define setpgid	setpgrp
432 # ifndef LA_TYPE
433 #  define LA_TYPE	LA_MACH
434 # endif
435 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
436 # ifndef _POSIX_SOURCE
437 typedef int		pid_t;
438 #  undef WEXITSTATUS
439 #  undef WIFEXITED
440 # endif
441 # define _PATH_VENDOR_CF	"/etc/sendmail/sendmail.cf"
442 # ifndef _PATH_SENDMAILPID
443 #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
444 # endif
445 #endif
446 
447 
448 /*
449 **  4.4 BSD
450 **
451 **	See also BSD defines.
452 */
453 
454 #if defined(BSD4_4) && !defined(__bsdi__)
455 # define HASUNSETENV	1	/* has unsetenv(3) call */
456 # define USESETEUID	1	/* has useable seteuid(2) call */
457 # include <sys/cdefs.h>
458 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
459 # define BSD4_4_SOCKADDR	/* has sa_len */
460 # define NETLINK	1	/* supports AF_LINK */
461 # ifndef LA_TYPE
462 #  define LA_TYPE	LA_SUBR
463 # endif
464 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
465 # define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
466 #endif
467 
468 
469 /*
470 **  BSD/386 (all versions)
471 **	From Tony Sanders, BSDI
472 */
473 
474 #ifdef __bsdi__
475 # define HASUNSETENV	1	/* has the unsetenv(3) call */
476 # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
477 # define USESETEUID	1	/* has useable seteuid(2) call */
478 # include <sys/cdefs.h>
479 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
480 # define BSD4_4_SOCKADDR	/* has sa_len */
481 # define NETLINK	1	/* supports AF_LINK */
482 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
483 # ifndef LA_TYPE
484 #  define LA_TYPE	LA_SUBR
485 # endif
486 # define GIDSET_T	gid_t
487 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
488 			/* version 1.1 or later */
489 #  undef SPT_TYPE
490 #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
491 # else
492 			/* version 1.0 or earlier */
493 #  ifndef OLD_NEWDB
494 #   define OLD_NEWDB	1	/* old version of newdb library */
495 #  endif
496 #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
497 # endif
498 #endif
499 
500 
501 
502 /*
503 **  FreeBSD / NetBSD (all architectures, all versions)
504 **
505 **  4.3BSD clone, closer to 4.4BSD	for FreeBSD 1.x and NetBSD 0.9x
506 **  4.4BSD-Lite based			for FreeBSD 2.x and NetBSD 1.x
507 **
508 **	See also BSD defines.
509 */
510 
511 #if defined(__FreeBSD__) || defined(__NetBSD__)
512 # define HASUNSETENV	1	/* has unsetenv(3) call */
513 # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
514 # define USESETEUID	1	/* has useable seteuid(2) call */
515 # define HASUNAME	1	/* has uname(2) syscall */
516 # include <sys/cdefs.h>
517 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
518 # define BSD4_4_SOCKADDR	/* has sa_len */
519 # define NETLINK	1	/* supports AF_LINK */
520 # define GIDSET_T	gid_t
521 # ifndef LA_TYPE
522 #  define LA_TYPE	LA_SUBR
523 # endif
524 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
525 #endif
526 
527 
528 /*
529 **  Mach386
530 **
531 **	For mt Xinu's Mach386 system.
532 */
533 
534 #if defined(MACH) && defined(i386)
535 # define MACH386	1
536 # define HASUNSETENV	1	/* has unsetenv(3) call */
537 # define HASINITGROUPS	1	/* has initgroups(3) call */
538 # ifndef HASFLOCK
539 #  define HASFLOCK	1	/* has flock(2) call */
540 # endif
541 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
542 # define NEEDSTRTOL	1	/* need the strtol() function */
543 # define setpgid	setpgrp
544 # ifndef LA_TYPE
545 #  define LA_TYPE	LA_FLOAT
546 # endif
547 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
548 # undef HASSETVBUF		/* don't actually have setvbuf(3) */
549 # undef WEXITSTATUS
550 # undef WIFEXITED
551 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
552 # ifndef _PATH_SENDMAILPID
553 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
554 # endif
555 #endif
556 
557 
558 /*
559 **  4.3 BSD -- this is for very old systems
560 **
561 **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
562 **
563 **	You'll also have to install a new resolver library.
564 **	I don't guarantee that support for this environment is complete.
565 */
566 
567 #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
568 # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
569 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
570 # define ARBPTR_T	char *
571 # define setpgid	setpgrp
572 # ifndef LA_TYPE
573 #  define LA_TYPE	LA_FLOAT
574 # endif
575 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
576 # ifndef IDENTPROTO
577 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
578 # endif
579 # undef WEXITSTATUS
580 # undef WIFEXITED
581 typedef short		pid_t;
582 extern int		errno;
583 #endif
584 
585 
586 /*
587 **  SCO Unix
588 **
589 **	This includes two parts -- the first is for SCO Open Server 3.2v4
590 **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
591 **	The second is, I believe, for an older version.
592 */
593 
594 #ifdef _SCO_unix_4_2
595 # define _SCO_unix_
596 # define HASSETREUID	1	/* has setreuid(2) call */
597 # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
598 # define _PATH_UNIX		"/unix"
599 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
600 # ifndef _PATH_SENDMAILPID
601 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
602 # endif
603 #endif
604 
605 #ifdef _SCO_unix_
606 # define SYSTEM5	1	/* include all the System V defines */
607 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
608 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
609 # define FORK		fork
610 # define MAXPATHLEN	PATHSIZE
611 # define LA_TYPE	LA_SHORT
612 # define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
613 # define SFS_BAVAIL	f_bfree		/* alternate field name */
614 # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
615 # define NETUNIX	0	/* no unix domain socket support */
616 #endif
617 
618 
619 /*
620 **  ISC (SunSoft) Unix.
621 **
622 **	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
623 */
624 
625 #ifdef ISC_UNIX
626 # include <net/errno.h>
627 # include <sys/stream.h>	/* needed for IP_SRCROUTE */
628 # include <sys/bsdtypes.h>
629 # define SYSTEM5	1	/* include all the System V defines */
630 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
631 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
632 # define HASSETREUID	1	/* has setreuid(2) call */
633 # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
634 # define NETUNIX	0	/* no unix domain socket support */
635 # define FORK		fork
636 # define MAXPATHLEN	1024
637 # define LA_TYPE	LA_SHORT
638 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
639 # define SFS_BAVAIL	f_bfree		/* alternate field name */
640 # define _PATH_UNIX		"/unix"
641 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
642 # ifndef _PATH_SENDMAILPID
643 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
644 # endif
645 
646 typedef short		pid_t;
647 
648 #endif
649 
650 
651 /*
652 **  Altos System V.
653 **	Contributed by Tim Rice <timr@crl.com>.
654 */
655 
656 #ifdef ALTOS_SYS_V
657 # include <limits.h>
658 # define SYSTEM5	1	/* include all the System V defines */
659 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
660 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
661 # define WAITUNION	1	/* use "union wait" as wait argument type */
662 # define NEEDFSYNC	1	/* no fsync(2) in system library */
663 # define FORK		fork
664 # define MAXPATHLEN	PATHSIZE
665 # define LA_TYPE	LA_SHORT
666 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
667 # define SFS_BAVAIL	f_bfree		/* alternate field name */
668 # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
669 # define NETUNIX	0	/* no unix domain socket support */
670 # undef WIFEXITED
671 # undef WEXITSTATUS
672 # define strtoul	strtol	/* gcc library bogosity */
673 
674 typedef unsigned short	uid_t;
675 typedef unsigned short	gid_t;
676 typedef short		pid_t;
677 #endif
678 
679 
680 /*
681 **  ConvexOS 11.0 and later
682 **
683 **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
684 **	works on 9.1 as well.
685 */
686 
687 #ifdef _CONVEX_SOURCE
688 # define BSD		1	/* include all the BSD defines */
689 # define HASUNAME	1	/* use System V uname(2) system call */
690 # define HASSETSID	1	/* has POSIX setsid(2) call */
691 # define NEEDGETOPT	1	/* need replacement for getopt(3) */
692 # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
693 # define LA_TYPE	LA_FLOAT
694 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
695 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
696 # ifndef S_IREAD
697 #  define S_IREAD	_S_IREAD
698 #  define S_IWRITE	_S_IWRITE
699 #  define S_IEXEC	_S_IEXEC
700 #  define S_IFMT	_S_IFMT
701 #  define S_IFCHR	_S_IFCHR
702 #  define S_IFBLK	_S_IFBLK
703 # endif
704 # ifndef IDENTPROTO
705 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
706 # endif
707 #endif
708 
709 
710 /*
711 **  RISC/os 4.52
712 **
713 **	Gives a ton of warning messages, but otherwise compiles.
714 */
715 
716 #ifdef RISCOS
717 
718 # define HASUNSETENV	1	/* has unsetenv(3) call */
719 # ifndef HASFLOCK
720 #  define HASFLOCK	1	/* has flock(2) call */
721 # endif
722 # define WAITUNION	1	/* use "union wait" as wait argument type */
723 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
724 # define LA_TYPE	LA_INT
725 # define LA_AVENRUN	"avenrun"
726 # define _PATH_UNIX	"/unix"
727 # undef WIFEXITED
728 
729 # define setpgid	setpgrp
730 
731 extern int		errno;
732 typedef int		pid_t;
733 #define			SIGFUNC_DEFINED
734 typedef int		(*sigfunc_t)();
735 extern char		*getenv();
736 extern void		*malloc();
737 
738 #endif
739 
740 
741 /*
742 **  Linux 0.99pl10 and above...
743 **
744 **  Thanks to, in reverse order of contact:
745 **
746 **	John Kennedy <warlock@csuchico.edu>
747 **	Andrew Pam <avatar@aus.xanadu.com>
748 **	Florian La Roche <rzsfl@rz.uni-sb.de>
749 **	Karl London <karl@borg.demon.co.uk>
750 **
751 **  Last compiled against:	[05/25/95 @ 11:39:31 AM (Thursday)]
752 **	sendmail 8.7.b.0	named 4.9.3-beta17	db-1.85
753 **	gcc 2.6.4-950518	libc-5.0.9		linux 1.2.8
754 */
755 
756 #ifdef __linux__
757 # define BSD		1	/* include BSD defines */
758 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
759 # define HASUNAME	1	/* use System V uname(2) system call */
760 # define HASUNSETENV	1	/* has unsetenv(3) call */
761 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
762 # define GIDSET_T	gid_t	/* from <linux/types.h> */
763 # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
764 # define IP_SRCROUTE	0	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
765 # ifndef HASFLOCK
766 #  define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
767 # endif
768 # ifndef LA_TYPE
769 #  define LA_TYPE	LA_PROCSTR
770 # endif
771 # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
772 # ifndef _PATH_SENDMAILPID
773 #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
774 # endif
775 # define TZ_TYPE	TZ_TNAME
776 # include <sys/sysmacros.h>
777 # undef atol			/* wounded in <stdlib.h> */
778 #endif
779 
780 
781 /*
782 **  DELL SVR4 Issue 2.2, and others
783 **	From Kimmo Suominen <kim@grendel.lut.fi>
784 **
785 **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
786 **	defined, and the definitions conflict.
787 **
788 **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
789 **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
790 **	(SVR4.0/386 version 3.0).
791 */
792 
793 #ifdef DELL_SVR4
794 				/* no changes necessary */
795 				/* see general __svr4__ defines below */
796 #endif
797 
798 
799 /*
800 **  Apple A/UX 3.0
801 */
802 
803 #ifdef _AUX_SOURCE
804 # include <sys/sysmacros.h>
805 # define BSD			/* has BSD routines */
806 # define HASSETRLIMIT	0	/* ... but not setrlimit(2) */
807 # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
808 # define HASUNAME	1	/* use System V uname(2) system call */
809 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
810 # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
811 # ifndef IDENTPROTO
812 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
813 # endif
814 # define FORK		fork
815 # ifndef LA_TYPE
816 #  define LA_TYPE	LA_INT
817 #  define FSHIFT	16
818 # endif
819 # define LA_AVENRUN	"avenrun"
820 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
821 # define TZ_TYPE	TZ_TZNAME
822 # ifndef _PATH_UNIX
823 #  define _PATH_UNIX		"/unix"		/* should be in <paths.h> */
824 # endif
825 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
826 # undef WIFEXITED
827 # undef WEXITSTATUS
828 #endif
829 
830 
831 /*
832 **  Encore UMAX V
833 **
834 **	Not extensively tested.
835 */
836 
837 #ifdef UMAXV
838 # include <limits.h>
839 # define HASUNAME	1	/* use System V uname(2) system call */
840 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
841 # define HASINITGROUPS	1	/* has initgroups(3) call */
842 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
843 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
844 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
845 # define FORK		fork	/* no vfork(2) primitive available */
846 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
847 # define MAXPATHLEN	PATH_MAX
848 extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
849 extern struct group	*getgrent(), *getgrnam(), *getgrgid();
850 # undef WIFEXITED
851 # undef WEXITSTATUS
852 #endif
853 
854 
855 /*
856 **  Stardent Titan 3000 running TitanOS 4.2.
857 **
858 **	Must be compiled in "cc -43" mode.
859 **
860 **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
861 **
862 **	Note the tweaking below after the BSD defines are set.
863 */
864 
865 #ifdef titan
866 # define setpgid	setpgrp
867 typedef int		pid_t;
868 # undef WIFEXITED
869 # undef WEXITSTATUS
870 #endif
871 
872 
873 /*
874 **  Sequent DYNIX 3.2.0
875 **
876 **	From Jim Davis <jdavis@cs.arizona.edu>.
877 */
878 
879 #ifdef sequent
880 
881 # define BSD		1
882 # define HASUNSETENV	1
883 # define BSD4_3		1	/* to get signal() in conf.c */
884 # define WAITUNION	1
885 # define LA_TYPE	LA_FLOAT
886 # ifdef	_POSIX_VERSION
887 #  undef _POSIX_VERSION		/* set in <unistd.h> */
888 # endif
889 # undef HASSETVBUF		/* don't actually have setvbuf(3) */
890 # define setpgid	setpgrp
891 
892 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
893 # undef	WIFEXITED
894 # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
895 			 ((union wait*)&(s))->w_termsig == 0)
896 # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
897 typedef int		pid_t;
898 # define isgraph(c)	(isprint(c) && (c != ' '))
899 
900 # ifndef IDENTPROTO
901 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
902 # endif
903 
904 # ifndef _PATH_UNIX
905 #  define _PATH_UNIX		"/dynix"
906 # endif
907 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
908 
909 #endif
910 
911 
912 /*
913 **  Sequent DYNIX/ptx v2.0 (and higher)
914 **
915 **	For DYNIX/ptx v1.x, undefine HASSETREUID.
916 **
917 **	From Tim Wright <timw@sequent.com>.
918 */
919 
920 #ifdef _SEQUENT_
921 # define SYSTEM5	1	/* include all the System V defines */
922 # define HASSETSID	1	/* has POSIX setsid(2) call */
923 # define HASINITGROUPS	1	/* has initgroups(3) call */
924 # define HASSETREUID	1	/* has setreuid(2) call */
925 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
926 # define GIDSET_T	gid_t
927 # define LA_TYPE	LA_INT
928 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
929 # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
930 # ifndef IDENTPROTO
931 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
932 # endif
933 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
934 # ifndef _PATH_SENDMAILPID
935 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
936 # endif
937 #endif
938 
939 
940 /*
941 **  Cray Unicos
942 **
943 **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
944 */
945 
946 #ifdef UNICOS
947 # define SYSTEM5	1	/* include all the System V defines */
948 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
949 # define MAXPATHLEN	PATHSIZE
950 # define LA_TYPE	LA_ZERO
951 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
952 # define SFS_BAVAIL	f_bfree		/* alternate field name */
953 #endif
954 
955 
956 /*
957 **  Apollo DomainOS
958 **
959 **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
960 **
961 **  15 Jan 1994
962 **
963 */
964 
965 #ifdef apollo
966 # define HASSETREUID	1	/* has setreuid(2) call */
967 # define HASINITGROUPS	1	/* has initgroups(2) call */
968 # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
969 # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
970 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
971 # define SFS_BAVAIL	f_bfree		/* alternate field name */
972 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
973 # ifndef _PATH_SENDMAILPID
974 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
975 # endif
976 # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
977 # undef  S_IFIFO
978 # define S_IFIFO	0010000
979 # ifndef IDENTPROTO
980 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
981 # endif
982 #endif
983 
984 
985 /*
986 **  UnixWare 1.1.2.
987 **
988 **	Updated by Petr Lampa <lampa@fee.vutbr.cz>.
989 **	From Evan Champion <evanc@spatial.synapse.org>.
990 */
991 
992 #ifdef UNIXWARE
993 # include <sys/mkdev.h>
994 # define SYSTEM5		1
995 # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
996 # define HASSETREUID		1
997 # define HASSETSID		1
998 # define HASINITGROUPS		1
999 # define GIDSET_T		gid_t
1000 # define SLEEP_T		unsigned
1001 # define SFS_TYPE		SFS_STATVFS
1002 # define LA_TYPE		LA_ZERO
1003 # undef WIFEXITED
1004 # undef WEXITSTATUS
1005 # define _PATH_UNIX		"/unix"
1006 # define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
1007 # ifndef _PATH_SENDMAILPID
1008 #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
1009 # endif
1010 # define SYSLOG_BUFSIZE	128
1011 #endif
1012 
1013 
1014 /*
1015 **  Intergraph CLIX 3.1
1016 **
1017 **	From Paul Southworth <pauls@locust.cic.net>
1018 */
1019 
1020 #ifdef CLIX
1021 # define SYSTEM5	1	/* looks like System V */
1022 # ifndef HASGETUSERSHELL
1023 #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1024 # endif
1025 # define DEV_BSIZE	512	/* device block size not defined */
1026 # define GIDSET_T	gid_t
1027 # undef LOG			/* syslog not available */
1028 # define NEEDFSYNC	1	/* no fsync in system library */
1029 # define GETSHORT	_getshort
1030 #endif
1031 
1032 
1033 /*
1034 **  NCR 3000 Series (SysVr4)
1035 **
1036 **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
1037 */
1038 
1039 #ifdef NCR3000
1040 # include <sys/sockio.h>
1041 # define __svr4__
1042 # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
1043 # undef BSD
1044 # define LA_AVENRUN	"avenrun"
1045 #endif
1046 
1047 
1048 /*
1049 **  Tandem NonStop-UX SVR4
1050 **
1051 **	From Rick McCarty <mccarty@mpd.tandem.com>.
1052 */
1053 
1054 #ifdef NonStop_UX_BXX
1055 # define __svr4__
1056 #endif
1057 
1058 
1059 /*
1060 **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
1061 **
1062 **	Tested for 1.04 and 1.03
1063 **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
1064 */
1065 
1066 #ifdef __H3050R
1067 # define SYSTEM5	1	/* include all the System V defines */
1068 # define HASINITGROUPS	1	/* has initgroups(3) call */
1069 # define setreuid(r, e)	setresuid(r, e, -1)
1070 # define LA_TYPE	LA_FLOAT
1071 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1072 # define HASSETVBUF	/* HI-UX has no setlinebuf */
1073 # ifndef GIDSET_T
1074 #  define GIDSET_T	gid_t
1075 # endif
1076 # ifndef _PATH_UNIX
1077 #  define _PATH_UNIX		"/HI-UX"
1078 # endif
1079 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1080 # ifndef IDENTPROTO
1081 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1082 # endif
1083 # ifndef HASGETUSERSHELL
1084 #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
1085 # endif
1086 
1087 /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
1088 # undef m_flags
1089 
1090 # ifdef __STDC__
1091 extern int	syslog(int, char *, ...);
1092 # endif
1093 
1094 #endif
1095 
1096 
1097 /*
1098 **  Amdahl UTS System V 2.1.5 (SVr3-based)
1099 **
1100 **    From: Janet Jackson <janet@dialix.oz.au>.
1101 */
1102 
1103 #ifdef _UTS
1104 # include <sys/sysmacros.h>
1105 # undef HASLSTAT		/* has symlinks, but they cause problems */
1106 # define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
1107 # define SYS5SIGNALS	1	/* System V signal semantics */
1108 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
1109 # define HASUNAME	1	/* use System V uname(2) system call */
1110 # define HASINITGROUPS	1	/* has initgroups(3) function */
1111 # define HASSETVBUF	1	/* has setvbuf(3) function */
1112 # define HASSIGSETMASK	0	/* does not have sigsetmask(2) function */
1113 # ifndef HASGETUSERSHELL
1114 #  define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
1115 # endif
1116 # define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
1117 # define LA_TYPE	LA_ZERO		/* doesn't have load average */
1118 # define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
1119 # define SFS_BAVAIL	f_bfree		/* alternate field name */
1120 # define _PATH_UNIX		"/unix"
1121 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1122 #endif
1123 
1124 /*
1125 **  Cray Computer Corporation's CSOS
1126 **
1127 **	From Scott Bolte <scott@craycos.com>.
1128 */
1129 
1130 #ifdef _CRAYCOM
1131 # define SYSTEM5	1	/* include all the System V defines */
1132 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1133 # define NEEDFSYNC	1	/* no fsync in system library */
1134 # define MAXPATHLEN	PATHSIZE
1135 # define LA_TYPE	LA_ZERO
1136 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
1137 # define SFS_BAVAIL	f_bfree		/* alternate field name */
1138 # define _POSIX_CHOWN_RESTRICTED	-1
1139 extern struct group	*getgrent(), *getgrnam(), *getgrgid();
1140 #endif
1141 
1142 
1143 /*
1144 **  Sony NEWS-OS 4.2.1R and 6.0.3
1145 **
1146 **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
1147 */
1148 
1149 #ifdef sony_news
1150 # ifndef __svr4
1151 			/* NEWS-OS 4.2.1R */
1152 #  ifndef BSD
1153 #   define BSD			/* has BSD routines */
1154 #  endif
1155 #  define HASUNSETENV	1	/* has unsetenv(2) call */
1156 #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
1157 #  define WAITUNION	1	/* use "union wait" as wait argument type */
1158 #  define LA_TYPE	LA_INT
1159 #  define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1160 #  ifndef HASFLOCK
1161 #   define HASFLOCK	1	/* has flock(2) call */
1162 #  endif
1163 #  define setpgid	setpgrp
1164 #  undef WIFEXITED
1165 #  undef WEXITSTATUS
1166 typedef int		pid_t;
1167 typedef int		(*sigfunc_t)();
1168 #  define SIGFUNC_DEFINED
1169 
1170 # else
1171 			/* NEWS-OS 6.0.3 with /bin/cc */
1172 #  ifndef __svr4__
1173 #   define __svr4__		/* use all System V Releae 4 defines below */
1174 #  endif
1175 #  define HASSETSID	1	/* has Posix setsid(2) call */
1176 #  define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
1177 #  define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
1178 #  ifndef SPT_TYPE
1179 #   define SPT_TYPE	SPT_SYSMIPS	/* use sysmips() (OS 6.0.2 or later) */
1180 #  endif
1181 #  define GIDSET_T	gid_t
1182 #  undef WIFEXITED
1183 #  undef WEXITSTATUS
1184 #  ifndef SYSLOG_BUFSIZE
1185 #   define SYSLOG_BUFSIZE	1024
1186 #  endif
1187 #  define _PATH_UNIX		"/stand/unix"
1188 #  define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
1189 #  ifndef _PATH_SENDMAILPID
1190 #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
1191 #  endif
1192 
1193 # endif
1194 #endif
1195 
1196 
1197 /*
1198 **  Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
1199 **
1200 **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
1201 */
1202 
1203 #ifdef luna
1204 # ifndef IDENTPROTO
1205 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1206 # endif
1207 # ifdef uniosb
1208 #  include <sys/time.h>
1209 #  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
1210 # endif
1211 # define HASUNSETENV	1	/* has unsetenv(2) call */
1212 # define NEEDPUTENV	1	/* need putenv(3) call */
1213 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
1214 # define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
1215 # define WAITUNION	1	/* use "union wait" as wait argument type */
1216 # ifdef uniosb
1217 #  define LA_TYPE	LA_INT
1218 # endif
1219 # ifdef luna2m
1220 #  define LA_TYPE	LA_SUBR
1221 # endif
1222 # ifdef luna88k
1223 #  define LA_TYPE	LA_INT
1224 # endif
1225 # define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1226 # define setpgid	setpgrp
1227 # undef WIFEXITED
1228 # undef WEXITSTATUS
1229 typedef int		pid_t;
1230 typedef int		(*sigfunc_t)();
1231 # define SIGFUNC_DEFINED
1232 extern char	*getenv();
1233 extern int	errno;
1234 # define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1235 #endif
1236 
1237 
1238 /*
1239 **  NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
1240 **
1241 **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
1242 */
1243 
1244 #ifdef nec_ews_svr4
1245 # ifndef __svr4__
1246 #  define __svr4__		/* use all System V Releae 4 defines below */
1247 # endif
1248 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1249 # define HASSETSID	1	/* has Posix setsid(2) call */
1250 # define LA_TYPE	LA_READKSYM	/* use MIOC_READSYM ioctl */
1251 # define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
1252 # define GIDSET_T	gid_t
1253 # undef WIFEXITED
1254 # undef WEXITSTATUS
1255 # define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
1256 #endif
1257 
1258 
1259 
1260 /**********************************************************************
1261 **  End of Per-Operating System defines
1262 **********************************************************************/
1263 /**********************************************************************
1264 **  More general defines
1265 **********************************************************************/
1266 
1267 /* general BSD defines */
1268 #ifdef BSD
1269 # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
1270 # define HASSETREUID	1	/* has setreuid(2) call */
1271 # define HASINITGROUPS	1	/* has initgroups(3) call */
1272 # ifndef IP_SRCROUTE
1273 #  define IP_SRCROUTE	1	/* can check IP source routing */
1274 # endif
1275 # ifndef HASSETRLIMIT
1276 #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
1277 # endif
1278 # ifndef HASFLOCK
1279 #  define HASFLOCK	1	/* has flock(2) call */
1280 # endif
1281 # ifndef TZ_TYPE
1282 #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
1283 # endif
1284 #endif
1285 
1286 /* general System V Release 4 defines */
1287 #ifdef __svr4__
1288 # define SYSTEM5	1
1289 # define USESETEUID	1	/* has useable seteuid(2) call */
1290 # define HASINITGROUPS	1	/* has initgroups(3) call */
1291 #  define BSD_COMP	1	/* get BSD ioctl calls */
1292 # ifndef HASSETRLIMIT
1293 #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
1294 # endif
1295 # ifndef HASGETUSERSHELL
1296 #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1297 # endif
1298 
1299 # ifndef _PATH_UNIX
1300 #  define _PATH_UNIX		"/unix"
1301 # endif
1302 # define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
1303 # ifndef _PATH_SENDMAILPID
1304 #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
1305 # endif
1306 # ifndef SYSLOG_BUFSIZE
1307 #  define SYSLOG_BUFSIZE	128
1308 # endif
1309 # ifndef SFS_TYPE
1310 #  define SFS_TYPE		SFS_STATVFS
1311 # endif
1312 #endif
1313 
1314 /* general System V defines */
1315 #ifdef SYSTEM5
1316 # include <sys/sysmacros.h>
1317 # define HASUNAME	1	/* use System V uname(2) system call */
1318 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
1319 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
1320 # ifndef HASULIMIT
1321 #  define HASULIMIT	1	/* has the ulimit(2) syscall */
1322 # endif
1323 # ifndef LA_TYPE
1324 #  ifdef MIOC_READKSYM
1325 #   define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
1326 #  else
1327 #   define LA_TYPE	LA_INT		/* assume integer load average */
1328 #  endif
1329 # endif
1330 # ifndef SFS_TYPE
1331 #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
1332 # endif
1333 # ifndef TZ_TYPE
1334 #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
1335 # endif
1336 # define bcopy(s, d, l)		(memmove((d), (s), (l)))
1337 # define bzero(d, l)		(memset((d), '\0', (l)))
1338 # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
1339 #endif
1340 
1341 /* general POSIX defines */
1342 #ifdef _POSIX_VERSION
1343 # define HASSETSID	1	/* has Posix setsid(2) call */
1344 # define HASWAITPID	1	/* has Posix waitpid(2) call */
1345 # if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
1346 #  define USESETEUID	1	/* has useable seteuid(2) call */
1347 # endif
1348 #endif
1349 /*
1350 **  Tweaking for systems that (for example) claim to be BSD or POSIX
1351 **  but don't have all the standard BSD or POSIX routines (boo hiss).
1352 */
1353 
1354 #ifdef titan
1355 # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
1356 #endif
1357 
1358 #ifdef _CRAYCOM
1359 # undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
1360 #endif
1361 
1362 #ifdef ISC_UNIX
1363 # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
1364 #endif
1365 
1366 #ifdef ALTOS_SYS_V
1367 # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
1368 # undef bzero			/* despite SystemV claim, uses BSD bzero */
1369 # undef bcmp			/* despite SystemV claim, uses BSD bcmp */
1370 #endif
1371 
1372 
1373 /*
1374 **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
1375 **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
1376 **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
1377 **  are closed.  Some firewalls return this error if you try to connect
1378 **  to the IDENT port (113), so you can't receive email from these hosts
1379 **  on these systems.  The firewall really should use a more specific
1380 **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
1381 **  not explicitly set to zero above, default it on.
1382 */
1383 
1384 #ifndef IDENTPROTO
1385 # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
1386 #endif
1387 
1388 #ifndef IP_SRCROUTE
1389 # define IP_SRCROUTE	1	/* Detect IP source routing */
1390 #endif
1391 
1392 #ifndef HASGETUSERSHELL
1393 # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
1394 #endif
1395 
1396 #ifndef NETUNIX
1397 # define NETUNIX	1	/* include unix domain support */
1398 #endif
1399 
1400 #ifndef HASFLOCK
1401 # define HASFLOCK	0	/* assume no flock(2) support */
1402 #endif
1403 
1404 #ifndef HASSETREUID
1405 # define HASSETREUID	0	/* assume no setreuid(2) call */
1406 #endif
1407 
1408 #ifndef USESETEUID
1409 # define USESETEUID	0	/* assume no seteuid(2) call or no saved ids */
1410 #endif
1411 
1412 #ifndef HASSETRLIMIT
1413 # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
1414 #endif
1415 
1416 #ifndef HASULIMIT
1417 # define HASULIMIT	0	/* assume no ulimit(2) support */
1418 #endif
1419 
1420 #ifndef OLD_NEWDB
1421 # define OLD_NEWDB	0	/* assume newer version of newdb */
1422 #endif
1423 
1424 /* heuristic setting of HASSETSIGMASK; can override above */
1425 #ifndef HASSIGSETMASK
1426 # ifdef SIGVTALRM
1427 #  define HASSETSIGMASK	1
1428 # else
1429 #  define HASSETSIGMASK	0
1430 # endif
1431 #endif
1432 
1433 /*
1434 **  If no type for argument two of getgroups call is defined, assume
1435 **  it's an integer -- unfortunately, there seem to be several choices
1436 **  here.
1437 */
1438 
1439 #ifndef GIDSET_T
1440 # define GIDSET_T	int
1441 #endif
1442 
1443 #ifndef UID_T
1444 # define UID_T		uid_t
1445 #endif
1446 
1447 #ifndef SIZE_T
1448 # define SIZE_T		size_t
1449 #endif
1450 
1451 #ifndef ARGV_T
1452 # define ARGV_T		char **
1453 #endif
1454 /**********************************************************************
1455 **  Remaining definitions should never have to be changed.  They are
1456 **  primarily to provide back compatibility for older systems -- for
1457 **  example, it includes some POSIX compatibility definitions
1458 **********************************************************************/
1459 
1460 /* System 5 compatibility */
1461 #ifndef S_ISREG
1462 # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
1463 #endif
1464 #if !defined(S_ISLNK) && defined(S_IFLNK)
1465 # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
1466 #endif
1467 #ifndef S_IWUSR
1468 # define S_IWUSR		0200
1469 #endif
1470 #ifndef S_IWGRP
1471 # define S_IWGRP		0020
1472 #endif
1473 #ifndef S_IWOTH
1474 # define S_IWOTH		0002
1475 #endif
1476 
1477 /*
1478 **  Older systems don't have this error code -- it should be in
1479 **  /usr/include/sysexits.h.
1480 */
1481 
1482 # ifndef EX_CONFIG
1483 # define EX_CONFIG	78	/* configuration error */
1484 # endif
1485 
1486 /* pseudo-code used in server SMTP */
1487 # define EX_QUIT	22	/* drop out of server immediately */
1488 
1489 
1490 /*
1491 **  These are used in a few cases where we need some special
1492 **  error codes, but where the system doesn't provide something
1493 **  reasonable.  They are printed in errstring.
1494 */
1495 
1496 #ifndef E_PSEUDOBASE
1497 # define E_PSEUDOBASE	256
1498 #endif
1499 
1500 #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
1501 #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
1502 
1503 /* type of arbitrary pointer */
1504 #ifndef ARBPTR_T
1505 # define ARBPTR_T	void *
1506 #endif
1507 
1508 #ifndef __P
1509 # include "cdefs.h"
1510 #endif
1511 
1512 #if NAMED_BIND
1513 # include <arpa/nameser.h>
1514 # ifdef __svr4__
1515 #  ifdef NOERROR
1516 #   undef NOERROR		/* avoid compiler conflict with stream.h */
1517 #  endif
1518 # endif
1519 #endif
1520 
1521 /*
1522 **  The size of an IP address -- can't use sizeof because of problems
1523 **  on Crays, where everything is 64 bits.  This will break if/when
1524 **  IP addresses are expanded to eight bytes.
1525 */
1526 
1527 #ifndef INADDRSZ
1528 # define INADDRSZ	4
1529 #endif
1530 
1531 /*
1532 **  The size of various known types -- for reading network protocols.
1533 **  Again, we can't use sizeof because of compiler randomness.
1534 */
1535 
1536 #ifndef INT16SZ
1537 # define INT16SZ	2
1538 #endif
1539 #ifndef INT32SZ
1540 # define INT32SZ	4
1541 #endif
1542 
1543 /*
1544 **  Do some required dependencies
1545 */
1546 
1547 #if defined(NETINET) || defined(NETISO)
1548 # define SMTP		1	/* enable user and server SMTP */
1549 # define QUEUE		1	/* enable queueing */
1550 # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
1551 #endif
1552 
1553 
1554 /*
1555 **  Arrange to use either varargs or stdargs
1556 */
1557 
1558 # ifdef __STDC__
1559 
1560 # include <stdarg.h>
1561 
1562 # define VA_LOCAL_DECL	va_list ap;
1563 # define VA_START(f)	va_start(ap, f)
1564 # define VA_END		va_end(ap)
1565 
1566 # else
1567 
1568 # include <varargs.h>
1569 
1570 # define VA_LOCAL_DECL	va_list ap;
1571 # define VA_START(f)	va_start(ap)
1572 # define VA_END		va_end(ap)
1573 
1574 # endif
1575 
1576 #ifdef HASUNAME
1577 # include <sys/utsname.h>
1578 # ifdef newstr
1579 #  undef newstr
1580 # endif
1581 #else /* ! HASUNAME */
1582 # define NODE_LENGTH 32
1583 struct utsname
1584 {
1585 	char nodename[NODE_LENGTH+1];
1586 };
1587 #endif /* HASUNAME */
1588 
1589 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
1590 # define MAXHOSTNAMELEN	256
1591 #endif
1592 
1593 #if !defined(SIGCHLD) && defined(SIGCLD)
1594 # define SIGCHLD	SIGCLD
1595 #endif
1596 
1597 #ifndef STDIN_FILENO
1598 # define STDIN_FILENO	0
1599 #endif
1600 
1601 #ifndef STDOUT_FILENO
1602 # define STDOUT_FILENO	1
1603 #endif
1604 
1605 #ifndef STDERR_FILENO
1606 # define STDERR_FILENO	2
1607 #endif
1608 
1609 #ifndef LOCK_SH
1610 # define LOCK_SH	0x01	/* shared lock */
1611 # define LOCK_EX	0x02	/* exclusive lock */
1612 # define LOCK_NB	0x04	/* non-blocking lock */
1613 # define LOCK_UN	0x08	/* unlock */
1614 #endif
1615 
1616 #ifndef SEEK_SET
1617 # define SEEK_SET	0
1618 # define SEEK_CUR	1
1619 # define SEEK_END	2
1620 #endif
1621 
1622 #ifndef SIG_ERR
1623 # define SIG_ERR	((void (*)()) -1)
1624 #endif
1625 
1626 #ifndef WEXITSTATUS
1627 # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
1628 #endif
1629 #ifndef WIFEXITED
1630 # define WIFEXITED(st)		(((st) & 0377) == 0)
1631 #endif
1632 
1633 #ifndef SIGFUNC_DEFINED
1634 typedef void		(*sigfunc_t) __P((int));
1635 #endif
1636 
1637 /* size of syslog buffer */
1638 #ifndef SYSLOG_BUFSIZE
1639 # define SYSLOG_BUFSIZE	1024
1640 #endif
1641 
1642 /*
1643 **  Size of tobuf (deliver.c)
1644 **	Tweak this to match your syslog implementation.  It will have to
1645 **	allow for the extra information printed.
1646 */
1647 
1648 #ifndef TOBUFSIZE
1649 # if (SYSLOG_BUFSIZE) > 512
1650 #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
1651 # else
1652 #  define TOBUFSIZE	256
1653 # endif
1654 #endif
1655 
1656 /*
1657 **  Size of prescan buffer.
1658 **	Despite comments in the _sendmail_ book, this probably should
1659 **	not be changed; there are some hard-to-define dependencies.
1660 */
1661 
1662 # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
1663 /* fork routine -- set above using #ifdef _osname_ or in Makefile */
1664 # ifndef FORK
1665 # define FORK		vfork		/* function to call to fork mailer */
1666 # endif
1667 
1668 /*
1669 **  Default to using scanf in readcf.
1670 */
1671 
1672 #ifndef SCANF
1673 # define SCANF		1
1674 #endif
1675