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