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