xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 64264)
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.22 (Berkeley) 08/15/93
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 # include <signal.h>
19 
20 /**********************************************************************
21 **  Table sizes, etc....
22 **	There shouldn't be much need to change these....
23 **********************************************************************/
24 
25 # define MAXLINE	2048		/* max line length */
26 # define MAXNAME	256		/* max length of a name */
27 # define MAXPV		40		/* max # of parms to mailers */
28 # define MAXATOM	200		/* max atoms per address */
29 # define MAXMAILERS	25		/* maximum mailers known to system */
30 # define MAXRWSETS	100		/* max # of sets of rewriting rules */
31 # define MAXPRIORITIES	25		/* max values for Precedence: field */
32 # define MAXMXHOSTS	20		/* max # of MX records */
33 # define SMTPLINELIM	990		/* maximum SMTP line length */
34 # define MAXKEY		128		/* maximum size of a database key */
35 # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
36 # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
37 # define MAXIPADDR	16		/* max # of IP addrs for this host */
38 # define MAXALIASDB	12		/* max # of alias databases */
39 # define PSBUFSIZE	(MAXLINE + MAXATOM)	/* size of prescan buffer */
40 
41 # ifndef QUEUESIZE
42 # define QUEUESIZE	1000		/* max # of jobs per queue run */
43 # endif
44 
45 /**********************************************************************
46 **  Compilation options.
47 **
48 **	#define these if they are available; comment them out otherwise.
49 **********************************************************************/
50 
51 # define LOG		1	/* enable logging */
52 # define UGLYUUCP	1	/* output ugly UUCP From lines */
53 # define NETINET	1	/* include internet support */
54 # define SETPROCTITLE	1	/* munge argv to display current status */
55 # define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
56 # define MATCHGECOS	1	/* match user names from gecos field */
57 # define XDEBUG		1	/* enable extended debugging */
58 
59 # ifdef NEWDB
60 # define USERDB		1	/* look in user database (requires NEWDB) */
61 # endif
62 
63 /*
64 **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
65 **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
66 **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
67 **  are closed.  Some firewalls return this error if you try to connect
68 **  to the IDENT port (113), so you can't receive email from these hosts
69 **  on these systems.  The firewall really should use a more specific
70 **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  This
71 **  will get #undefed below as needed.
72 */
73 
74 # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
75 
76 /**********************************************************************
77 **  Operating system configuration.
78 **
79 **	Unless you are porting to a new OS, you shouldn't have to
80 **	change these.
81 **********************************************************************/
82 
83 /*
84 **  Per-Operating System defines
85 */
86 
87 /*
88 **  HP-UX -- tested for 8.07
89 */
90 
91 # ifdef __hpux
92 # define SYSTEM5	1	/* include all the System V defines */
93 # define HASINITGROUPS	1	/* has initgroups(3) call */
94 # define HASSETREUID	1	/* has setreuid(2) call */
95 # define setreuid(r, e)		setresuid(r, e, -1)
96 # define LA_TYPE	LA_FLOAT
97 # define _PATH_UNIX	"/hp-ux"
98 # undef IDENTPROTO
99 # endif
100 
101 /*
102 **  IBM AIX 3.x -- actually tested for 3.2.3
103 */
104 
105 # ifdef _AIX3
106 # define HASINITGROUPS	1	/* has initgroups(3) call */
107 # define FORK		fork	/* no vfork primitive available */
108 # endif
109 
110 /*
111 **  Silicon Graphics IRIX
112 **
113 **	Compiles on 4.0.1.
114 */
115 
116 # ifdef IRIX
117 # define HASSETREUID	1	/* has setreuid(2) call */
118 # define HASINITGROUPS	1	/* has initgroups(3) call */
119 # define FORK		fork	/* no vfork primitive available */
120 # define setpgid	BSDsetpgrp
121 # define GIDSET_T	gid_t
122 # endif
123 
124 
125 /*
126 **  SunOS
127 */
128 
129 #if defined(sun) && !defined(BSD)
130 
131 # define LA_TYPE	LA_INT
132 # define HASSETREUID	1	/* has setreuid(2) call */
133 # define HASINITGROUPS	1	/* has initgroups(3) call */
134 
135 # ifdef SOLARIS
136 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
137 #  define SYSTEM5	1	/* use System V definitions */
138 #  define setreuid(r, e)	seteuid(e)
139 #  include <sys/time.h>
140 #  define gethostbyname	__switch_gethostbyname	/* get working version */
141 #  define gethostbyaddr	__switch_gethostbyaddr	/* get working version */
142 #  define _PATH_UNIX	"/kernel/unix"
143 #  ifndef _PATH_SENDMAILCF
144 #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
145 #  endif
146 #  ifndef _PATH_SENDMAILFC
147 #   define _PATH_SENDMAILFC	"/etc/mail/sendmail.fc"
148 #  endif
149 #  ifndef _PATH_SENDMAILPID
150 #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
151 #  endif
152 
153 # else
154 			/* SunOS 4.1.x */
155 #  define HASSTATFS	1	/* has the statfs(2) syscall */
156 /* #  define HASFLOCK	1	/* has flock(2) call */
157 #  include <vfork.h>
158 
159 # endif
160 #endif
161 
162 /*
163 **  Digital Ultrix 4.2A or 4.3
164 **
165 **	Apparently, fcntl locking is broken on 4.2A, in that locks are
166 **	not dropped when the process exits.  This causes major problems,
167 **	so flock is the only alternative.
168 */
169 
170 #ifdef ultrix
171 # define HASSTATFS	1	/* has the statfs(2) syscall */
172 # define HASSETREUID	1	/* has setreuid(2) call */
173 # define HASUNSETENV	1	/* has unsetenv(3) call */
174 # define HASINITGROUPS	1	/* has initgroups(3) call */
175 # define HASFLOCK	1	/* has flock(2) call */
176 # define LA_TYPE	LA_INT
177 # define LA_AVENRUN	"avenrun"
178 # undef IDENTPROTO
179 #endif
180 
181 /*
182 **  OSF/1 (tested on Alpha)
183 */
184 
185 #ifdef __osf__
186 # define HASUNSETENV	1	/* has unsetenv(3) call */
187 # define HASSETREUID	1	/* has setreuid(2) call */
188 # define HASINITGROUPS	1	/* has initgroups(3) call */
189 /* # define HASFLOCK	1	/* has flock(2) call */
190 # define LA_TYPE	LA_INT
191 #endif
192 
193 /*
194 **  NeXTstep
195 */
196 
197 #ifdef NeXT
198 # define HASINITGROUPS	1	/* has initgroups(3) call */
199 # define HASFLOCK	1	/* has flock(2) call */
200 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
201 # define sleep		sleepX
202 # define setpgid	setpgrp
203 # define LA_TYPE	LA_ZERO
204 typedef int		pid_t;
205 # ifndef _PATH_SENDMAILCF
206 #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
207 # endif
208 # ifndef _PATH_SENDMAILFC
209 #  define _PATH_SENDMAILFC	"/etc/sendmail/sendmail.fc"
210 # endif
211 # ifndef _PATH_SENDMAILPID
212 #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
213 # endif
214 #endif
215 
216 /*
217 **  4.4 BSD
218 */
219 
220 #ifdef BSD4_4
221 # define HASUNSETENV	1	/* has unsetenv(3) call */
222 # include <sys/cdefs.h>
223 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
224 # ifndef LA_TYPE
225 #  define LA_TYPE	LA_SUBR
226 # endif
227 #endif
228 
229 /*
230 **  4.3 BSD -- this is for very old systems
231 **
232 **	You'll also have to install a new resolver library.
233 **	I don't guarantee that support for this environment is complete.
234 */
235 
236 #ifdef oldBSD43
237 # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
238 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
239 # define ARBPTR_T	char *
240 # define setpgid	setpgrp
241 # ifndef LA_TYPE
242 #  define LA_TYPE	LA_FLOAT
243 # endif
244 # ifndef _PATH_SENDMAILCF
245 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
246 # endif
247 # ifndef _PATH_SENDMAILFC
248 #  define _PATH_SENDMAILFC	"/usr/lib/sendmail.fc"
249 # endif
250 #endif
251 
252 /*
253 **  SCO Unix
254 */
255 
256 #ifdef _SCO_unix_
257 # define SYSTEM5	1	/* include all the System V defines */
258 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
259 # define HASSTATFS	1	/* has the statfs(2) syscall */
260 # define FORK		fork
261 # define MAXPATHLEN	PATHSIZE
262 # define LA_TYPE	LA_ZERO
263 #endif
264 
265 /*
266 **  ConvexOS 11.0 and later
267 */
268 
269 #ifdef _CONVEX_SOURCE
270 # define BSD		1	/* include all the BSD defines */
271 # define HASUNAME	1	/* use System V uname(2) system call */
272 # define HASSTATFS	1	/* has the statfs(2) syscall */
273 # define HASSETSID	1	/* has POSIX setsid(2) call */
274 # define NEEDGETOPT	1	/* need replacement for getopt(3) */
275 # define LA_TYPE	LA_FLOAT
276 # undef IDENTPROTO
277 #endif
278 
279 /*
280 **  RISC/os 4.51
281 **
282 **	Untested...
283 */
284 
285 #ifdef RISCOS
286 # define HASUNSETENV	1	/* has unsetenv(3) call */
287 /* # define HASFLOCK	1	/* has flock(2) call */
288 # define LA_TYPE	LA_INT
289 # define LA_AVENRUN	"avenrun"
290 # define _PATH_UNIX	"/unix"
291 #endif
292 
293 /*
294 **  Linux 0.99pl10 and above...
295 **	From Karl London <karl@borg.demon.co.uk>.
296 */
297 
298 #ifdef linux
299 # define BSD		1	/* pretend to be BSD based today */
300 # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
301 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
302 # ifndef LA_TYPE
303 #  define LA_TYPE	LA_FLOAT
304 # endif
305 #endif
306 
307 
308 /**********************************************************************
309 **  End of Per-Operating System defines
310 **********************************************************************/
311 
312 /**********************************************************************
313 **  More general defines
314 **********************************************************************/
315 
316 /* general BSD defines */
317 #ifdef BSD
318 # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
319 # define HASSETREUID	1	/* has setreuid(2) call */
320 # define HASINITGROUPS	1	/* has initgroups(2) call */
321 # define HASFLOCK	1	/* has flock(2) call */
322 #endif
323 
324 /* general System V defines */
325 # ifdef SYSTEM5
326 # define HASUNAME	1	/* use System V uname(2) system call */
327 # define HASUSTAT	1	/* use System V ustat(2) syscall */
328 # ifndef LA_TYPE
329 #  define LA_TYPE	LA_INT
330 # endif
331 # define bcopy(s, d, l)		(memmove((d), (s), (l)))
332 # define bzero(d, l)		(memset((d), '\0', (l)))
333 # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
334 # endif
335 
336 /* general "standard C" defines */
337 #if defined(__STDC__) || defined(SYSTEM5)
338 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
339 #endif
340 
341 /* general POSIX defines */
342 #ifdef _POSIX_VERSION
343 # define HASSETSID	1	/* has setsid(2) call */
344 # define HASWAITPID	1	/* has waitpid(2) call */
345 #endif
346 
347 /*
348 **  If no type for argument two of getgroups call is defined, assume
349 **  it's an integer -- unfortunately, there seem to be several choices
350 **  here.
351 */
352 
353 #ifndef GIDSET_T
354 # define GIDSET_T	int
355 #endif
356 
357 /*
358 **  Remaining definitions should never have to be changed.  They are
359 **  primarily to provide back compatibility for older systems -- for
360 **  example, it includes some POSIX compatibility definitions
361 */
362 
363 /* System 5 compatibility */
364 #ifndef S_ISREG
365 #define S_ISREG(foo)	((foo & S_IFREG) == S_IFREG)
366 #endif
367 #ifndef S_IWGRP
368 #define S_IWGRP		020
369 #endif
370 #ifndef S_IWOTH
371 #define S_IWOTH		002
372 #endif
373 
374 /*
375 **  Older systems don't have this error code -- it should be in
376 **  /usr/include/sysexits.h.
377 */
378 
379 # ifndef EX_CONFIG
380 # define EX_CONFIG	78	/* configuration error */
381 # endif
382 
383 /*
384 **  These are used in a few cases where we need some special
385 **  error codes, but where the system doesn't provide something
386 **  reasonable.  They are printed in errstring.
387 */
388 
389 #ifndef E_PSEUDOBASE
390 # define E_PSEUDOBASE	256
391 #endif
392 
393 #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
394 #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
395 
396 /* type of arbitrary pointer */
397 #ifndef ARBPTR_T
398 # define ARBPTR_T	void *
399 #endif
400 
401 #ifndef __P
402 # include "cdefs.h"
403 #endif
404 
405 /*
406 **  Do some required dependencies
407 */
408 
409 #if defined(NETINET) || defined(NETISO)
410 # define SMTP		1	/* enable user and server SMTP */
411 # define QUEUE		1	/* enable queueing */
412 # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
413 #endif
414 
415 
416 /*
417 **  Arrange to use either varargs or stdargs
418 */
419 
420 # ifdef __STDC__
421 
422 # include <stdarg.h>
423 
424 # define VA_LOCAL_DECL	va_list ap;
425 # define VA_START(f)	va_start(ap, f)
426 # define VA_END		va_end(ap)
427 
428 # else
429 
430 # include <varargs.h>
431 
432 # define VA_LOCAL_DECL	va_list ap;
433 # define VA_START(f)	va_start(ap)
434 # define VA_END		va_end(ap)
435 
436 # endif
437 
438 #ifdef HASUNAME
439 # include <sys/utsname.h>
440 # ifdef newstr
441 #  undef newstr
442 # endif
443 #else /* ! HASUNAME */
444 # define NODE_LENGTH 32
445 struct utsname
446 {
447 	char nodename[NODE_LENGTH+1];
448 };
449 #endif /* HASUNAME */
450 
451 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
452 # define MAXHOSTNAMELEN	256
453 #endif
454 
455 #if !defined(SIGCHLD) && defined(SIGCLD)
456 # define SIGCHLD	SIGCLD
457 #endif
458 
459 #ifndef STDIN_FILENO
460 #define STDIN_FILENO	0
461 #endif
462 
463 #ifndef STDOUT_FILENO
464 #define STDOUT_FILENO	1
465 #endif
466 
467 #ifndef STDERR_FILENO
468 #define STDERR_FILENO	2
469 #endif
470 
471 #ifdef HASFLOCK
472 # include <sys/file.h>
473 #endif
474 
475 #ifndef LOCK_SH
476 # define LOCK_SH	0x01	/* shared lock */
477 # define LOCK_EX	0x02	/* exclusive lock */
478 # define LOCK_NB	0x04	/* non-blocking lock */
479 # define LOCK_UN	0x08	/* unlock */
480 #endif
481 
482 #ifndef SIG_ERR
483 # define SIG_ERR	((void (*)()) -1)
484 #endif
485 
486 /*
487 **  Size of tobuf (deliver.c)
488 **	Tweak this to match your syslog implementation.  It will have to
489 **	allow for the extra information printed.
490 */
491 
492 #ifndef TOBUFSIZE
493 # define TOBUFSIZE (1024 - 256)
494 #endif
495 
496 /* fork routine -- set above using #ifdef _osname_ or in Makefile */
497 # ifndef FORK
498 # define FORK		vfork		/* function to call to fork mailer */
499 # endif
500