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