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