xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 65015)
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.57 (Berkeley) 12/02/93
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 **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
67 **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
68 **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
69 **  are closed.  Some firewalls return this error if you try to connect
70 **  to the IDENT port (113), so you can't receive email from these hosts
71 **  on these systems.  The firewall really should use a more specific
72 **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  This
73 **  will get #undefed below as needed.
74 */
75 
76 #ifndef IDENTPROTO
77 # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
78 #endif
79 
80 /*
81 **  Most systems have symbolic links today, so default them on.  You
82 **  can turn them off by #undef'ing this below.
83 */
84 
85 # define HASLSTAT	1	/* has lstat(2) call */
86 
87 /*
88 **  General "standard C" defines.
89 **
90 **	These may be undone later, to cope with systems that claim to
91 **	be Standard C but aren't.  Gcc is the biggest offender -- it
92 **	doesn't realize that the library is part of the language.
93 **
94 **	Life would be much easier if we could get rid of this sort
95 **	of bozo problems.
96 */
97 
98 #ifdef __STDC__
99 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
100 #endif
101 
102 /**********************************************************************
103 **  Operating system configuration.
104 **
105 **	Unless you are porting to a new OS, you shouldn't have to
106 **	change these.
107 **********************************************************************/
108 
109 /*
110 **  Per-Operating System defines
111 */
112 
113 
114 /*
115 **  HP-UX -- tested for 8.07
116 */
117 
118 # ifdef __hpux
119 /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
120 # undef m_flags
121 # define SYSTEM5	1	/* include all the System V defines */
122 # define HASINITGROUPS	1	/* has initgroups(3) call */
123 # define HASSTATFS	1	/* has the statfs(2) syscall */
124 # define HASSETREUID	1	/* has setreuid(2) call */
125 # define setreuid(r, e)		setresuid(r, e, -1)
126 # define LA_TYPE	LA_FLOAT
127 # define _PATH_UNIX	"/hp-ux"
128 # undef IDENTPROTO		/* TCP/IP implementation is broken */
129 # endif
130 
131 
132 /*
133 **  IBM AIX 3.x -- actually tested for 3.2.3
134 */
135 
136 # ifdef _AIX3
137 # define HASINITGROUPS	1	/* has initgroups(3) call */
138 # define HASSTATFS	1	/* has the statfs(2) syscall */
139 # define HASUNAME	1	/* use System V uname(2) system call */
140 # define FORK		fork	/* no vfork primitive available */
141 # undef  SETPROCTITLE		/* setproctitle confuses AIX */
142 # endif
143 
144 
145 /*
146 **  Silicon Graphics IRIX
147 **
148 **	Compiles on 4.0.1.
149 */
150 
151 # ifdef IRIX
152 # include <sys/sysmacros.h>
153 # define HASSETREUID	1	/* has setreuid(2) call */
154 # define HASINITGROUPS	1	/* has initgroups(3) call */
155 # define HASSTATFS	1	/* has the statfs(2) syscall */
156 # define FORK		fork	/* no vfork primitive available */
157 # define WAITUNION	1	/* use "union wait" as wait argument type */
158 # define setpgid	BSDsetpgrp
159 # define GIDSET_T	gid_t
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 LA_TYPE	LA_INT
173 # define HASSETREUID	1	/* has setreuid(2) call */
174 # define HASINITGROUPS	1	/* has initgroups(3) call */
175 # define HASUNAME	1	/* use System V uname(2) system call */
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 #  define SYSTEM5	1	/* use System V definitions */
184 #  define setreuid(r, e)	seteuid(e)
185 #  include <sys/time.h>
186 #  define gethostbyname	solaris_gethostbyname	/* get working version */
187 #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
188 #  define _PATH_UNIX	"/kernel/unix"
189 #  ifndef _PATH_SENDMAILCF
190 #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
191 #  endif
192 #  ifndef _PATH_SENDMAILPID
193 #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
194 #  endif
195 
196 # else
197 			/* SunOS 4.1.x */
198 #  define HASSTATFS	1	/* has the statfs(2) syscall */
199 #  define HASFLOCK	1	/* has flock(2) call */
200 #  include <vfork.h>
201 
202 # endif
203 #endif
204 
205 /*
206 **  DG/UX
207 **
208 **	Tested on 5.4.2
209 */
210 
211 #ifdef	DGUX
212 # define SYSTEM5	1
213 # define LA_TYPE	LA_SUBR
214 # define HASSTATFS	1	/* has the statfs(2) syscall */
215 # define HASSETREUID	1	/* has setreuid(2) call */
216 # define HASUNAME	1	/* use System V uname(2) system call */
217 # define HASSETSID	1	/* has Posix setsid(2) call */
218 # define HASINITGROUPS	1	/* has initgroups(3) call */
219 # undef IDENTPROTO		/* TCP/IP implementation is broken */
220 # undef SETPROCTITLE
221 
222 /* these include files must be included early on DG/UX */
223 # include <netinet/in.h>
224 # include <arpa/inet.h>
225 
226 # define inet_addr	dgux_inet_addr
227 extern long	dgux_inet_addr();
228 #endif
229 
230 
231 /*
232 **  Digital Ultrix 4.2A or 4.3
233 **
234 **	Apparently, fcntl locking is broken on 4.2A, in that locks are
235 **	not dropped when the process exits.  This causes major problems,
236 **	so flock is the only alternative.
237 */
238 
239 #ifdef ultrix
240 # define HASSTATFS	1	/* has the statfs(2) syscall */
241 # define HASSETREUID	1	/* has setreuid(2) call */
242 # define HASUNSETENV	1	/* has unsetenv(3) call */
243 # define HASINITGROUPS	1	/* has initgroups(3) call */
244 # define HASFLOCK	1	/* has flock(2) call */
245 # define LA_TYPE	LA_INT
246 # define LA_AVENRUN	"avenrun"
247 # undef IDENTPROTO		/* TCP/IP implementation is broken */
248 #endif
249 
250 
251 /*
252 **  OSF/1 (tested on Alpha)
253 */
254 
255 #ifdef __osf__
256 # define HASSTATFS	1	/* has the statfs(2) syscall */
257 # define HASUNSETENV	1	/* has unsetenv(3) call */
258 # define HASSETREUID	1	/* has setreuid(2) call */
259 # define HASINITGROUPS	1	/* has initgroups(3) call */
260 # define HASFLOCK	1	/* has flock(2) call */
261 # define LA_TYPE	LA_INT
262 # ifndef _PATH_SENDMAILPID
263 #  define _PATH_SENDMAILPID	"/var/run/sendmial.pid"
264 # endif
265 #endif
266 
267 
268 /*
269 **  NeXTstep
270 */
271 
272 #ifdef NeXT
273 # define HASINITGROUPS	1	/* has initgroups(3) call */
274 # define HASFLOCK	1	/* has flock(2) call */
275 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
276 # define HASSTATFS	1	/* has the statfs(2) syscall */
277 # define WAITUNION	1	/* use "union wait" as wait argument type */
278 # define sleep		sleepX
279 # define setpgid	setpgrp
280 # ifndef LA_TYPE
281 #  define LA_TYPE	LA_MACH
282 # endif
283 # ifndef _POSIX_SOURCE
284 typedef int		pid_t;
285 #  undef WEXITSTATUS
286 #  undef WIFEXITED
287 # endif
288 # ifndef _PATH_SENDMAILCF
289 #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
290 # endif
291 # ifndef _PATH_SENDMAILPID
292 #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
293 # endif
294 #endif
295 
296 
297 /*
298 **  4.4 BSD
299 **
300 **	See also BSD defines.
301 */
302 
303 #ifdef BSD4_4
304 # define HASUNSETENV	1	/* has unsetenv(3) call */
305 # define HASSTATFS	1	/* has the statfs(2) syscall */
306 # include <sys/cdefs.h>
307 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
308 # ifndef LA_TYPE
309 #  define LA_TYPE	LA_SUBR
310 # endif
311 #endif
312 
313 
314 /*
315 **  386BSD / FreeBSD 1.0E (works) / NetBSD (not tested)
316 **
317 **  4.3BSD clone, closer to 4.4BSD
318 **
319 **	See also BSD defines.
320 */
321 
322 #ifdef __386BSD__
323 # define HASUNSETENV	1	/* has unsetenv(3) call */
324 # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
325 # define HASSTATFS	1	/* has the statfs(2) syscall */
326 # include <sys/cdefs.h>
327 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
328 # ifndef LA_TYPE
329 #  define LA_TYPE	LA_SUBR
330 # endif
331 #endif
332 
333 
334 /*
335 **  Mach386
336 **
337 **	For mt Xinu's Mach386 system.
338 */
339 
340 #if defined(MACH) && defined(i386)
341 # define MACH386	1
342 # define HASUNSETENV	1	/* has unsetenv(3) call */
343 # define HASINITGROUPS	1	/* has initgroups(3) call */
344 # define HASFLOCK	1	/* has flock(2) call */
345 # define HASSTATFS	1	/* has the statfs(2) syscall */
346 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
347 # define NEEDSTRTOL	1	/* need the strtol() function */
348 # define setpgid	setpgrp
349 # ifndef LA_TYPE
350 #  define LA_TYPE	LA_FLOAT
351 # endif
352 # undef HASSETVBUF		/* don't actually have setvbuf(3) */
353 # undef WEXITSTATUS
354 # undef WIFEXITED
355 # ifndef _PATH_SENDMAILCF
356 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
357 # endif
358 # ifndef _PATH_SENDMAILPID
359 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
360 # endif
361 #endif
362 
363 
364 /*
365 **  4.3 BSD -- this is for very old systems
366 **
367 **	You'll also have to install a new resolver library.
368 **	I don't guarantee that support for this environment is complete.
369 */
370 
371 #ifdef oldBSD43
372 # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
373 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
374 # define ARBPTR_T	char *
375 # define setpgid	setpgrp
376 # ifndef LA_TYPE
377 #  define LA_TYPE	LA_FLOAT
378 # endif
379 # ifndef _PATH_SENDMAILCF
380 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
381 # endif
382 # undef IDENTPROTO		/* TCP/IP implementation is broken */
383 # undef WEXITSTATUS
384 # undef WIFEXITED
385 typedef short		pid_t;
386 extern int		errno;
387 #endif
388 
389 
390 /*
391 **  SCO Unix
392 */
393 
394 #ifdef _SCO_unix_
395 # define SYSTEM5	1	/* include all the System V defines */
396 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
397 # define HASSTATFS	1	/* has the statfs(2) syscall */
398 # define FORK		fork
399 # define MAXPATHLEN	PATHSIZE
400 # define LA_TYPE	LA_SHORT
401 # undef NETUNIX			/* no unix domain socket support */
402 #endif
403 
404 
405 /*
406 **  ConvexOS 11.0 and later
407 */
408 
409 #ifdef _CONVEX_SOURCE
410 # define BSD		1	/* include all the BSD defines */
411 # define HASUNAME	1	/* use System V uname(2) system call */
412 # define HASSTATFS	1	/* has the statfs(2) syscall */
413 # define HASSETSID	1	/* has POSIX setsid(2) call */
414 # define NEEDGETOPT	1	/* need replacement for getopt(3) */
415 # define LA_TYPE	LA_FLOAT
416 # undef IDENTPROTO
417 #endif
418 
419 
420 /*
421 **  RISC/os 4.52
422 **
423 **	Gives a ton of warning messages, but otherwise compiles.
424 */
425 
426 #ifdef RISCOS
427 
428 # define HASUNSETENV	1	/* has unsetenv(3) call */
429 # define HASFLOCK	1	/* has flock(2) call */
430 # define WAITUNION	1	/* use "union wait" as wait argument type */
431 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
432 # define LA_TYPE	LA_INT
433 # define LA_AVENRUN	"avenrun"
434 # define _PATH_UNIX	"/unix"
435 # undef WIFEXITED
436 
437 # define setpgid	setpgrp
438 
439 extern int		errno;
440 typedef int		pid_t;
441 #define			SIGFUNC_DEFINED
442 typedef int		(*sigfunc_t)();
443 extern char		*getenv();
444 extern void		*malloc();
445 
446 #endif
447 
448 
449 /*
450 **  Linux 0.99pl10 and above...
451 **	From Karl London <karl@borg.demon.co.uk>.
452 */
453 
454 #ifdef __linux__
455 # define BSD		1	/* pretend to be BSD based today */
456 # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
457 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
458 # define HASUNSETENV	1	/* has unsetenv(3) call */
459 # ifndef LA_TYPE
460 #  define LA_TYPE	LA_FLOAT
461 # endif
462 # include <sys/sysmacros.h>
463 #endif
464 
465 
466 /*
467 **  DELL SVR4 Issue 2.2, and others
468 **	From Kimmo Suominen <kim@grendel.lut.fi>
469 **
470 **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
471 **	defined, and the definitions conflict.
472 **
473 **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
474 **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
475 **	(SVR4.0/386 version 3.0).
476 */
477 
478 #ifdef DELL_SVR4
479 # define SYSTEM5	1
480 # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
481 # define setreuid(r, e)	seteuid(e)
482 /* # include <sys/time.h> */
483 # define _PATH_UNIX	"/unix"
484 # ifndef _PATH_SENDMAILCF
485 #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
486 # endif
487 # ifndef _PATH_SENDMAILPID
488 #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
489 # endif
490 #endif
491 
492 
493 /*
494 **  Apple A/UX 3.0
495 */
496 
497 #ifdef _AUX_SOURCE
498 # include <sys/sysmacros.h>
499 # define BSD			/* has BSD routines */
500 # define HASSTATFS	1	/* has the statfs(2) syscall */
501 # define HASUNAME	1	/* use System V uname(2) system call */
502 # define HASUSTAT	1	/* use System V ustat(2) syscall */
503 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
504 # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
505 # undef IDENTPROTO		/* TCP/IP implementation is broken */
506 # define FORK		fork
507 # ifndef _PATH_SENDMAILCF
508 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
509 # endif
510 # ifndef LA_TYPE
511 #  define LA_TYPE	LA_ZERO
512 # endif
513 # undef WIFEXITED
514 # undef WEXITSTATUS
515 #endif
516 
517 
518 /*
519 **  Encore UMAX V
520 **
521 **	Not extensively tested.
522 */
523 
524 #ifdef UMAXV
525 # include <limits.h>
526 # define HASUNAME	1	/* use System V uname(2) system call */
527 # define HASSTATFS	1	/* has the statfs(2) syscall */
528 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
529 # define HASINITGROUPS	1	/* has initgroups(3) call */
530 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
531 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
532 # define FORK		fork	/* no vfork(2) primitive available */
533 # define MAXPATHLEN	PATH_MAX
534 extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
535 extern struct group	*getgrent(), *getgrnam(), *getgrgid();
536 # undef WIFEXITED
537 # undef WEXITSTATUS
538 #endif
539 
540 
541 /*
542 **  Stardent Titan 3000 running TitanOS 4.2.
543 **
544 **	Must be compiled in "cc -43" mode.
545 **
546 **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
547 **
548 **	Note the tweaking below after the BSD defines are set.
549 */
550 
551 #ifdef titan
552 # define setpgid	setpgrp
553 typedef int		pid_t;
554 # undef WIFEXITED
555 # undef WEXITSTATUS
556 #endif
557 
558 
559 /*
560 **  Sequent DYNIX 3.2.0
561 **
562 **	From Jim Davis <jdavis@cs.arizona.edu>.
563 */
564 
565 #ifdef sequent
566 # define BSD		1
567 # define HASUNSETENV	1
568 # define BSD4_3		1	/* to get signal() in conf.c */
569 # define WAITUNION	1
570 # define LA_TYPE	LA_FLOAT
571 # ifdef	_POSIX_VERSION
572 #  undef _POSIX_VERSION		/* set in <unistd.h> */
573 # endif
574 # undef HASSETVBUF		/* don't actually have setvbuf(3) */
575 # define setpgid	setpgrp
576 
577 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
578 # undef	WIFEXITED
579 # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
580 			 ((union wait*)&(s))->w_termsig == 0)
581 # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
582 typedef int		pid_t;
583 # define isgraph(c)	(isprint(c) && (c != ' '))
584 
585 # ifndef _PATH_UNIX
586 #  define _PATH_UNIX	"/dynix"
587 # endif
588 # ifndef _PATH_SENDMAILCF
589 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
590 # endif
591 
592 #endif
593 
594 
595 
596 
597 /**********************************************************************
598 **  End of Per-Operating System defines
599 **********************************************************************/
600 
601 /**********************************************************************
602 **  More general defines
603 **********************************************************************/
604 
605 /* general BSD defines */
606 #ifdef BSD
607 # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
608 # define HASSETREUID	1	/* has setreuid(2) call */
609 # define HASINITGROUPS	1	/* has initgroups(2) call */
610 # define HASFLOCK	1	/* has flock(2) call */
611 #endif
612 
613 /* general System V defines */
614 # ifdef SYSTEM5
615 # include <sys/sysmacros.h>
616 # define HASUNAME	1	/* use System V uname(2) system call */
617 # define HASUSTAT	1	/* use System V ustat(2) syscall */
618 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
619 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
620 # ifndef LA_TYPE
621 #  define LA_TYPE	LA_INT
622 # endif
623 # define bcopy(s, d, l)		(memmove((d), (s), (l)))
624 # define bzero(d, l)		(memset((d), '\0', (l)))
625 # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
626 # endif
627 
628 /* general POSIX defines */
629 #ifdef _POSIX_VERSION
630 # define HASSETSID	1	/* has Posix setsid(2) call */
631 # define HASWAITPID	1	/* has Posix waitpid(2) call */
632 #endif
633 
634 /*
635 **  If no type for argument two of getgroups call is defined, assume
636 **  it's an integer -- unfortunately, there seem to be several choices
637 **  here.
638 */
639 
640 #ifndef GIDSET_T
641 # define GIDSET_T	int
642 #endif
643 
644 /*
645 **  Tweaking for systems that (for example) claim to be BSD but
646 **  don't have all the standard BSD routines (boo hiss).
647 */
648 
649 #ifdef titan
650 # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
651 #endif
652 
653 
654 /**********************************************************************
655 **  Remaining definitions should never have to be changed.  They are
656 **  primarily to provide back compatibility for older systems -- for
657 **  example, it includes some POSIX compatibility definitions
658 **********************************************************************/
659 
660 /* System 5 compatibility */
661 #ifndef S_ISREG
662 # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
663 #endif
664 #if !defined(S_ISLNK) && defined(S_IFLNK)
665 # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
666 #endif
667 #ifndef S_IWGRP
668 #define S_IWGRP		020
669 #endif
670 #ifndef S_IWOTH
671 #define S_IWOTH		002
672 #endif
673 
674 /*
675 **  Older systems don't have this error code -- it should be in
676 **  /usr/include/sysexits.h.
677 */
678 
679 # ifndef EX_CONFIG
680 # define EX_CONFIG	78	/* configuration error */
681 # endif
682 
683 /* pseudo-code used in server SMTP */
684 # define EX_QUIT	22	/* drop out of server immediately */
685 
686 
687 /*
688 **  These are used in a few cases where we need some special
689 **  error codes, but where the system doesn't provide something
690 **  reasonable.  They are printed in errstring.
691 */
692 
693 #ifndef E_PSEUDOBASE
694 # define E_PSEUDOBASE	256
695 #endif
696 
697 #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
698 #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
699 
700 /* type of arbitrary pointer */
701 #ifndef ARBPTR_T
702 # define ARBPTR_T	void *
703 #endif
704 
705 #ifndef __P
706 # include "cdefs.h"
707 #endif
708 
709 /*
710 **  Do some required dependencies
711 */
712 
713 #if defined(NETINET) || defined(NETISO)
714 # define SMTP		1	/* enable user and server SMTP */
715 # define QUEUE		1	/* enable queueing */
716 # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
717 #endif
718 
719 
720 /*
721 **  Arrange to use either varargs or stdargs
722 */
723 
724 # ifdef __STDC__
725 
726 # include <stdarg.h>
727 
728 # define VA_LOCAL_DECL	va_list ap;
729 # define VA_START(f)	va_start(ap, f)
730 # define VA_END		va_end(ap)
731 
732 # else
733 
734 # include <varargs.h>
735 
736 # define VA_LOCAL_DECL	va_list ap;
737 # define VA_START(f)	va_start(ap)
738 # define VA_END		va_end(ap)
739 
740 # endif
741 
742 #ifdef HASUNAME
743 # include <sys/utsname.h>
744 # ifdef newstr
745 #  undef newstr
746 # endif
747 #else /* ! HASUNAME */
748 # define NODE_LENGTH 32
749 struct utsname
750 {
751 	char nodename[NODE_LENGTH+1];
752 };
753 #endif /* HASUNAME */
754 
755 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
756 # define MAXHOSTNAMELEN	256
757 #endif
758 
759 #if !defined(SIGCHLD) && defined(SIGCLD)
760 # define SIGCHLD	SIGCLD
761 #endif
762 
763 #ifndef STDIN_FILENO
764 #define STDIN_FILENO	0
765 #endif
766 
767 #ifndef STDOUT_FILENO
768 #define STDOUT_FILENO	1
769 #endif
770 
771 #ifndef STDERR_FILENO
772 #define STDERR_FILENO	2
773 #endif
774 
775 #ifndef LOCK_SH
776 # define LOCK_SH	0x01	/* shared lock */
777 # define LOCK_EX	0x02	/* exclusive lock */
778 # define LOCK_NB	0x04	/* non-blocking lock */
779 # define LOCK_UN	0x08	/* unlock */
780 #endif
781 
782 #ifndef SIG_ERR
783 # define SIG_ERR	((void (*)()) -1)
784 #endif
785 
786 #ifndef WEXITSTATUS
787 # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
788 #endif
789 #ifndef WIFEXITED
790 # define WIFEXITED(st)		(((st) & 0377) == 0)
791 #endif
792 
793 #ifndef SIGFUNC_DEFINED
794 typedef void		(*sigfunc_t) __P((int));
795 #endif
796 
797 /*
798 **  Size of tobuf (deliver.c)
799 **	Tweak this to match your syslog implementation.  It will have to
800 **	allow for the extra information printed.
801 */
802 
803 #ifndef TOBUFSIZE
804 # define TOBUFSIZE (1024 - 256)
805 #endif
806 
807 /*
808 **  Size of prescan buffer.
809 **	Despite comments in the _sendmail_ book, this probably should
810 **	not be changed; there are some hard-to-define dependencies.
811 */
812 
813 # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
814 /* fork routine -- set above using #ifdef _osname_ or in Makefile */
815 # ifndef FORK
816 # define FORK		vfork		/* function to call to fork mailer */
817 # endif
818 
819 #ifndef IDENTPROTO
820 # define IDENTPROTO	0		/* don't use RFC 1413 */
821 #endif
822