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