xref: /original-bsd/usr.sbin/sendmail/src/conf.h (revision f737e041)
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.94 (Berkeley) 03/03/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 #  ifndef SYSLOG_BUFSIZE
200 #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
201 #  endif
202 
203 # else
204 			/* SunOS 4.0.3 or 4.1.x */
205 #  define HASSETREUID	1	/* has setreuid(2) call */
206 #  ifndef HASFLOCK
207 #   define HASFLOCK	1	/* has flock(2) call */
208 #  endif
209 #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
210 #  include <vfork.h>
211 
212 #  ifdef SUNOS403
213 			/* special tweaking for SunOS 4.0.3 */
214 #   include <malloc.h>
215 #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
216 #   define WAITUNION	1	/* use "union wait" as wait argument type */
217 #   undef WIFEXITED
218 #   undef WEXITSTATUS
219 #   undef HASUNAME
220 #   define setpgid	setpgrp
221 typedef int		pid_t;
222 extern char		*getenv();
223 
224 #  endif
225 # endif
226 #endif
227 
228 /*
229 **  DG/UX
230 **
231 **	Tested on 5.4.2
232 */
233 
234 #ifdef	DGUX
235 # define SYSTEM5	1
236 # define LA_TYPE	LA_SUBR
237 # define HASSETREUID	1	/* has setreuid(2) call */
238 # define HASUNAME	1	/* use System V uname(2) system call */
239 # define HASSETSID	1	/* has Posix setsid(2) call */
240 # define HASINITGROUPS	1	/* has initgroups(3) call */
241 # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
242 # ifndef IDENTPROTO
243 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
244 # endif
245 # undef SETPROCTITLE
246 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
247 
248 /* these include files must be included early on DG/UX */
249 # include <netinet/in.h>
250 # include <arpa/inet.h>
251 
252 # define inet_addr	dgux_inet_addr
253 extern long	dgux_inet_addr();
254 #endif
255 
256 
257 /*
258 **  Digital Ultrix 4.2A or 4.3
259 **
260 **	Apparently, fcntl locking is broken on 4.2A, in that locks are
261 **	not dropped when the process exits.  This causes major problems,
262 **	so flock is the only alternative.
263 */
264 
265 #ifdef ultrix
266 # define HASSETREUID	1	/* has setreuid(2) call */
267 # define HASUNSETENV	1	/* has unsetenv(3) call */
268 # define HASINITGROUPS	1	/* has initgroups(3) call */
269 # define HASUNAME	1	/* use System V uname(2) system call */
270 # ifndef HASFLOCK
271 #  define HASFLOCK	1	/* has flock(2) call */
272 # endif
273 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
274 # ifdef vax
275 #  define LA_TYPE	LA_FLOAT
276 # else
277 #  define LA_TYPE	LA_INT
278 #  define LA_AVENRUN	"avenrun"
279 # endif
280 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
281 # ifndef IDENTPROTO
282 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
283 # endif
284 #endif
285 
286 
287 /*
288 **  OSF/1 (tested on Alpha)
289 */
290 
291 #ifdef __osf__
292 # define HASUNSETENV	1	/* has unsetenv(3) call */
293 # define HASSETREUID	1	/* has setreuid(2) call */
294 # define HASINITGROUPS	1	/* has initgroups(3) call */
295 # ifndef HASFLOCK
296 #  define HASFLOCK	1	/* has flock(2) call */
297 # endif
298 # define LA_TYPE	LA_INT
299 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
300 # ifndef _PATH_SENDMAILPID
301 #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
302 # endif
303 #endif
304 
305 
306 /*
307 **  NeXTstep
308 */
309 
310 #ifdef NeXT
311 # define HASINITGROUPS	1	/* has initgroups(3) call */
312 # ifndef HASFLOCK
313 #  define HASFLOCK	1	/* has flock(2) call */
314 # endif
315 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
316 # define WAITUNION	1	/* use "union wait" as wait argument type */
317 # define sleep		sleepX
318 # define setpgid	setpgrp
319 # ifndef LA_TYPE
320 #  define LA_TYPE	LA_MACH
321 # endif
322 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
323 # ifndef _POSIX_SOURCE
324 typedef int		pid_t;
325 #  undef WEXITSTATUS
326 #  undef WIFEXITED
327 # endif
328 # ifndef _PATH_SENDMAILCF
329 #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
330 # endif
331 # ifndef _PATH_SENDMAILPID
332 #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
333 # endif
334 #endif
335 
336 
337 /*
338 **  4.4 BSD
339 **
340 **	See also BSD defines.
341 */
342 
343 #ifdef BSD4_4
344 # define HASUNSETENV	1	/* has unsetenv(3) call */
345 # include <sys/cdefs.h>
346 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
347 # ifndef LA_TYPE
348 #  define LA_TYPE	LA_SUBR
349 # endif
350 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
351 #endif
352 
353 
354 /*
355 **  BSD/386 (all versions)
356 **	From Tony Sanders, BSDI
357 */
358 
359 #ifdef __bsdi__
360 # define HASUNSETENV	1	/* has the unsetenv(3) call */
361 # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
362 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
363 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
364 #  define HASSETPROCTITLE 1	/* setproctitle is in libc */
365 # else
366 #  define SETPROCTITLE	1
367 # endif
368 # include <sys/cdefs.h>
369 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
370 # ifndef LA_TYPE
371 #  define LA_TYPE	LA_SUBR
372 # endif
373 #endif
374 
375 
376 
377 /*
378 **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
379 **
380 **  4.3BSD clone, closer to 4.4BSD
381 **
382 **	See also BSD defines.
383 */
384 
385 #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
386 # define HASUNSETENV	1	/* has unsetenv(3) call */
387 # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
388 # include <sys/cdefs.h>
389 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
390 # ifndef LA_TYPE
391 #  define LA_TYPE	LA_SUBR
392 # endif
393 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
394 #endif
395 
396 
397 /*
398 **  Mach386
399 **
400 **	For mt Xinu's Mach386 system.
401 */
402 
403 #if defined(MACH) && defined(i386)
404 # define MACH386	1
405 # define HASUNSETENV	1	/* has unsetenv(3) call */
406 # define HASINITGROUPS	1	/* has initgroups(3) call */
407 # ifndef HASFLOCK
408 #  define HASFLOCK	1	/* has flock(2) call */
409 # endif
410 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
411 # define NEEDSTRTOL	1	/* need the strtol() function */
412 # define setpgid	setpgrp
413 # ifndef LA_TYPE
414 #  define LA_TYPE	LA_FLOAT
415 # endif
416 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
417 # undef HASSETVBUF		/* don't actually have setvbuf(3) */
418 # undef WEXITSTATUS
419 # undef WIFEXITED
420 # ifndef _PATH_SENDMAILCF
421 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
422 # endif
423 # ifndef _PATH_SENDMAILPID
424 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
425 # endif
426 #endif
427 
428 
429 /*
430 **  4.3 BSD -- this is for very old systems
431 **
432 **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
433 **
434 **	You'll also have to install a new resolver library.
435 **	I don't guarantee that support for this environment is complete.
436 */
437 
438 #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
439 # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
440 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
441 # define ARBPTR_T	char *
442 # define setpgid	setpgrp
443 # ifndef LA_TYPE
444 #  define LA_TYPE	LA_FLOAT
445 # endif
446 # ifndef _PATH_SENDMAILCF
447 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
448 # endif
449 # ifndef IDENTPROTO
450 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
451 # endif
452 # undef WEXITSTATUS
453 # undef WIFEXITED
454 typedef short		pid_t;
455 extern int		errno;
456 #endif
457 
458 
459 /*
460 **  SCO Unix
461 **
462 **	This includes two parts -- the first is for SCO Open Server 3.2v4
463 **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
464 **	The second is, I believe, for an older version.
465 */
466 
467 #ifdef _SCO_unix_4_2
468 # define _SCO_unix_
469 # define HASSETREUID	1	/* has setreuid(2) call */
470 # define _PATH_UNIX	"/unix"
471 # ifndef _PATH_SENDMAILCF
472 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
473 # endif
474 # ifndef _PATH_SENDMAILPID
475 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
476 # endif
477 #endif
478 
479 #ifdef _SCO_unix_
480 # define SYSTEM5	1	/* include all the System V defines */
481 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
482 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
483 # define FORK		fork
484 # define MAXPATHLEN	PATHSIZE
485 # define LA_TYPE	LA_SHORT
486 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
487 # undef NETUNIX			/* no unix domain socket support */
488 #endif
489 
490 
491 /*
492 **  ConvexOS 11.0 and later
493 **
494 **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
495 **	works on 9.1 as well.
496 */
497 
498 #ifdef _CONVEX_SOURCE
499 # define BSD		1	/* include all the BSD defines */
500 # define HASUNAME	1	/* use System V uname(2) system call */
501 # define HASSETSID	1	/* has POSIX setsid(2) call */
502 # define NEEDGETOPT	1	/* need replacement for getopt(3) */
503 # define LA_TYPE	LA_FLOAT
504 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
505 # ifndef _PATH_SENDMAILCF
506 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
507 # endif
508 # ifndef S_IREAD
509 #  define S_IREAD	_S_IREAD
510 #  define S_IWRITE	_S_IWRITE
511 #  define S_IEXEC	_S_IEXEC
512 #  define S_IFMT	_S_IFMT
513 #  define S_IFCHR	_S_IFCHR
514 #  define S_IFBLK	_S_IFBLK
515 # endif
516 # ifndef IDENTPROTO
517 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
518 # endif
519 #endif
520 
521 
522 /*
523 **  RISC/os 4.52
524 **
525 **	Gives a ton of warning messages, but otherwise compiles.
526 */
527 
528 #ifdef RISCOS
529 
530 # define HASUNSETENV	1	/* has unsetenv(3) call */
531 # ifndef HASFLOCK
532 #  define HASFLOCK	1	/* has flock(2) call */
533 # endif
534 # define WAITUNION	1	/* use "union wait" as wait argument type */
535 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
536 # define LA_TYPE	LA_INT
537 # define LA_AVENRUN	"avenrun"
538 # define _PATH_UNIX	"/unix"
539 # undef WIFEXITED
540 
541 # define setpgid	setpgrp
542 
543 extern int		errno;
544 typedef int		pid_t;
545 #define			SIGFUNC_DEFINED
546 typedef int		(*sigfunc_t)();
547 extern char		*getenv();
548 extern void		*malloc();
549 
550 #endif
551 
552 
553 /*
554 **  Linux 0.99pl10 and above...
555 **
556 **  Thanks to, in reverse order of contact:
557 **
558 **	John Kennedy <warlock@csuchico.edu>
559 **	Florian La Roche <rzsfl@rz.uni-sb.de>
560 **	Karl London <karl@borg.demon.co.uk>
561 **
562 **  Last compiled against:	[03/02/94 @ 05:34 PM (Wednesday)]
563 **	sendmail 8.6.6.b9	named 4.9.2-931205-p1	db-1.73
564 **	gcc 2.5.8		libc.so.4.5.19
565 **	slackware 1.1.2		linux 0.99.15
566 */
567 
568 #ifdef __linux__
569 # define BSD		1	/* include BSD defines */
570 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
571 # define HASUNAME	1	/* use System V uname(2) system call */
572 # define HASUNSETENV	1	/* has unsetenv(3) call */
573 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
574 # define GIDSET_T	gid_t	/* from <linux/types.h> */
575 # ifndef LA_TYPE
576 #  define LA_TYPE	LA_PROCSTR
577 # endif
578 # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
579 # include <sys/sysmacros.h>
580 # undef atol			/* wounded in <stdlib.h> */
581 #endif
582 
583 
584 /*
585 **  DELL SVR4 Issue 2.2, and others
586 **	From Kimmo Suominen <kim@grendel.lut.fi>
587 **
588 **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
589 **	defined, and the definitions conflict.
590 **
591 **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
592 **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
593 **	(SVR4.0/386 version 3.0).
594 */
595 
596 #ifdef DELL_SVR4
597 				/* no changes necessary */
598 				/* see general __svr4__ defines below */
599 #endif
600 
601 
602 /*
603 **  Apple A/UX 3.0
604 */
605 
606 #ifdef _AUX_SOURCE
607 # include <sys/sysmacros.h>
608 # define BSD			/* has BSD routines */
609 # define HASUNAME	1	/* use System V uname(2) system call */
610 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
611 # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
612 # ifndef IDENTPROTO
613 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
614 # endif
615 # define FORK		fork
616 # ifndef _PATH_SENDMAILCF
617 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
618 # endif
619 # ifndef LA_TYPE
620 #  define LA_TYPE	LA_ZERO
621 # endif
622 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
623 # undef WIFEXITED
624 # undef WEXITSTATUS
625 #endif
626 
627 
628 /*
629 **  Encore UMAX V
630 **
631 **	Not extensively tested.
632 */
633 
634 #ifdef UMAXV
635 # include <limits.h>
636 # define HASUNAME	1	/* use System V uname(2) system call */
637 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
638 # define HASINITGROUPS	1	/* has initgroups(3) call */
639 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
640 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
641 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
642 # define FORK		fork	/* no vfork(2) primitive available */
643 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
644 # define MAXPATHLEN	PATH_MAX
645 extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
646 extern struct group	*getgrent(), *getgrnam(), *getgrgid();
647 # undef WIFEXITED
648 # undef WEXITSTATUS
649 #endif
650 
651 
652 /*
653 **  Stardent Titan 3000 running TitanOS 4.2.
654 **
655 **	Must be compiled in "cc -43" mode.
656 **
657 **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
658 **
659 **	Note the tweaking below after the BSD defines are set.
660 */
661 
662 #ifdef titan
663 # define setpgid	setpgrp
664 typedef int		pid_t;
665 # undef WIFEXITED
666 # undef WEXITSTATUS
667 #endif
668 
669 
670 /*
671 **  Sequent DYNIX 3.2.0
672 **
673 **	From Jim Davis <jdavis@cs.arizona.edu>.
674 */
675 
676 #ifdef sequent
677 
678 # define BSD		1
679 # define HASUNSETENV	1
680 # define BSD4_3		1	/* to get signal() in conf.c */
681 # define WAITUNION	1
682 # define LA_TYPE	LA_FLOAT
683 # ifdef	_POSIX_VERSION
684 #  undef _POSIX_VERSION		/* set in <unistd.h> */
685 # endif
686 # undef HASSETVBUF		/* don't actually have setvbuf(3) */
687 # define setpgid	setpgrp
688 
689 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
690 # undef	WIFEXITED
691 # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
692 			 ((union wait*)&(s))->w_termsig == 0)
693 # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
694 typedef int		pid_t;
695 # define isgraph(c)	(isprint(c) && (c != ' '))
696 
697 # ifndef IDENTPROTO
698 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
699 # endif
700 
701 # ifndef _PATH_UNIX
702 #  define _PATH_UNIX	"/dynix"
703 # endif
704 # ifndef _PATH_SENDMAILCF
705 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
706 # endif
707 
708 #endif
709 
710 
711 /*
712 **  Sequent DYNIX/ptx v2.0 (and higher)
713 **
714 **	For DYNIX/ptx v1.x, undefine HASSETREUID.
715 **
716 **	From Tim Wright <timw@sequent.com>.
717 */
718 
719 #ifdef _SEQUENT_
720 # define SYSTEM5	1	/* include all the System V defines */
721 # define HASSETSID	1	/* has POSIX setsid(2) call */
722 # define HASINITGROUPS	1	/* has initgroups(3) call */
723 # define HASSETREUID	1	/* has setreuid(2) call */
724 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
725 # define GIDSET_T	gid_t
726 # define LA_TYPE	LA_INT
727 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
728 # undef SETPROCTITLE
729 # ifndef IDENTPROTO
730 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
731 # endif
732 # ifndef _PATH_SENDMAILCF
733 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
734 # endif
735 # ifndef _PATH_SENDMAILPID
736 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
737 # endif
738 #endif
739 
740 
741 /*
742 **  Cray Unicos
743 **
744 **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
745 */
746 
747 #ifdef UNICOS
748 # define SYSTEM5	1	/* include all the System V defines */
749 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
750 # define MAXPATHLEN	PATHSIZE
751 # define LA_TYPE	LA_ZERO
752 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
753 #endif
754 
755 
756 /*
757 **  Apollo DomainOS
758 **
759 **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
760 **
761 **  15 Jan 1994
762 **
763 */
764 
765 #ifdef apollo
766 # define HASSETREUID	1	/* has setreuid(2) call */
767 # define HASINITGROUPS	1	/* has initgroups(2) call */
768 # undef  SETPROCTITLE
769 # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
770 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
771 # ifndef _PATH_SENDMAILCF
772 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
773 # endif
774 # ifndef _PATH_SENDMAILPID
775 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
776 # endif
777 # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
778 # undef  S_IFIFO
779 # define S_IFIFO	0010000
780 # ifndef IDENTPROTO
781 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
782 # endif
783 #endif
784 
785 
786 
787 
788 /**********************************************************************
789 **  End of Per-Operating System defines
790 **********************************************************************/
791 
792 /**********************************************************************
793 **  More general defines
794 **********************************************************************/
795 
796 /* general BSD defines */
797 #ifdef BSD
798 # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
799 # define HASSETREUID	1	/* has setreuid(2) call */
800 # define HASINITGROUPS	1	/* has initgroups(2) call */
801 # ifndef HASFLOCK
802 #  define HASFLOCK	1	/* has flock(2) call */
803 # endif
804 #endif
805 
806 /* general System V Release 4 defines */
807 #ifdef __svr4__
808 # define SYSTEM5	1
809 # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
810 # ifndef HASGETUSERSHELL
811 #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
812 # endif
813 # define setreuid(r, e)	seteuid(e)
814 
815 # ifndef _PATH_UNIX
816 #  define _PATH_UNIX		"/unix"
817 # endif
818 # ifndef _PATH_SENDMAILCF
819 #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
820 # endif
821 # ifndef _PATH_SENDMAILPID
822 #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
823 # endif
824 # ifndef SYSLOG_BUFSIZE
825 #  define SYSLOG_BUFSIZE	128
826 # endif
827 #endif
828 
829 /* general System V defines */
830 #ifdef SYSTEM5
831 # include <sys/sysmacros.h>
832 # define HASUNAME	1	/* use System V uname(2) system call */
833 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
834 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
835 # ifndef LA_TYPE
836 #  define LA_TYPE	LA_INT		/* assume integer load average */
837 # endif
838 # ifndef SFS_TYPE
839 #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
840 # endif
841 # define bcopy(s, d, l)		(memmove((d), (s), (l)))
842 # define bzero(d, l)		(memset((d), '\0', (l)))
843 # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
844 #endif
845 
846 /* general POSIX defines */
847 #ifdef _POSIX_VERSION
848 # define HASSETSID	1	/* has Posix setsid(2) call */
849 # define HASWAITPID	1	/* has Posix waitpid(2) call */
850 #endif
851 
852 /*
853 **  If no type for argument two of getgroups call is defined, assume
854 **  it's an integer -- unfortunately, there seem to be several choices
855 **  here.
856 */
857 
858 #ifndef GIDSET_T
859 # define GIDSET_T	int
860 #endif
861 
862 /*
863 **  Tweaking for systems that (for example) claim to be BSD but
864 **  don't have all the standard BSD routines (boo hiss).
865 */
866 
867 #ifdef titan
868 # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
869 #endif
870 
871 
872 /*
873 **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
874 **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
875 **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
876 **  are closed.  Some firewalls return this error if you try to connect
877 **  to the IDENT port (113), so you can't receive email from these hosts
878 **  on these systems.  The firewall really should use a more specific
879 **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
880 **  not explicitly set to zero above, default it on.
881 */
882 
883 #ifndef IDENTPROTO
884 # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
885 #endif
886 
887 #ifndef HASGETUSERSHELL
888 # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
889 #endif
890 
891 #ifndef HASFLOCK
892 # define HASFLOCK	0	/* assume no flock(2) support */
893 #endif
894 
895 
896 /**********************************************************************
897 **  Remaining definitions should never have to be changed.  They are
898 **  primarily to provide back compatibility for older systems -- for
899 **  example, it includes some POSIX compatibility definitions
900 **********************************************************************/
901 
902 /* System 5 compatibility */
903 #ifndef S_ISREG
904 # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
905 #endif
906 #if !defined(S_ISLNK) && defined(S_IFLNK)
907 # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
908 #endif
909 #ifndef S_IWGRP
910 #define S_IWGRP		020
911 #endif
912 #ifndef S_IWOTH
913 #define S_IWOTH		002
914 #endif
915 
916 /*
917 **  Older systems don't have this error code -- it should be in
918 **  /usr/include/sysexits.h.
919 */
920 
921 # ifndef EX_CONFIG
922 # define EX_CONFIG	78	/* configuration error */
923 # endif
924 
925 /* pseudo-code used in server SMTP */
926 # define EX_QUIT	22	/* drop out of server immediately */
927 
928 
929 /*
930 **  These are used in a few cases where we need some special
931 **  error codes, but where the system doesn't provide something
932 **  reasonable.  They are printed in errstring.
933 */
934 
935 #ifndef E_PSEUDOBASE
936 # define E_PSEUDOBASE	256
937 #endif
938 
939 #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
940 #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
941 
942 /* type of arbitrary pointer */
943 #ifndef ARBPTR_T
944 # define ARBPTR_T	void *
945 #endif
946 
947 #ifndef __P
948 # include "cdefs.h"
949 #endif
950 
951 /*
952 **  Do some required dependencies
953 */
954 
955 #if defined(NETINET) || defined(NETISO)
956 # define SMTP		1	/* enable user and server SMTP */
957 # define QUEUE		1	/* enable queueing */
958 # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
959 #endif
960 
961 
962 /*
963 **  Arrange to use either varargs or stdargs
964 */
965 
966 # ifdef __STDC__
967 
968 # include <stdarg.h>
969 
970 # define VA_LOCAL_DECL	va_list ap;
971 # define VA_START(f)	va_start(ap, f)
972 # define VA_END		va_end(ap)
973 
974 # else
975 
976 # include <varargs.h>
977 
978 # define VA_LOCAL_DECL	va_list ap;
979 # define VA_START(f)	va_start(ap)
980 # define VA_END		va_end(ap)
981 
982 # endif
983 
984 #ifdef HASUNAME
985 # include <sys/utsname.h>
986 # ifdef newstr
987 #  undef newstr
988 # endif
989 #else /* ! HASUNAME */
990 # define NODE_LENGTH 32
991 struct utsname
992 {
993 	char nodename[NODE_LENGTH+1];
994 };
995 #endif /* HASUNAME */
996 
997 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
998 # define MAXHOSTNAMELEN	256
999 #endif
1000 
1001 #if !defined(SIGCHLD) && defined(SIGCLD)
1002 # define SIGCHLD	SIGCLD
1003 #endif
1004 
1005 #ifndef STDIN_FILENO
1006 #define STDIN_FILENO	0
1007 #endif
1008 
1009 #ifndef STDOUT_FILENO
1010 #define STDOUT_FILENO	1
1011 #endif
1012 
1013 #ifndef STDERR_FILENO
1014 #define STDERR_FILENO	2
1015 #endif
1016 
1017 #ifndef LOCK_SH
1018 # define LOCK_SH	0x01	/* shared lock */
1019 # define LOCK_EX	0x02	/* exclusive lock */
1020 # define LOCK_NB	0x04	/* non-blocking lock */
1021 # define LOCK_UN	0x08	/* unlock */
1022 #endif
1023 
1024 #ifndef SIG_ERR
1025 # define SIG_ERR	((void (*)()) -1)
1026 #endif
1027 
1028 #ifndef WEXITSTATUS
1029 # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
1030 #endif
1031 #ifndef WIFEXITED
1032 # define WIFEXITED(st)		(((st) & 0377) == 0)
1033 #endif
1034 
1035 #ifndef SIGFUNC_DEFINED
1036 typedef void		(*sigfunc_t) __P((int));
1037 #endif
1038 
1039 /* size of syslog buffer */
1040 #ifndef SYSLOG_BUFSIZE
1041 # define SYSLOG_BUFSIZE	1024
1042 #endif
1043 
1044 /*
1045 **  Size of tobuf (deliver.c)
1046 **	Tweak this to match your syslog implementation.  It will have to
1047 **	allow for the extra information printed.
1048 */
1049 
1050 #ifndef TOBUFSIZE
1051 # if (SYSLOG_BUFSIZE) > 512
1052 #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
1053 # else
1054 #  define TOBUFSIZE	256
1055 # endif
1056 #endif
1057 
1058 /*
1059 **  Size of prescan buffer.
1060 **	Despite comments in the _sendmail_ book, this probably should
1061 **	not be changed; there are some hard-to-define dependencies.
1062 */
1063 
1064 # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
1065 /* fork routine -- set above using #ifdef _osname_ or in Makefile */
1066 # ifndef FORK
1067 # define FORK		vfork		/* function to call to fork mailer */
1068 # endif
1069 
1070 /*
1071 **  If we are going to link scanf anyway, use it in readcf
1072 */
1073 
1074 #if !defined(HASUNAME) && !defined(SCANF)
1075 # define SCANF		1
1076 #endif
1077