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