update copyright notice
[unix-history] / usr / src / usr.sbin / sendmail / src / conf.h
CommitLineData
5a739feb 1/*
792e6158 2 * Copyright (c) 1983, 1995 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 *
792e6158 8 * @(#)conf.h 8.151 (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>
5b7a2dfe
EA
22# include <netdb.h>
23# include <pwd.h>
f43b04ce 24
ba6514e2 25/**********************************************************************
5a739feb
EA
26** Table sizes, etc....
27** There shouldn't be much need to change these....
ba6514e2 28**********************************************************************/
5a739feb 29
d36f8e5c 30# define MAXLINE 2048 /* max line length */
f0a960f1 31# define MAXNAME 256 /* max length of a name */
5a739feb 32# define MAXPV 40 /* max # of parms to mailers */
d36f8e5c 33# define MAXATOM 200 /* max atoms per address */
5a739feb 34# define MAXMAILERS 25 /* maximum mailers known to system */
91e25a39 35# define MAXRWSETS 200 /* max # of sets of rewriting rules */
5a739feb 36# define MAXPRIORITIES 25 /* max values for Precedence: field */
8583ab39 37# define MAXMXHOSTS 20 /* max # of MX records */
8657d05f 38# define SMTPLINELIM 990 /* maximum SMTP line length */
f43b04ce
EA
39# define MAXKEY 128 /* maximum size of a database key */
40# define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */
b0b636d1 41# define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */
9f7134c8 42# define MAXALIASDB 12 /* max # of alias databases */
3b2e4211
EA
43# define MAXMAPSTACK 12 /* max # of stacked or sequenced maps */
44# define MAXTOCLASS 8 /* max # of message timeout classes */
022362dd
EA
45# define MAXMIMEARGS 20 /* max args in Content-Type: */
46# define MAXMIMENESTING 20 /* max MIME multipart nesting */
8583ab39
EA
47
48# ifndef QUEUESIZE
49# define QUEUESIZE 1000 /* max # of jobs per queue run */
50# endif
51
ba6514e2 52/**********************************************************************
5a739feb 53** Compilation options.
9bcdff70
EA
54**
55** #define these if they are available; comment them out otherwise.
ba6514e2 56**********************************************************************/
5a739feb 57
9bcdff70 58# define LOG 1 /* enable logging */
9bcdff70 59# define UGLYUUCP 1 /* output ugly UUCP From lines */
8988dfd3 60# define NETUNIX 1 /* include unix domain support */
3356c77c 61# define NETINET 1 /* include internet support */
7f0fd60b 62# define MATCHGECOS 1 /* match user names from gecos field */
8e5c6745 63# define XDEBUG 1 /* enable extended debugging */
f09505ac
EA
64# if (defined(NEWDB) || defined(HESIOD)) && !defined(USERDB)
65# define USERDB 1 /* look in user database */
5a4c03c6
EA
66# endif
67
efe7f723
EA
68/**********************************************************************
69** 0/1 Compilation options.
70** #define these to 1 if they are available;
71** #define them to 0 otherwise.
72**********************************************************************/
73
74# ifndef NAMED_BIND
75# define NAMED_BIND 1 /* use Berkeley Internet Domain Server */
76# endif
77
fce21cb9
EA
78/*
79** Most systems have symbolic links today, so default them on. You
80** can turn them off by #undef'ing this below.
81*/
82
83# define HASLSTAT 1 /* has lstat(2) call */
84
c6bd47b4
EA
85/*
86** General "standard C" defines.
87**
88** These may be undone later, to cope with systems that claim to
89** be Standard C but aren't. Gcc is the biggest offender -- it
90** doesn't realize that the library is part of the language.
91**
92** Life would be much easier if we could get rid of this sort
93** of bozo problems.
94*/
95
96#ifdef __STDC__
97# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
98#endif
99
ba6514e2 100/**********************************************************************
e6245c7e
EA
101** Operating system configuration.
102**
103** Unless you are porting to a new OS, you shouldn't have to
104** change these.
ba6514e2 105**********************************************************************/
5a4c03c6 106
fd57f063
EA
107/*
108** Per-Operating System defines
109*/
110
2b09dd75 111
ba6514e2 112/*
27a00e24 113** HP-UX -- tested for 8.07, 9.00, and 9.01.
ba6514e2
EA
114*/
115
2e4c6b4f 116#ifdef __hpux
192b13aa
EA
117/* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
118# undef m_flags
fd57f063 119# define SYSTEM5 1 /* include all the System V defines */
39270cfd
EA
120# define HASINITGROUPS 1 /* has initgroups(3) call */
121# define HASSETREUID 1 /* has setreuid(2) call */
e7261663 122# define setreuid(r, e) setresuid(r, e, -1)
f1f79a58 123# define LA_TYPE LA_SUBR
5e0e0f8f 124# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
60e52ca7 125# define GIDSET_T gid_t
33d59d37 126# define _PATH_UNIX "/hp-ux"
60e52ca7
EA
127# ifndef _PATH_SENDMAILCF
128# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
129# endif
a74fd615
EA
130# ifndef IDENTPROTO
131# define IDENTPROTO 0 /* TCP/IP implementation is broken */
132# endif
0379c130
EA
133# ifndef HASGETUSERSHELL
134# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
135# endif
fc658fc9 136# define syslog hard_syslog
0379c130
EA
137# ifdef __STDC__
138extern int syslog(int, char *, ...);
139# endif
2e4c6b4f 140#endif
273562d8 141
2b09dd75 142
ba6514e2
EA
143/*
144** IBM AIX 3.x -- actually tested for 3.2.3
145*/
146
2e4c6b4f 147#ifdef _AIX3
39270cfd 148# define HASINITGROUPS 1 /* has initgroups(3) call */
485a1ac5 149# define HASUNAME 1 /* use System V uname(2) system call */
1ee33f7d 150# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
9114f86c 151# define FORK fork /* no vfork primitive available */
5e0e0f8f 152# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
ddeafa3b 153# define SPT_PADCHAR '\0' /* pad process title with nulls */
263da570 154# define LA_TYPE LA_INT
2e4c6b4f 155#endif
8e5c6745 156
2b09dd75 157
ba6514e2
EA
158/*
159** Silicon Graphics IRIX
160**
0fc3fb21 161** Compiles on 4.0.1.
10589f62 162**
94faee41
EA
163** Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
164** Use IRIX5 instead of IRIX for IRIX 5.x.
10589f62
EA
165**
166** IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
94faee41 167** IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
ba6514e2
EA
168*/
169
94faee41 170#if defined(IRIX64) || defined(IRIX5)
10589f62
EA
171# define IRIX
172#endif
173
2e4c6b4f 174#ifdef IRIX
f369a70b 175# define SYSTEM5 1 /* this is a System-V derived system */
39270cfd
EA
176# define HASSETREUID 1 /* has setreuid(2) call */
177# define HASINITGROUPS 1 /* has initgroups(3) call */
1ee33f7d 178# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
8e5c6745 179# define FORK fork /* no vfork primitive available */
94faee41 180# if !defined(IRIX64) && !defined(IRIX5)
162edce0
EA
181# define WAITUNION 1 /* use "union wait" as wait argument type */
182# endif
0d2faefc 183# define setpgid BSDsetpgrp
e6cb9fc4 184# define GIDSET_T gid_t
782a2f97 185# define ARGV_T const char **
5e0e0f8f 186# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
b2b48b69 187# define SFS_BAVAIL f_bfree /* alternate field name */
f369a70b 188# define LA_TYPE LA_INT
10589f62
EA
189# ifdef IRIX64
190# define NAMELISTMASK 0x7fffffffffffffff /* mask for nlist() values */
191# else
192# define NAMELISTMASK 0x7fffffff /* mask for nlist() values */
193# endif
2e4c6b4f 194#endif
9114f86c 195
ba6514e2
EA
196
197/*
8988dfd3
EA
198** SunOS and Solaris
199**
200** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
201** Solaris 2.2 (a.k.a. SunOS 5.2).
ba6514e2
EA
202*/
203
45f49b73 204#if defined(sun) && !defined(BSD)
fd57f063 205
39270cfd 206# define HASINITGROUPS 1 /* has initgroups(3) call */
8988dfd3 207# define HASUNAME 1 /* use System V uname(2) system call */
1ee33f7d 208# define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */
5e0e0f8f 209# define LA_TYPE LA_INT
45f49b73 210
d4125001 211# ifdef SOLARIS_2_3
67439414 212# define SOLARIS 203 /* for back compat only -- use -DSOLARIS=203 */
d4125001
EA
213# endif
214
7b3820ed 215# ifdef SOLARIS
ba6514e2 216 /* Solaris 2.x (a.k.a. SunOS 5.x) */
0554a095
EA
217# ifndef __svr4__
218# define __svr4__ /* use all System V Releae 4 defines below */
219# endif
fd57f063 220# include <sys/time.h>
d7a2e485 221# define GIDSET_T gid_t
f361504a 222# ifndef _PATH_UNIX
1960c7b8 223# define _PATH_UNIX "/dev/ksyms"
f361504a 224# endif
33d59d37
EA
225# ifndef _PATH_SENDMAILCF
226# define _PATH_SENDMAILCF "/etc/mail/sendmail.cf"
0f786d57 227# endif
0f786d57 228# ifndef _PATH_SENDMAILPID
33d59d37
EA
229# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
230# endif
71aecf7c
EA
231# ifndef SYSLOG_BUFSIZE
232# define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */
233# endif
fd57f063 234
7b3820ed 235# else
e9abaf1a 236 /* SunOS 4.0.3 or 4.1.x */
f361504a 237# define HASSETREUID 1 /* has setreuid(2) call */
72af7ebb
EA
238# ifndef HASFLOCK
239# define HASFLOCK 1 /* has flock(2) call */
240# endif
5e0e0f8f 241# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
45f49b73 242# include <vfork.h>
45f49b73 243
e9abaf1a
EA
244# ifdef SUNOS403
245 /* special tweaking for SunOS 4.0.3 */
246# include <malloc.h>
247# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
248# define WAITUNION 1 /* use "union wait" as wait argument type */
249# undef WIFEXITED
250# undef WEXITSTATUS
251# undef HASUNAME
252# define setpgid setpgrp
253typedef int pid_t;
254extern char *getenv();
255
d0812b5a
EA
256# else
257 /* 4.1.x specifics */
258# define HASSETSID 1 /* has Posix setsid(2) call */
259# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
260
e9abaf1a 261# endif
fd57f063 262# endif
45f49b73
EA
263#endif
264
fe3849ea 265/*
8988dfd3
EA
266** DG/UX
267**
810a6265
EA
268** Tested on 5.4.2 and 5.4.3. Use DGUX_5_4_2 to get the
269** older support.
270** 5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
fe3849ea
EA
271*/
272
810a6265
EA
273#ifdef DGUX_5_4_2
274# define DGUX 1
275#endif
276
fe3849ea
EA
277#ifdef DGUX
278# define SYSTEM5 1
279# define LA_TYPE LA_SUBR
fe3849ea
EA
280# define HASSETREUID 1 /* has setreuid(2) call */
281# define HASUNAME 1 /* use System V uname(2) system call */
282# define HASSETSID 1 /* has Posix setsid(2) call */
283# define HASINITGROUPS 1 /* has initgroups(3) call */
e1ab99fe 284# define HASGETUSERSHELL 0 /* does not have getusershell(3) */
a74fd615
EA
285# ifndef IDENTPROTO
286# define IDENTPROTO 0 /* TCP/IP implementation is broken */
287# endif
ddeafa3b 288# define SPT_TYPE SPT_NONE /* don't use setproctitle */
5e0e0f8f 289# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
8988dfd3
EA
290
291/* these include files must be included early on DG/UX */
292# include <netinet/in.h>
293# include <arpa/inet.h>
294
810a6265
EA
295# ifdef DGUX_5_4_2
296# define inet_addr dgux_inet_addr
fe3849ea 297extern long dgux_inet_addr();
810a6265 298# endif
fe3849ea
EA
299#endif
300
2b09dd75 301
ba6514e2
EA
302/*
303** Digital Ultrix 4.2A or 4.3
9cea9407
EA
304**
305** Apparently, fcntl locking is broken on 4.2A, in that locks are
306** not dropped when the process exits. This causes major problems,
307** so flock is the only alternative.
ba6514e2
EA
308*/
309
45f49b73 310#ifdef ultrix
39270cfd 311# define HASSETREUID 1 /* has setreuid(2) call */
33d59d37 312# define HASUNSETENV 1 /* has unsetenv(3) call */
39270cfd 313# define HASINITGROUPS 1 /* has initgroups(3) call */
b1839a64 314# define HASUNAME 1 /* use System V uname(2) system call */
72af7ebb
EA
315# ifndef HASFLOCK
316# define HASFLOCK 1 /* has flock(2) call */
317# endif
1ee33f7d 318# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
a3815d39 319# define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */
0dbb4629
EA
320# ifdef vax
321# define LA_TYPE LA_FLOAT
322# else
323# define LA_TYPE LA_INT
324# define LA_AVENRUN "avenrun"
325# endif
5e0e0f8f 326# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
a74fd615
EA
327# ifndef IDENTPROTO
328# define IDENTPROTO 0 /* TCP/IP implementation is broken */
329# endif
e6245c7e
EA
330#endif
331
2b09dd75 332
6068a621
EA
333/*
334** OSF/1 for Intel Paragon.
335**
d4895973
EA
336** Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
337** of Intel Scalable Systems Divison.
6068a621
EA
338*/
339
340#ifdef __PARAGON__
341# define __osf__ 1 /* get OSF/1 defines below */
342# ifndef _PATH_SENDMAILCF
343# define _PATH_SENDMAILCF "/var/adm/sendmail/sendmail.cf"
344# endif
345#endif
346
347
ba6514e2
EA
348/*
349** OSF/1 (tested on Alpha)
350*/
351
fd57f063 352#ifdef __osf__
33d59d37 353# define HASUNSETENV 1 /* has unsetenv(3) call */
39270cfd
EA
354# define HASSETREUID 1 /* has setreuid(2) call */
355# define HASINITGROUPS 1 /* has initgroups(3) call */
534256ae 356# ifndef HASFLOCK
72af7ebb
EA
357# define HASFLOCK 1 /* has flock(2) call */
358# endif
33d59d37 359# define LA_TYPE LA_INT
5e0e0f8f 360# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
8988dfd3 361# ifndef _PATH_SENDMAILPID
fc658fc9 362# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
8988dfd3 363# endif
6070681d
EA
364#endif
365
2b09dd75 366
ba6514e2
EA
367/*
368** NeXTstep
369*/
370
fbfeb92c 371#ifdef NeXT
39270cfd 372# define HASINITGROUPS 1 /* has initgroups(3) call */
72af7ebb
EA
373# ifndef HASFLOCK
374# define HASFLOCK 1 /* has flock(2) call */
375# endif
9cb009c2 376# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
693a756a 377# define WAITUNION 1 /* use "union wait" as wait argument type */
782a2f97 378# define UID_T int /* compiler gripes on uid_t */
8e5c6745 379# define sleep sleepX
0d2faefc 380# define setpgid setpgrp
e60b62fd
EA
381# ifndef LA_TYPE
382# define LA_TYPE LA_MACH
383# endif
5e0e0f8f 384# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
0349f8cc 385# ifndef _POSIX_SOURCE
39270cfd 386typedef int pid_t;
0349f8cc
EA
387# undef WEXITSTATUS
388# undef WIFEXITED
389# endif
0f786d57
EA
390# ifndef _PATH_SENDMAILCF
391# define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf"
392# endif
0f786d57
EA
393# ifndef _PATH_SENDMAILPID
394# define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid"
395# endif
8c5949d2
EA
396#endif
397
2b09dd75 398
ba6514e2 399/*
33d59d37 400** 4.4 BSD
9c08c09b
EA
401**
402** See also BSD defines.
ba6514e2
EA
403*/
404
ed0b2c1b 405#ifdef BSD4_4
0f786d57 406# define HASUNSETENV 1 /* has unsetenv(3) call */
ed0b2c1b 407# include <sys/cdefs.h>
7621e399 408# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
0f786d57
EA
409# ifndef LA_TYPE
410# define LA_TYPE LA_SUBR
411# endif
5e0e0f8f 412# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
ddeafa3b 413# define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */
7621e399
EA
414#endif
415
2b09dd75 416
e7261663
EA
417/*
418** BSD/386 (all versions)
419** From Tony Sanders, BSDI
420*/
421
422#ifdef __bsdi__
423# define HASUNSETENV 1 /* has the unsetenv(3) call */
424# define HASSETSID 1 /* has the setsid(2) POSIX syscall */
e7261663
EA
425# include <sys/cdefs.h>
426# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
11c14c72 427# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
e7261663
EA
428# ifndef LA_TYPE
429# define LA_TYPE LA_SUBR
430# endif
c291e9af 431# define GIDSET_T gid_t
11c14c72
EA
432# if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
433 /* version 1.1 or later */
ddeafa3b
EA
434# undef SPT_TYPE
435# define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
11c14c72
EA
436# else
437 /* version 1.0 or earlier */
438# ifndef OLD_NEWDB
439# define OLD_NEWDB 1 /* old version of newdb library */
440# endif
ddeafa3b 441# define SPT_PADCHAR '\0' /* pad process title with nulls */
11c14c72 442# endif
e7261663
EA
443#endif
444
445
446
db82ecce 447/*
766f059d 448** 386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
db82ecce
EA
449**
450** 4.3BSD clone, closer to 4.4BSD
9c08c09b
EA
451**
452** See also BSD defines.
db82ecce
EA
453*/
454
766f059d 455#if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
db82ecce
EA
456# define HASUNSETENV 1 /* has unsetenv(3) call */
457# define HASSETSID 1 /* has the setsid(2) POSIX syscall */
1411dc64
EA
458# ifdef __NetBSD__
459# define HASUNAME 1 /* has uname(2) syscall */
460# endif
db82ecce
EA
461# include <sys/cdefs.h>
462# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
463# ifndef LA_TYPE
464# define LA_TYPE LA_SUBR
465# endif
5e0e0f8f 466# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
db82ecce
EA
467#endif
468
469
8988dfd3
EA
470/*
471** Mach386
472**
473** For mt Xinu's Mach386 system.
474*/
475
476#if defined(MACH) && defined(i386)
477# define MACH386 1
478# define HASUNSETENV 1 /* has unsetenv(3) call */
479# define HASINITGROUPS 1 /* has initgroups(3) call */
534256ae 480# ifndef HASFLOCK
72af7ebb
EA
481# define HASFLOCK 1 /* has flock(2) call */
482# endif
8988dfd3
EA
483# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
484# define NEEDSTRTOL 1 /* need the strtol() function */
485# define setpgid setpgrp
486# ifndef LA_TYPE
487# define LA_TYPE LA_FLOAT
488# endif
5e0e0f8f 489# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
c6bd47b4 490# undef HASSETVBUF /* don't actually have setvbuf(3) */
8988dfd3
EA
491# undef WEXITSTATUS
492# undef WIFEXITED
493# ifndef _PATH_SENDMAILCF
494# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
495# endif
496# ifndef _PATH_SENDMAILPID
497# define _PATH_SENDMAILPID "/etc/sendmail.pid"
498# endif
499#endif
500
501
35f1f39e
EA
502/*
503** 4.3 BSD -- this is for very old systems
504**
f0bb212b
EA
505** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
506**
35f1f39e
EA
507** You'll also have to install a new resolver library.
508** I don't guarantee that support for this environment is complete.
509*/
510
f0bb212b 511#if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
35f1f39e
EA
512# define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
513# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
0639fd0c 514# define ARBPTR_T char *
0d2faefc 515# define setpgid setpgrp
35f1f39e
EA
516# ifndef LA_TYPE
517# define LA_TYPE LA_FLOAT
518# endif
519# ifndef _PATH_SENDMAILCF
520# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
521# endif
a74fd615
EA
522# ifndef IDENTPROTO
523# define IDENTPROTO 0 /* TCP/IP implementation is broken */
524# endif
ac3f694f
EA
525# undef WEXITSTATUS
526# undef WIFEXITED
527typedef short pid_t;
528extern int errno;
35f1f39e
EA
529#endif
530
2b09dd75 531
ba6514e2
EA
532/*
533** SCO Unix
8e01bd08
EA
534**
535** This includes two parts -- the first is for SCO Open Server 3.2v4
536** (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
537** The second is, I believe, for an older version.
ba6514e2
EA
538*/
539
8e01bd08
EA
540#ifdef _SCO_unix_4_2
541# define _SCO_unix_
542# define HASSETREUID 1 /* has setreuid(2) call */
3f23b98b 543# define NEEDFSYNC 1 /* needs the fsync(2) call stub */
8e01bd08
EA
544# define _PATH_UNIX "/unix"
545# ifndef _PATH_SENDMAILCF
546# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
547# endif
548# ifndef _PATH_SENDMAILPID
549# define _PATH_SENDMAILPID "/etc/sendmail.pid"
550# endif
551#endif
552
7621e399
EA
553#ifdef _SCO_unix_
554# define SYSTEM5 1 /* include all the System V defines */
39270cfd 555# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
175dac04 556# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
7621e399
EA
557# define FORK fork
558# define MAXPATHLEN PATHSIZE
fe3849ea 559# define LA_TYPE LA_SHORT
e8dfcb16 560# define SFS_TYPE SFS_4ARGS /* use <sys/statfs.h> 4-arg impl */
b2b48b69 561# define SFS_BAVAIL f_bfree /* alternate field name */
f7311261 562# define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */
8988dfd3 563# undef NETUNIX /* no unix domain socket support */
33d59d37
EA
564#endif
565
2b09dd75 566
e3a8e3e0
EA
567/*
568** ISC (SunSoft) Unix.
569**
570** Contributed by J.J. Bailey <jjb@jagware.bcc.com>
571*/
572
573#ifdef ISC_UNIX
574# include <net/errno.h>
575# define SYSTEM5 1 /* include all the System V defines */
576# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
577# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
578# define HASSETREUID 1 /* has setreuid(2) call */
579# define NEEDFSYNC 1 /* needs the fsync(2) call stub */
580# undef NETUNIX /* no unix domain socket support */
581# define FORK fork
582# define MAXPATHLEN 1024
583# define LA_TYPE LA_SHORT
584# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
585# define SFS_BAVAIL f_bfree /* alternate field name */
586# define _PATH_UNIX "/unix"
587# ifndef _PATH_SENDMAILCF
588# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
589# endif
590# ifndef _PATH_SENDMAILPID
591# define _PATH_SENDMAILPID "/etc/sendmail.pid"
592# endif
593
594typedef short pid_t;
595
596#endif
597
598
4d645e29
EA
599/*
600** Altos System V.
601** Contributed by Tim Rice <timr@crl.com>.
602*/
603
604#ifdef ALTOS_SYS_V
605# include <limits.h>
606# define SYSTEM5 1 /* include all the System V defines */
607# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
608# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
609# define WAITUNION 1 /* use "union wait" as wait argument type */
610# define NEEDFSYNC 1 /* no fsync(2) in system library */
611# define FORK fork
612# define MAXPATHLEN PATHSIZE
613# define LA_TYPE LA_SHORT
614# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
b2b48b69 615# define SFS_BAVAIL f_bfree /* alternate field name */
4d645e29
EA
616# define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */
617# undef NETUNIX /* no unix domain socket support */
618# undef WIFEXITED
619# undef WEXITSTATUS
620# define strtoul strtol /* gcc library bogosity */
621
622typedef unsigned short uid_t;
623typedef unsigned short gid_t;
624typedef short pid_t;
625#endif
626
627
33d59d37
EA
628/*
629** ConvexOS 11.0 and later
f0bb212b
EA
630**
631** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
632** works on 9.1 as well.
33d59d37
EA
633*/
634
635#ifdef _CONVEX_SOURCE
0c31d7be
EA
636# define BSD 1 /* include all the BSD defines */
637# define HASUNAME 1 /* use System V uname(2) system call */
33d59d37 638# define HASSETSID 1 /* has POSIX setsid(2) call */
0c31d7be 639# define NEEDGETOPT 1 /* need replacement for getopt(3) */
33d59d37 640# define LA_TYPE LA_FLOAT
5e0e0f8f 641# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
f0bb212b
EA
642# ifndef _PATH_SENDMAILCF
643# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
644# endif
645# ifndef S_IREAD
646# define S_IREAD _S_IREAD
647# define S_IWRITE _S_IWRITE
648# define S_IEXEC _S_IEXEC
649# define S_IFMT _S_IFMT
650# define S_IFCHR _S_IFCHR
651# define S_IFBLK _S_IFBLK
652# endif
a74fd615
EA
653# ifndef IDENTPROTO
654# define IDENTPROTO 0 /* TCP/IP implementation is broken */
655# endif
33d59d37
EA
656#endif
657
2b09dd75 658
33d59d37 659/*
fa323968 660** RISC/os 4.52
33d59d37 661**
fa323968 662** Gives a ton of warning messages, but otherwise compiles.
33d59d37
EA
663*/
664
0fc3fb21 665#ifdef RISCOS
fa323968 666
33d59d37 667# define HASUNSETENV 1 /* has unsetenv(3) call */
534256ae 668# ifndef HASFLOCK
72af7ebb
EA
669# define HASFLOCK 1 /* has flock(2) call */
670# endif
fa323968
EA
671# define WAITUNION 1 /* use "union wait" as wait argument type */
672# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
33d59d37
EA
673# define LA_TYPE LA_INT
674# define LA_AVENRUN "avenrun"
675# define _PATH_UNIX "/unix"
fa323968
EA
676# undef WIFEXITED
677
678# define setpgid setpgrp
679
680extern int errno;
681typedef int pid_t;
682#define SIGFUNC_DEFINED
683typedef int (*sigfunc_t)();
684extern char *getenv();
685extern void *malloc();
686
ed0b2c1b
EA
687#endif
688
2b09dd75 689
0d2faefc
EA
690/*
691** Linux 0.99pl10 and above...
a1a01683
EA
692**
693** Thanks to, in reverse order of contact:
694**
695** John Kennedy <warlock@csuchico.edu>
5d944135 696** Andrew Pam <avatar@aus.xanadu.com>
a1a01683
EA
697** Florian La Roche <rzsfl@rz.uni-sb.de>
698** Karl London <karl@borg.demon.co.uk>
699**
5d944135
EA
700** Last compiled against: [12/14/94 @ 11:38:41 PM (Wednesday)]
701** sendmail 8.7.a.5 named 4.9.3-beta12-p1 db-1.85
702** gcc 2.6.2 libc.so.4.6.20
703** slackware 2.1.0 linux 1.1.70
0d2faefc
EA
704*/
705
404f4d13 706#ifdef __linux__
402003b1 707# define BSD 1 /* include BSD defines */
0d2faefc 708# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
402003b1 709# define HASUNAME 1 /* use System V uname(2) system call */
c2edb205 710# define HASUNSETENV 1 /* has unsetenv(3) call */
402003b1 711# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
a1a01683 712# define GIDSET_T gid_t /* from <linux/types.h> */
375679c6 713# define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */
0668ff23
EA
714# ifndef HASFLOCK
715# define HASFLOCK 0 /* flock(2) is broken after 0.99.13 */
716# endif
0d2faefc 717# ifndef LA_TYPE
ff065a83 718# define LA_TYPE LA_PROCSTR
0d2faefc 719# endif
a1a01683 720# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */
5d944135
EA
721# ifndef _PATH_SENDMAILPID
722# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
723# endif
724# define TZ_TYPE TZ_TNAME
72ef208d 725# include <sys/sysmacros.h>
a1a01683 726# undef atol /* wounded in <stdlib.h> */
0d2faefc
EA
727#endif
728
729
178464cb
EA
730/*
731** DELL SVR4 Issue 2.2, and others
732** From Kimmo Suominen <kim@grendel.lut.fi>
733**
734** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
735** defined, and the definitions conflict.
69bed929
EA
736**
737** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
738** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
739** (SVR4.0/386 version 3.0).
178464cb
EA
740*/
741
742#ifdef DELL_SVR4
f361504a
EA
743 /* no changes necessary */
744 /* see general __svr4__ defines below */
178464cb
EA
745#endif
746
747
c2edb205
EA
748/*
749** Apple A/UX 3.0
750*/
751
752#ifdef _AUX_SOURCE
25a722b1 753# include <sys/sysmacros.h>
c2edb205 754# define BSD /* has BSD routines */
02e07c7e 755# define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */
c2edb205 756# define HASUNAME 1 /* use System V uname(2) system call */
c2edb205 757# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
53335960 758# define SIGFUNC_DEFINED /* sigfunc_t already defined */
a74fd615
EA
759# ifndef IDENTPROTO
760# define IDENTPROTO 0 /* TCP/IP implementation is broken */
761# endif
c2edb205
EA
762# define FORK fork
763# ifndef _PATH_SENDMAILCF
764# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
765# endif
766# ifndef LA_TYPE
767# define LA_TYPE LA_ZERO
768# endif
5e0e0f8f 769# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
96e003d2
EA
770# undef WIFEXITED
771# undef WEXITSTATUS
c2edb205
EA
772#endif
773
774
82530719
EA
775/*
776** Encore UMAX V
777**
778** Not extensively tested.
779*/
780
781#ifdef UMAXV
782# include <limits.h>
783# define HASUNAME 1 /* use System V uname(2) system call */
82530719
EA
784# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
785# define HASINITGROUPS 1 /* has initgroups(3) call */
1ee33f7d 786# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
82530719
EA
787# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
788# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
789# define FORK fork /* no vfork(2) primitive available */
5e0e0f8f 790# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
82530719
EA
791# define MAXPATHLEN PATH_MAX
792extern struct passwd *getpwent(), *getpwnam(), *getpwuid();
793extern struct group *getgrent(), *getgrnam(), *getgrgid();
794# undef WIFEXITED
795# undef WEXITSTATUS
796#endif
797
798
31c3ae15
EA
799/*
800** Stardent Titan 3000 running TitanOS 4.2.
801**
802** Must be compiled in "cc -43" mode.
803**
fce21cb9 804** From Kate Hedstrom <kate@ahab.rutgers.edu>.
31c3ae15
EA
805**
806** Note the tweaking below after the BSD defines are set.
807*/
808
809#ifdef titan
810# define setpgid setpgrp
811typedef int pid_t;
812# undef WIFEXITED
813# undef WEXITSTATUS
814#endif
815
816
c6bd47b4
EA
817/*
818** Sequent DYNIX 3.2.0
819**
820** From Jim Davis <jdavis@cs.arizona.edu>.
821*/
822
823#ifdef sequent
efadb8ee 824
c6bd47b4
EA
825# define BSD 1
826# define HASUNSETENV 1
827# define BSD4_3 1 /* to get signal() in conf.c */
828# define WAITUNION 1
829# define LA_TYPE LA_FLOAT
830# ifdef _POSIX_VERSION
831# undef _POSIX_VERSION /* set in <unistd.h> */
832# endif
833# undef HASSETVBUF /* don't actually have setvbuf(3) */
834# define setpgid setpgrp
835
836/* Have to redefine WIFEXITED to take an int, to work with waitfor() */
837# undef WIFEXITED
838# define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \
839 ((union wait*)&(s))->w_termsig == 0)
840# define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode)
841typedef int pid_t;
842# define isgraph(c) (isprint(c) && (c != ' '))
843
28462cf3
EA
844# ifndef IDENTPROTO
845# define IDENTPROTO 0 /* TCP/IP implementation is broken */
846# endif
847
c6bd47b4
EA
848# ifndef _PATH_UNIX
849# define _PATH_UNIX "/dynix"
850# endif
851# ifndef _PATH_SENDMAILCF
852# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
853# endif
854
855#endif
856
857
efadb8ee
EA
858/*
859** Sequent DYNIX/ptx v2.0 (and higher)
860**
861** For DYNIX/ptx v1.x, undefine HASSETREUID.
862**
863** From Tim Wright <timw@sequent.com>.
864*/
865
866#ifdef _SEQUENT_
867# define SYSTEM5 1 /* include all the System V defines */
868# define HASSETSID 1 /* has POSIX setsid(2) call */
869# define HASINITGROUPS 1 /* has initgroups(3) call */
870# define HASSETREUID 1 /* has setreuid(2) call */
871# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
872# define GIDSET_T gid_t
873# define LA_TYPE LA_INT
874# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
ddeafa3b 875# define SPT_TYPE SPT_NONE /* don't use setproctitle */
28462cf3
EA
876# ifndef IDENTPROTO
877# define IDENTPROTO 0 /* TCP/IP implementation is broken */
878# endif
efadb8ee
EA
879# ifndef _PATH_SENDMAILCF
880# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
881# endif
882# ifndef _PATH_SENDMAILPID
883# define _PATH_SENDMAILPID "/etc/sendmail.pid"
884# endif
885#endif
886
887
250441f6
EA
888/*
889** Cray Unicos
890**
891** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
892*/
893
894#ifdef UNICOS
895# define SYSTEM5 1 /* include all the System V defines */
896# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
250441f6
EA
897# define MAXPATHLEN PATHSIZE
898# define LA_TYPE LA_ZERO
5e0e0f8f 899# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
b2b48b69 900# define SFS_BAVAIL f_bfree /* alternate field name */
250441f6
EA
901#endif
902
c6bd47b4 903
548197f7
EA
904/*
905** Apollo DomainOS
906**
907** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
e7261663 908**
548197f7
EA
909** 15 Jan 1994
910**
911*/
912
913#ifdef apollo
548197f7
EA
914# define HASSETREUID 1 /* has setreuid(2) call */
915# define HASINITGROUPS 1 /* has initgroups(2) call */
ddeafa3b 916# define SPT_TYPE SPT_NONE /* don't use setproctitle */
548197f7 917# define LA_TYPE LA_SUBR /* use getloadavg.c */
f243158a 918# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
b2b48b69 919# define SFS_BAVAIL f_bfree /* alternate field name */
548197f7
EA
920# ifndef _PATH_SENDMAILCF
921# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
922# endif
923# ifndef _PATH_SENDMAILPID
924# define _PATH_SENDMAILPID "/etc/sendmail.pid"
925# endif
926# undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */
927# undef S_IFIFO
928# define S_IFIFO 0010000
929# ifndef IDENTPROTO
930# define IDENTPROTO 0 /* TCP/IP implementation is broken */
931# endif
e7261663 932#endif
548197f7
EA
933
934
41915d28 935/*
4579ffd9 936** UnixWare 1.1.2.
41915d28
EA
937**
938** From Evan Champion <evanc@spatial.synapse.org>.
939*/
940
941#ifdef UNIXWARE
942# define SYSTEM5 1
4579ffd9
EA
943# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
944# define HASGETDTABLESIZE 1
945# define HASSETREUID 1
946# define HASSETSID 1
947# define HASINITGROUPS 1
948# define GIDSET_T gid_t
949# define SLEEP_T unsigned
41915d28
EA
950# define SFS_TYPE SFS_STATVFS
951# define LA_TYPE LA_ZERO
952# undef WIFEXITED
953# undef WEXITSTATUS
954# define _PATH_UNIX "/unix"
955# ifndef _PATH_SENDMAILCF
956# define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf"
957# endif
958# ifndef _PATH_SENDMAILPID
959# define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
960# endif
961# define SYSLOG_BUFSIZE 128
962#endif
963
964
8b223875
EA
965/*
966** Intergraph CLIX 3.1
967**
968** From Paul Southworth <pauls@locust.cic.net>
969*/
970
971#ifdef CLIX
972# define SYSTEM5 1 /* looks like System V */
41915d28
EA
973# ifndef HASGETUSERSHELL
974# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
975# endif
8b223875
EA
976# define DEV_BSIZE 512 /* device block size not defined */
977# define GIDSET_T gid_t
978# undef LOG /* syslog not available */
979# define NEEDFSYNC 1 /* no fsync in system library */
980# define GETSHORT _getshort
981#endif
982
983
01e1d6e5
EA
984/*
985** NCR 3000 Series (SysVr4)
986**
264ee34f 987** From Kevin Darcy <kevin@tech.mis.cfc.com>.
01e1d6e5
EA
988*/
989
990#ifdef NCR3000
991# define __svr4__
992# undef BSD
993# define LA_AVENRUN "avenrun"
994#endif
01e1d6e5
EA
995
996
264ee34f
EA
997/*
998** Tandem NonStop-UX SVR4
999**
1000** From Rick McCarty <mccarty@mpd.tandem.com>.
1001*/
1002
1003#ifdef NonStop_UX_BXX
1004# define __svr4__
1005#endif
1006
548197f7 1007
d576f75d
EA
1008/*
1009** Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
1010**
1011** Tested for 1.04 and 1.03
1012** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
1013*/
1014
1015#ifdef __H3050R
1016# define SYSTEM5 1 /* include all the System V defines */
1017# define HASINITGROUPS 1 /* has initgroups(3) call */
1018# define setreuid(r, e) setresuid(r, e, -1)
1019# define LA_TYPE LA_FLOAT
1020# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1021# define HASSETVBUF /* HI-UX has no setlinebuf */
1022# ifndef GIDSET_T
1023# define GIDSET_T gid_t
1024# endif
1025# ifndef _PATH_UNIX
1026# define _PATH_UNIX "/HI-UX"
1027# endif
1028# ifndef _PATH_SENDMAILCF
1029# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
1030# endif
1031# ifndef IDENTPROTO
1032# define IDENTPROTO 0 /* TCP/IP implementation is broken */
1033# endif
1034# ifndef HASGETUSERSHELL
1035# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
1036# endif
1037
1038/* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
1039# undef m_flags
1040
1041# ifdef __STDC__
1042extern int syslog(int, char *, ...);
1043# endif
1044
1045#endif
1046
1047
3a15d11b
EA
1048/*
1049** Amdahl UTS System V 2.1.5 (SVr3-based)
1050**
1051** From: Janet Jackson <janet@dialix.oz.au>.
1052*/
1053
1054#ifdef _UTS
1055# include <sys/sysmacros.h>
1056# undef HASLSTAT /* has symlinks, but they cause problems */
1057# define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */
1058# define SYS5SIGNALS 1 /* System V signal semantics */
1059# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
1060# define HASUNAME 1 /* use System V uname(2) system call */
1061# define HASINITGROUPS 1 /* has initgroups(3) function */
1062# define HASSETVBUF 1 /* has setvbuf(3) function */
1063# define HASSIGSETMASK 0 /* does not have sigsetmask(2) function */
1064# ifndef HASGETUSERSHELL
1065# define HASGETUSERSHELL 0 /* does not have getusershell(3) function */
1066# endif
1067# define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */
1068# define LA_TYPE LA_ZERO /* doesn't have load average */
1069# define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */
b2b48b69 1070# define SFS_BAVAIL f_bfree /* alternate field name */
3a15d11b
EA
1071# define _PATH_UNIX "/unix"
1072# ifndef _PATH_SENDMAILCF
1073# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
1074# endif
1075#endif
1076
1ead4c2f
EA
1077/*
1078** Cray Computer Corporation's CSOS
1079**
1080** Contributed by Scott Bolte <scott@craycos.com>.
1081*/
3a15d11b 1082
1ead4c2f
EA
1083#ifdef _CRAYCOM
1084# define SYSTEM5 1 /* include all the System V defines */
1085# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1086# define NEEDFSYNC 1 /* no fsync in system library */
1087# define MAXPATHLEN PATHSIZE
1088# define LA_TYPE LA_ZERO
1089# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
b2b48b69 1090# define SFS_BAVAIL f_bfree /* alternate field name */
1ead4c2f
EA
1091# define _POSIX_CHOWN_RESTRICTED -1
1092extern struct group *getgrent(), *getgrnam(), *getgrgid();
1093#endif
3a15d11b 1094
178464cb 1095
550fee58
EA
1096/*
1097** Sony NEWS-OS 4.2.1R and 6.0.3
1098*/
1099
1100#ifdef sony_news
1101# ifndef __svr4
1102 /* NEWS-OS 4.2.1R */
1103# ifndef BSD
1104# define BSD /* has BSD routines */
1105# endif
1106# define HASUNSETENV 1 /* has unsetenv(2) call */
1107# undef HASSETVBUF /* don't actually have setvbuf(3) */
1108# define WAITUNION 1 /* use "union wait" as wait argument type */
1109# define LA_TYPE LA_INT
1110# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1111# ifndef HASFLOCK
1112# define HASFLOCK 1 /* has flock(2) call */
1113# endif
1114# define setpgid setpgrp
1115# undef WIFEXITED
1116# undef WEXITSTATUS
1117typedef int pid_t;
1118typedef int (*sigfunc_t)();
1119# define SIGFUNC_DEFINED
1120
1121# else
1122 /* NEWS-OS 6.0.3 with /bin/cc */
1123# define SYSTEM5 1 /* include all the System V defines */
1124# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1125# define HASINITGROUPS 1 /* has initgroups(3) call */
1126# define HASSETREUID 1 /* has setreuid(2) call */
1127# define HASSETSID 1 /* has Posix setsid(2) call */
1128# define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */
1129# define LA_TYPE LA_INT
1130# define SFS_TYPE SFS_STATVFS /* use <sys/statvfs.h> statvfs() impl */
1131# define GIDSET_T gid_t
1132# define setreuid(r, e) seteuid(e)
1133# undef WIFEXITED
1134# undef WEXITSTATUS
1135# define _PATH_UNIX "/stand/unix"
1136# ifndef _PATH_SENDMAILCF
1137# define _PATH_SENDMAILCF "/etc/mail/sendmail.cf"
1138# endif
1139# ifndef _PATH_SENDMAILPID
1140# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
1141# endif
1142
1143# endif
1144#endif
1145
1146
1147/*
1148** Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
1149*/
1150
1151#ifdef luna
1152# ifndef IDENTPROTO
1153# define IDENTPROTO 0 /* TCP/IP implementation is broken */
1154# endif
1155# ifdef uniosb
550fee58
EA
1156# define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
1157# endif
1158# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
1159# define WAITUNION 1 /* use "union wait" as wait argument type */
1160# ifdef uniosb
1161# define LA_TYPE LA_INT
1162# endif
1163# ifdef luna2m
1164# define LA_TYPE LA_SUBR
1165# endif
1166# ifdef luna88k
1167# define LA_TYPE LA_INT
1168# endif
1169# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1170# define setpgid setpgrp
1171# undef WIFEXITED
1172# undef WEXITSTATUS
1173typedef int pid_t;
1174typedef int (*sigfunc_t)();
1175# define SIGFUNC_DEFINED
1176extern char *getenv();
1177extern int errno;
1178# ifndef _PATH_SENDMAILCF
1179# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
1180# endif
1181#endif
1182
1183
1184/*
1185** NEC EWS-UX/V 4.2
1186**
1187** with /usr/ucb/cc
1188*/
1189
1190#ifdef nec_ews_svr4
1191# define SYSTEM5 1 /* include all the System V defines */
1192# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1193# define HASINITGROUPS 1 /* has initgroups(3) call */
1194# define HASSETREUID 1 /* has setreuid(2) call */
1195# define setreuid(r, e) seteuid(e)
1196# define HASSETSID 1 /* has Posix setsid(2) call */
1197# define LA_TYPE LA_INT
1198# define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */
1199# define GIDSET_T gid_t
1200# ifndef HASGETUSERSHELL
1201# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1202# endif
1203# undef WIFEXITED
1204# undef WEXITSTATUS
1205# ifndef _PATH_UNIX
1206# define _PATH_UNIX "/unix"
1207# endif
1208# ifndef _PATH_SENDMAILCF
1209# define _PATH_SENDMAILCF "/var/ucblib/sendmail.cf"
1210# endif
1211# ifndef _PATH_SENDMAILPID
1212# define _PATH_SENDMAILPID "/var/ucblib/sendmail.pid"
1213# endif
1214# define NAMELISTMASK 0x7fffffff /* mask for nlist() values */
1215#endif
1216
1217
1218
ba6514e2 1219/**********************************************************************
fd57f063 1220** End of Per-Operating System defines
ba6514e2 1221**********************************************************************/
fd57f063 1222
b4cd00ff
EA
1223/**********************************************************************
1224** More general defines
1225**********************************************************************/
1226
33d59d37
EA
1227/* general BSD defines */
1228#ifdef BSD
39270cfd
EA
1229# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
1230# define HASSETREUID 1 /* has setreuid(2) call */
1d560021 1231# define HASINITGROUPS 1 /* has initgroups(3) call */
230ac0bd
EA
1232# ifndef HASSETRLIMIT
1233# define HASSETRLIMIT 1 /* has setrlimit(2) call */
1234# endif
72af7ebb
EA
1235# ifndef HASFLOCK
1236# define HASFLOCK 1 /* has flock(2) call */
1237# endif
a2ba2f44 1238# ifndef TZ_TYPE
f7311261 1239# define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */
a2ba2f44 1240# endif
33d59d37
EA
1241#endif
1242
f361504a
EA
1243/* general System V Release 4 defines */
1244#ifdef __svr4__
1245# define SYSTEM5 1
1246# define HASSETREUID 1 /* has seteuid(2) call & working saved uids */
1d560021
EA
1247# define HASINITGROUPS 1 /* has initgroups(3) call */
1248# ifndef HASSETRLIMIT
1249# define HASSETRLIMIT 1 /* has setrlimit(2) call */
1250# endif
1ee33f7d
EA
1251# ifndef HASGETUSERSHELL
1252# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
9ceb18fe 1253# endif
f361504a
EA
1254# define setreuid(r, e) seteuid(e)
1255
1256# ifndef _PATH_UNIX
1257# define _PATH_UNIX "/unix"
1258# endif
1259# ifndef _PATH_SENDMAILCF
1260# define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf"
1261# endif
1262# ifndef _PATH_SENDMAILPID
1263# define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
1264# endif
1265# ifndef SYSLOG_BUFSIZE
1266# define SYSLOG_BUFSIZE 128
1267# endif
25e2468c
EA
1268# ifndef SFS_TYPE
1269# define SFS_TYPE SFS_STATVFS
1270# endif
f361504a
EA
1271#endif
1272
fd57f063 1273/* general System V defines */
402003b1 1274#ifdef SYSTEM5
8988dfd3 1275# include <sys/sysmacros.h>
b4cd00ff 1276# define HASUNAME 1 /* use System V uname(2) system call */
82530719 1277# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
c6bd47b4 1278# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
230ac0bd
EA
1279# ifndef HASULIMIT
1280# define HASULIMIT 1 /* has the ulimit(2) syscall */
1281# endif
33d59d37 1282# ifndef LA_TYPE
5e0e0f8f
EA
1283# define LA_TYPE LA_INT /* assume integer load average */
1284# endif
1285# ifndef SFS_TYPE
1286# define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */
33d59d37 1287# endif
a2ba2f44 1288# ifndef TZ_TYPE
f7311261 1289# define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
a2ba2f44 1290# endif
e3a8e3e0
EA
1291# define bcopy(s, d, l) (memmove((d), (s), (l)))
1292# define bzero(d, l) (memset((d), '\0', (l)))
1293# define bcmp(s, d, l) (memcmp((s), (d), (l)))
402003b1 1294#endif
fd57f063 1295
b4cd00ff
EA
1296/* general POSIX defines */
1297#ifdef _POSIX_VERSION
fe3849ea
EA
1298# define HASSETSID 1 /* has Posix setsid(2) call */
1299# define HASWAITPID 1 /* has Posix waitpid(2) call */
b4cd00ff
EA
1300#endif
1301
e6cb9fc4
EA
1302/*
1303** If no type for argument two of getgroups call is defined, assume
1304** it's an integer -- unfortunately, there seem to be several choices
1305** here.
1306*/
1307
1308#ifndef GIDSET_T
1309# define GIDSET_T int
1310#endif
1311
31c3ae15 1312/*
1ead4c2f
EA
1313** Tweaking for systems that (for example) claim to be BSD or POSIX
1314** but don't have all the standard BSD or POSIX routines (boo hiss).
31c3ae15
EA
1315*/
1316
1317#ifdef titan
1318# undef HASINITGROUPS /* doesn't have initgroups(3) call */
1319#endif
1320
1ead4c2f
EA
1321#ifdef _CRAYCOM
1322# undef HASSETSID /* despite POSIX claim, doesn't have setsid */
1323#endif
1324
e3a8e3e0
EA
1325#ifdef ISC_UNIX
1326# undef bcopy /* despite SystemV claim, uses BSD bcopy */
1327#endif
1328
1329#ifdef ALTOS_SYS_V
1330# undef bcopy /* despite SystemV claim, uses BSD bcopy */
1331# undef bzero /* despite SystemV claim, uses BSD bzero */
1332# undef bcmp /* despite SystemV claim, uses BSD bcmp */
1333#endif
1334
72af7ebb 1335
a74fd615
EA
1336/*
1337** Due to a "feature" in some operating systems such as Ultrix 4.3 and
1338** HPUX 8.0, if you receive a "No route to host" message (ICMP message
1339** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
1340** are closed. Some firewalls return this error if you try to connect
1341** to the IDENT port (113), so you can't receive email from these hosts
1342** on these systems. The firewall really should use a more specific
1343** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If
1344** not explicitly set to zero above, default it on.
1345*/
1346
1347#ifndef IDENTPROTO
1348# define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */
1349#endif
1350
1ee33f7d
EA
1351#ifndef HASGETUSERSHELL
1352# define HASGETUSERSHELL 1 /* libc has getusershell(3) call */
9ceb18fe
EA
1353#endif
1354
72af7ebb
EA
1355#ifndef HASFLOCK
1356# define HASFLOCK 0 /* assume no flock(2) support */
1357#endif
1358
230ac0bd
EA
1359#ifndef HASSETRLIMIT
1360# define HASSETRLIMIT 0 /* assume no setrlimit(2) support */
1361#endif
1362
1363#ifndef HASULIMIT
1364# define HASULIMIT 0 /* assume no ulimit(2) support */
1365#endif
1366
11c14c72
EA
1367#ifndef OLD_NEWDB
1368# define OLD_NEWDB 0 /* assume newer version of newdb */
1369#endif
1370
3a15d11b
EA
1371/* heuristic setting of HASSETSIGMASK; can override above */
1372#ifndef HASSIGSETMASK
1373# ifdef SIGVTALRM
1374# define HASSETSIGMASK 1
1375# else
1376# define HASSETSIGMASK 0
1377# endif
1378#endif
1379
782a2f97
EA
1380#ifndef UID_T
1381# define UID_T uid_t
1382#endif
1383
2604d017
EA
1384#ifndef SIZE_T
1385# define SIZE_T size_t
1386#endif
1387
782a2f97
EA
1388#ifndef ARGV_T
1389# define ARGV_T char **
1390#endif
1391
2295903c
EA
1392
1393/**********************************************************************
e6245c7e
EA
1394** Remaining definitions should never have to be changed. They are
1395** primarily to provide back compatibility for older systems -- for
6070681d 1396** example, it includes some POSIX compatibility definitions
2295903c 1397**********************************************************************/
e6245c7e 1398
bd3dddbf
EA
1399/* System 5 compatibility */
1400#ifndef S_ISREG
fce21cb9
EA
1401# define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG)
1402#endif
1403#if !defined(S_ISLNK) && defined(S_IFLNK)
1404# define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK)
bd3dddbf 1405#endif
d52f8819
EA
1406#ifndef S_IWUSR
1407# define S_IWUSR 0200
1408#endif
bd3dddbf 1409#ifndef S_IWGRP
d52f8819 1410# define S_IWGRP 0020
bd3dddbf
EA
1411#endif
1412#ifndef S_IWOTH
d52f8819 1413# define S_IWOTH 0002
bd3dddbf
EA
1414#endif
1415
030ae776
EA
1416/*
1417** Older systems don't have this error code -- it should be in
1418** /usr/include/sysexits.h.
1419*/
1420
1421# ifndef EX_CONFIG
1422# define EX_CONFIG 78 /* configuration error */
1423# endif
5229f34d 1424
fe3849ea
EA
1425/* pseudo-code used in server SMTP */
1426# define EX_QUIT 22 /* drop out of server immediately */
1427
1428
92f2b65e
EA
1429/*
1430** These are used in a few cases where we need some special
1431** error codes, but where the system doesn't provide something
1432** reasonable. They are printed in errstring.
1433*/
1434
1435#ifndef E_PSEUDOBASE
1436# define E_PSEUDOBASE 256
1437#endif
1438
1439#define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */
1440#define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */
1441
0639fd0c
EA
1442/* type of arbitrary pointer */
1443#ifndef ARBPTR_T
1444# define ARBPTR_T void *
1445#endif
1446
ed0b2c1b
EA
1447#ifndef __P
1448# include "cdefs.h"
1449#endif
1450
648eb46e
EA
1451#if NAMED_BIND
1452# include <arpa/nameser.h>
264ee34f
EA
1453# ifdef __svr4__
1454# ifdef NOERROR
1455# undef NOERROR /* avoid compiler conflict with stream.h */
1456# endif
1457# endif
648eb46e
EA
1458#endif
1459
d2dc4dd0
EA
1460/*
1461** The size of an IP address -- can't use sizeof because of problems
1462** on Crays, where everything is 64 bits. This will break if/when
1463** IP addresses are expanded to eight bytes.
1464*/
1465
648eb46e
EA
1466#ifndef INADDRSZ
1467# define INADDRSZ 4
1468#endif
1469
1470/*
1471** The size of various known types -- for reading network protocols.
1472** Again, we can't use sizeof because of compiler randomness.
1473*/
1474
1475#ifndef INT16SZ
1476# define INT16SZ 2
1477#endif
1478#ifndef INT32SZ
1479# define INT32SZ 4
1480#endif
d2dc4dd0 1481
3356c77c
EA
1482/*
1483** Do some required dependencies
1484*/
1485
1486#if defined(NETINET) || defined(NETISO)
e9aa7870
EA
1487# define SMTP 1 /* enable user and server SMTP */
1488# define QUEUE 1 /* enable queueing */
1489# define DAEMON 1 /* include the daemon (requires IPC & SMTP) */
3356c77c
EA
1490#endif
1491
1492
5229f34d
EA
1493/*
1494** Arrange to use either varargs or stdargs
1495*/
1496
1497# ifdef __STDC__
1498
1499# include <stdarg.h>
1500
5229f34d
EA
1501# define VA_LOCAL_DECL va_list ap;
1502# define VA_START(f) va_start(ap, f)
1503# define VA_END va_end(ap)
1504
1505# else
1506
1507# include <varargs.h>
1508
5229f34d
EA
1509# define VA_LOCAL_DECL va_list ap;
1510# define VA_START(f) va_start(ap)
1511# define VA_END va_end(ap)
1512
1513# endif
422bed79 1514
322eceee 1515#ifdef HASUNAME
422bed79
EA
1516# include <sys/utsname.h>
1517# ifdef newstr
1518# undef newstr
1519# endif
322eceee 1520#else /* ! HASUNAME */
422bed79
EA
1521# define NODE_LENGTH 32
1522struct utsname
1523{
1524 char nodename[NODE_LENGTH+1];
1525};
322eceee 1526#endif /* HASUNAME */
6e99f903 1527
4d645e29 1528#if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
7621e399 1529# define MAXHOSTNAMELEN 256
8d3fd325 1530#endif
49c069a9
EA
1531
1532#if !defined(SIGCHLD) && defined(SIGCLD)
1533# define SIGCHLD SIGCLD
1534#endif
1535
1536#ifndef STDIN_FILENO
550fee58 1537# define STDIN_FILENO 0
49c069a9
EA
1538#endif
1539
1540#ifndef STDOUT_FILENO
550fee58 1541# define STDOUT_FILENO 1
49c069a9
EA
1542#endif
1543
1544#ifndef STDERR_FILENO
550fee58 1545# define STDERR_FILENO 2
49c069a9 1546#endif
f8a31c8e 1547
0f786d57 1548#ifndef LOCK_SH
39270cfd
EA
1549# define LOCK_SH 0x01 /* shared lock */
1550# define LOCK_EX 0x02 /* exclusive lock */
1551# define LOCK_NB 0x04 /* non-blocking lock */
1552# define LOCK_UN 0x08 /* unlock */
1553#endif
64247676 1554
550fee58
EA
1555#ifndef SEEK_SET
1556# define SEEK_SET 0
1557# define SEEK_CUR 1
1558# define SEEK_END 2
1559#endif
1560
39270cfd
EA
1561#ifndef SIG_ERR
1562# define SIG_ERR ((void (*)()) -1)
f8a31c8e 1563#endif
a3685d83 1564
0349f8cc
EA
1565#ifndef WEXITSTATUS
1566# define WEXITSTATUS(st) (((st) >> 8) & 0377)
1567#endif
1568#ifndef WIFEXITED
1569# define WIFEXITED(st) (((st) & 0377) == 0)
1570#endif
1571
53335960
EA
1572#ifndef SIGFUNC_DEFINED
1573typedef void (*sigfunc_t) __P((int));
1574#endif
1575
7cfc9c77
EA
1576/* size of syslog buffer */
1577#ifndef SYSLOG_BUFSIZE
1578# define SYSLOG_BUFSIZE 1024
1579#endif
1580
a3685d83
EA
1581/*
1582** Size of tobuf (deliver.c)
1583** Tweak this to match your syslog implementation. It will have to
1584** allow for the extra information printed.
1585*/
1586
1587#ifndef TOBUFSIZE
7cfc9c77
EA
1588# if (SYSLOG_BUFSIZE) > 512
1589# define TOBUFSIZE (SYSLOG_BUFSIZE - 256)
1590# else
1591# define TOBUFSIZE 256
1592# endif
a3685d83 1593#endif
9114f86c 1594
77779257
EA
1595/*
1596** Size of prescan buffer.
1597** Despite comments in the _sendmail_ book, this probably should
1598** not be changed; there are some hard-to-define dependencies.
1599*/
1600
1601# define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */
9114f86c
EA
1602/* fork routine -- set above using #ifdef _osname_ or in Makefile */
1603# ifndef FORK
1604# define FORK vfork /* function to call to fork mailer */
1605# endif
5e0139e6
EA
1606
1607/*
1608** If we are going to link scanf anyway, use it in readcf
1609*/
1610
1611#if !defined(HASUNAME) && !defined(SCANF)
1612# define SCANF 1
1613#endif