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