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