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