fix bogus implementation of name overflow limiting
[unix-history] / usr / src / usr.sbin / sendmail / src / conf.h
CommitLineData
5a739feb 1/*
dc45ba8c 2 * Copyright (c) 1983 Eric P. Allman
31de980b
KB
3 * Copyright (c) 1988, 1993
4 * The Regents of the University of California. All rights reserved.
bee79b64 5 *
417f7a11 6 * %sccs.include.redist.c%
bee79b64 7 *
77779257 8 * @(#)conf.h 8.57 (Berkeley) %G%
bee79b64 9 */
aeb2545d
DF
10
11/*
12** CONF.H -- All user-configurable parameters for sendmail
5a739feb
EA
13*/
14
f43b04ce 15# include <sys/param.h>
82530719 16# include <sys/types.h>
46300693 17# include <sys/stat.h>
c2edb205 18# include <sys/file.h>
0349f8cc 19# include <sys/wait.h>
f8a31c8e 20# include <fcntl.h>
39270cfd 21# include <signal.h>
f43b04ce 22
ba6514e2 23/**********************************************************************
5a739feb
EA
24** Table sizes, etc....
25** There shouldn't be much need to change these....
ba6514e2 26**********************************************************************/
5a739feb 27
d36f8e5c 28# define MAXLINE 2048 /* max line length */
f0a960f1 29# define MAXNAME 256 /* max length of a name */
5a739feb 30# define MAXPV 40 /* max # of parms to mailers */
d36f8e5c 31# define MAXATOM 200 /* max atoms per address */
5a739feb 32# define MAXMAILERS 25 /* maximum mailers known to system */
8583ab39 33# define MAXRWSETS 100 /* max # of sets of rewriting rules */
5a739feb 34# define MAXPRIORITIES 25 /* max values for Precedence: field */
8583ab39 35# define MAXMXHOSTS 20 /* max # of MX records */
8657d05f 36# define SMTPLINELIM 990 /* maximum SMTP line length */
f43b04ce
EA
37# define MAXKEY 128 /* maximum size of a database key */
38# define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */
b0b636d1 39# define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */
9f7134c8 40# define MAXALIASDB 12 /* max # of alias databases */
8583ab39
EA
41
42# ifndef QUEUESIZE
43# define QUEUESIZE 1000 /* max # of jobs per queue run */
44# endif
45
ba6514e2 46/**********************************************************************
5a739feb 47** Compilation options.
9bcdff70
EA
48**
49** #define these if they are available; comment them out otherwise.
ba6514e2 50**********************************************************************/
5a739feb 51
9bcdff70 52# define LOG 1 /* enable logging */
9bcdff70 53# define UGLYUUCP 1 /* output ugly UUCP From lines */
8988dfd3 54# define NETUNIX 1 /* include unix domain support */
3356c77c 55# define NETINET 1 /* include internet support */
9bcdff70 56# define SETPROCTITLE 1 /* munge argv to display current status */
35af2f06 57# define NAMED_BIND 1 /* use Berkeley Internet Domain Server */
7f0fd60b 58# define MATCHGECOS 1 /* match user names from gecos field */
8e5c6745 59# define XDEBUG 1 /* enable extended debugging */
d25bb424 60
273562d8
EA
61# ifdef NEWDB
62# define USERDB 1 /* look in user database (requires NEWDB) */
5a4c03c6
EA
63# endif
64
c19e43df
EA
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
cb81a6a2 76#ifndef IDENTPROTO
c19e43df 77# define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */
cb81a6a2 78#endif
c19e43df 79
fce21cb9
EA
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
c6bd47b4
EA
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
ba6514e2 102/**********************************************************************
e6245c7e
EA
103** Operating system configuration.
104**
105** Unless you are porting to a new OS, you shouldn't have to
106** change these.
ba6514e2 107**********************************************************************/
5a4c03c6 108
fd57f063
EA
109/*
110** Per-Operating System defines
111*/
112
2b09dd75 113
ba6514e2
EA
114/*
115** HP-UX -- tested for 8.07
116*/
117
8a47b280 118# ifdef __hpux
192b13aa
EA
119/* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
120# undef m_flags
fd57f063 121# define SYSTEM5 1 /* include all the System V defines */
39270cfd 122# define HASINITGROUPS 1 /* has initgroups(3) call */
2b09dd75 123# define HASSTATFS 1 /* has the statfs(2) syscall */
39270cfd 124# define HASSETREUID 1 /* has setreuid(2) call */
ba6514e2 125# define setreuid(r, e) setresuid(r, e, -1)
33d59d37
EA
126# define LA_TYPE LA_FLOAT
127# define _PATH_UNIX "/hp-ux"
3911462a 128# undef IDENTPROTO /* TCP/IP implementation is broken */
273562d8
EA
129# endif
130
2b09dd75 131
ba6514e2
EA
132/*
133** IBM AIX 3.x -- actually tested for 3.2.3
134*/
135
a419d027 136# ifdef _AIX3
39270cfd 137# define HASINITGROUPS 1 /* has initgroups(3) call */
485a1ac5
EA
138# define HASSTATFS 1 /* has the statfs(2) syscall */
139# define HASUNAME 1 /* use System V uname(2) system call */
9114f86c 140# define FORK fork /* no vfork primitive available */
3077a686 141# undef SETPROCTITLE /* setproctitle confuses AIX */
8e5c6745
EA
142# endif
143
2b09dd75 144
ba6514e2
EA
145/*
146** Silicon Graphics IRIX
147**
0fc3fb21 148** Compiles on 4.0.1.
ba6514e2
EA
149*/
150
8e5c6745 151# ifdef IRIX
192b13aa 152# include <sys/sysmacros.h>
39270cfd
EA
153# define HASSETREUID 1 /* has setreuid(2) call */
154# define HASINITGROUPS 1 /* has initgroups(3) call */
2b09dd75 155# define HASSTATFS 1 /* has the statfs(2) syscall */
8e5c6745 156# define FORK fork /* no vfork primitive available */
1c8c1ad2 157# define WAITUNION 1 /* use "union wait" as wait argument type */
0d2faefc 158# define setpgid BSDsetpgrp
e6cb9fc4 159# define GIDSET_T gid_t
9114f86c
EA
160# endif
161
ba6514e2
EA
162
163/*
8988dfd3
EA
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).
ba6514e2
EA
168*/
169
45f49b73 170#if defined(sun) && !defined(BSD)
fd57f063 171
33d59d37 172# define LA_TYPE LA_INT
39270cfd
EA
173# define HASSETREUID 1 /* has setreuid(2) call */
174# define HASINITGROUPS 1 /* has initgroups(3) call */
8988dfd3 175# define HASUNAME 1 /* use System V uname(2) system call */
45f49b73 176
d4125001
EA
177# ifdef SOLARIS_2_3
178# define SOLARIS
179# endif
180
7b3820ed 181# ifdef SOLARIS
ba6514e2 182 /* Solaris 2.x (a.k.a. SunOS 5.x) */
b4cd00ff 183# define SYSTEM5 1 /* use System V definitions */
0c31d7be 184# define setreuid(r, e) seteuid(e)
fd57f063 185# include <sys/time.h>
6f884c69
EA
186# define gethostbyname solaris_gethostbyname /* get working version */
187# define gethostbyaddr solaris_gethostbyaddr /* get working version */
33d59d37
EA
188# define _PATH_UNIX "/kernel/unix"
189# ifndef _PATH_SENDMAILCF
190# define _PATH_SENDMAILCF "/etc/mail/sendmail.cf"
0f786d57 191# endif
0f786d57 192# ifndef _PATH_SENDMAILPID
33d59d37
EA
193# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
194# endif
fd57f063 195
7b3820ed 196# else
fd57f063 197 /* SunOS 4.1.x */
7b3820ed 198# define HASSTATFS 1 /* has the statfs(2) syscall */
9c08c09b 199# define HASFLOCK 1 /* has flock(2) call */
45f49b73 200# include <vfork.h>
45f49b73 201
fd57f063 202# endif
45f49b73
EA
203#endif
204
fe3849ea 205/*
8988dfd3
EA
206** DG/UX
207**
208** Tested on 5.4.2
fe3849ea
EA
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 */
fe3849ea
EA
219# undef IDENTPROTO /* TCP/IP implementation is broken */
220# undef SETPROCTITLE
8988dfd3
EA
221
222/* these include files must be included early on DG/UX */
223# include <netinet/in.h>
224# include <arpa/inet.h>
225
fe3849ea
EA
226# define inet_addr dgux_inet_addr
227extern long dgux_inet_addr();
228#endif
229
2b09dd75 230
ba6514e2
EA
231/*
232** Digital Ultrix 4.2A or 4.3
9cea9407
EA
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.
ba6514e2
EA
237*/
238
45f49b73
EA
239#ifdef ultrix
240# define HASSTATFS 1 /* has the statfs(2) syscall */
39270cfd 241# define HASSETREUID 1 /* has setreuid(2) call */
33d59d37 242# define HASUNSETENV 1 /* has unsetenv(3) call */
39270cfd 243# define HASINITGROUPS 1 /* has initgroups(3) call */
9cea9407 244# define HASFLOCK 1 /* has flock(2) call */
33d59d37
EA
245# define LA_TYPE LA_INT
246# define LA_AVENRUN "avenrun"
3911462a 247# undef IDENTPROTO /* TCP/IP implementation is broken */
e6245c7e
EA
248#endif
249
2b09dd75 250
ba6514e2
EA
251/*
252** OSF/1 (tested on Alpha)
253*/
254
fd57f063 255#ifdef __osf__
2b09dd75 256# define HASSTATFS 1 /* has the statfs(2) syscall */
33d59d37 257# define HASUNSETENV 1 /* has unsetenv(3) call */
39270cfd
EA
258# define HASSETREUID 1 /* has setreuid(2) call */
259# define HASINITGROUPS 1 /* has initgroups(3) call */
9c08c09b 260# define HASFLOCK 1 /* has flock(2) call */
33d59d37 261# define LA_TYPE LA_INT
8988dfd3
EA
262# ifndef _PATH_SENDMAILPID
263# define _PATH_SENDMAILPID "/var/run/sendmial.pid"
264# endif
6070681d
EA
265#endif
266
2b09dd75 267
ba6514e2
EA
268/*
269** NeXTstep
270*/
271
fbfeb92c 272#ifdef NeXT
39270cfd
EA
273# define HASINITGROUPS 1 /* has initgroups(3) call */
274# define HASFLOCK 1 /* has flock(2) call */
9cb009c2 275# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
2b09dd75 276# define HASSTATFS 1 /* has the statfs(2) syscall */
693a756a 277# define WAITUNION 1 /* use "union wait" as wait argument type */
8e5c6745 278# define sleep sleepX
0d2faefc 279# define setpgid setpgrp
e60b62fd
EA
280# ifndef LA_TYPE
281# define LA_TYPE LA_MACH
282# endif
0349f8cc 283# ifndef _POSIX_SOURCE
39270cfd 284typedef int pid_t;
0349f8cc
EA
285# undef WEXITSTATUS
286# undef WIFEXITED
287# endif
0f786d57
EA
288# ifndef _PATH_SENDMAILCF
289# define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf"
290# endif
0f786d57
EA
291# ifndef _PATH_SENDMAILPID
292# define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid"
293# endif
8c5949d2
EA
294#endif
295
2b09dd75 296
ba6514e2 297/*
33d59d37 298** 4.4 BSD
9c08c09b
EA
299**
300** See also BSD defines.
ba6514e2
EA
301*/
302
ed0b2c1b 303#ifdef BSD4_4
0f786d57 304# define HASUNSETENV 1 /* has unsetenv(3) call */
2b09dd75 305# define HASSTATFS 1 /* has the statfs(2) syscall */
ed0b2c1b 306# include <sys/cdefs.h>
7621e399 307# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
0f786d57
EA
308# ifndef LA_TYPE
309# define LA_TYPE LA_SUBR
310# endif
7621e399
EA
311#endif
312
2b09dd75 313
db82ecce
EA
314/*
315** 386BSD / FreeBSD 1.0E (works) / NetBSD (not tested)
316**
317** 4.3BSD clone, closer to 4.4BSD
9c08c09b
EA
318**
319** See also BSD defines.
db82ecce
EA
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
8988dfd3
EA
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
c6bd47b4 352# undef HASSETVBUF /* don't actually have setvbuf(3) */
8988dfd3
EA
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
35f1f39e
EA
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) */
0639fd0c 374# define ARBPTR_T char *
0d2faefc 375# define setpgid setpgrp
35f1f39e
EA
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
3911462a 382# undef IDENTPROTO /* TCP/IP implementation is broken */
ac3f694f
EA
383# undef WEXITSTATUS
384# undef WIFEXITED
385typedef short pid_t;
386extern int errno;
35f1f39e
EA
387#endif
388
2b09dd75 389
ba6514e2
EA
390/*
391** SCO Unix
392*/
393
7621e399
EA
394#ifdef _SCO_unix_
395# define SYSTEM5 1 /* include all the System V defines */
39270cfd 396# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
0efc4574 397# define HASSTATFS 1 /* has the statfs(2) syscall */
7621e399
EA
398# define FORK fork
399# define MAXPATHLEN PATHSIZE
fe3849ea 400# define LA_TYPE LA_SHORT
8988dfd3 401# undef NETUNIX /* no unix domain socket support */
33d59d37
EA
402#endif
403
2b09dd75 404
33d59d37
EA
405/*
406** ConvexOS 11.0 and later
407*/
408
409#ifdef _CONVEX_SOURCE
0c31d7be
EA
410# define BSD 1 /* include all the BSD defines */
411# define HASUNAME 1 /* use System V uname(2) system call */
33d59d37
EA
412# define HASSTATFS 1 /* has the statfs(2) syscall */
413# define HASSETSID 1 /* has POSIX setsid(2) call */
0c31d7be 414# define NEEDGETOPT 1 /* need replacement for getopt(3) */
33d59d37 415# define LA_TYPE LA_FLOAT
c19e43df 416# undef IDENTPROTO
33d59d37
EA
417#endif
418
2b09dd75 419
33d59d37 420/*
fa323968 421** RISC/os 4.52
33d59d37 422**
fa323968 423** Gives a ton of warning messages, but otherwise compiles.
33d59d37
EA
424*/
425
0fc3fb21 426#ifdef RISCOS
fa323968 427
33d59d37 428# define HASUNSETENV 1 /* has unsetenv(3) call */
9c08c09b 429# define HASFLOCK 1 /* has flock(2) call */
fa323968
EA
430# define WAITUNION 1 /* use "union wait" as wait argument type */
431# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
33d59d37
EA
432# define LA_TYPE LA_INT
433# define LA_AVENRUN "avenrun"
434# define _PATH_UNIX "/unix"
fa323968
EA
435# undef WIFEXITED
436
437# define setpgid setpgrp
438
439extern int errno;
440typedef int pid_t;
441#define SIGFUNC_DEFINED
442typedef int (*sigfunc_t)();
443extern char *getenv();
444extern void *malloc();
445
ed0b2c1b
EA
446#endif
447
2b09dd75 448
0d2faefc
EA
449/*
450** Linux 0.99pl10 and above...
451** From Karl London <karl@borg.demon.co.uk>.
452*/
453
404f4d13 454#ifdef __linux__
0d2faefc
EA
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) */
c2edb205 458# define HASUNSETENV 1 /* has unsetenv(3) call */
0d2faefc
EA
459# ifndef LA_TYPE
460# define LA_TYPE LA_FLOAT
461# endif
72ef208d 462# include <sys/sysmacros.h>
0d2faefc
EA
463#endif
464
465
178464cb
EA
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.
69bed929
EA
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).
178464cb
EA
476*/
477
478#ifdef DELL_SVR4
479# define SYSTEM5 1
69bed929
EA
480# define HASSETREUID 1 /* has seteuid(2) call & working saved uids */
481# define setreuid(r, e) seteuid(e)
178464cb
EA
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
c2edb205
EA
493/*
494** Apple A/UX 3.0
495*/
496
497#ifdef _AUX_SOURCE
25a722b1 498# include <sys/sysmacros.h>
c2edb205
EA
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 */
53335960 504# define SIGFUNC_DEFINED /* sigfunc_t already defined */
fe3849ea 505# undef IDENTPROTO /* TCP/IP implementation is broken */
c2edb205
EA
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
96e003d2
EA
513# undef WIFEXITED
514# undef WEXITSTATUS
c2edb205
EA
515#endif
516
517
82530719
EA
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
534extern struct passwd *getpwent(), *getpwnam(), *getpwuid();
535extern struct group *getgrent(), *getgrnam(), *getgrgid();
536# undef WIFEXITED
537# undef WEXITSTATUS
538#endif
539
540
31c3ae15
EA
541/*
542** Stardent Titan 3000 running TitanOS 4.2.
543**
544** Must be compiled in "cc -43" mode.
545**
fce21cb9 546** From Kate Hedstrom <kate@ahab.rutgers.edu>.
31c3ae15
EA
547**
548** Note the tweaking below after the BSD defines are set.
549*/
550
551#ifdef titan
552# define setpgid setpgrp
553typedef int pid_t;
554# undef WIFEXITED
555# undef WEXITSTATUS
556#endif
557
558
c6bd47b4
EA
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)
582typedef 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
178464cb 596
ba6514e2 597/**********************************************************************
fd57f063 598** End of Per-Operating System defines
ba6514e2 599**********************************************************************/
fd57f063 600
b4cd00ff
EA
601/**********************************************************************
602** More general defines
603**********************************************************************/
604
33d59d37
EA
605/* general BSD defines */
606#ifdef BSD
39270cfd
EA
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 */
33d59d37
EA
611#endif
612
fd57f063
EA
613/* general System V defines */
614# ifdef SYSTEM5
8988dfd3 615# include <sys/sysmacros.h>
b4cd00ff
EA
616# define HASUNAME 1 /* use System V uname(2) system call */
617# define HASUSTAT 1 /* use System V ustat(2) syscall */
82530719 618# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
c6bd47b4 619# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
33d59d37
EA
620# ifndef LA_TYPE
621# define LA_TYPE LA_INT
622# endif
b4cd00ff
EA
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)))
fd57f063
EA
626# endif
627
b4cd00ff
EA
628/* general POSIX defines */
629#ifdef _POSIX_VERSION
fe3849ea
EA
630# define HASSETSID 1 /* has Posix setsid(2) call */
631# define HASWAITPID 1 /* has Posix waitpid(2) call */
b4cd00ff
EA
632#endif
633
e6cb9fc4
EA
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
31c3ae15
EA
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
2295903c
EA
653
654/**********************************************************************
e6245c7e
EA
655** Remaining definitions should never have to be changed. They are
656** primarily to provide back compatibility for older systems -- for
6070681d 657** example, it includes some POSIX compatibility definitions
2295903c 658**********************************************************************/
e6245c7e 659
bd3dddbf
EA
660/* System 5 compatibility */
661#ifndef S_ISREG
fce21cb9
EA
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)
bd3dddbf
EA
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
030ae776
EA
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
5229f34d 682
fe3849ea
EA
683/* pseudo-code used in server SMTP */
684# define EX_QUIT 22 /* drop out of server immediately */
685
686
92f2b65e
EA
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
0639fd0c
EA
700/* type of arbitrary pointer */
701#ifndef ARBPTR_T
702# define ARBPTR_T void *
703#endif
704
ed0b2c1b
EA
705#ifndef __P
706# include "cdefs.h"
707#endif
708
3356c77c
EA
709/*
710** Do some required dependencies
711*/
712
713#if defined(NETINET) || defined(NETISO)
e9aa7870
EA
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) */
3356c77c
EA
717#endif
718
719
5229f34d
EA
720/*
721** Arrange to use either varargs or stdargs
722*/
723
724# ifdef __STDC__
725
726# include <stdarg.h>
727
5229f34d
EA
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
5229f34d
EA
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
422bed79 741
322eceee 742#ifdef HASUNAME
422bed79
EA
743# include <sys/utsname.h>
744# ifdef newstr
745# undef newstr
746# endif
322eceee 747#else /* ! HASUNAME */
422bed79
EA
748# define NODE_LENGTH 32
749struct utsname
750{
751 char nodename[NODE_LENGTH+1];
752};
322eceee 753#endif /* HASUNAME */
6e99f903 754
7621e399
EA
755#if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
756# define MAXHOSTNAMELEN 256
8d3fd325 757#endif
49c069a9
EA
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
f8a31c8e 774
0f786d57 775#ifndef LOCK_SH
39270cfd
EA
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
64247676 781
39270cfd
EA
782#ifndef SIG_ERR
783# define SIG_ERR ((void (*)()) -1)
f8a31c8e 784#endif
a3685d83 785
0349f8cc
EA
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
53335960
EA
793#ifndef SIGFUNC_DEFINED
794typedef void (*sigfunc_t) __P((int));
795#endif
796
a3685d83
EA
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
9114f86c 806
77779257
EA
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 */
9114f86c
EA
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
cb81a6a2
EA
818
819#ifndef IDENTPROTO
820# define IDENTPROTO 0 /* don't use RFC 1413 */
821#endif