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