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