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