xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 63753)
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.2 (Berkeley) 07/11/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 
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 #ifdef __STDC__
70 # define HASSETVBUF	1	/* yes, we have setvbuf in libc */
71 #endif
72 
73 /* HP-UX -- tested for 8.07 */
74 # ifdef __hpux
75 # define SYSTEM5	1
76 # define UNSETENV	1	/* need unsetenv(3) support */
77 # define seteuid	setuid
78 # define HASSETVBUF		/* we have setvbuf in libc (but not __STDC__) */
79 # endif
80 
81 /* IBM AIX 3.x -- actually tested for 3.2.3 */
82 # ifdef _AIX3
83 # define LOCKF		1	/* use System V lockf instead of flock */
84 # define FORK		fork	/* no vfork primitive available */
85 # define UNSETENV	1	/* need unsetenv(3) support */
86 # define SYS5TZ		1	/* use System V style timezones */
87 # endif
88 
89 /* Silicon Graphics IRIX */
90 # ifdef IRIX
91 # define FORK		fork	/* no vfork primitive available */
92 # define UNSETENV	1	/* need unsetenv(3) support */
93 # define setpgrp	BSDsetpgrp
94 # endif
95 
96 /* general System V defines */
97 # ifdef SYSTEM5
98 # define LOCKF		1	/* use System V lockf instead of flock */
99 # define SYS5TZ		1	/* use System V style timezones */
100 # define HASUNAME	1	/* use System V uname system call */
101 # endif
102 
103 #if defined(sun) && !defined(BSD)
104 # define UNSETENV	1	/* need unsetenv(3) support */
105 
106 # ifdef SOLARIS
107 #  define LOCKF		1	/* use System V lockf instead of flock */
108 #  define UNSETENV	1	/* need unsetenv(3) support */
109 #  define HASUSTAT	1	/* has the ustat(2) syscall */
110 # else
111 #  define HASSTATFS	1	/* has the statfs(2) syscall */
112 #  include <vfork.h>
113 # endif
114 
115 #endif
116 
117 #ifdef ultrix
118 # define HASSTATFS	1	/* has the statfs(2) syscall */
119 #endif
120 
121 #ifdef _POSIX_VERSION
122 # define HASSETSID	1	/* has setsid(2) call */
123 #endif
124 
125 #ifdef __NeXT__
126 # define sleep		sleepX
127 # define UNSETENV	1	/* need unsetenv(3) support */
128 #endif
129 
130 #ifdef BSD4_4
131 # include <sys/cdefs.h>
132 # ifndef _POSIX_SAVED_IDS
133 #  define _POSIX_SAVED_IDS	/* safe because we actually use seteuid */
134 # endif
135 #endif
136 
137 /*
138 **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
139 **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
140 **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
141 **  are closed.  Some firewalls return this error if you try to connect
142 **  to the IDENT port (113), so you can't receive email from these hosts
143 **  on these systems.  The firewall really should use a more specific
144 **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.
145 */
146 
147 #if !defined(ultrix) && !defined(__hpux)
148 # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
149 #endif
150 
151 /*
152 **  Remaining definitions should never have to be changed.  They are
153 **  primarily to provide back compatibility for older systems -- for
154 **  example, it includes some POSIX compatibility definitions
155 */
156 
157 /* System 5 compatibility */
158 #ifndef S_ISREG
159 #define S_ISREG(foo)	((foo & S_IFREG) == S_IFREG)
160 #endif
161 #ifndef S_IWGRP
162 #define S_IWGRP		020
163 #endif
164 #ifndef S_IWOTH
165 #define S_IWOTH		002
166 #endif
167 
168 /*
169 **  Older systems don't have this error code -- it should be in
170 **  /usr/include/sysexits.h.
171 */
172 
173 # ifndef EX_CONFIG
174 # define EX_CONFIG	78	/* configuration error */
175 # endif
176 
177 #ifndef __P
178 # include "cdefs.h"
179 #endif
180 
181 /*
182 **  Do some required dependencies
183 */
184 
185 #if defined(NETINET) || defined(NETISO)
186 # define SMTP		1	/* enable user and server SMTP */
187 # define QUEUE		1	/* enable queueing */
188 # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
189 #endif
190 
191 
192 /*
193 **  Arrange to use either varargs or stdargs
194 */
195 
196 # ifdef __STDC__
197 
198 # include <stdarg.h>
199 
200 # define VA_LOCAL_DECL	va_list ap;
201 # define VA_START(f)	va_start(ap, f)
202 # define VA_END		va_end(ap)
203 
204 # else
205 
206 # include <varargs.h>
207 
208 # define VA_LOCAL_DECL	va_list ap;
209 # define VA_START(f)	va_start(ap)
210 # define VA_END		va_end(ap)
211 
212 # endif
213 
214 #ifdef HASUNAME
215 # include <sys/utsname.h>
216 # ifdef newstr
217 #  undef newstr
218 # endif
219 #else /* ! HASUNAME */
220 # define NODE_LENGTH 32
221 struct utsname
222 {
223 	char nodename[NODE_LENGTH+1];
224 };
225 #endif /* HASUNAME */
226 
227 #ifndef MAXHOSTNAMELEN
228 #define MAXHOSTNAMELEN	256
229 #endif
230 
231 #if !defined(SIGCHLD) && defined(SIGCLD)
232 # define SIGCHLD	SIGCLD
233 #endif
234 
235 #ifndef STDIN_FILENO
236 #define STDIN_FILENO	0
237 #endif
238 
239 #ifndef STDOUT_FILENO
240 #define STDOUT_FILENO	1
241 #endif
242 
243 #ifndef STDERR_FILENO
244 #define STDERR_FILENO	2
245 #endif
246 
247 #ifdef LOCKF
248 #define LOCK_SH		0x01	/* shared lock */
249 #define LOCK_EX		0x02	/* exclusive lock */
250 #define LOCK_NB		0x04	/* non-blocking lock */
251 #define LOCK_UN		0x08	/* unlock */
252 
253 #else
254 
255 # include <sys/file.h>
256 
257 #endif
258 
259 /*
260 **  Size of tobuf (deliver.c)
261 **	Tweak this to match your syslog implementation.  It will have to
262 **	allow for the extra information printed.
263 */
264 
265 #ifndef TOBUFSIZE
266 # define TOBUFSIZE (1024 - 256)
267 #endif
268 
269 /* fork routine -- set above using #ifdef _osname_ or in Makefile */
270 # ifndef FORK
271 # define FORK		vfork		/* function to call to fork mailer */
272 # endif
273