have to purge v_id as soon as it is cleaned
[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 *
c291e9af 8 * @(#)conf.h 8.147 (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 */
273562d8
EA
64# ifdef NEWDB
65# define USERDB 1 /* look in user database (requires NEWDB) */
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
a6f7e106 212# define SOLARIS /* 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 */
c2edb205 755# define HASUNAME 1 /* use System V uname(2) system call */
c2edb205 756# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
53335960 757# define SIGFUNC_DEFINED /* sigfunc_t already defined */
a74fd615
EA
758# ifndef IDENTPROTO
759# define IDENTPROTO 0 /* TCP/IP implementation is broken */
760# endif
c2edb205
EA
761# define FORK fork
762# ifndef _PATH_SENDMAILCF
763# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
764# endif
765# ifndef LA_TYPE
766# define LA_TYPE LA_ZERO
767# endif
5e0e0f8f 768# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
96e003d2
EA
769# undef WIFEXITED
770# undef WEXITSTATUS
c2edb205
EA
771#endif
772
773
82530719
EA
774/*
775** Encore UMAX V
776**
777** Not extensively tested.
778*/
779
780#ifdef UMAXV
781# include <limits.h>
782# define HASUNAME 1 /* use System V uname(2) system call */
82530719
EA
783# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
784# define HASINITGROUPS 1 /* has initgroups(3) call */
1ee33f7d 785# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
82530719
EA
786# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
787# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
788# define FORK fork /* no vfork(2) primitive available */
5e0e0f8f 789# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
82530719
EA
790# define MAXPATHLEN PATH_MAX
791extern struct passwd *getpwent(), *getpwnam(), *getpwuid();
792extern struct group *getgrent(), *getgrnam(), *getgrgid();
793# undef WIFEXITED
794# undef WEXITSTATUS
795#endif
796
797
31c3ae15
EA
798/*
799** Stardent Titan 3000 running TitanOS 4.2.
800**
801** Must be compiled in "cc -43" mode.
802**
fce21cb9 803** From Kate Hedstrom <kate@ahab.rutgers.edu>.
31c3ae15
EA
804**
805** Note the tweaking below after the BSD defines are set.
806*/
807
808#ifdef titan
809# define setpgid setpgrp
810typedef int pid_t;
811# undef WIFEXITED
812# undef WEXITSTATUS
813#endif
814
815
c6bd47b4
EA
816/*
817** Sequent DYNIX 3.2.0
818**
819** From Jim Davis <jdavis@cs.arizona.edu>.
820*/
821
822#ifdef sequent
efadb8ee 823
c6bd47b4
EA
824# define BSD 1
825# define HASUNSETENV 1
826# define BSD4_3 1 /* to get signal() in conf.c */
827# define WAITUNION 1
828# define LA_TYPE LA_FLOAT
829# ifdef _POSIX_VERSION
830# undef _POSIX_VERSION /* set in <unistd.h> */
831# endif
832# undef HASSETVBUF /* don't actually have setvbuf(3) */
833# define setpgid setpgrp
834
835/* Have to redefine WIFEXITED to take an int, to work with waitfor() */
836# undef WIFEXITED
837# define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \
838 ((union wait*)&(s))->w_termsig == 0)
839# define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode)
840typedef int pid_t;
841# define isgraph(c) (isprint(c) && (c != ' '))
842
28462cf3
EA
843# ifndef IDENTPROTO
844# define IDENTPROTO 0 /* TCP/IP implementation is broken */
845# endif
846
c6bd47b4
EA
847# ifndef _PATH_UNIX
848# define _PATH_UNIX "/dynix"
849# endif
850# ifndef _PATH_SENDMAILCF
851# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
852# endif
853
854#endif
855
856
efadb8ee
EA
857/*
858** Sequent DYNIX/ptx v2.0 (and higher)
859**
860** For DYNIX/ptx v1.x, undefine HASSETREUID.
861**
862** From Tim Wright <timw@sequent.com>.
863*/
864
865#ifdef _SEQUENT_
866# define SYSTEM5 1 /* include all the System V defines */
867# define HASSETSID 1 /* has POSIX setsid(2) call */
868# define HASINITGROUPS 1 /* has initgroups(3) call */
869# define HASSETREUID 1 /* has setreuid(2) call */
870# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
871# define GIDSET_T gid_t
872# define LA_TYPE LA_INT
873# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
ddeafa3b 874# define SPT_TYPE SPT_NONE /* don't use setproctitle */
28462cf3
EA
875# ifndef IDENTPROTO
876# define IDENTPROTO 0 /* TCP/IP implementation is broken */
877# endif
efadb8ee
EA
878# ifndef _PATH_SENDMAILCF
879# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
880# endif
881# ifndef _PATH_SENDMAILPID
882# define _PATH_SENDMAILPID "/etc/sendmail.pid"
883# endif
884#endif
885
886
250441f6
EA
887/*
888** Cray Unicos
889**
890** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
891*/
892
893#ifdef UNICOS
894# define SYSTEM5 1 /* include all the System V defines */
895# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
250441f6
EA
896# define MAXPATHLEN PATHSIZE
897# define LA_TYPE LA_ZERO
5e0e0f8f 898# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
b2b48b69 899# define SFS_BAVAIL f_bfree /* alternate field name */
250441f6
EA
900#endif
901
c6bd47b4 902
548197f7
EA
903/*
904** Apollo DomainOS
905**
906** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
e7261663 907**
548197f7
EA
908** 15 Jan 1994
909**
910*/
911
912#ifdef apollo
548197f7
EA
913# define HASSETREUID 1 /* has setreuid(2) call */
914# define HASINITGROUPS 1 /* has initgroups(2) call */
ddeafa3b 915# define SPT_TYPE SPT_NONE /* don't use setproctitle */
548197f7 916# define LA_TYPE LA_SUBR /* use getloadavg.c */
f243158a 917# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
b2b48b69 918# define SFS_BAVAIL f_bfree /* alternate field name */
548197f7
EA
919# ifndef _PATH_SENDMAILCF
920# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
921# endif
922# ifndef _PATH_SENDMAILPID
923# define _PATH_SENDMAILPID "/etc/sendmail.pid"
924# endif
925# undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */
926# undef S_IFIFO
927# define S_IFIFO 0010000
928# ifndef IDENTPROTO
929# define IDENTPROTO 0 /* TCP/IP implementation is broken */
930# endif
e7261663 931#endif
548197f7
EA
932
933
41915d28 934/*
4579ffd9 935** UnixWare 1.1.2.
41915d28
EA
936**
937** From Evan Champion <evanc@spatial.synapse.org>.
938*/
939
940#ifdef UNIXWARE
941# define SYSTEM5 1
4579ffd9
EA
942# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
943# define HASGETDTABLESIZE 1
944# define HASSETREUID 1
945# define HASSETSID 1
946# define HASINITGROUPS 1
947# define GIDSET_T gid_t
948# define SLEEP_T unsigned
41915d28
EA
949# define SFS_TYPE SFS_STATVFS
950# define LA_TYPE LA_ZERO
951# undef WIFEXITED
952# undef WEXITSTATUS
953# define _PATH_UNIX "/unix"
954# ifndef _PATH_SENDMAILCF
955# define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf"
956# endif
957# ifndef _PATH_SENDMAILPID
958# define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
959# endif
960# define SYSLOG_BUFSIZE 128
961#endif
962
963
8b223875
EA
964/*
965** Intergraph CLIX 3.1
966**
967** From Paul Southworth <pauls@locust.cic.net>
968*/
969
970#ifdef CLIX
971# define SYSTEM5 1 /* looks like System V */
41915d28
EA
972# ifndef HASGETUSERSHELL
973# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
974# endif
8b223875
EA
975# define DEV_BSIZE 512 /* device block size not defined */
976# define GIDSET_T gid_t
977# undef LOG /* syslog not available */
978# define NEEDFSYNC 1 /* no fsync in system library */
979# define GETSHORT _getshort
980#endif
981
982
01e1d6e5
EA
983/*
984** NCR 3000 Series (SysVr4)
985**
264ee34f 986** From Kevin Darcy <kevin@tech.mis.cfc.com>.
01e1d6e5
EA
987*/
988
989#ifdef NCR3000
990# define __svr4__
991# undef BSD
992# define LA_AVENRUN "avenrun"
993#endif
01e1d6e5
EA
994
995
264ee34f
EA
996/*
997** Tandem NonStop-UX SVR4
998**
999** From Rick McCarty <mccarty@mpd.tandem.com>.
1000*/
1001
1002#ifdef NonStop_UX_BXX
1003# define __svr4__
1004#endif
1005
548197f7 1006
d576f75d
EA
1007/*
1008** Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
1009**
1010** Tested for 1.04 and 1.03
1011** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
1012*/
1013
1014#ifdef __H3050R
1015# define SYSTEM5 1 /* include all the System V defines */
1016# define HASINITGROUPS 1 /* has initgroups(3) call */
1017# define setreuid(r, e) setresuid(r, e, -1)
1018# define LA_TYPE LA_FLOAT
1019# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1020# define HASSETVBUF /* HI-UX has no setlinebuf */
1021# ifndef GIDSET_T
1022# define GIDSET_T gid_t
1023# endif
1024# ifndef _PATH_UNIX
1025# define _PATH_UNIX "/HI-UX"
1026# endif
1027# ifndef _PATH_SENDMAILCF
1028# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
1029# endif
1030# ifndef IDENTPROTO
1031# define IDENTPROTO 0 /* TCP/IP implementation is broken */
1032# endif
1033# ifndef HASGETUSERSHELL
1034# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
1035# endif
1036
1037/* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
1038# undef m_flags
1039
1040# ifdef __STDC__
1041extern int syslog(int, char *, ...);
1042# endif
1043
1044#endif
1045
1046
3a15d11b
EA
1047/*
1048** Amdahl UTS System V 2.1.5 (SVr3-based)
1049**
1050** From: Janet Jackson <janet@dialix.oz.au>.
1051*/
1052
1053#ifdef _UTS
1054# include <sys/sysmacros.h>
1055# undef HASLSTAT /* has symlinks, but they cause problems */
1056# define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */
1057# define SYS5SIGNALS 1 /* System V signal semantics */
1058# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
1059# define HASUNAME 1 /* use System V uname(2) system call */
1060# define HASINITGROUPS 1 /* has initgroups(3) function */
1061# define HASSETVBUF 1 /* has setvbuf(3) function */
1062# define HASSIGSETMASK 0 /* does not have sigsetmask(2) function */
1063# ifndef HASGETUSERSHELL
1064# define HASGETUSERSHELL 0 /* does not have getusershell(3) function */
1065# endif
1066# define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */
1067# define LA_TYPE LA_ZERO /* doesn't have load average */
1068# define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */
b2b48b69 1069# define SFS_BAVAIL f_bfree /* alternate field name */
3a15d11b
EA
1070# define _PATH_UNIX "/unix"
1071# ifndef _PATH_SENDMAILCF
1072# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
1073# endif
1074#endif
1075
1ead4c2f
EA
1076/*
1077** Cray Computer Corporation's CSOS
1078**
1079** Contributed by Scott Bolte <scott@craycos.com>.
1080*/
3a15d11b 1081
1ead4c2f
EA
1082#ifdef _CRAYCOM
1083# define SYSTEM5 1 /* include all the System V defines */
1084# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1085# define NEEDFSYNC 1 /* no fsync in system library */
1086# define MAXPATHLEN PATHSIZE
1087# define LA_TYPE LA_ZERO
1088# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
b2b48b69 1089# define SFS_BAVAIL f_bfree /* alternate field name */
1ead4c2f
EA
1090# define _POSIX_CHOWN_RESTRICTED -1
1091extern struct group *getgrent(), *getgrnam(), *getgrgid();
1092#endif
3a15d11b 1093
178464cb 1094
550fee58
EA
1095/*
1096** Sony NEWS-OS 4.2.1R and 6.0.3
1097*/
1098
1099#ifdef sony_news
1100# ifndef __svr4
1101 /* NEWS-OS 4.2.1R */
1102# ifndef BSD
1103# define BSD /* has BSD routines */
1104# endif
1105# define HASUNSETENV 1 /* has unsetenv(2) call */
1106# undef HASSETVBUF /* don't actually have setvbuf(3) */
1107# define WAITUNION 1 /* use "union wait" as wait argument type */
1108# define LA_TYPE LA_INT
1109# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1110# ifndef HASFLOCK
1111# define HASFLOCK 1 /* has flock(2) call */
1112# endif
1113# define setpgid setpgrp
1114# undef WIFEXITED
1115# undef WEXITSTATUS
1116typedef int pid_t;
1117typedef int (*sigfunc_t)();
1118# define SIGFUNC_DEFINED
1119
1120# else
1121 /* NEWS-OS 6.0.3 with /bin/cc */
1122# define SYSTEM5 1 /* include all the System V defines */
1123# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1124# define HASINITGROUPS 1 /* has initgroups(3) call */
1125# define HASSETREUID 1 /* has setreuid(2) call */
1126# define HASSETSID 1 /* has Posix setsid(2) call */
1127# define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */
1128# define LA_TYPE LA_INT
1129# define SFS_TYPE SFS_STATVFS /* use <sys/statvfs.h> statvfs() impl */
1130# define GIDSET_T gid_t
1131# define setreuid(r, e) seteuid(e)
1132# undef WIFEXITED
1133# undef WEXITSTATUS
1134# define _PATH_UNIX "/stand/unix"
1135# ifndef _PATH_SENDMAILCF
1136# define _PATH_SENDMAILCF "/etc/mail/sendmail.cf"
1137# endif
1138# ifndef _PATH_SENDMAILPID
1139# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
1140# endif
1141
1142# endif
1143#endif
1144
1145
1146/*
1147** Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
1148*/
1149
1150#ifdef luna
1151# ifndef IDENTPROTO
1152# define IDENTPROTO 0 /* TCP/IP implementation is broken */
1153# endif
1154# ifdef uniosb
550fee58
EA
1155# define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
1156# endif
1157# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
1158# define WAITUNION 1 /* use "union wait" as wait argument type */
1159# ifdef uniosb
1160# define LA_TYPE LA_INT
1161# endif
1162# ifdef luna2m
1163# define LA_TYPE LA_SUBR
1164# endif
1165# ifdef luna88k
1166# define LA_TYPE LA_INT
1167# endif
1168# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1169# define setpgid setpgrp
1170# undef WIFEXITED
1171# undef WEXITSTATUS
1172typedef int pid_t;
1173typedef int (*sigfunc_t)();
1174# define SIGFUNC_DEFINED
1175extern char *getenv();
1176extern int errno;
1177# ifndef _PATH_SENDMAILCF
1178# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
1179# endif
1180#endif
1181
1182
1183/*
1184** NEC EWS-UX/V 4.2
1185**
1186** with /usr/ucb/cc
1187*/
1188
1189#ifdef nec_ews_svr4
1190# define SYSTEM5 1 /* include all the System V defines */
1191# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1192# define HASINITGROUPS 1 /* has initgroups(3) call */
1193# define HASSETREUID 1 /* has setreuid(2) call */
1194# define setreuid(r, e) seteuid(e)
1195# define HASSETSID 1 /* has Posix setsid(2) call */
1196# define LA_TYPE LA_INT
1197# define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */
1198# define GIDSET_T gid_t
1199# ifndef HASGETUSERSHELL
1200# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1201# endif
1202# undef WIFEXITED
1203# undef WEXITSTATUS
1204# ifndef _PATH_UNIX
1205# define _PATH_UNIX "/unix"
1206# endif
1207# ifndef _PATH_SENDMAILCF
1208# define _PATH_SENDMAILCF "/var/ucblib/sendmail.cf"
1209# endif
1210# ifndef _PATH_SENDMAILPID
1211# define _PATH_SENDMAILPID "/var/ucblib/sendmail.pid"
1212# endif
1213# define NAMELISTMASK 0x7fffffff /* mask for nlist() values */
1214#endif
1215
1216
1217
ba6514e2 1218/**********************************************************************
fd57f063 1219** End of Per-Operating System defines
ba6514e2 1220**********************************************************************/
fd57f063 1221
b4cd00ff
EA
1222/**********************************************************************
1223** More general defines
1224**********************************************************************/
1225
33d59d37
EA
1226/* general BSD defines */
1227#ifdef BSD
39270cfd
EA
1228# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
1229# define HASSETREUID 1 /* has setreuid(2) call */
1d560021 1230# define HASINITGROUPS 1 /* has initgroups(3) call */
230ac0bd
EA
1231# ifndef HASSETRLIMIT
1232# define HASSETRLIMIT 1 /* has setrlimit(2) call */
1233# endif
72af7ebb
EA
1234# ifndef HASFLOCK
1235# define HASFLOCK 1 /* has flock(2) call */
1236# endif
a2ba2f44 1237# ifndef TZ_TYPE
f7311261 1238# define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */
a2ba2f44 1239# endif
33d59d37
EA
1240#endif
1241
f361504a
EA
1242/* general System V Release 4 defines */
1243#ifdef __svr4__
1244# define SYSTEM5 1
1245# define HASSETREUID 1 /* has seteuid(2) call & working saved uids */
1d560021
EA
1246# define HASINITGROUPS 1 /* has initgroups(3) call */
1247# ifndef HASSETRLIMIT
1248# define HASSETRLIMIT 1 /* has setrlimit(2) call */
1249# endif
1ee33f7d
EA
1250# ifndef HASGETUSERSHELL
1251# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
9ceb18fe 1252# endif
f361504a
EA
1253# define setreuid(r, e) seteuid(e)
1254
1255# ifndef _PATH_UNIX
1256# define _PATH_UNIX "/unix"
1257# endif
1258# ifndef _PATH_SENDMAILCF
1259# define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf"
1260# endif
1261# ifndef _PATH_SENDMAILPID
1262# define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
1263# endif
1264# ifndef SYSLOG_BUFSIZE
1265# define SYSLOG_BUFSIZE 128
1266# endif
25e2468c
EA
1267# ifndef SFS_TYPE
1268# define SFS_TYPE SFS_STATVFS
1269# endif
f361504a
EA
1270#endif
1271
fd57f063 1272/* general System V defines */
402003b1 1273#ifdef SYSTEM5
8988dfd3 1274# include <sys/sysmacros.h>
b4cd00ff 1275# define HASUNAME 1 /* use System V uname(2) system call */
82530719 1276# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
c6bd47b4 1277# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
230ac0bd
EA
1278# ifndef HASULIMIT
1279# define HASULIMIT 1 /* has the ulimit(2) syscall */
1280# endif
33d59d37 1281# ifndef LA_TYPE
5e0e0f8f
EA
1282# define LA_TYPE LA_INT /* assume integer load average */
1283# endif
1284# ifndef SFS_TYPE
1285# define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */
33d59d37 1286# endif
a2ba2f44 1287# ifndef TZ_TYPE
f7311261 1288# define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
a2ba2f44 1289# endif
e3a8e3e0
EA
1290# define bcopy(s, d, l) (memmove((d), (s), (l)))
1291# define bzero(d, l) (memset((d), '\0', (l)))
1292# define bcmp(s, d, l) (memcmp((s), (d), (l)))
402003b1 1293#endif
fd57f063 1294
b4cd00ff
EA
1295/* general POSIX defines */
1296#ifdef _POSIX_VERSION
fe3849ea
EA
1297# define HASSETSID 1 /* has Posix setsid(2) call */
1298# define HASWAITPID 1 /* has Posix waitpid(2) call */
b4cd00ff
EA
1299#endif
1300
e6cb9fc4
EA
1301/*
1302** If no type for argument two of getgroups call is defined, assume
1303** it's an integer -- unfortunately, there seem to be several choices
1304** here.
1305*/
1306
1307#ifndef GIDSET_T
1308# define GIDSET_T int
1309#endif
1310
31c3ae15 1311/*
1ead4c2f
EA
1312** Tweaking for systems that (for example) claim to be BSD or POSIX
1313** but don't have all the standard BSD or POSIX routines (boo hiss).
31c3ae15
EA
1314*/
1315
1316#ifdef titan
1317# undef HASINITGROUPS /* doesn't have initgroups(3) call */
1318#endif
1319
1ead4c2f
EA
1320#ifdef _CRAYCOM
1321# undef HASSETSID /* despite POSIX claim, doesn't have setsid */
1322#endif
1323
e3a8e3e0
EA
1324#ifdef ISC_UNIX
1325# undef bcopy /* despite SystemV claim, uses BSD bcopy */
1326#endif
1327
1328#ifdef ALTOS_SYS_V
1329# undef bcopy /* despite SystemV claim, uses BSD bcopy */
1330# undef bzero /* despite SystemV claim, uses BSD bzero */
1331# undef bcmp /* despite SystemV claim, uses BSD bcmp */
1332#endif
1333
72af7ebb 1334
a74fd615
EA
1335/*
1336** Due to a "feature" in some operating systems such as Ultrix 4.3 and
1337** HPUX 8.0, if you receive a "No route to host" message (ICMP message
1338** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
1339** are closed. Some firewalls return this error if you try to connect
1340** to the IDENT port (113), so you can't receive email from these hosts
1341** on these systems. The firewall really should use a more specific
1342** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If
1343** not explicitly set to zero above, default it on.
1344*/
1345
1346#ifndef IDENTPROTO
1347# define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */
1348#endif
1349
1ee33f7d
EA
1350#ifndef HASGETUSERSHELL
1351# define HASGETUSERSHELL 1 /* libc has getusershell(3) call */
9ceb18fe
EA
1352#endif
1353
72af7ebb
EA
1354#ifndef HASFLOCK
1355# define HASFLOCK 0 /* assume no flock(2) support */
1356#endif
1357
230ac0bd
EA
1358#ifndef HASSETRLIMIT
1359# define HASSETRLIMIT 0 /* assume no setrlimit(2) support */
1360#endif
1361
1362#ifndef HASULIMIT
1363# define HASULIMIT 0 /* assume no ulimit(2) support */
1364#endif
1365
11c14c72
EA
1366#ifndef OLD_NEWDB
1367# define OLD_NEWDB 0 /* assume newer version of newdb */
1368#endif
1369
3a15d11b
EA
1370/* heuristic setting of HASSETSIGMASK; can override above */
1371#ifndef HASSIGSETMASK
1372# ifdef SIGVTALRM
1373# define HASSETSIGMASK 1
1374# else
1375# define HASSETSIGMASK 0
1376# endif
1377#endif
1378
782a2f97
EA
1379#ifndef UID_T
1380# define UID_T uid_t
1381#endif
1382
2604d017
EA
1383#ifndef SIZE_T
1384# define SIZE_T size_t
1385#endif
1386
782a2f97
EA
1387#ifndef ARGV_T
1388# define ARGV_T char **
1389#endif
1390
2295903c
EA
1391
1392/**********************************************************************
e6245c7e
EA
1393** Remaining definitions should never have to be changed. They are
1394** primarily to provide back compatibility for older systems -- for
6070681d 1395** example, it includes some POSIX compatibility definitions
2295903c 1396**********************************************************************/
e6245c7e 1397
bd3dddbf
EA
1398/* System 5 compatibility */
1399#ifndef S_ISREG
fce21cb9
EA
1400# define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG)
1401#endif
1402#if !defined(S_ISLNK) && defined(S_IFLNK)
1403# define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK)
bd3dddbf 1404#endif
d52f8819
EA
1405#ifndef S_IWUSR
1406# define S_IWUSR 0200
1407#endif
bd3dddbf 1408#ifndef S_IWGRP
d52f8819 1409# define S_IWGRP 0020
bd3dddbf
EA
1410#endif
1411#ifndef S_IWOTH
d52f8819 1412# define S_IWOTH 0002
bd3dddbf
EA
1413#endif
1414
030ae776
EA
1415/*
1416** Older systems don't have this error code -- it should be in
1417** /usr/include/sysexits.h.
1418*/
1419
1420# ifndef EX_CONFIG
1421# define EX_CONFIG 78 /* configuration error */
1422# endif
5229f34d 1423
fe3849ea
EA
1424/* pseudo-code used in server SMTP */
1425# define EX_QUIT 22 /* drop out of server immediately */
1426
1427
92f2b65e
EA
1428/*
1429** These are used in a few cases where we need some special
1430** error codes, but where the system doesn't provide something
1431** reasonable. They are printed in errstring.
1432*/
1433
1434#ifndef E_PSEUDOBASE
1435# define E_PSEUDOBASE 256
1436#endif
1437
1438#define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */
1439#define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */
1440
0639fd0c
EA
1441/* type of arbitrary pointer */
1442#ifndef ARBPTR_T
1443# define ARBPTR_T void *
1444#endif
1445
ed0b2c1b
EA
1446#ifndef __P
1447# include "cdefs.h"
1448#endif
1449
648eb46e
EA
1450#if NAMED_BIND
1451# include <arpa/nameser.h>
264ee34f
EA
1452# ifdef __svr4__
1453# ifdef NOERROR
1454# undef NOERROR /* avoid compiler conflict with stream.h */
1455# endif
1456# endif
648eb46e
EA
1457#endif
1458
d2dc4dd0
EA
1459/*
1460** The size of an IP address -- can't use sizeof because of problems
1461** on Crays, where everything is 64 bits. This will break if/when
1462** IP addresses are expanded to eight bytes.
1463*/
1464
648eb46e
EA
1465#ifndef INADDRSZ
1466# define INADDRSZ 4
1467#endif
1468
1469/*
1470** The size of various known types -- for reading network protocols.
1471** Again, we can't use sizeof because of compiler randomness.
1472*/
1473
1474#ifndef INT16SZ
1475# define INT16SZ 2
1476#endif
1477#ifndef INT32SZ
1478# define INT32SZ 4
1479#endif
d2dc4dd0 1480
3356c77c
EA
1481/*
1482** Do some required dependencies
1483*/
1484
1485#if defined(NETINET) || defined(NETISO)
e9aa7870
EA
1486# define SMTP 1 /* enable user and server SMTP */
1487# define QUEUE 1 /* enable queueing */
1488# define DAEMON 1 /* include the daemon (requires IPC & SMTP) */
3356c77c
EA
1489#endif
1490
1491
5229f34d
EA
1492/*
1493** Arrange to use either varargs or stdargs
1494*/
1495
1496# ifdef __STDC__
1497
1498# include <stdarg.h>
1499
5229f34d
EA
1500# define VA_LOCAL_DECL va_list ap;
1501# define VA_START(f) va_start(ap, f)
1502# define VA_END va_end(ap)
1503
1504# else
1505
1506# include <varargs.h>
1507
5229f34d
EA
1508# define VA_LOCAL_DECL va_list ap;
1509# define VA_START(f) va_start(ap)
1510# define VA_END va_end(ap)
1511
1512# endif
422bed79 1513
322eceee 1514#ifdef HASUNAME
422bed79
EA
1515# include <sys/utsname.h>
1516# ifdef newstr
1517# undef newstr
1518# endif
322eceee 1519#else /* ! HASUNAME */
422bed79
EA
1520# define NODE_LENGTH 32
1521struct utsname
1522{
1523 char nodename[NODE_LENGTH+1];
1524};
322eceee 1525#endif /* HASUNAME */
6e99f903 1526
4d645e29 1527#if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
7621e399 1528# define MAXHOSTNAMELEN 256
8d3fd325 1529#endif
49c069a9
EA
1530
1531#if !defined(SIGCHLD) && defined(SIGCLD)
1532# define SIGCHLD SIGCLD
1533#endif
1534
1535#ifndef STDIN_FILENO
550fee58 1536# define STDIN_FILENO 0
49c069a9
EA
1537#endif
1538
1539#ifndef STDOUT_FILENO
550fee58 1540# define STDOUT_FILENO 1
49c069a9
EA
1541#endif
1542
1543#ifndef STDERR_FILENO
550fee58 1544# define STDERR_FILENO 2
49c069a9 1545#endif
f8a31c8e 1546
0f786d57 1547#ifndef LOCK_SH
39270cfd
EA
1548# define LOCK_SH 0x01 /* shared lock */
1549# define LOCK_EX 0x02 /* exclusive lock */
1550# define LOCK_NB 0x04 /* non-blocking lock */
1551# define LOCK_UN 0x08 /* unlock */
1552#endif
64247676 1553
550fee58
EA
1554#ifndef SEEK_SET
1555# define SEEK_SET 0
1556# define SEEK_CUR 1
1557# define SEEK_END 2
1558#endif
1559
39270cfd
EA
1560#ifndef SIG_ERR
1561# define SIG_ERR ((void (*)()) -1)
f8a31c8e 1562#endif
a3685d83 1563
0349f8cc
EA
1564#ifndef WEXITSTATUS
1565# define WEXITSTATUS(st) (((st) >> 8) & 0377)
1566#endif
1567#ifndef WIFEXITED
1568# define WIFEXITED(st) (((st) & 0377) == 0)
1569#endif
1570
53335960
EA
1571#ifndef SIGFUNC_DEFINED
1572typedef void (*sigfunc_t) __P((int));
1573#endif
1574
7cfc9c77
EA
1575/* size of syslog buffer */
1576#ifndef SYSLOG_BUFSIZE
1577# define SYSLOG_BUFSIZE 1024
1578#endif
1579
a3685d83
EA
1580/*
1581** Size of tobuf (deliver.c)
1582** Tweak this to match your syslog implementation. It will have to
1583** allow for the extra information printed.
1584*/
1585
1586#ifndef TOBUFSIZE
7cfc9c77
EA
1587# if (SYSLOG_BUFSIZE) > 512
1588# define TOBUFSIZE (SYSLOG_BUFSIZE - 256)
1589# else
1590# define TOBUFSIZE 256
1591# endif
a3685d83 1592#endif
9114f86c 1593
77779257
EA
1594/*
1595** Size of prescan buffer.
1596** Despite comments in the _sendmail_ book, this probably should
1597** not be changed; there are some hard-to-define dependencies.
1598*/
1599
1600# define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */
9114f86c
EA
1601/* fork routine -- set above using #ifdef _osname_ or in Makefile */
1602# ifndef FORK
1603# define FORK vfork /* function to call to fork mailer */
1604# endif
5e0139e6
EA
1605
1606/*
1607** If we are going to link scanf anyway, use it in readcf
1608*/
1609
1610#if !defined(HASUNAME) && !defined(SCANF)
1611# define SCANF 1
1612#endif