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