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