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