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