RISCOS and SGI fixes; fix error handling (caused error messages to
[unix-history] / usr / src / usr.sbin / sendmail / src / conf.h
... / ...
CommitLineData
1/*
2 * Copyright (c) 1983 Eric P. Allman
3 * Copyright (c) 1988, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * %sccs.include.redist.c%
7 *
8 * @(#)conf.h 8.9 (Berkeley) %G%
9 */
10
11/*
12** CONF.H -- All user-configurable parameters for sendmail
13*/
14
15# include <sys/param.h>
16# include <sys/stat.h>
17# include <fcntl.h>
18
19/**********************************************************************
20** Table sizes, etc....
21** There shouldn't be much need to change these....
22**********************************************************************/
23
24# define MAXLINE 2048 /* max line length */
25# define MAXNAME 256 /* max length of a name */
26# define MAXPV 40 /* max # of parms to mailers */
27# define MAXATOM 200 /* max atoms per address */
28# define MAXMAILERS 25 /* maximum mailers known to system */
29# define MAXRWSETS 100 /* max # of sets of rewriting rules */
30# define MAXPRIORITIES 25 /* max values for Precedence: field */
31# define MAXMXHOSTS 20 /* max # of MX records */
32# define SMTPLINELIM 990 /* maximum SMTP line length */
33# define MAXKEY 128 /* maximum size of a database key */
34# define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */
35# define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */
36# define MAXIPADDR 16 /* max # of IP addrs for this host */
37# define MAXALIASDB 12 /* max # of alias databases */
38# define PSBUFSIZE (MAXLINE + MAXATOM) /* size of prescan buffer */
39
40# ifndef QUEUESIZE
41# define QUEUESIZE 1000 /* max # of jobs per queue run */
42# endif
43
44/**********************************************************************
45** Compilation options.
46**
47** #define these if they are available; comment them out otherwise.
48**********************************************************************/
49
50# define LOG 1 /* enable logging */
51# define UGLYUUCP 1 /* output ugly UUCP From lines */
52# define NETINET 1 /* include internet support */
53# define SETPROCTITLE 1 /* munge argv to display current status */
54# define NAMED_BIND 1 /* use Berkeley Internet Domain Server */
55# define MATCHGECOS 1 /* match user names from gecos field */
56# define XDEBUG 1 /* enable extended debugging */
57
58# ifdef NEWDB
59# define USERDB 1 /* look in user database (requires NEWDB) */
60# endif
61
62/**********************************************************************
63** Operating system configuration.
64**
65** Unless you are porting to a new OS, you shouldn't have to
66** change these.
67**********************************************************************/
68
69/*
70** Per-Operating System defines
71*/
72
73/*
74** HP-UX -- tested for 8.07
75*/
76
77# ifdef __hpux
78# define SYSTEM5 1 /* include all the System V defines */
79# define HASSETREUID 1 /* have setreuid(2) call */
80# define setreuid(r, e) setresuid(r, e, -1)
81# define LA_TYPE LA_FLOAT
82# define _PATH_UNIX "/hp-ux"
83# endif
84
85/*
86** IBM AIX 3.x -- actually tested for 3.2.3
87*/
88
89# ifdef _AIX3
90# define LOCKF 1 /* use System V lockf instead of flock */
91# define FORK fork /* no vfork primitive available */
92# endif
93
94/*
95** Silicon Graphics IRIX
96**
97** Compiles on 4.0.1.
98*/
99
100# ifdef IRIX
101# define HASSETREUID 1 /* have setreuid(2) call */
102# define FORK fork /* no vfork primitive available */
103# define setpgrp BSDsetpgrp
104# define GIDSET_T gid_t
105# endif
106
107
108/*
109** SunOS
110*/
111
112#if defined(sun) && !defined(BSD)
113
114# define LA_TYPE LA_INT
115
116# ifdef SOLARIS
117 /* Solaris 2.x (a.k.a. SunOS 5.x) */
118# define SYSTEM5 1 /* use System V definitions */
119# include <sys/time.h>
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
125
126# else
127 /* SunOS 4.1.x */
128# define HASSTATFS 1 /* has the statfs(2) syscall */
129# define HASSETREUID 1 /* have setreuid(2) call */
130# include <vfork.h>
131
132# endif
133#endif
134
135/*
136** Digital Ultrix 4.2A or 4.3
137*/
138
139#ifdef ultrix
140# define HASSTATFS 1 /* has the statfs(2) syscall */
141# define HASSETREUID 1 /* have setreuid(2) call */
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"
146#endif
147
148/*
149** OSF/1 (tested on Alpha)
150*/
151
152#ifdef __osf__
153# define HASSETENV 1 /* has setenv(3) call */
154# define HASUNSETENV 1 /* has unsetenv(3) call */
155# define HASSETREUID 1 /* have setreuid(2) call */
156# define LA_TYPE LA_INT
157# define LA_AVENRUN "avenrun"
158#endif
159
160/*
161** NeXTstep
162*/
163
164#ifdef __NeXT__
165# define sleep sleepX
166# define LA_TYPE LA_ZERO
167#endif
168
169/*
170** 4.4 BSD
171*/
172
173#ifdef BSD4_4
174# include <sys/cdefs.h>
175# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
176#endif
177
178/*
179** SCO Unix
180*/
181
182#ifdef _SCO_unix_
183# define SYSTEM5 1 /* include all the System V defines */
184# define FORK fork
185# define MAXPATHLEN PATHSIZE
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
209#ifdef RISCOS
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"
215#endif
216
217/**********************************************************************
218** End of Per-Operating System defines
219**********************************************************************/
220
221/**********************************************************************
222** More general defines
223**********************************************************************/
224
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
236/* general System V defines */
237# ifdef SYSTEM5
238# define LOCKF 1 /* use System V locking instead of flock */
239# define HASUNAME 1 /* use System V uname(2) system call */
240# define HASUSTAT 1 /* use System V ustat(2) syscall */
241# ifndef LA_TYPE
242# define LA_TYPE LA_INT
243# endif
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)))
247# endif
248
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
259/*
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.
267*/
268
269#if !defined(ultrix) && !defined(__hpux)
270# define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */
271#endif
272
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
283/*
284** Remaining definitions should never have to be changed. They are
285** primarily to provide back compatibility for older systems -- for
286** example, it includes some POSIX compatibility definitions
287*/
288
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
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
308
309#ifndef __P
310# include "cdefs.h"
311#endif
312
313/*
314** Do some required dependencies
315*/
316
317#if defined(NETINET) || defined(NETISO)
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) */
321#endif
322
323
324/*
325** Arrange to use either varargs or stdargs
326*/
327
328# ifdef __STDC__
329
330# include <stdarg.h>
331
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
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
345
346#ifdef HASUNAME
347# include <sys/utsname.h>
348# ifdef newstr
349# undef newstr
350# endif
351#else /* ! HASUNAME */
352# define NODE_LENGTH 32
353struct utsname
354{
355 char nodename[NODE_LENGTH+1];
356};
357#endif /* HASUNAME */
358
359#if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
360# define MAXHOSTNAMELEN 256
361#endif
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
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 */
383#define LOCK_UN 0x08 /* unlock */
384
385#else
386
387# include <sys/file.h>
388
389#endif
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
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