Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | /* |
2 | * Copyright (c) 1983 Eric P. Allman | |
6f14531a RG |
3 | * Copyright (c) 1988, 1993 |
4 | * The Regents of the University of California. All rights reserved. | |
15637ed4 RG |
5 | * |
6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. All advertising materials mentioning features or use of this software | |
15 | * must display the following acknowledgement: | |
16 | * This product includes software developed by the University of | |
17 | * California, Berkeley and its contributors. | |
18 | * 4. Neither the name of the University nor the names of its contributors | |
19 | * may be used to endorse or promote products derived from this software | |
20 | * without specific prior written permission. | |
21 | * | |
22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
32 | * SUCH DAMAGE. | |
33 | * | |
69fc843f | 34 | * @(#)conf.h 8.44 (Berkeley) 10/29/93 |
15637ed4 RG |
35 | */ |
36 | ||
37 | /* | |
38 | ** CONF.H -- All user-configurable parameters for sendmail | |
39 | */ | |
40 | ||
6f14531a | 41 | # include <sys/param.h> |
d747e748 | 42 | # include <sys/types.h> |
6f14531a | 43 | # include <sys/stat.h> |
d747e748 JH |
44 | # include <sys/file.h> |
45 | # include <sys/wait.h> | |
6f14531a | 46 | # include <fcntl.h> |
d747e748 | 47 | # include <signal.h> |
6f14531a | 48 | |
d747e748 | 49 | /********************************************************************** |
15637ed4 RG |
50 | ** Table sizes, etc.... |
51 | ** There shouldn't be much need to change these.... | |
d747e748 | 52 | **********************************************************************/ |
15637ed4 | 53 | |
6f14531a | 54 | # define MAXLINE 2048 /* max line length */ |
15637ed4 | 55 | # define MAXNAME 256 /* max length of a name */ |
15637ed4 | 56 | # define MAXPV 40 /* max # of parms to mailers */ |
6f14531a | 57 | # define MAXATOM 200 /* max atoms per address */ |
15637ed4 | 58 | # define MAXMAILERS 25 /* maximum mailers known to system */ |
6f14531a | 59 | # define MAXRWSETS 100 /* max # of sets of rewriting rules */ |
15637ed4 | 60 | # define MAXPRIORITIES 25 /* max values for Precedence: field */ |
6f14531a RG |
61 | # define MAXMXHOSTS 20 /* max # of MX records */ |
62 | # define SMTPLINELIM 990 /* maximum SMTP line length */ | |
63 | # define MAXKEY 128 /* maximum size of a database key */ | |
64 | # define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */ | |
65 | # define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */ | |
6f14531a RG |
66 | # define MAXALIASDB 12 /* max # of alias databases */ |
67 | # define PSBUFSIZE (MAXLINE + MAXATOM) /* size of prescan buffer */ | |
68 | ||
69 | # ifndef QUEUESIZE | |
70 | # define QUEUESIZE 1000 /* max # of jobs per queue run */ | |
71 | # endif | |
15637ed4 | 72 | |
d747e748 | 73 | /********************************************************************** |
15637ed4 RG |
74 | ** Compilation options. |
75 | ** | |
76 | ** #define these if they are available; comment them out otherwise. | |
d747e748 | 77 | **********************************************************************/ |
15637ed4 | 78 | |
15637ed4 | 79 | # define LOG 1 /* enable logging */ |
15637ed4 | 80 | # define UGLYUUCP 1 /* output ugly UUCP From lines */ |
6f14531a | 81 | # define NETINET 1 /* include internet support */ |
15637ed4 RG |
82 | # define SETPROCTITLE 1 /* munge argv to display current status */ |
83 | # define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ | |
6f14531a | 84 | # define MATCHGECOS 1 /* match user names from gecos field */ |
3a363396 | 85 | # define XDEBUG 1 /* enable extended debugging */ |
6f14531a RG |
86 | |
87 | # ifdef NEWDB | |
88 | # define USERDB 1 /* look in user database (requires NEWDB) */ | |
89 | # endif | |
90 | ||
91 | /* | |
d747e748 JH |
92 | ** Due to a "feature" in some operating systems such as Ultrix 4.3 and |
93 | ** HPUX 8.0, if you receive a "No route to host" message (ICMP message | |
94 | ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host | |
95 | ** are closed. Some firewalls return this error if you try to connect | |
96 | ** to the IDENT port (113), so you can't receive email from these hosts | |
97 | ** on these systems. The firewall really should use a more specific | |
98 | ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. This | |
99 | ** will get #undefed below as needed. | |
100 | */ | |
101 | ||
102 | # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ | |
103 | ||
104 | /********************************************************************** | |
6f14531a RG |
105 | ** Operating system configuration. |
106 | ** | |
107 | ** Unless you are porting to a new OS, you shouldn't have to | |
108 | ** change these. | |
d747e748 | 109 | **********************************************************************/ |
6f14531a | 110 | |
d747e748 JH |
111 | /* |
112 | ** Per-Operating System defines | |
113 | */ | |
3a363396 | 114 | |
3a363396 NW |
115 | |
116 | /* | |
d747e748 | 117 | ** HP-UX -- tested for 8.07 |
3a363396 NW |
118 | */ |
119 | ||
6f14531a | 120 | # ifdef __hpux |
d747e748 JH |
121 | /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */ |
122 | # undef m_flags | |
3a363396 | 123 | # define SYSTEM5 1 /* include all the System V defines */ |
d747e748 JH |
124 | # define HASINITGROUPS 1 /* has initgroups(3) call */ |
125 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
126 | # define HASSETREUID 1 /* has setreuid(2) call */ | |
127 | # define setreuid(r, e) setresuid(r, e, -1) | |
128 | # define LA_TYPE LA_FLOAT | |
129 | # define _PATH_UNIX "/hp-ux" | |
130 | # undef IDENTPROTO /* TCP/IP implementation is broken */ | |
6f14531a RG |
131 | # endif |
132 | ||
d747e748 JH |
133 | |
134 | /* | |
135 | ** IBM AIX 3.x -- actually tested for 3.2.3 | |
136 | */ | |
137 | ||
6f14531a | 138 | # ifdef _AIX3 |
d747e748 | 139 | # define HASINITGROUPS 1 /* has initgroups(3) call */ |
6f14531a | 140 | # define FORK fork /* no vfork primitive available */ |
d747e748 | 141 | # undef SETPROCTITLE /* setproctitle confuses AIX */ |
6f14531a RG |
142 | # endif |
143 | ||
d747e748 JH |
144 | |
145 | /* | |
146 | ** Silicon Graphics IRIX | |
147 | ** | |
148 | ** Compiles on 4.0.1. | |
149 | */ | |
150 | ||
3a363396 | 151 | # ifdef IRIX |
d747e748 JH |
152 | # include <sys/sysmacros.h> |
153 | # define HASSETREUID 1 /* has setreuid(2) call */ | |
154 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
155 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
3a363396 | 156 | # define FORK fork /* no vfork primitive available */ |
d747e748 JH |
157 | # define WAITUNION 1 /* use "union wait" as wait argument type */ |
158 | # define setpgid BSDsetpgrp | |
159 | # define GIDSET_T gid_t | |
6f14531a RG |
160 | # endif |
161 | ||
d747e748 JH |
162 | |
163 | /* | |
164 | ** SunOS | |
165 | */ | |
166 | ||
6f14531a | 167 | #if defined(sun) && !defined(BSD) |
3a363396 | 168 | |
d747e748 JH |
169 | # define LA_TYPE LA_INT |
170 | # define HASSETREUID 1 /* has setreuid(2) call */ | |
171 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
6f14531a RG |
172 | |
173 | # ifdef SOLARIS | |
d747e748 JH |
174 | /* Solaris 2.x (a.k.a. SunOS 5.x) */ |
175 | # define SYSTEM5 1 /* use System V definitions */ | |
176 | # define setreuid(r, e) seteuid(e) | |
177 | # include <sys/sysmacros.h> | |
3a363396 | 178 | # include <sys/time.h> |
d747e748 JH |
179 | # define gethostbyname __switch_gethostbyname /* get working version */ |
180 | # define gethostbyaddr __switch_gethostbyaddr /* get working version */ | |
181 | # define _PATH_UNIX "/kernel/unix" | |
182 | # ifndef _PATH_SENDMAILCF | |
183 | # define _PATH_SENDMAILCF "/etc/mail/sendmail.cf" | |
184 | # endif | |
185 | # ifndef _PATH_SENDMAILPID | |
186 | # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" | |
187 | # endif | |
3a363396 | 188 | |
6f14531a | 189 | # else |
3a363396 | 190 | /* SunOS 4.1.x */ |
6f14531a | 191 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
d747e748 | 192 | /* # define HASFLOCK 1 /* has flock(2) call */ |
6f14531a | 193 | # include <vfork.h> |
6f14531a | 194 | |
3a363396 | 195 | # endif |
6f14531a RG |
196 | #endif |
197 | ||
d747e748 JH |
198 | /* |
199 | ** DG/UX 5.4.2 | |
200 | */ | |
201 | ||
202 | #ifdef DGUX | |
203 | # define SYSTEM5 1 | |
204 | # define LA_TYPE LA_SUBR | |
205 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
206 | # define HASSETREUID 1 /* has setreuid(2) call */ | |
207 | # define HASUNAME 1 /* use System V uname(2) system call */ | |
208 | # define HASSETSID 1 /* has Posix setsid(2) call */ | |
209 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
210 | # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ | |
211 | # undef IDENTPROTO /* TCP/IP implementation is broken */ | |
212 | # undef SETPROCTITLE | |
213 | # define inet_addr dgux_inet_addr | |
214 | extern long dgux_inet_addr(); | |
215 | #endif | |
216 | ||
217 | ||
218 | /* | |
219 | ** Digital Ultrix 4.2A or 4.3 | |
220 | ** | |
221 | ** Apparently, fcntl locking is broken on 4.2A, in that locks are | |
222 | ** not dropped when the process exits. This causes major problems, | |
223 | ** so flock is the only alternative. | |
224 | */ | |
225 | ||
6f14531a RG |
226 | #ifdef ultrix |
227 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
d747e748 JH |
228 | # define HASSETREUID 1 /* has setreuid(2) call */ |
229 | # define HASUNSETENV 1 /* has unsetenv(3) call */ | |
230 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
231 | # define HASFLOCK 1 /* has flock(2) call */ | |
232 | # define LA_TYPE LA_INT | |
233 | # define LA_AVENRUN "avenrun" | |
234 | # undef IDENTPROTO /* TCP/IP implementation is broken */ | |
6f14531a RG |
235 | #endif |
236 | ||
d747e748 JH |
237 | |
238 | /* | |
239 | ** OSF/1 (tested on Alpha) | |
240 | */ | |
241 | ||
3a363396 | 242 | #ifdef __osf__ |
d747e748 JH |
243 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
244 | # define HASUNSETENV 1 /* has unsetenv(3) call */ | |
245 | # define HASSETREUID 1 /* has setreuid(2) call */ | |
246 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
247 | /* # define HASFLOCK 1 /* has flock(2) call */ | |
248 | # define LA_TYPE LA_INT | |
3a363396 NW |
249 | #endif |
250 | ||
d747e748 JH |
251 | |
252 | /* | |
253 | ** NeXTstep | |
254 | */ | |
255 | ||
256 | #ifdef NeXT | |
257 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
258 | # define HASFLOCK 1 /* has flock(2) call */ | |
259 | # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ | |
260 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
261 | # define WAITUNION 1 /* use "union wait" as wait argument type */ | |
3a363396 | 262 | # define sleep sleepX |
d747e748 JH |
263 | # define setpgid setpgrp |
264 | # ifndef LA_TYPE | |
265 | # define LA_TYPE LA_MACH | |
266 | # endif | |
267 | # ifndef _POSIX_SOURCE | |
268 | typedef int pid_t; | |
269 | # undef WEXITSTATUS | |
270 | # undef WIFEXITED | |
271 | # endif | |
272 | # ifndef _PATH_SENDMAILCF | |
273 | # define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf" | |
274 | # endif | |
275 | # ifndef _PATH_SENDMAILPID | |
276 | # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" | |
277 | # endif | |
6f14531a RG |
278 | #endif |
279 | ||
6f14531a | 280 | |
d747e748 JH |
281 | /* |
282 | ** 4.4 BSD | |
283 | */ | |
3a363396 | 284 | |
6f14531a | 285 | #ifdef BSD4_4 |
d747e748 JH |
286 | # define HASUNSETENV 1 /* has unsetenv(3) call */ |
287 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
6f14531a | 288 | # include <sys/cdefs.h> |
d747e748 JH |
289 | # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ |
290 | # ifndef LA_TYPE | |
291 | # define LA_TYPE LA_SUBR | |
292 | # endif | |
6f14531a RG |
293 | #endif |
294 | ||
d747e748 | 295 | |
3a363396 | 296 | /* |
d747e748 JH |
297 | ** 386BSD / FreeBSD 1.0E (works) / NetBSD (not tested) |
298 | ** | |
299 | ** 4.3BSD clone, closer to 4.4BSD | |
300 | */ | |
301 | ||
302 | #ifdef __386BSD__ | |
303 | # define HASUNSETENV 1 /* has unsetenv(3) call */ | |
304 | # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ | |
305 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
306 | # include <sys/cdefs.h> | |
307 | # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ | |
308 | # ifndef LA_TYPE | |
309 | # define LA_TYPE LA_SUBR | |
310 | # endif | |
311 | #endif | |
312 | ||
313 | ||
314 | /* | |
315 | ** 4.3 BSD -- this is for very old systems | |
316 | ** | |
317 | ** You'll also have to install a new resolver library. | |
318 | ** I don't guarantee that support for this environment is complete. | |
319 | */ | |
320 | ||
321 | #ifdef oldBSD43 | |
322 | # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ | |
323 | # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ | |
324 | # define ARBPTR_T char * | |
325 | # define setpgid setpgrp | |
326 | # ifndef LA_TYPE | |
327 | # define LA_TYPE LA_FLOAT | |
328 | # endif | |
329 | # ifndef _PATH_SENDMAILCF | |
330 | # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" | |
331 | # endif | |
332 | # undef IDENTPROTO /* TCP/IP implementation is broken */ | |
333 | #endif | |
334 | ||
335 | ||
336 | /* | |
337 | ** SCO Unix | |
338 | */ | |
339 | ||
340 | #ifdef _SCO_unix_ | |
341 | # define SYSTEM5 1 /* include all the System V defines */ | |
342 | # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ | |
343 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
344 | # define FORK fork | |
345 | # define MAXPATHLEN PATHSIZE | |
346 | # define LA_TYPE LA_SHORT | |
347 | #endif | |
348 | ||
349 | ||
350 | /* | |
351 | ** ConvexOS 11.0 and later | |
352 | */ | |
353 | ||
354 | #ifdef _CONVEX_SOURCE | |
355 | # define BSD 1 /* include all the BSD defines */ | |
356 | # define HASUNAME 1 /* use System V uname(2) system call */ | |
357 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
358 | # define HASSETSID 1 /* has POSIX setsid(2) call */ | |
359 | # define NEEDGETOPT 1 /* need replacement for getopt(3) */ | |
360 | # define LA_TYPE LA_FLOAT | |
361 | # undef IDENTPROTO | |
362 | #endif | |
363 | ||
364 | ||
365 | /* | |
366 | ** RISC/os 4.51 | |
367 | ** | |
368 | ** Untested... | |
369 | */ | |
370 | ||
371 | #ifdef RISCOS | |
372 | # define HASUNSETENV 1 /* has unsetenv(3) call */ | |
373 | /* # define HASFLOCK 1 /* has flock(2) call */ | |
374 | # define LA_TYPE LA_INT | |
375 | # define LA_AVENRUN "avenrun" | |
376 | # define _PATH_UNIX "/unix" | |
377 | #endif | |
378 | ||
379 | ||
380 | /* | |
381 | ** Linux 0.99pl10 and above... | |
382 | ** From Karl London <karl@borg.demon.co.uk>. | |
3a363396 NW |
383 | */ |
384 | ||
69fc843f | 385 | #ifdef __linux__ |
d747e748 JH |
386 | # define BSD 1 /* pretend to be BSD based today */ |
387 | # undef NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ | |
388 | # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ | |
389 | # define HASUNSETENV 1 /* has unsetenv(3) call */ | |
390 | # ifndef LA_TYPE | |
391 | # define LA_TYPE LA_FLOAT | |
392 | # endif | |
69fc843f | 393 | # include <sys/sysmacros.h> |
d747e748 JH |
394 | #endif |
395 | ||
396 | ||
397 | /* | |
398 | ** DELL SVR4 Issue 2.2, and others | |
399 | ** From Kimmo Suominen <kim@grendel.lut.fi> | |
400 | ** | |
401 | ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ | |
402 | ** defined, and the definitions conflict. | |
403 | */ | |
404 | ||
405 | #ifdef DELL_SVR4 | |
406 | # define SYSTEM5 1 | |
407 | /* # define setreuid(r, e) seteuid(e) */ | |
408 | /* # include <sys/time.h> */ | |
409 | # define _PATH_UNIX "/unix" | |
410 | # ifndef _PATH_SENDMAILCF | |
411 | # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" | |
412 | # endif | |
413 | # ifndef _PATH_SENDMAILPID | |
414 | # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" | |
415 | # endif | |
416 | #endif | |
417 | ||
418 | ||
419 | /* | |
420 | ** Apple A/UX 3.0 | |
421 | */ | |
422 | ||
423 | #ifdef _AUX_SOURCE | |
424 | # include <sys/sysmacros.h> | |
425 | # define BSD /* has BSD routines */ | |
426 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
427 | # define HASUNAME 1 /* use System V uname(2) system call */ | |
428 | # define HASUSTAT 1 /* use System V ustat(2) syscall */ | |
429 | # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ | |
430 | # define SIGFUNC_DEFINED /* sigfunc_t already defined */ | |
431 | # undef IDENTPROTO /* TCP/IP implementation is broken */ | |
432 | # define FORK fork | |
433 | # ifndef _PATH_SENDMAILCF | |
434 | # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" | |
435 | # endif | |
436 | # ifndef LA_TYPE | |
437 | # define LA_TYPE LA_ZERO | |
438 | # endif | |
439 | # undef WIFEXITED | |
440 | # undef WEXITSTATUS | |
441 | #endif | |
442 | ||
443 | ||
444 | /* | |
445 | ** Encore UMAX V | |
446 | ** | |
447 | ** Not extensively tested. | |
448 | */ | |
449 | ||
450 | #ifdef UMAXV | |
451 | # include <limits.h> | |
452 | # define HASUNAME 1 /* use System V uname(2) system call */ | |
453 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
454 | # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ | |
455 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
456 | # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ | |
457 | # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ | |
458 | # define FORK fork /* no vfork(2) primitive available */ | |
459 | # define MAXPATHLEN PATH_MAX | |
460 | extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); | |
461 | extern struct group *getgrent(), *getgrnam(), *getgrgid(); | |
462 | # undef WIFEXITED | |
463 | # undef WEXITSTATUS | |
464 | #endif | |
465 | ||
466 | ||
467 | ||
468 | /********************************************************************** | |
469 | ** End of Per-Operating System defines | |
470 | **********************************************************************/ | |
471 | ||
472 | /********************************************************************** | |
473 | ** More general defines | |
474 | **********************************************************************/ | |
475 | ||
476 | /* general BSD defines */ | |
477 | #ifdef BSD | |
478 | # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ | |
479 | # define HASSETREUID 1 /* has setreuid(2) call */ | |
480 | # define HASINITGROUPS 1 /* has initgroups(2) call */ | |
481 | # define HASFLOCK 1 /* has flock(2) call */ | |
482 | #endif | |
483 | ||
3a363396 NW |
484 | /* general System V defines */ |
485 | # ifdef SYSTEM5 | |
d747e748 JH |
486 | # define HASUNAME 1 /* use System V uname(2) system call */ |
487 | # define HASUSTAT 1 /* use System V ustat(2) syscall */ | |
488 | # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ | |
489 | # ifndef LA_TYPE | |
490 | # define LA_TYPE LA_INT | |
491 | # endif | |
492 | # define bcopy(s, d, l) (memmove((d), (s), (l))) | |
493 | # define bzero(d, l) (memset((d), '\0', (l))) | |
494 | # define bcmp(s, d, l) (memcmp((s), (d), (l))) | |
3a363396 NW |
495 | # endif |
496 | ||
d747e748 JH |
497 | /* general "standard C" defines */ |
498 | #if defined(__STDC__) || defined(SYSTEM5) | |
499 | # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ | |
500 | #endif | |
501 | ||
502 | /* general POSIX defines */ | |
503 | #ifdef _POSIX_VERSION | |
504 | # define HASSETSID 1 /* has Posix setsid(2) call */ | |
505 | # define HASWAITPID 1 /* has Posix waitpid(2) call */ | |
506 | #endif | |
507 | ||
6f14531a | 508 | /* |
d747e748 JH |
509 | ** If no type for argument two of getgroups call is defined, assume |
510 | ** it's an integer -- unfortunately, there seem to be several choices | |
511 | ** here. | |
6f14531a RG |
512 | */ |
513 | ||
d747e748 JH |
514 | #ifndef GIDSET_T |
515 | # define GIDSET_T int | |
6f14531a RG |
516 | #endif |
517 | ||
d747e748 JH |
518 | |
519 | /********************************************************************** | |
6f14531a RG |
520 | ** Remaining definitions should never have to be changed. They are |
521 | ** primarily to provide back compatibility for older systems -- for | |
522 | ** example, it includes some POSIX compatibility definitions | |
d747e748 | 523 | **********************************************************************/ |
6f14531a RG |
524 | |
525 | /* System 5 compatibility */ | |
526 | #ifndef S_ISREG | |
527 | #define S_ISREG(foo) ((foo & S_IFREG) == S_IFREG) | |
528 | #endif | |
529 | #ifndef S_IWGRP | |
530 | #define S_IWGRP 020 | |
531 | #endif | |
532 | #ifndef S_IWOTH | |
533 | #define S_IWOTH 002 | |
534 | #endif | |
535 | ||
536 | /* | |
537 | ** Older systems don't have this error code -- it should be in | |
538 | ** /usr/include/sysexits.h. | |
539 | */ | |
540 | ||
541 | # ifndef EX_CONFIG | |
542 | # define EX_CONFIG 78 /* configuration error */ | |
543 | # endif | |
544 | ||
d747e748 JH |
545 | /* pseudo-code used in server SMTP */ |
546 | # define EX_QUIT 22 /* drop out of server immediately */ | |
547 | ||
548 | ||
549 | /* | |
550 | ** These are used in a few cases where we need some special | |
551 | ** error codes, but where the system doesn't provide something | |
552 | ** reasonable. They are printed in errstring. | |
553 | */ | |
554 | ||
555 | #ifndef E_PSEUDOBASE | |
556 | # define E_PSEUDOBASE 256 | |
557 | #endif | |
558 | ||
559 | #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ | |
560 | #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ | |
561 | ||
562 | /* type of arbitrary pointer */ | |
563 | #ifndef ARBPTR_T | |
564 | # define ARBPTR_T void * | |
565 | #endif | |
566 | ||
6f14531a RG |
567 | #ifndef __P |
568 | # include "cdefs.h" | |
569 | #endif | |
570 | ||
571 | /* | |
572 | ** Do some required dependencies | |
573 | */ | |
574 | ||
575 | #if defined(NETINET) || defined(NETISO) | |
576 | # define SMTP 1 /* enable user and server SMTP */ | |
577 | # define QUEUE 1 /* enable queueing */ | |
578 | # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ | |
579 | #endif | |
580 | ||
581 | ||
582 | /* | |
583 | ** Arrange to use either varargs or stdargs | |
584 | */ | |
585 | ||
586 | # ifdef __STDC__ | |
587 | ||
588 | # include <stdarg.h> | |
589 | ||
590 | # define VA_LOCAL_DECL va_list ap; | |
591 | # define VA_START(f) va_start(ap, f) | |
592 | # define VA_END va_end(ap) | |
593 | ||
594 | # else | |
595 | ||
596 | # include <varargs.h> | |
597 | ||
598 | # define VA_LOCAL_DECL va_list ap; | |
599 | # define VA_START(f) va_start(ap) | |
600 | # define VA_END va_end(ap) | |
601 | ||
602 | # endif | |
603 | ||
604 | #ifdef HASUNAME | |
605 | # include <sys/utsname.h> | |
606 | # ifdef newstr | |
607 | # undef newstr | |
608 | # endif | |
609 | #else /* ! HASUNAME */ | |
610 | # define NODE_LENGTH 32 | |
611 | struct utsname | |
612 | { | |
613 | char nodename[NODE_LENGTH+1]; | |
614 | }; | |
615 | #endif /* HASUNAME */ | |
616 | ||
d747e748 JH |
617 | #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) |
618 | # define MAXHOSTNAMELEN 256 | |
6f14531a RG |
619 | #endif |
620 | ||
621 | #if !defined(SIGCHLD) && defined(SIGCLD) | |
622 | # define SIGCHLD SIGCLD | |
623 | #endif | |
624 | ||
625 | #ifndef STDIN_FILENO | |
626 | #define STDIN_FILENO 0 | |
627 | #endif | |
628 | ||
629 | #ifndef STDOUT_FILENO | |
630 | #define STDOUT_FILENO 1 | |
631 | #endif | |
632 | ||
633 | #ifndef STDERR_FILENO | |
634 | #define STDERR_FILENO 2 | |
635 | #endif | |
636 | ||
d747e748 JH |
637 | #ifndef LOCK_SH |
638 | # define LOCK_SH 0x01 /* shared lock */ | |
639 | # define LOCK_EX 0x02 /* exclusive lock */ | |
640 | # define LOCK_NB 0x04 /* non-blocking lock */ | |
641 | # define LOCK_UN 0x08 /* unlock */ | |
642 | #endif | |
6f14531a | 643 | |
d747e748 JH |
644 | #ifndef SIG_ERR |
645 | # define SIG_ERR ((void (*)()) -1) | |
646 | #endif | |
6f14531a | 647 | |
d747e748 JH |
648 | #ifndef WEXITSTATUS |
649 | # define WEXITSTATUS(st) (((st) >> 8) & 0377) | |
650 | #endif | |
651 | #ifndef WIFEXITED | |
652 | # define WIFEXITED(st) (((st) & 0377) == 0) | |
653 | #endif | |
6f14531a | 654 | |
d747e748 JH |
655 | #ifndef SIGFUNC_DEFINED |
656 | typedef void (*sigfunc_t) __P((int)); | |
6f14531a RG |
657 | #endif |
658 | ||
659 | /* | |
660 | ** Size of tobuf (deliver.c) | |
661 | ** Tweak this to match your syslog implementation. It will have to | |
662 | ** allow for the extra information printed. | |
663 | */ | |
664 | ||
665 | #ifndef TOBUFSIZE | |
666 | # define TOBUFSIZE (1024 - 256) | |
667 | #endif | |
15637ed4 | 668 | |
6f14531a RG |
669 | /* fork routine -- set above using #ifdef _osname_ or in Makefile */ |
670 | # ifndef FORK | |
671 | # define FORK vfork /* function to call to fork mailer */ | |
672 | # endif |