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