RISCOS and SGI fixes; fix error handling (caused error messages to
[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 *
0fc3fb21 8 * @(#)conf.h 8.9 (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>
46300693 16# include <sys/stat.h>
f8a31c8e 17# include <fcntl.h>
f43b04ce 18
ba6514e2 19/**********************************************************************
5a739feb
EA
20** Table sizes, etc....
21** There shouldn't be much need to change these....
ba6514e2 22**********************************************************************/
5a739feb 23
d36f8e5c 24# define MAXLINE 2048 /* max line length */
f0a960f1 25# define MAXNAME 256 /* max length of a name */
5a739feb 26# define MAXPV 40 /* max # of parms to mailers */
d36f8e5c 27# define MAXATOM 200 /* max atoms per address */
5a739feb 28# define MAXMAILERS 25 /* maximum mailers known to system */
8583ab39 29# define MAXRWSETS 100 /* max # of sets of rewriting rules */
5a739feb 30# define MAXPRIORITIES 25 /* max values for Precedence: field */
8583ab39 31# define MAXMXHOSTS 20 /* max # of MX records */
8657d05f 32# define SMTPLINELIM 990 /* maximum SMTP line length */
f43b04ce
EA
33# define MAXKEY 128 /* maximum size of a database key */
34# define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */
b0b636d1 35# define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */
8e571338 36# define MAXIPADDR 16 /* max # of IP addrs for this host */
9f7134c8 37# define MAXALIASDB 12 /* max # of alias databases */
d36f8e5c 38# define PSBUFSIZE (MAXLINE + MAXATOM) /* size of prescan buffer */
8583ab39
EA
39
40# ifndef QUEUESIZE
41# define QUEUESIZE 1000 /* max # of jobs per queue run */
42# endif
43
ba6514e2 44/**********************************************************************
5a739feb 45** Compilation options.
9bcdff70
EA
46**
47** #define these if they are available; comment them out otherwise.
ba6514e2 48**********************************************************************/
5a739feb 49
9bcdff70 50# define LOG 1 /* enable logging */
9bcdff70 51# define UGLYUUCP 1 /* output ugly UUCP From lines */
3356c77c 52# define NETINET 1 /* include internet support */
9bcdff70 53# define SETPROCTITLE 1 /* munge argv to display current status */
35af2f06 54# define NAMED_BIND 1 /* use Berkeley Internet Domain Server */
7f0fd60b 55# define MATCHGECOS 1 /* match user names from gecos field */
8e5c6745 56# define XDEBUG 1 /* enable extended debugging */
d25bb424 57
273562d8
EA
58# ifdef NEWDB
59# define USERDB 1 /* look in user database (requires NEWDB) */
5a4c03c6
EA
60# endif
61
ba6514e2 62/**********************************************************************
e6245c7e
EA
63** Operating system configuration.
64**
65** Unless you are porting to a new OS, you shouldn't have to
66** change these.
ba6514e2 67**********************************************************************/
5a4c03c6 68
fd57f063
EA
69/*
70** Per-Operating System defines
71*/
72
ba6514e2
EA
73/*
74** HP-UX -- tested for 8.07
75*/
76
8a47b280 77# ifdef __hpux
fd57f063 78# define SYSTEM5 1 /* include all the System V defines */
ba6514e2
EA
79# define HASSETREUID 1 /* have setreuid(2) call */
80# define setreuid(r, e) setresuid(r, e, -1)
33d59d37
EA
81# define LA_TYPE LA_FLOAT
82# define _PATH_UNIX "/hp-ux"
273562d8
EA
83# endif
84
ba6514e2
EA
85/*
86** IBM AIX 3.x -- actually tested for 3.2.3
87*/
88
a419d027 89# ifdef _AIX3
9114f86c
EA
90# define LOCKF 1 /* use System V lockf instead of flock */
91# define FORK fork /* no vfork primitive available */
8e5c6745
EA
92# endif
93
ba6514e2
EA
94/*
95** Silicon Graphics IRIX
96**
0fc3fb21 97** Compiles on 4.0.1.
ba6514e2
EA
98*/
99
8e5c6745 100# ifdef IRIX
0fc3fb21 101# define HASSETREUID 1 /* have setreuid(2) call */
8e5c6745 102# define FORK fork /* no vfork primitive available */
8e5c6745 103# define setpgrp BSDsetpgrp
e6cb9fc4 104# define GIDSET_T gid_t
9114f86c
EA
105# endif
106
ba6514e2
EA
107
108/*
109** SunOS
110*/
111
45f49b73 112#if defined(sun) && !defined(BSD)
fd57f063 113
33d59d37 114# define LA_TYPE LA_INT
45f49b73 115
7b3820ed 116# ifdef SOLARIS
ba6514e2 117 /* Solaris 2.x (a.k.a. SunOS 5.x) */
b4cd00ff 118# define SYSTEM5 1 /* use System V definitions */
fd57f063 119# include <sys/time.h>
33d59d37
EA
120# define _PATH_UNIX "/kernel/unix"
121# ifndef _PATH_SENDMAILCF
122# define _PATH_SENDMAILCF "/etc/mail/sendmail.cf"
123# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
124# endif
fd57f063 125
7b3820ed 126# else
fd57f063 127 /* SunOS 4.1.x */
7b3820ed 128# define HASSTATFS 1 /* has the statfs(2) syscall */
ba6514e2 129# define HASSETREUID 1 /* have setreuid(2) call */
45f49b73 130# include <vfork.h>
45f49b73 131
fd57f063 132# endif
45f49b73
EA
133#endif
134
ba6514e2
EA
135/*
136** Digital Ultrix 4.2A or 4.3
137*/
138
45f49b73
EA
139#ifdef ultrix
140# define HASSTATFS 1 /* has the statfs(2) syscall */
ba6514e2 141# define HASSETREUID 1 /* have setreuid(2) call */
33d59d37
EA
142# define HASSETENV 1 /* has setenv(3) call */
143# define HASUNSETENV 1 /* has unsetenv(3) call */
144# define LA_TYPE LA_INT
145# define LA_AVENRUN "avenrun"
e6245c7e
EA
146#endif
147
ba6514e2
EA
148/*
149** OSF/1 (tested on Alpha)
150*/
151
fd57f063 152#ifdef __osf__
33d59d37
EA
153# define HASSETENV 1 /* has setenv(3) call */
154# define HASUNSETENV 1 /* has unsetenv(3) call */
ba6514e2 155# define HASSETREUID 1 /* have setreuid(2) call */
33d59d37
EA
156# define LA_TYPE LA_INT
157# define LA_AVENRUN "avenrun"
6070681d
EA
158#endif
159
ba6514e2
EA
160/*
161** NeXTstep
162*/
163
8e5c6745
EA
164#ifdef __NeXT__
165# define sleep sleepX
33d59d37 166# define LA_TYPE LA_ZERO
8c5949d2
EA
167#endif
168
ba6514e2 169/*
33d59d37 170** 4.4 BSD
ba6514e2
EA
171*/
172
ed0b2c1b
EA
173#ifdef BSD4_4
174# include <sys/cdefs.h>
7621e399
EA
175# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
176#endif
177
ba6514e2
EA
178/*
179** SCO Unix
180*/
181
7621e399
EA
182#ifdef _SCO_unix_
183# define SYSTEM5 1 /* include all the System V defines */
7621e399
EA
184# define FORK fork
185# define MAXPATHLEN PATHSIZE
33d59d37
EA
186# define LA_TYPE LA_ZERO
187#endif
188
189/*
190** ConvexOS 11.0 and later
191*/
192
193#ifdef _CONVEX_SOURCE
194# define SYSTEM5 1 /* include all the System V defines */
195# define HASSTATFS 1 /* has the statfs(2) syscall */
196# define HASSETSID 1 /* has POSIX setsid(2) call */
197# define HASINITGROUPS 1 /* has initgroups(2) call */
198# define HASGETDTABLESIZE 1 /* we have getdtablesize(2) call */
199# define HASSETREUID 1 /* have setreuid(2) call */
200# define LA_TYPE LA_FLOAT
201#endif
202
203/*
204** RISC/os 4.51
205**
206** Untested...
207*/
208
0fc3fb21 209#ifdef RISCOS
33d59d37
EA
210# define HASSETENV 1 /* has setenv(3) call */
211# define HASUNSETENV 1 /* has unsetenv(3) call */
212# define LA_TYPE LA_INT
213# define LA_AVENRUN "avenrun"
214# define _PATH_UNIX "/unix"
ed0b2c1b
EA
215#endif
216
ba6514e2 217/**********************************************************************
fd57f063 218** End of Per-Operating System defines
ba6514e2 219**********************************************************************/
fd57f063 220
b4cd00ff
EA
221/**********************************************************************
222** More general defines
223**********************************************************************/
224
33d59d37
EA
225/* general BSD defines */
226#ifdef BSD
227# define HASSETENV 1 /* has setenv(3) call */
228# define HASUNSETENV 1 /* has unsetenv(3) call */
229# define HASGETDTABLESIZE 1 /* we have getdtablesize(2) call */
230# define HASSETREUID 1 /* have setreuid(2) call */
231# ifndef LA_TYPE
232# define LA_TYPE LA_SUBR
233# endif
234#endif
235
fd57f063
EA
236/* general System V defines */
237# ifdef SYSTEM5
b4cd00ff 238# define LOCKF 1 /* use System V locking instead of flock */
b4cd00ff
EA
239# define HASUNAME 1 /* use System V uname(2) system call */
240# define HASUSTAT 1 /* use System V ustat(2) syscall */
33d59d37
EA
241# ifndef LA_TYPE
242# define LA_TYPE LA_INT
243# endif
b4cd00ff
EA
244# define bcopy(s, d, l) (memmove((d), (s), (l)))
245# define bzero(d, l) (memset((d), '\0', (l)))
246# define bcmp(s, d, l) (memcmp((s), (d), (l)))
fd57f063
EA
247# endif
248
b4cd00ff
EA
249/* general "standard C" defines */
250#if defined(__STDC__) || defined(SYSTEM5)
251# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
252#endif
253
254/* general POSIX defines */
255#ifdef _POSIX_VERSION
256# define HASSETSID 1 /* has setsid(2) call */
257#endif
258
df39ad0d 259/*
38966fa4
EA
260** Due to a "feature" in some operating systems such as Ultrix 4.3 and
261** HPUX 8.0, if you receive a "No route to host" message (ICMP message
262** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
263** are closed. Some firewalls return this error if you try to connect
264** to the IDENT port (113), so you can't receive email from these hosts
265** on these systems. The firewall really should use a more specific
266** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.
df39ad0d
EA
267*/
268
8a47b280 269#if !defined(ultrix) && !defined(__hpux)
df39ad0d
EA
270# define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */
271#endif
19c9e482 272
e6cb9fc4
EA
273/*
274** If no type for argument two of getgroups call is defined, assume
275** it's an integer -- unfortunately, there seem to be several choices
276** here.
277*/
278
279#ifndef GIDSET_T
280# define GIDSET_T int
281#endif
282
e6245c7e
EA
283/*
284** Remaining definitions should never have to be changed. They are
285** primarily to provide back compatibility for older systems -- for
6070681d
EA
286** example, it includes some POSIX compatibility definitions
287*/
e6245c7e 288
bd3dddbf
EA
289/* System 5 compatibility */
290#ifndef S_ISREG
291#define S_ISREG(foo) ((foo & S_IFREG) == S_IFREG)
292#endif
293#ifndef S_IWGRP
294#define S_IWGRP 020
295#endif
296#ifndef S_IWOTH
297#define S_IWOTH 002
298#endif
299
030ae776
EA
300/*
301** Older systems don't have this error code -- it should be in
302** /usr/include/sysexits.h.
303*/
304
305# ifndef EX_CONFIG
306# define EX_CONFIG 78 /* configuration error */
307# endif
5229f34d 308
ed0b2c1b
EA
309#ifndef __P
310# include "cdefs.h"
311#endif
312
3356c77c
EA
313/*
314** Do some required dependencies
315*/
316
317#if defined(NETINET) || defined(NETISO)
e9aa7870
EA
318# define SMTP 1 /* enable user and server SMTP */
319# define QUEUE 1 /* enable queueing */
320# define DAEMON 1 /* include the daemon (requires IPC & SMTP) */
3356c77c
EA
321#endif
322
323
5229f34d
EA
324/*
325** Arrange to use either varargs or stdargs
326*/
327
328# ifdef __STDC__
329
330# include <stdarg.h>
331
5229f34d
EA
332# define VA_LOCAL_DECL va_list ap;
333# define VA_START(f) va_start(ap, f)
334# define VA_END va_end(ap)
335
336# else
337
338# include <varargs.h>
339
5229f34d
EA
340# define VA_LOCAL_DECL va_list ap;
341# define VA_START(f) va_start(ap)
342# define VA_END va_end(ap)
343
344# endif
422bed79 345
322eceee 346#ifdef HASUNAME
422bed79
EA
347# include <sys/utsname.h>
348# ifdef newstr
349# undef newstr
350# endif
322eceee 351#else /* ! HASUNAME */
422bed79
EA
352# define NODE_LENGTH 32
353struct utsname
354{
355 char nodename[NODE_LENGTH+1];
356};
322eceee 357#endif /* HASUNAME */
6e99f903 358
7621e399
EA
359#if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
360# define MAXHOSTNAMELEN 256
8d3fd325 361#endif
49c069a9
EA
362
363#if !defined(SIGCHLD) && defined(SIGCLD)
364# define SIGCHLD SIGCLD
365#endif
366
367#ifndef STDIN_FILENO
368#define STDIN_FILENO 0
369#endif
370
371#ifndef STDOUT_FILENO
372#define STDOUT_FILENO 1
373#endif
374
375#ifndef STDERR_FILENO
376#define STDERR_FILENO 2
377#endif
f8a31c8e
EA
378
379#ifdef LOCKF
380#define LOCK_SH 0x01 /* shared lock */
381#define LOCK_EX 0x02 /* exclusive lock */
382#define LOCK_NB 0x04 /* non-blocking lock */
d8c2a697 383#define LOCK_UN 0x08 /* unlock */
64247676
EA
384
385#else
386
387# include <sys/file.h>
388
f8a31c8e 389#endif
a3685d83
EA
390
391/*
392** Size of tobuf (deliver.c)
393** Tweak this to match your syslog implementation. It will have to
394** allow for the extra information printed.
395*/
396
397#ifndef TOBUFSIZE
398# define TOBUFSIZE (1024 - 256)
399#endif
9114f86c
EA
400
401/* fork routine -- set above using #ifdef _osname_ or in Makefile */
402# ifndef FORK
403# define FORK vfork /* function to call to fork mailer */
404# endif