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