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