Commit | Line | Data |
---|---|---|
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 | * |
175dac04 | 8 | * @(#)conf.h 8.70 (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> |
82530719 | 16 | # include <sys/types.h> |
46300693 | 17 | # include <sys/stat.h> |
c2edb205 | 18 | # include <sys/file.h> |
0349f8cc | 19 | # include <sys/wait.h> |
f8a31c8e | 20 | # include <fcntl.h> |
39270cfd | 21 | # include <signal.h> |
f43b04ce | 22 | |
ba6514e2 | 23 | /********************************************************************** |
5a739feb EA |
24 | ** Table sizes, etc.... |
25 | ** There shouldn't be much need to change these.... | |
ba6514e2 | 26 | **********************************************************************/ |
5a739feb | 27 | |
d36f8e5c | 28 | # define MAXLINE 2048 /* max line length */ |
f0a960f1 | 29 | # define MAXNAME 256 /* max length of a name */ |
5a739feb | 30 | # define MAXPV 40 /* max # of parms to mailers */ |
d36f8e5c | 31 | # define MAXATOM 200 /* max atoms per address */ |
5a739feb | 32 | # define MAXMAILERS 25 /* maximum mailers known to system */ |
8583ab39 | 33 | # define MAXRWSETS 100 /* max # of sets of rewriting rules */ |
5a739feb | 34 | # define MAXPRIORITIES 25 /* max values for Precedence: field */ |
8583ab39 | 35 | # define MAXMXHOSTS 20 /* max # of MX records */ |
8657d05f | 36 | # define SMTPLINELIM 990 /* maximum SMTP line length */ |
f43b04ce EA |
37 | # define MAXKEY 128 /* maximum size of a database key */ |
38 | # define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */ | |
b0b636d1 | 39 | # define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */ |
9f7134c8 | 40 | # define MAXALIASDB 12 /* max # of alias databases */ |
8583ab39 EA |
41 | |
42 | # ifndef QUEUESIZE | |
43 | # define QUEUESIZE 1000 /* max # of jobs per queue run */ | |
44 | # endif | |
45 | ||
ba6514e2 | 46 | /********************************************************************** |
5a739feb | 47 | ** Compilation options. |
9bcdff70 EA |
48 | ** |
49 | ** #define these if they are available; comment them out otherwise. | |
ba6514e2 | 50 | **********************************************************************/ |
5a739feb | 51 | |
9bcdff70 | 52 | # define LOG 1 /* enable logging */ |
9bcdff70 | 53 | # define UGLYUUCP 1 /* output ugly UUCP From lines */ |
8988dfd3 | 54 | # define NETUNIX 1 /* include unix domain support */ |
3356c77c | 55 | # define NETINET 1 /* include internet support */ |
9bcdff70 | 56 | # define SETPROCTITLE 1 /* munge argv to display current status */ |
35af2f06 | 57 | # define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ |
7f0fd60b | 58 | # define MATCHGECOS 1 /* match user names from gecos field */ |
8e5c6745 | 59 | # define XDEBUG 1 /* enable extended debugging */ |
d25bb424 | 60 | |
273562d8 EA |
61 | # ifdef NEWDB |
62 | # define USERDB 1 /* look in user database (requires NEWDB) */ | |
5a4c03c6 EA |
63 | # endif |
64 | ||
fce21cb9 EA |
65 | /* |
66 | ** Most systems have symbolic links today, so default them on. You | |
67 | ** can turn them off by #undef'ing this below. | |
68 | */ | |
69 | ||
70 | # define HASLSTAT 1 /* has lstat(2) call */ | |
71 | ||
c6bd47b4 EA |
72 | /* |
73 | ** General "standard C" defines. | |
74 | ** | |
75 | ** These may be undone later, to cope with systems that claim to | |
76 | ** be Standard C but aren't. Gcc is the biggest offender -- it | |
77 | ** doesn't realize that the library is part of the language. | |
78 | ** | |
79 | ** Life would be much easier if we could get rid of this sort | |
80 | ** of bozo problems. | |
81 | */ | |
82 | ||
83 | #ifdef __STDC__ | |
84 | # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ | |
85 | #endif | |
86 | ||
ba6514e2 | 87 | /********************************************************************** |
e6245c7e EA |
88 | ** Operating system configuration. |
89 | ** | |
90 | ** Unless you are porting to a new OS, you shouldn't have to | |
91 | ** change these. | |
ba6514e2 | 92 | **********************************************************************/ |
5a4c03c6 | 93 | |
fd57f063 EA |
94 | /* |
95 | ** Per-Operating System defines | |
96 | */ | |
97 | ||
2b09dd75 | 98 | |
ba6514e2 EA |
99 | /* |
100 | ** HP-UX -- tested for 8.07 | |
101 | */ | |
102 | ||
8a47b280 | 103 | # ifdef __hpux |
192b13aa EA |
104 | /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */ |
105 | # undef m_flags | |
fd57f063 | 106 | # define SYSTEM5 1 /* include all the System V defines */ |
39270cfd | 107 | # define HASINITGROUPS 1 /* has initgroups(3) call */ |
2b09dd75 | 108 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
39270cfd | 109 | # define HASSETREUID 1 /* has setreuid(2) call */ |
ba6514e2 | 110 | # define setreuid(r, e) setresuid(r, e, -1) |
33d59d37 EA |
111 | # define LA_TYPE LA_FLOAT |
112 | # define _PATH_UNIX "/hp-ux" | |
a74fd615 EA |
113 | # ifndef IDENTPROTO |
114 | # define IDENTPROTO 0 /* TCP/IP implementation is broken */ | |
115 | # endif | |
273562d8 EA |
116 | # endif |
117 | ||
2b09dd75 | 118 | |
ba6514e2 EA |
119 | /* |
120 | ** IBM AIX 3.x -- actually tested for 3.2.3 | |
121 | */ | |
122 | ||
a419d027 | 123 | # ifdef _AIX3 |
39270cfd | 124 | # define HASINITGROUPS 1 /* has initgroups(3) call */ |
485a1ac5 EA |
125 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
126 | # define HASUNAME 1 /* use System V uname(2) system call */ | |
1ee33f7d | 127 | # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ |
9114f86c | 128 | # define FORK fork /* no vfork primitive available */ |
3077a686 | 129 | # undef SETPROCTITLE /* setproctitle confuses AIX */ |
8e5c6745 EA |
130 | # endif |
131 | ||
2b09dd75 | 132 | |
ba6514e2 EA |
133 | /* |
134 | ** Silicon Graphics IRIX | |
135 | ** | |
0fc3fb21 | 136 | ** Compiles on 4.0.1. |
ba6514e2 EA |
137 | */ |
138 | ||
8e5c6745 | 139 | # ifdef IRIX |
192b13aa | 140 | # include <sys/sysmacros.h> |
39270cfd EA |
141 | # define HASSETREUID 1 /* has setreuid(2) call */ |
142 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
2b09dd75 | 143 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
1ee33f7d | 144 | # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ |
8e5c6745 | 145 | # define FORK fork /* no vfork primitive available */ |
1c8c1ad2 | 146 | # define WAITUNION 1 /* use "union wait" as wait argument type */ |
0d2faefc | 147 | # define setpgid BSDsetpgrp |
e6cb9fc4 | 148 | # define GIDSET_T gid_t |
9114f86c EA |
149 | # endif |
150 | ||
ba6514e2 EA |
151 | |
152 | /* | |
8988dfd3 EA |
153 | ** SunOS and Solaris |
154 | ** | |
155 | ** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and | |
156 | ** Solaris 2.2 (a.k.a. SunOS 5.2). | |
ba6514e2 EA |
157 | */ |
158 | ||
45f49b73 | 159 | #if defined(sun) && !defined(BSD) |
fd57f063 | 160 | |
33d59d37 | 161 | # define LA_TYPE LA_INT |
39270cfd | 162 | # define HASINITGROUPS 1 /* has initgroups(3) call */ |
8988dfd3 | 163 | # define HASUNAME 1 /* use System V uname(2) system call */ |
1ee33f7d | 164 | # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ |
45f49b73 | 165 | |
d4125001 EA |
166 | # ifdef SOLARIS_2_3 |
167 | # define SOLARIS | |
168 | # endif | |
169 | ||
7b3820ed | 170 | # ifdef SOLARIS |
ba6514e2 | 171 | /* Solaris 2.x (a.k.a. SunOS 5.x) */ |
f361504a | 172 | /* see also __svr4__ defines below */ |
fd57f063 | 173 | # include <sys/time.h> |
6f884c69 EA |
174 | # define gethostbyname solaris_gethostbyname /* get working version */ |
175 | # define gethostbyaddr solaris_gethostbyaddr /* get working version */ | |
d7a2e485 | 176 | # define GIDSET_T gid_t |
f361504a EA |
177 | # ifndef _PATH_UNIX |
178 | # define _PATH_UNIX "/kernel/unix" | |
179 | # endif | |
33d59d37 EA |
180 | # ifndef _PATH_SENDMAILCF |
181 | # define _PATH_SENDMAILCF "/etc/mail/sendmail.cf" | |
0f786d57 | 182 | # endif |
0f786d57 | 183 | # ifndef _PATH_SENDMAILPID |
33d59d37 EA |
184 | # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" |
185 | # endif | |
fd57f063 | 186 | |
7b3820ed | 187 | # else |
e9abaf1a | 188 | /* SunOS 4.0.3 or 4.1.x */ |
f361504a | 189 | # define HASSETREUID 1 /* has setreuid(2) call */ |
7b3820ed | 190 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
9c08c09b | 191 | # define HASFLOCK 1 /* has flock(2) call */ |
45f49b73 | 192 | # include <vfork.h> |
45f49b73 | 193 | |
e9abaf1a EA |
194 | # ifdef SUNOS403 |
195 | /* special tweaking for SunOS 4.0.3 */ | |
196 | # include <malloc.h> | |
197 | # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ | |
198 | # define WAITUNION 1 /* use "union wait" as wait argument type */ | |
199 | # undef WIFEXITED | |
200 | # undef WEXITSTATUS | |
201 | # undef HASUNAME | |
202 | # define setpgid setpgrp | |
203 | typedef int pid_t; | |
204 | extern char *getenv(); | |
205 | ||
206 | # endif | |
fd57f063 | 207 | # endif |
45f49b73 EA |
208 | #endif |
209 | ||
fe3849ea | 210 | /* |
8988dfd3 EA |
211 | ** DG/UX |
212 | ** | |
213 | ** Tested on 5.4.2 | |
fe3849ea EA |
214 | */ |
215 | ||
216 | #ifdef DGUX | |
217 | # define SYSTEM5 1 | |
218 | # define LA_TYPE LA_SUBR | |
219 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
220 | # define HASSETREUID 1 /* has setreuid(2) call */ | |
221 | # define HASUNAME 1 /* use System V uname(2) system call */ | |
222 | # define HASSETSID 1 /* has Posix setsid(2) call */ | |
223 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
a74fd615 EA |
224 | # ifndef IDENTPROTO |
225 | # define IDENTPROTO 0 /* TCP/IP implementation is broken */ | |
226 | # endif | |
fe3849ea | 227 | # undef SETPROCTITLE |
8988dfd3 EA |
228 | |
229 | /* these include files must be included early on DG/UX */ | |
230 | # include <netinet/in.h> | |
231 | # include <arpa/inet.h> | |
232 | ||
fe3849ea EA |
233 | # define inet_addr dgux_inet_addr |
234 | extern long dgux_inet_addr(); | |
235 | #endif | |
236 | ||
2b09dd75 | 237 | |
ba6514e2 EA |
238 | /* |
239 | ** Digital Ultrix 4.2A or 4.3 | |
9cea9407 EA |
240 | ** |
241 | ** Apparently, fcntl locking is broken on 4.2A, in that locks are | |
242 | ** not dropped when the process exits. This causes major problems, | |
243 | ** so flock is the only alternative. | |
ba6514e2 EA |
244 | */ |
245 | ||
45f49b73 EA |
246 | #ifdef ultrix |
247 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
39270cfd | 248 | # define HASSETREUID 1 /* has setreuid(2) call */ |
33d59d37 | 249 | # define HASUNSETENV 1 /* has unsetenv(3) call */ |
39270cfd | 250 | # define HASINITGROUPS 1 /* has initgroups(3) call */ |
9cea9407 | 251 | # define HASFLOCK 1 /* has flock(2) call */ |
1ee33f7d | 252 | # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ |
0dbb4629 EA |
253 | # ifdef vax |
254 | # define LA_TYPE LA_FLOAT | |
255 | # else | |
256 | # define LA_TYPE LA_INT | |
257 | # define LA_AVENRUN "avenrun" | |
258 | # endif | |
a74fd615 EA |
259 | # ifndef IDENTPROTO |
260 | # define IDENTPROTO 0 /* TCP/IP implementation is broken */ | |
261 | # endif | |
e6245c7e EA |
262 | #endif |
263 | ||
2b09dd75 | 264 | |
ba6514e2 EA |
265 | /* |
266 | ** OSF/1 (tested on Alpha) | |
267 | */ | |
268 | ||
fd57f063 | 269 | #ifdef __osf__ |
2b09dd75 | 270 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
33d59d37 | 271 | # define HASUNSETENV 1 /* has unsetenv(3) call */ |
39270cfd EA |
272 | # define HASSETREUID 1 /* has setreuid(2) call */ |
273 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
9c08c09b | 274 | # define HASFLOCK 1 /* has flock(2) call */ |
33d59d37 | 275 | # define LA_TYPE LA_INT |
8988dfd3 EA |
276 | # ifndef _PATH_SENDMAILPID |
277 | # define _PATH_SENDMAILPID "/var/run/sendmial.pid" | |
278 | # endif | |
6070681d EA |
279 | #endif |
280 | ||
2b09dd75 | 281 | |
ba6514e2 EA |
282 | /* |
283 | ** NeXTstep | |
284 | */ | |
285 | ||
fbfeb92c | 286 | #ifdef NeXT |
39270cfd EA |
287 | # define HASINITGROUPS 1 /* has initgroups(3) call */ |
288 | # define HASFLOCK 1 /* has flock(2) call */ | |
9cb009c2 | 289 | # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ |
2b09dd75 | 290 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
693a756a | 291 | # define WAITUNION 1 /* use "union wait" as wait argument type */ |
8e5c6745 | 292 | # define sleep sleepX |
0d2faefc | 293 | # define setpgid setpgrp |
e60b62fd EA |
294 | # ifndef LA_TYPE |
295 | # define LA_TYPE LA_MACH | |
296 | # endif | |
0349f8cc | 297 | # ifndef _POSIX_SOURCE |
39270cfd | 298 | typedef int pid_t; |
0349f8cc EA |
299 | # undef WEXITSTATUS |
300 | # undef WIFEXITED | |
301 | # endif | |
0f786d57 EA |
302 | # ifndef _PATH_SENDMAILCF |
303 | # define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf" | |
304 | # endif | |
0f786d57 EA |
305 | # ifndef _PATH_SENDMAILPID |
306 | # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" | |
307 | # endif | |
8c5949d2 EA |
308 | #endif |
309 | ||
2b09dd75 | 310 | |
ba6514e2 | 311 | /* |
33d59d37 | 312 | ** 4.4 BSD |
9c08c09b EA |
313 | ** |
314 | ** See also BSD defines. | |
ba6514e2 EA |
315 | */ |
316 | ||
ed0b2c1b | 317 | #ifdef BSD4_4 |
0f786d57 | 318 | # define HASUNSETENV 1 /* has unsetenv(3) call */ |
2b09dd75 | 319 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
ed0b2c1b | 320 | # include <sys/cdefs.h> |
7621e399 | 321 | # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ |
0f786d57 EA |
322 | # ifndef LA_TYPE |
323 | # define LA_TYPE LA_SUBR | |
324 | # endif | |
7621e399 EA |
325 | #endif |
326 | ||
2b09dd75 | 327 | |
db82ecce | 328 | /* |
766f059d | 329 | ** 386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions) |
db82ecce EA |
330 | ** |
331 | ** 4.3BSD clone, closer to 4.4BSD | |
9c08c09b EA |
332 | ** |
333 | ** See also BSD defines. | |
db82ecce EA |
334 | */ |
335 | ||
766f059d | 336 | #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__) |
db82ecce EA |
337 | # define HASUNSETENV 1 /* has unsetenv(3) call */ |
338 | # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ | |
339 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
340 | # include <sys/cdefs.h> | |
341 | # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ | |
342 | # ifndef LA_TYPE | |
343 | # define LA_TYPE LA_SUBR | |
344 | # endif | |
345 | #endif | |
346 | ||
347 | ||
8988dfd3 EA |
348 | /* |
349 | ** Mach386 | |
350 | ** | |
351 | ** For mt Xinu's Mach386 system. | |
352 | */ | |
353 | ||
354 | #if defined(MACH) && defined(i386) | |
355 | # define MACH386 1 | |
356 | # define HASUNSETENV 1 /* has unsetenv(3) call */ | |
357 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
358 | # define HASFLOCK 1 /* has flock(2) call */ | |
359 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
360 | # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ | |
361 | # define NEEDSTRTOL 1 /* need the strtol() function */ | |
362 | # define setpgid setpgrp | |
363 | # ifndef LA_TYPE | |
364 | # define LA_TYPE LA_FLOAT | |
365 | # endif | |
c6bd47b4 | 366 | # undef HASSETVBUF /* don't actually have setvbuf(3) */ |
8988dfd3 EA |
367 | # undef WEXITSTATUS |
368 | # undef WIFEXITED | |
369 | # ifndef _PATH_SENDMAILCF | |
370 | # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" | |
371 | # endif | |
372 | # ifndef _PATH_SENDMAILPID | |
373 | # define _PATH_SENDMAILPID "/etc/sendmail.pid" | |
374 | # endif | |
375 | #endif | |
376 | ||
377 | ||
35f1f39e EA |
378 | /* |
379 | ** 4.3 BSD -- this is for very old systems | |
380 | ** | |
381 | ** You'll also have to install a new resolver library. | |
382 | ** I don't guarantee that support for this environment is complete. | |
383 | */ | |
384 | ||
385 | #ifdef oldBSD43 | |
386 | # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ | |
387 | # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ | |
0639fd0c | 388 | # define ARBPTR_T char * |
0d2faefc | 389 | # define setpgid setpgrp |
35f1f39e EA |
390 | # ifndef LA_TYPE |
391 | # define LA_TYPE LA_FLOAT | |
392 | # endif | |
393 | # ifndef _PATH_SENDMAILCF | |
394 | # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" | |
395 | # endif | |
a74fd615 EA |
396 | # ifndef IDENTPROTO |
397 | # define IDENTPROTO 0 /* TCP/IP implementation is broken */ | |
398 | # endif | |
ac3f694f EA |
399 | # undef WEXITSTATUS |
400 | # undef WIFEXITED | |
401 | typedef short pid_t; | |
402 | extern int errno; | |
35f1f39e EA |
403 | #endif |
404 | ||
2b09dd75 | 405 | |
ba6514e2 EA |
406 | /* |
407 | ** SCO Unix | |
8e01bd08 EA |
408 | ** |
409 | ** This includes two parts -- the first is for SCO Open Server 3.2v4 | |
410 | ** (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). | |
411 | ** The second is, I believe, for an older version. | |
ba6514e2 EA |
412 | */ |
413 | ||
8e01bd08 EA |
414 | #ifdef _SCO_unix_4_2 |
415 | # define _SCO_unix_ | |
416 | # define HASSETREUID 1 /* has setreuid(2) call */ | |
417 | # define _PATH_UNIX "/unix" | |
418 | # ifndef _PATH_SENDMAILCF | |
419 | # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" | |
420 | # endif | |
421 | # ifndef _PATH_SENDMAILPID | |
422 | # define _PATH_SENDMAILPID "/etc/sendmail.pid" | |
423 | # endif | |
424 | #endif | |
425 | ||
7621e399 EA |
426 | #ifdef _SCO_unix_ |
427 | # define SYSTEM5 1 /* include all the System V defines */ | |
39270cfd | 428 | # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ |
0efc4574 | 429 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
175dac04 | 430 | # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ |
7621e399 EA |
431 | # define FORK fork |
432 | # define MAXPATHLEN PATHSIZE | |
fe3849ea | 433 | # define LA_TYPE LA_SHORT |
8988dfd3 | 434 | # undef NETUNIX /* no unix domain socket support */ |
33d59d37 EA |
435 | #endif |
436 | ||
2b09dd75 | 437 | |
33d59d37 EA |
438 | /* |
439 | ** ConvexOS 11.0 and later | |
440 | */ | |
441 | ||
442 | #ifdef _CONVEX_SOURCE | |
0c31d7be EA |
443 | # define BSD 1 /* include all the BSD defines */ |
444 | # define HASUNAME 1 /* use System V uname(2) system call */ | |
33d59d37 EA |
445 | # define HASSTATFS 1 /* has the statfs(2) syscall */ |
446 | # define HASSETSID 1 /* has POSIX setsid(2) call */ | |
0c31d7be | 447 | # define NEEDGETOPT 1 /* need replacement for getopt(3) */ |
33d59d37 | 448 | # define LA_TYPE LA_FLOAT |
a74fd615 EA |
449 | # ifndef IDENTPROTO |
450 | # define IDENTPROTO 0 /* TCP/IP implementation is broken */ | |
451 | # endif | |
33d59d37 EA |
452 | #endif |
453 | ||
2b09dd75 | 454 | |
33d59d37 | 455 | /* |
fa323968 | 456 | ** RISC/os 4.52 |
33d59d37 | 457 | ** |
fa323968 | 458 | ** Gives a ton of warning messages, but otherwise compiles. |
33d59d37 EA |
459 | */ |
460 | ||
0fc3fb21 | 461 | #ifdef RISCOS |
fa323968 | 462 | |
33d59d37 | 463 | # define HASUNSETENV 1 /* has unsetenv(3) call */ |
9c08c09b | 464 | # define HASFLOCK 1 /* has flock(2) call */ |
fa323968 EA |
465 | # define WAITUNION 1 /* use "union wait" as wait argument type */ |
466 | # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ | |
33d59d37 EA |
467 | # define LA_TYPE LA_INT |
468 | # define LA_AVENRUN "avenrun" | |
469 | # define _PATH_UNIX "/unix" | |
fa323968 EA |
470 | # undef WIFEXITED |
471 | ||
472 | # define setpgid setpgrp | |
473 | ||
474 | extern int errno; | |
475 | typedef int pid_t; | |
476 | #define SIGFUNC_DEFINED | |
477 | typedef int (*sigfunc_t)(); | |
478 | extern char *getenv(); | |
479 | extern void *malloc(); | |
480 | ||
ed0b2c1b EA |
481 | #endif |
482 | ||
2b09dd75 | 483 | |
0d2faefc EA |
484 | /* |
485 | ** Linux 0.99pl10 and above... | |
486 | ** From Karl London <karl@borg.demon.co.uk>. | |
487 | */ | |
488 | ||
404f4d13 | 489 | #ifdef __linux__ |
0d2faefc EA |
490 | # define BSD 1 /* pretend to be BSD based today */ |
491 | # undef NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ | |
492 | # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ | |
c2edb205 | 493 | # define HASUNSETENV 1 /* has unsetenv(3) call */ |
0d2faefc EA |
494 | # ifndef LA_TYPE |
495 | # define LA_TYPE LA_FLOAT | |
496 | # endif | |
72ef208d | 497 | # include <sys/sysmacros.h> |
6c8c0a75 | 498 | # define GIDSET_T gid_t |
0d2faefc EA |
499 | #endif |
500 | ||
501 | ||
178464cb EA |
502 | /* |
503 | ** DELL SVR4 Issue 2.2, and others | |
504 | ** From Kimmo Suominen <kim@grendel.lut.fi> | |
505 | ** | |
506 | ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ | |
507 | ** defined, and the definitions conflict. | |
69bed929 EA |
508 | ** |
509 | ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid | |
510 | ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A | |
511 | ** (SVR4.0/386 version 3.0). | |
178464cb EA |
512 | */ |
513 | ||
514 | #ifdef DELL_SVR4 | |
f361504a EA |
515 | /* no changes necessary */ |
516 | /* see general __svr4__ defines below */ | |
178464cb EA |
517 | #endif |
518 | ||
519 | ||
c2edb205 EA |
520 | /* |
521 | ** Apple A/UX 3.0 | |
522 | */ | |
523 | ||
524 | #ifdef _AUX_SOURCE | |
25a722b1 | 525 | # include <sys/sysmacros.h> |
c2edb205 EA |
526 | # define BSD /* has BSD routines */ |
527 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
528 | # define HASUNAME 1 /* use System V uname(2) system call */ | |
529 | # define HASUSTAT 1 /* use System V ustat(2) syscall */ | |
530 | # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ | |
53335960 | 531 | # define SIGFUNC_DEFINED /* sigfunc_t already defined */ |
a74fd615 EA |
532 | # ifndef IDENTPROTO |
533 | # define IDENTPROTO 0 /* TCP/IP implementation is broken */ | |
534 | # endif | |
c2edb205 EA |
535 | # define FORK fork |
536 | # ifndef _PATH_SENDMAILCF | |
537 | # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" | |
538 | # endif | |
539 | # ifndef LA_TYPE | |
540 | # define LA_TYPE LA_ZERO | |
541 | # endif | |
96e003d2 EA |
542 | # undef WIFEXITED |
543 | # undef WEXITSTATUS | |
c2edb205 EA |
544 | #endif |
545 | ||
546 | ||
82530719 EA |
547 | /* |
548 | ** Encore UMAX V | |
549 | ** | |
550 | ** Not extensively tested. | |
551 | */ | |
552 | ||
553 | #ifdef UMAXV | |
554 | # include <limits.h> | |
555 | # define HASUNAME 1 /* use System V uname(2) system call */ | |
556 | # define HASSTATFS 1 /* has the statfs(2) syscall */ | |
557 | # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ | |
558 | # define HASINITGROUPS 1 /* has initgroups(3) call */ | |
1ee33f7d | 559 | # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ |
82530719 EA |
560 | # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ |
561 | # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ | |
562 | # define FORK fork /* no vfork(2) primitive available */ | |
563 | # define MAXPATHLEN PATH_MAX | |
564 | extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); | |
565 | extern struct group *getgrent(), *getgrnam(), *getgrgid(); | |
566 | # undef WIFEXITED | |
567 | # undef WEXITSTATUS | |
568 | #endif | |
569 | ||
570 | ||
31c3ae15 EA |
571 | /* |
572 | ** Stardent Titan 3000 running TitanOS 4.2. | |
573 | ** | |
574 | ** Must be compiled in "cc -43" mode. | |
575 | ** | |
fce21cb9 | 576 | ** From Kate Hedstrom <kate@ahab.rutgers.edu>. |
31c3ae15 EA |
577 | ** |
578 | ** Note the tweaking below after the BSD defines are set. | |
579 | */ | |
580 | ||
581 | #ifdef titan | |
582 | # define setpgid setpgrp | |
583 | typedef int pid_t; | |
584 | # undef WIFEXITED | |
585 | # undef WEXITSTATUS | |
586 | #endif | |
587 | ||
588 | ||
c6bd47b4 EA |
589 | /* |
590 | ** Sequent DYNIX 3.2.0 | |
591 | ** | |
592 | ** From Jim Davis <jdavis@cs.arizona.edu>. | |
593 | */ | |
594 | ||
595 | #ifdef sequent | |
596 | # define BSD 1 | |
597 | # define HASUNSETENV 1 | |
598 | # define BSD4_3 1 /* to get signal() in conf.c */ | |
599 | # define WAITUNION 1 | |
600 | # define LA_TYPE LA_FLOAT | |
601 | # ifdef _POSIX_VERSION | |
602 | # undef _POSIX_VERSION /* set in <unistd.h> */ | |
603 | # endif | |
604 | # undef HASSETVBUF /* don't actually have setvbuf(3) */ | |
605 | # define setpgid setpgrp | |
606 | ||
607 | /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ | |
608 | # undef WIFEXITED | |
609 | # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ | |
610 | ((union wait*)&(s))->w_termsig == 0) | |
611 | # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) | |
612 | typedef int pid_t; | |
613 | # define isgraph(c) (isprint(c) && (c != ' ')) | |
614 | ||
615 | # ifndef _PATH_UNIX | |
616 | # define _PATH_UNIX "/dynix" | |
617 | # endif | |
618 | # ifndef _PATH_SENDMAILCF | |
619 | # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" | |
620 | # endif | |
621 | ||
622 | #endif | |
623 | ||
624 | ||
625 | ||
178464cb | 626 | |
ba6514e2 | 627 | /********************************************************************** |
fd57f063 | 628 | ** End of Per-Operating System defines |
ba6514e2 | 629 | **********************************************************************/ |
fd57f063 | 630 | |
b4cd00ff EA |
631 | /********************************************************************** |
632 | ** More general defines | |
633 | **********************************************************************/ | |
634 | ||
33d59d37 EA |
635 | /* general BSD defines */ |
636 | #ifdef BSD | |
39270cfd EA |
637 | # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ |
638 | # define HASSETREUID 1 /* has setreuid(2) call */ | |
639 | # define HASINITGROUPS 1 /* has initgroups(2) call */ | |
640 | # define HASFLOCK 1 /* has flock(2) call */ | |
33d59d37 EA |
641 | #endif |
642 | ||
f361504a EA |
643 | /* general System V Release 4 defines */ |
644 | #ifdef __svr4__ | |
645 | # define SYSTEM5 1 | |
646 | # define HASSETREUID 1 /* has seteuid(2) call & working saved uids */ | |
1ee33f7d EA |
647 | # ifndef HASGETUSERSHELL |
648 | # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ | |
9ceb18fe | 649 | # endif |
f361504a EA |
650 | # define setreuid(r, e) seteuid(e) |
651 | ||
652 | # ifndef _PATH_UNIX | |
653 | # define _PATH_UNIX "/unix" | |
654 | # endif | |
655 | # ifndef _PATH_SENDMAILCF | |
656 | # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" | |
657 | # endif | |
658 | # ifndef _PATH_SENDMAILPID | |
659 | # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" | |
660 | # endif | |
661 | # ifndef SYSLOG_BUFSIZE | |
662 | # define SYSLOG_BUFSIZE 128 | |
663 | # endif | |
664 | #endif | |
665 | ||
fd57f063 EA |
666 | /* general System V defines */ |
667 | # ifdef SYSTEM5 | |
8988dfd3 | 668 | # include <sys/sysmacros.h> |
b4cd00ff EA |
669 | # define HASUNAME 1 /* use System V uname(2) system call */ |
670 | # define HASUSTAT 1 /* use System V ustat(2) syscall */ | |
82530719 | 671 | # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ |
c6bd47b4 | 672 | # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ |
33d59d37 EA |
673 | # ifndef LA_TYPE |
674 | # define LA_TYPE LA_INT | |
675 | # endif | |
b4cd00ff EA |
676 | # define bcopy(s, d, l) (memmove((d), (s), (l))) |
677 | # define bzero(d, l) (memset((d), '\0', (l))) | |
678 | # define bcmp(s, d, l) (memcmp((s), (d), (l))) | |
fd57f063 EA |
679 | # endif |
680 | ||
b4cd00ff EA |
681 | /* general POSIX defines */ |
682 | #ifdef _POSIX_VERSION | |
fe3849ea EA |
683 | # define HASSETSID 1 /* has Posix setsid(2) call */ |
684 | # define HASWAITPID 1 /* has Posix waitpid(2) call */ | |
b4cd00ff EA |
685 | #endif |
686 | ||
e6cb9fc4 EA |
687 | /* |
688 | ** If no type for argument two of getgroups call is defined, assume | |
689 | ** it's an integer -- unfortunately, there seem to be several choices | |
690 | ** here. | |
691 | */ | |
692 | ||
693 | #ifndef GIDSET_T | |
694 | # define GIDSET_T int | |
695 | #endif | |
696 | ||
31c3ae15 EA |
697 | /* |
698 | ** Tweaking for systems that (for example) claim to be BSD but | |
699 | ** don't have all the standard BSD routines (boo hiss). | |
700 | */ | |
701 | ||
702 | #ifdef titan | |
703 | # undef HASINITGROUPS /* doesn't have initgroups(3) call */ | |
704 | #endif | |
705 | ||
a74fd615 EA |
706 | /* |
707 | ** Due to a "feature" in some operating systems such as Ultrix 4.3 and | |
708 | ** HPUX 8.0, if you receive a "No route to host" message (ICMP message | |
709 | ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host | |
710 | ** are closed. Some firewalls return this error if you try to connect | |
711 | ** to the IDENT port (113), so you can't receive email from these hosts | |
712 | ** on these systems. The firewall really should use a more specific | |
713 | ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If | |
714 | ** not explicitly set to zero above, default it on. | |
715 | */ | |
716 | ||
717 | #ifndef IDENTPROTO | |
718 | # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ | |
719 | #endif | |
720 | ||
1ee33f7d EA |
721 | #ifndef HASGETUSERSHELL |
722 | # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ | |
9ceb18fe EA |
723 | #endif |
724 | ||
2295903c EA |
725 | |
726 | /********************************************************************** | |
e6245c7e EA |
727 | ** Remaining definitions should never have to be changed. They are |
728 | ** primarily to provide back compatibility for older systems -- for | |
6070681d | 729 | ** example, it includes some POSIX compatibility definitions |
2295903c | 730 | **********************************************************************/ |
e6245c7e | 731 | |
bd3dddbf EA |
732 | /* System 5 compatibility */ |
733 | #ifndef S_ISREG | |
fce21cb9 EA |
734 | # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) |
735 | #endif | |
736 | #if !defined(S_ISLNK) && defined(S_IFLNK) | |
737 | # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) | |
bd3dddbf EA |
738 | #endif |
739 | #ifndef S_IWGRP | |
740 | #define S_IWGRP 020 | |
741 | #endif | |
742 | #ifndef S_IWOTH | |
743 | #define S_IWOTH 002 | |
744 | #endif | |
745 | ||
030ae776 EA |
746 | /* |
747 | ** Older systems don't have this error code -- it should be in | |
748 | ** /usr/include/sysexits.h. | |
749 | */ | |
750 | ||
751 | # ifndef EX_CONFIG | |
752 | # define EX_CONFIG 78 /* configuration error */ | |
753 | # endif | |
5229f34d | 754 | |
fe3849ea EA |
755 | /* pseudo-code used in server SMTP */ |
756 | # define EX_QUIT 22 /* drop out of server immediately */ | |
757 | ||
758 | ||
92f2b65e EA |
759 | /* |
760 | ** These are used in a few cases where we need some special | |
761 | ** error codes, but where the system doesn't provide something | |
762 | ** reasonable. They are printed in errstring. | |
763 | */ | |
764 | ||
765 | #ifndef E_PSEUDOBASE | |
766 | # define E_PSEUDOBASE 256 | |
767 | #endif | |
768 | ||
769 | #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ | |
770 | #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ | |
771 | ||
0639fd0c EA |
772 | /* type of arbitrary pointer */ |
773 | #ifndef ARBPTR_T | |
774 | # define ARBPTR_T void * | |
775 | #endif | |
776 | ||
ed0b2c1b EA |
777 | #ifndef __P |
778 | # include "cdefs.h" | |
779 | #endif | |
780 | ||
3356c77c EA |
781 | /* |
782 | ** Do some required dependencies | |
783 | */ | |
784 | ||
785 | #if defined(NETINET) || defined(NETISO) | |
e9aa7870 EA |
786 | # define SMTP 1 /* enable user and server SMTP */ |
787 | # define QUEUE 1 /* enable queueing */ | |
788 | # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ | |
3356c77c EA |
789 | #endif |
790 | ||
791 | ||
5229f34d EA |
792 | /* |
793 | ** Arrange to use either varargs or stdargs | |
794 | */ | |
795 | ||
796 | # ifdef __STDC__ | |
797 | ||
798 | # include <stdarg.h> | |
799 | ||
5229f34d EA |
800 | # define VA_LOCAL_DECL va_list ap; |
801 | # define VA_START(f) va_start(ap, f) | |
802 | # define VA_END va_end(ap) | |
803 | ||
804 | # else | |
805 | ||
806 | # include <varargs.h> | |
807 | ||
5229f34d EA |
808 | # define VA_LOCAL_DECL va_list ap; |
809 | # define VA_START(f) va_start(ap) | |
810 | # define VA_END va_end(ap) | |
811 | ||
812 | # endif | |
422bed79 | 813 | |
322eceee | 814 | #ifdef HASUNAME |
422bed79 EA |
815 | # include <sys/utsname.h> |
816 | # ifdef newstr | |
817 | # undef newstr | |
818 | # endif | |
322eceee | 819 | #else /* ! HASUNAME */ |
422bed79 EA |
820 | # define NODE_LENGTH 32 |
821 | struct utsname | |
822 | { | |
823 | char nodename[NODE_LENGTH+1]; | |
824 | }; | |
322eceee | 825 | #endif /* HASUNAME */ |
6e99f903 | 826 | |
7621e399 EA |
827 | #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) |
828 | # define MAXHOSTNAMELEN 256 | |
8d3fd325 | 829 | #endif |
49c069a9 EA |
830 | |
831 | #if !defined(SIGCHLD) && defined(SIGCLD) | |
832 | # define SIGCHLD SIGCLD | |
833 | #endif | |
834 | ||
835 | #ifndef STDIN_FILENO | |
836 | #define STDIN_FILENO 0 | |
837 | #endif | |
838 | ||
839 | #ifndef STDOUT_FILENO | |
840 | #define STDOUT_FILENO 1 | |
841 | #endif | |
842 | ||
843 | #ifndef STDERR_FILENO | |
844 | #define STDERR_FILENO 2 | |
845 | #endif | |
f8a31c8e | 846 | |
0f786d57 | 847 | #ifndef LOCK_SH |
39270cfd EA |
848 | # define LOCK_SH 0x01 /* shared lock */ |
849 | # define LOCK_EX 0x02 /* exclusive lock */ | |
850 | # define LOCK_NB 0x04 /* non-blocking lock */ | |
851 | # define LOCK_UN 0x08 /* unlock */ | |
852 | #endif | |
64247676 | 853 | |
39270cfd EA |
854 | #ifndef SIG_ERR |
855 | # define SIG_ERR ((void (*)()) -1) | |
f8a31c8e | 856 | #endif |
a3685d83 | 857 | |
0349f8cc EA |
858 | #ifndef WEXITSTATUS |
859 | # define WEXITSTATUS(st) (((st) >> 8) & 0377) | |
860 | #endif | |
861 | #ifndef WIFEXITED | |
862 | # define WIFEXITED(st) (((st) & 0377) == 0) | |
863 | #endif | |
864 | ||
53335960 EA |
865 | #ifndef SIGFUNC_DEFINED |
866 | typedef void (*sigfunc_t) __P((int)); | |
867 | #endif | |
868 | ||
7cfc9c77 EA |
869 | /* size of syslog buffer */ |
870 | #ifndef SYSLOG_BUFSIZE | |
871 | # define SYSLOG_BUFSIZE 1024 | |
872 | #endif | |
873 | ||
a3685d83 EA |
874 | /* |
875 | ** Size of tobuf (deliver.c) | |
876 | ** Tweak this to match your syslog implementation. It will have to | |
877 | ** allow for the extra information printed. | |
878 | */ | |
879 | ||
880 | #ifndef TOBUFSIZE | |
7cfc9c77 EA |
881 | # if (SYSLOG_BUFSIZE) > 512 |
882 | # define TOBUFSIZE (SYSLOG_BUFSIZE - 256) | |
883 | # else | |
884 | # define TOBUFSIZE 256 | |
885 | # endif | |
a3685d83 | 886 | #endif |
9114f86c | 887 | |
77779257 EA |
888 | /* |
889 | ** Size of prescan buffer. | |
890 | ** Despite comments in the _sendmail_ book, this probably should | |
891 | ** not be changed; there are some hard-to-define dependencies. | |
892 | */ | |
893 | ||
894 | # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ | |
9114f86c EA |
895 | /* fork routine -- set above using #ifdef _osname_ or in Makefile */ |
896 | # ifndef FORK | |
897 | # define FORK vfork /* function to call to fork mailer */ | |
898 | # endif |