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