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