xref: /original-bsd/usr.sbin/sendmail/src/conf.h (revision 7a38d872)
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.77 (Berkeley) 01/15/94
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 
23 /**********************************************************************
24 **  Table sizes, etc....
25 **	There shouldn't be much need to change these....
26 **********************************************************************/
27 
28 # define MAXLINE	2048		/* max line length */
29 # define MAXNAME	256		/* max length of a name */
30 # define MAXPV		40		/* max # of parms to mailers */
31 # define MAXATOM	200		/* max atoms per address */
32 # define MAXMAILERS	25		/* maximum mailers known to system */
33 # define MAXRWSETS	100		/* max # of sets of rewriting rules */
34 # define MAXPRIORITIES	25		/* max values for Precedence: field */
35 # define MAXMXHOSTS	20		/* max # of MX records */
36 # define SMTPLINELIM	990		/* maximum SMTP line length */
37 # define MAXKEY		128		/* maximum size of a database key */
38 # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
39 # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
40 # define MAXALIASDB	12		/* max # of alias databases */
41 
42 # ifndef QUEUESIZE
43 # define QUEUESIZE	1000		/* max # of jobs per queue run */
44 # endif
45 
46 /**********************************************************************
47 **  Compilation options.
48 **
49 **	#define these if they are available; comment them out otherwise.
50 **********************************************************************/
51 
52 # define LOG		1	/* enable logging */
53 # define UGLYUUCP	1	/* output ugly UUCP From lines */
54 # define NETUNIX	1	/* include unix domain support */
55 # define NETINET	1	/* include internet support */
56 # define SETPROCTITLE	1	/* munge argv to display current status */
57 # define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
58 # define MATCHGECOS	1	/* match user names from gecos field */
59 # define XDEBUG		1	/* enable extended debugging */
60 
61 # ifdef NEWDB
62 # define USERDB		1	/* look in user database (requires NEWDB) */
63 # endif
64 
65 /*
66 **  Most systems have symbolic links today, so default them on.  You
67 **  can turn them off by #undef'ing this below.
68 */
69 
70 # define HASLSTAT	1	/* has lstat(2) call */
71 
72 /*
73 **  General "standard C" defines.
74 **
75 **	These may be undone later, to cope with systems that claim to
76 **	be Standard C but aren't.  Gcc is the biggest offender -- it
77 **	doesn't realize that the library is part of the language.
78 **
79 **	Life would be much easier if we could get rid of this sort
80 **	of bozo problems.
81 */
82 
83 #ifdef __STDC__
84 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
85 #endif
86 
87 /**********************************************************************
88 **  Operating system configuration.
89 **
90 **	Unless you are porting to a new OS, you shouldn't have to
91 **	change these.
92 **********************************************************************/
93 
94 /*
95 **  Per-Operating System defines
96 */
97 
98 
99 /*
100 **  HP-UX -- tested for 8.07, 9.00, and 9.01.
101 */
102 
103 # ifdef __hpux
104 /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
105 # undef m_flags
106 # define SYSTEM5	1	/* include all the System V defines */
107 # define HASINITGROUPS	1	/* has initgroups(3) call */
108 # define HASSETREUID	1	/* has setreuid(2) call */
109 # define setreuid(r, e)		setresuid(r, e, -1)
110 # define LA_TYPE	LA_FLOAT
111 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
112 # define GIDSET_T	gid_t
113 # define _PATH_UNIX	"/hp-ux"
114 # ifndef _PATH_SENDMAILCF
115 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
116 # endif
117 # ifndef IDENTPROTO
118 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
119 # endif
120 # ifndef HASGETUSERSHELL
121 #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
122 # endif
123 # define syslog		hard_syslog
124 # ifdef __STDC__
125 extern int	syslog(int, char *, ...);
126 # endif
127 # endif
128 
129 
130 /*
131 **  IBM AIX 3.x -- actually tested for 3.2.3
132 */
133 
134 # ifdef _AIX3
135 # define HASINITGROUPS	1	/* has initgroups(3) call */
136 # define HASUNAME	1	/* use System V uname(2) system call */
137 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
138 # define FORK		fork	/* no vfork primitive available */
139 # undef  SETPROCTITLE		/* setproctitle confuses AIX */
140 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
141 # endif
142 
143 
144 /*
145 **  Silicon Graphics IRIX
146 **
147 **	Compiles on 4.0.1.
148 */
149 
150 # ifdef IRIX
151 # include <sys/sysmacros.h>
152 # define HASSETREUID	1	/* has setreuid(2) call */
153 # define HASINITGROUPS	1	/* has initgroups(3) call */
154 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
155 # define FORK		fork	/* no vfork primitive available */
156 # define WAITUNION	1	/* use "union wait" as wait argument type */
157 # define setpgid	BSDsetpgrp
158 # define GIDSET_T	gid_t
159 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
160 # endif
161 
162 
163 /*
164 **  SunOS and Solaris
165 **
166 **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
167 **	Solaris 2.2 (a.k.a. SunOS 5.2).
168 */
169 
170 #if defined(sun) && !defined(BSD)
171 
172 # define HASINITGROUPS	1	/* has initgroups(3) call */
173 # define HASUNAME	1	/* use System V uname(2) system call */
174 # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
175 # define LA_TYPE	LA_INT
176 
177 # ifdef SOLARIS_2_3
178 #  define SOLARIS
179 # endif
180 
181 # ifdef SOLARIS
182 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
183 #  ifndef __svr4__
184 #   define __svr4__		/* use all System V Releae 4 defines below */
185 #  endif
186 #  include <sys/time.h>
187 #  define gethostbyname	solaris_gethostbyname	/* get working version */
188 #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
189 #  define GIDSET_T	gid_t
190 #  ifndef _PATH_UNIX
191 #   define _PATH_UNIX	"/kernel/unix"
192 #  endif
193 #  ifndef _PATH_SENDMAILCF
194 #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
195 #  endif
196 #  ifndef _PATH_SENDMAILPID
197 #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
198 #  endif
199 
200 # else
201 			/* SunOS 4.0.3 or 4.1.x */
202 #  define HASSETREUID	1	/* has setreuid(2) call */
203 #  define HASFLOCK	1	/* has flock(2) call */
204 #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
205 #  include <vfork.h>
206 
207 #  ifdef SUNOS403
208 			/* special tweaking for SunOS 4.0.3 */
209 #   include <malloc.h>
210 #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
211 #   define WAITUNION	1	/* use "union wait" as wait argument type */
212 #   undef WIFEXITED
213 #   undef WEXITSTATUS
214 #   undef HASUNAME
215 #   define setpgid	setpgrp
216 typedef int		pid_t;
217 extern char		*getenv();
218 
219 #  endif
220 # endif
221 #endif
222 
223 /*
224 **  DG/UX
225 **
226 **	Tested on 5.4.2
227 */
228 
229 #ifdef	DGUX
230 # define SYSTEM5	1
231 # define LA_TYPE	LA_SUBR
232 # define HASSETREUID	1	/* has setreuid(2) call */
233 # define HASUNAME	1	/* use System V uname(2) system call */
234 # define HASSETSID	1	/* has Posix setsid(2) call */
235 # define HASINITGROUPS	1	/* has initgroups(3) call */
236 # ifndef IDENTPROTO
237 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
238 # endif
239 # undef SETPROCTITLE
240 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
241 
242 /* these include files must be included early on DG/UX */
243 # include <netinet/in.h>
244 # include <arpa/inet.h>
245 
246 # define inet_addr	dgux_inet_addr
247 extern long	dgux_inet_addr();
248 #endif
249 
250 
251 /*
252 **  Digital Ultrix 4.2A or 4.3
253 **
254 **	Apparently, fcntl locking is broken on 4.2A, in that locks are
255 **	not dropped when the process exits.  This causes major problems,
256 **	so flock is the only alternative.
257 */
258 
259 #ifdef ultrix
260 # define HASSETREUID	1	/* has setreuid(2) call */
261 # define HASUNSETENV	1	/* has unsetenv(3) call */
262 # define HASINITGROUPS	1	/* has initgroups(3) call */
263 # define HASFLOCK	1	/* has flock(2) call */
264 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
265 # ifdef vax
266 #  define LA_TYPE	LA_FLOAT
267 # else
268 #  define LA_TYPE	LA_INT
269 #  define LA_AVENRUN	"avenrun"
270 # endif
271 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
272 # ifndef IDENTPROTO
273 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
274 # endif
275 #endif
276 
277 
278 /*
279 **  OSF/1 (tested on Alpha)
280 */
281 
282 #ifdef __osf__
283 # define HASUNSETENV	1	/* has unsetenv(3) call */
284 # define HASSETREUID	1	/* has setreuid(2) call */
285 # define HASINITGROUPS	1	/* has initgroups(3) call */
286 # define HASFLOCK	1	/* has flock(2) call */
287 # define LA_TYPE	LA_INT
288 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
289 # ifndef _PATH_SENDMAILPID
290 #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
291 # endif
292 #endif
293 
294 
295 /*
296 **  NeXTstep
297 */
298 
299 #ifdef NeXT
300 # define HASINITGROUPS	1	/* has initgroups(3) call */
301 # define HASFLOCK	1	/* has flock(2) call */
302 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
303 # define WAITUNION	1	/* use "union wait" as wait argument type */
304 # define sleep		sleepX
305 # define setpgid	setpgrp
306 # ifndef LA_TYPE
307 #  define LA_TYPE	LA_MACH
308 # endif
309 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
310 # ifndef _POSIX_SOURCE
311 typedef int		pid_t;
312 #  undef WEXITSTATUS
313 #  undef WIFEXITED
314 # endif
315 # ifndef _PATH_SENDMAILCF
316 #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
317 # endif
318 # ifndef _PATH_SENDMAILPID
319 #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
320 # endif
321 #endif
322 
323 
324 /*
325 **  4.4 BSD
326 **
327 **	See also BSD defines.
328 */
329 
330 #ifdef BSD4_4
331 # define HASUNSETENV	1	/* has unsetenv(3) call */
332 # include <sys/cdefs.h>
333 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
334 # ifndef LA_TYPE
335 #  define LA_TYPE	LA_SUBR
336 # endif
337 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
338 #endif
339 
340 
341 /*
342 **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
343 **
344 **  4.3BSD clone, closer to 4.4BSD
345 **
346 **	See also BSD defines.
347 */
348 
349 #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
350 # define HASUNSETENV	1	/* has unsetenv(3) call */
351 # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
352 # include <sys/cdefs.h>
353 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
354 # ifndef LA_TYPE
355 #  define LA_TYPE	LA_SUBR
356 # endif
357 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
358 #endif
359 
360 
361 /*
362 **  Mach386
363 **
364 **	For mt Xinu's Mach386 system.
365 */
366 
367 #if defined(MACH) && defined(i386)
368 # define MACH386	1
369 # define HASUNSETENV	1	/* has unsetenv(3) call */
370 # define HASINITGROUPS	1	/* has initgroups(3) call */
371 # define HASFLOCK	1	/* has flock(2) call */
372 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
373 # define NEEDSTRTOL	1	/* need the strtol() function */
374 # define setpgid	setpgrp
375 # ifndef LA_TYPE
376 #  define LA_TYPE	LA_FLOAT
377 # endif
378 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
379 # undef HASSETVBUF		/* don't actually have setvbuf(3) */
380 # undef WEXITSTATUS
381 # undef WIFEXITED
382 # ifndef _PATH_SENDMAILCF
383 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
384 # endif
385 # ifndef _PATH_SENDMAILPID
386 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
387 # endif
388 #endif
389 
390 
391 /*
392 **  4.3 BSD -- this is for very old systems
393 **
394 **	You'll also have to install a new resolver library.
395 **	I don't guarantee that support for this environment is complete.
396 */
397 
398 #ifdef oldBSD43
399 # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
400 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
401 # define ARBPTR_T	char *
402 # define setpgid	setpgrp
403 # ifndef LA_TYPE
404 #  define LA_TYPE	LA_FLOAT
405 # endif
406 # ifndef _PATH_SENDMAILCF
407 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
408 # endif
409 # ifndef IDENTPROTO
410 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
411 # endif
412 # undef WEXITSTATUS
413 # undef WIFEXITED
414 typedef short		pid_t;
415 extern int		errno;
416 #endif
417 
418 
419 /*
420 **  SCO Unix
421 **
422 **	This includes two parts -- the first is for SCO Open Server 3.2v4
423 **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
424 **	The second is, I believe, for an older version.
425 */
426 
427 #ifdef _SCO_unix_4_2
428 # define _SCO_unix_
429 # define HASSETREUID	1	/* has setreuid(2) call */
430 # define _PATH_UNIX	"/unix"
431 # ifndef _PATH_SENDMAILCF
432 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
433 # endif
434 # ifndef _PATH_SENDMAILPID
435 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
436 # endif
437 #endif
438 
439 #ifdef _SCO_unix_
440 # define SYSTEM5	1	/* include all the System V defines */
441 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
442 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
443 # define FORK		fork
444 # define MAXPATHLEN	PATHSIZE
445 # define LA_TYPE	LA_SHORT
446 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
447 # undef NETUNIX			/* no unix domain socket support */
448 #endif
449 
450 
451 /*
452 **  ConvexOS 11.0 and later
453 */
454 
455 #ifdef _CONVEX_SOURCE
456 # define BSD		1	/* include all the BSD defines */
457 # define HASUNAME	1	/* use System V uname(2) system call */
458 # define HASSETSID	1	/* has POSIX setsid(2) call */
459 # define NEEDGETOPT	1	/* need replacement for getopt(3) */
460 # define LA_TYPE	LA_FLOAT
461 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
462 # ifndef IDENTPROTO
463 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
464 # endif
465 #endif
466 
467 
468 /*
469 **  RISC/os 4.52
470 **
471 **	Gives a ton of warning messages, but otherwise compiles.
472 */
473 
474 #ifdef RISCOS
475 
476 # define HASUNSETENV	1	/* has unsetenv(3) call */
477 # define HASFLOCK	1	/* has flock(2) call */
478 # define WAITUNION	1	/* use "union wait" as wait argument type */
479 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
480 # define LA_TYPE	LA_INT
481 # define LA_AVENRUN	"avenrun"
482 # define _PATH_UNIX	"/unix"
483 # undef WIFEXITED
484 
485 # define setpgid	setpgrp
486 
487 extern int		errno;
488 typedef int		pid_t;
489 #define			SIGFUNC_DEFINED
490 typedef int		(*sigfunc_t)();
491 extern char		*getenv();
492 extern void		*malloc();
493 
494 #endif
495 
496 
497 /*
498 **  Linux 0.99pl10 and above...
499 **	From Karl London <karl@borg.demon.co.uk>.
500 */
501 
502 #ifdef __linux__
503 # define BSD		1	/* pretend to be BSD based today */
504 # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
505 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
506 # define HASUNSETENV	1	/* has unsetenv(3) call */
507 # ifndef LA_TYPE
508 #  define LA_TYPE	LA_FLOAT
509 # endif
510 # include <sys/sysmacros.h>
511 # define GIDSET_T	gid_t
512 #endif
513 
514 
515 /*
516 **  DELL SVR4 Issue 2.2, and others
517 **	From Kimmo Suominen <kim@grendel.lut.fi>
518 **
519 **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
520 **	defined, and the definitions conflict.
521 **
522 **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
523 **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
524 **	(SVR4.0/386 version 3.0).
525 */
526 
527 #ifdef DELL_SVR4
528 				/* no changes necessary */
529 				/* see general __svr4__ defines below */
530 #endif
531 
532 
533 /*
534 **  Apple A/UX 3.0
535 */
536 
537 #ifdef _AUX_SOURCE
538 # include <sys/sysmacros.h>
539 # define BSD			/* has BSD routines */
540 # define HASUNAME	1	/* use System V uname(2) system call */
541 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
542 # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
543 # ifndef IDENTPROTO
544 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
545 # endif
546 # define FORK		fork
547 # ifndef _PATH_SENDMAILCF
548 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
549 # endif
550 # ifndef LA_TYPE
551 #  define LA_TYPE	LA_ZERO
552 # endif
553 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
554 # undef WIFEXITED
555 # undef WEXITSTATUS
556 #endif
557 
558 
559 /*
560 **  Encore UMAX V
561 **
562 **	Not extensively tested.
563 */
564 
565 #ifdef UMAXV
566 # include <limits.h>
567 # define HASUNAME	1	/* use System V uname(2) system call */
568 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
569 # define HASINITGROUPS	1	/* has initgroups(3) call */
570 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
571 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
572 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
573 # define FORK		fork	/* no vfork(2) primitive available */
574 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
575 # define MAXPATHLEN	PATH_MAX
576 extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
577 extern struct group	*getgrent(), *getgrnam(), *getgrgid();
578 # undef WIFEXITED
579 # undef WEXITSTATUS
580 #endif
581 
582 
583 /*
584 **  Stardent Titan 3000 running TitanOS 4.2.
585 **
586 **	Must be compiled in "cc -43" mode.
587 **
588 **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
589 **
590 **	Note the tweaking below after the BSD defines are set.
591 */
592 
593 #ifdef titan
594 # define setpgid	setpgrp
595 typedef int		pid_t;
596 # undef WIFEXITED
597 # undef WEXITSTATUS
598 #endif
599 
600 
601 /*
602 **  Sequent DYNIX 3.2.0
603 **
604 **	From Jim Davis <jdavis@cs.arizona.edu>.
605 */
606 
607 #ifdef sequent
608 # define BSD		1
609 # define HASUNSETENV	1
610 # define BSD4_3		1	/* to get signal() in conf.c */
611 # define WAITUNION	1
612 # define LA_TYPE	LA_FLOAT
613 # ifdef	_POSIX_VERSION
614 #  undef _POSIX_VERSION		/* set in <unistd.h> */
615 # endif
616 # undef HASSETVBUF		/* don't actually have setvbuf(3) */
617 # define setpgid	setpgrp
618 
619 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
620 # undef	WIFEXITED
621 # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
622 			 ((union wait*)&(s))->w_termsig == 0)
623 # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
624 typedef int		pid_t;
625 # define isgraph(c)	(isprint(c) && (c != ' '))
626 
627 # ifndef _PATH_UNIX
628 #  define _PATH_UNIX	"/dynix"
629 # endif
630 # ifndef _PATH_SENDMAILCF
631 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
632 # endif
633 
634 #endif
635 
636 
637 /*
638 **  Cray Unicos
639 **
640 **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
641 */
642 
643 #ifdef UNICOS
644 # define SYSTEM5	1	/* include all the System V defines */
645 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
646 # define MAXPATHLEN	PATHSIZE
647 # define LA_TYPE	LA_ZERO
648 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
649 #endif
650 
651 
652 
653 /**********************************************************************
654 **  End of Per-Operating System defines
655 **********************************************************************/
656 
657 /**********************************************************************
658 **  More general defines
659 **********************************************************************/
660 
661 /* general BSD defines */
662 #ifdef BSD
663 # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
664 # define HASSETREUID	1	/* has setreuid(2) call */
665 # define HASINITGROUPS	1	/* has initgroups(2) call */
666 # define HASFLOCK	1	/* has flock(2) call */
667 #endif
668 
669 /* general System V Release 4 defines */
670 #ifdef __svr4__
671 # define SYSTEM5	1
672 # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
673 # ifndef HASGETUSERSHELL
674 #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
675 # endif
676 # define setreuid(r, e)	seteuid(e)
677 
678 # ifndef _PATH_UNIX
679 #  define _PATH_UNIX		"/unix"
680 # endif
681 # ifndef _PATH_SENDMAILCF
682 #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
683 # endif
684 # ifndef _PATH_SENDMAILPID
685 #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
686 # endif
687 # ifndef SYSLOG_BUFSIZE
688 #  define SYSLOG_BUFSIZE	128
689 # endif
690 #endif
691 
692 /* general System V defines */
693 # ifdef SYSTEM5
694 # include <sys/sysmacros.h>
695 # define HASUNAME	1	/* use System V uname(2) system call */
696 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
697 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
698 # ifndef LA_TYPE
699 #  define LA_TYPE	LA_INT		/* assume integer load average */
700 # endif
701 # ifndef SFS_TYPE
702 #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
703 # endif
704 # define bcopy(s, d, l)		(memmove((d), (s), (l)))
705 # define bzero(d, l)		(memset((d), '\0', (l)))
706 # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
707 # endif
708 
709 /* general POSIX defines */
710 #ifdef _POSIX_VERSION
711 # define HASSETSID	1	/* has Posix setsid(2) call */
712 # define HASWAITPID	1	/* has Posix waitpid(2) call */
713 #endif
714 
715 /*
716 **  If no type for argument two of getgroups call is defined, assume
717 **  it's an integer -- unfortunately, there seem to be several choices
718 **  here.
719 */
720 
721 #ifndef GIDSET_T
722 # define GIDSET_T	int
723 #endif
724 
725 /*
726 **  Tweaking for systems that (for example) claim to be BSD but
727 **  don't have all the standard BSD routines (boo hiss).
728 */
729 
730 #ifdef titan
731 # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
732 #endif
733 
734 /*
735 **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
736 **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
737 **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
738 **  are closed.  Some firewalls return this error if you try to connect
739 **  to the IDENT port (113), so you can't receive email from these hosts
740 **  on these systems.  The firewall really should use a more specific
741 **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
742 **  not explicitly set to zero above, default it on.
743 */
744 
745 #ifndef IDENTPROTO
746 # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
747 #endif
748 
749 #ifndef HASGETUSERSHELL
750 # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
751 #endif
752 
753 
754 /**********************************************************************
755 **  Remaining definitions should never have to be changed.  They are
756 **  primarily to provide back compatibility for older systems -- for
757 **  example, it includes some POSIX compatibility definitions
758 **********************************************************************/
759 
760 /* System 5 compatibility */
761 #ifndef S_ISREG
762 # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
763 #endif
764 #if !defined(S_ISLNK) && defined(S_IFLNK)
765 # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
766 #endif
767 #ifndef S_IWGRP
768 #define S_IWGRP		020
769 #endif
770 #ifndef S_IWOTH
771 #define S_IWOTH		002
772 #endif
773 
774 /*
775 **  Older systems don't have this error code -- it should be in
776 **  /usr/include/sysexits.h.
777 */
778 
779 # ifndef EX_CONFIG
780 # define EX_CONFIG	78	/* configuration error */
781 # endif
782 
783 /* pseudo-code used in server SMTP */
784 # define EX_QUIT	22	/* drop out of server immediately */
785 
786 
787 /*
788 **  These are used in a few cases where we need some special
789 **  error codes, but where the system doesn't provide something
790 **  reasonable.  They are printed in errstring.
791 */
792 
793 #ifndef E_PSEUDOBASE
794 # define E_PSEUDOBASE	256
795 #endif
796 
797 #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
798 #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
799 
800 /* type of arbitrary pointer */
801 #ifndef ARBPTR_T
802 # define ARBPTR_T	void *
803 #endif
804 
805 #ifndef __P
806 # include "cdefs.h"
807 #endif
808 
809 /*
810 **  Do some required dependencies
811 */
812 
813 #if defined(NETINET) || defined(NETISO)
814 # define SMTP		1	/* enable user and server SMTP */
815 # define QUEUE		1	/* enable queueing */
816 # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
817 #endif
818 
819 
820 /*
821 **  Arrange to use either varargs or stdargs
822 */
823 
824 # ifdef __STDC__
825 
826 # include <stdarg.h>
827 
828 # define VA_LOCAL_DECL	va_list ap;
829 # define VA_START(f)	va_start(ap, f)
830 # define VA_END		va_end(ap)
831 
832 # else
833 
834 # include <varargs.h>
835 
836 # define VA_LOCAL_DECL	va_list ap;
837 # define VA_START(f)	va_start(ap)
838 # define VA_END		va_end(ap)
839 
840 # endif
841 
842 #ifdef HASUNAME
843 # include <sys/utsname.h>
844 # ifdef newstr
845 #  undef newstr
846 # endif
847 #else /* ! HASUNAME */
848 # define NODE_LENGTH 32
849 struct utsname
850 {
851 	char nodename[NODE_LENGTH+1];
852 };
853 #endif /* HASUNAME */
854 
855 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
856 # define MAXHOSTNAMELEN	256
857 #endif
858 
859 #if !defined(SIGCHLD) && defined(SIGCLD)
860 # define SIGCHLD	SIGCLD
861 #endif
862 
863 #ifndef STDIN_FILENO
864 #define STDIN_FILENO	0
865 #endif
866 
867 #ifndef STDOUT_FILENO
868 #define STDOUT_FILENO	1
869 #endif
870 
871 #ifndef STDERR_FILENO
872 #define STDERR_FILENO	2
873 #endif
874 
875 #ifndef LOCK_SH
876 # define LOCK_SH	0x01	/* shared lock */
877 # define LOCK_EX	0x02	/* exclusive lock */
878 # define LOCK_NB	0x04	/* non-blocking lock */
879 # define LOCK_UN	0x08	/* unlock */
880 #endif
881 
882 #ifndef SIG_ERR
883 # define SIG_ERR	((void (*)()) -1)
884 #endif
885 
886 #ifndef WEXITSTATUS
887 # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
888 #endif
889 #ifndef WIFEXITED
890 # define WIFEXITED(st)		(((st) & 0377) == 0)
891 #endif
892 
893 #ifndef SIGFUNC_DEFINED
894 typedef void		(*sigfunc_t) __P((int));
895 #endif
896 
897 /* size of syslog buffer */
898 #ifndef SYSLOG_BUFSIZE
899 # define SYSLOG_BUFSIZE	1024
900 #endif
901 
902 /*
903 **  Size of tobuf (deliver.c)
904 **	Tweak this to match your syslog implementation.  It will have to
905 **	allow for the extra information printed.
906 */
907 
908 #ifndef TOBUFSIZE
909 # if (SYSLOG_BUFSIZE) > 512
910 #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
911 # else
912 #  define TOBUFSIZE	256
913 # endif
914 #endif
915 
916 /*
917 **  Size of prescan buffer.
918 **	Despite comments in the _sendmail_ book, this probably should
919 **	not be changed; there are some hard-to-define dependencies.
920 */
921 
922 # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
923 /* fork routine -- set above using #ifdef _osname_ or in Makefile */
924 # ifndef FORK
925 # define FORK		vfork		/* function to call to fork mailer */
926 # endif
927