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.17 (Berkeley) 07/26/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 setpgrp 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 _PATH_UNIX "/kernel/unix" 141 # ifndef _PATH_SENDMAILCF 142 # define _PATH_SENDMAILCF "/etc/mail/sendmail.cf" 143 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 144 # endif 145 146 # else 147 /* SunOS 4.1.x */ 148 # define HASSTATFS 1 /* has the statfs(2) syscall */ 149 /* # define HASFLOCK 1 /* has flock(2) call */ 150 # include <vfork.h> 151 152 # endif 153 #endif 154 155 /* 156 ** Digital Ultrix 4.2A or 4.3 157 */ 158 159 #ifdef ultrix 160 # define HASSTATFS 1 /* has the statfs(2) syscall */ 161 # define HASSETREUID 1 /* has setreuid(2) call */ 162 # define HASSETENV 1 /* has setenv(3) call */ 163 # define HASUNSETENV 1 /* has unsetenv(3) call */ 164 # define HASINITGROUPS 1 /* has initgroups(3) call */ 165 /* # define HASFLOCK 1 /* has flock(2) call */ 166 # define LA_TYPE LA_INT 167 # define LA_AVENRUN "avenrun" 168 # undef IDENTPROTO 169 #endif 170 171 /* 172 ** OSF/1 (tested on Alpha) 173 */ 174 175 #ifdef __osf__ 176 # define HASSETENV 1 /* has setenv(3) call */ 177 # define HASUNSETENV 1 /* has unsetenv(3) call */ 178 # define HASSETREUID 1 /* has setreuid(2) call */ 179 # define HASINITGROUPS 1 /* has initgroups(3) call */ 180 /* # define HASFLOCK 1 /* has flock(2) call */ 181 # define LA_TYPE LA_INT 182 # define LA_AVENRUN "avenrun" 183 #endif 184 185 /* 186 ** NeXTstep 187 */ 188 189 #ifdef __NeXT__ 190 # define HASINITGROUPS 1 /* has initgroups(3) call */ 191 # define HASFLOCK 1 /* has flock(2) call */ 192 # define sleep sleepX 193 # define LA_TYPE LA_ZERO 194 typedef int pid_t; 195 #endif 196 197 /* 198 ** 4.4 BSD 199 */ 200 201 #ifdef BSD4_4 202 # include <sys/cdefs.h> 203 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 204 #endif 205 206 /* 207 ** 4.3 BSD -- this is for very old systems 208 ** 209 ** You'll also have to install a new resolver library. 210 ** I don't guarantee that support for this environment is complete. 211 */ 212 213 #ifdef oldBSD43 214 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 215 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 216 # define ARBPTR_T char * 217 # ifndef LA_TYPE 218 # define LA_TYPE LA_FLOAT 219 # endif 220 # ifndef _PATH_SENDMAILCF 221 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 222 # endif 223 # ifndef _PATH_SENDMAILFC 224 # define _PATH_SENDMAILFC "/usr/lib/sendmail.fc" 225 # endif 226 #endif 227 228 /* 229 ** SCO Unix 230 */ 231 232 #ifdef _SCO_unix_ 233 # define SYSTEM5 1 /* include all the System V defines */ 234 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 235 # define HASSTATFS 1 /* has the statfs(2) syscall */ 236 # define FORK fork 237 # define MAXPATHLEN PATHSIZE 238 # define LA_TYPE LA_ZERO 239 #endif 240 241 /* 242 ** ConvexOS 11.0 and later 243 */ 244 245 #ifdef _CONVEX_SOURCE 246 # define BSD 1 /* include all the BSD defines */ 247 # define HASUNAME 1 /* use System V uname(2) system call */ 248 # define HASSTATFS 1 /* has the statfs(2) syscall */ 249 # define HASSETSID 1 /* has POSIX setsid(2) call */ 250 # define NEEDGETOPT 1 /* need replacement for getopt(3) */ 251 # define LA_TYPE LA_FLOAT 252 # undef IDENTPROTO 253 #endif 254 255 /* 256 ** RISC/os 4.51 257 ** 258 ** Untested... 259 */ 260 261 #ifdef RISCOS 262 # define HASSETENV 1 /* has setenv(3) call */ 263 # define HASUNSETENV 1 /* has unsetenv(3) call */ 264 /* # define HASFLOCK 1 /* has flock(2) call */ 265 # define LA_TYPE LA_INT 266 # define LA_AVENRUN "avenrun" 267 # define _PATH_UNIX "/unix" 268 #endif 269 270 /********************************************************************** 271 ** End of Per-Operating System defines 272 **********************************************************************/ 273 274 /********************************************************************** 275 ** More general defines 276 **********************************************************************/ 277 278 /* general BSD defines */ 279 #ifdef BSD 280 # define HASSETENV 1 /* has setenv(3) call */ 281 # define HASUNSETENV 1 /* has unsetenv(3) call */ 282 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 283 # define HASSETREUID 1 /* has setreuid(2) call */ 284 # define HASINITGROUPS 1 /* has initgroups(2) call */ 285 # define HASFLOCK 1 /* has flock(2) call */ 286 # ifndef LA_TYPE 287 # define LA_TYPE LA_SUBR 288 # endif 289 #endif 290 291 /* general System V defines */ 292 # ifdef SYSTEM5 293 # define HASUNAME 1 /* use System V uname(2) system call */ 294 # define HASUSTAT 1 /* use System V ustat(2) syscall */ 295 # ifndef LA_TYPE 296 # define LA_TYPE LA_INT 297 # endif 298 # define bcopy(s, d, l) (memmove((d), (s), (l))) 299 # define bzero(d, l) (memset((d), '\0', (l))) 300 # define bcmp(s, d, l) (memcmp((s), (d), (l))) 301 # endif 302 303 /* general "standard C" defines */ 304 #if defined(__STDC__) || defined(SYSTEM5) 305 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 306 #endif 307 308 /* general POSIX defines */ 309 #ifdef _POSIX_VERSION 310 # define HASSETSID 1 /* has setsid(2) call */ 311 # define HASWAITPID 1 /* has waitpid(2) call */ 312 #endif 313 314 /* 315 ** If no type for argument two of getgroups call is defined, assume 316 ** it's an integer -- unfortunately, there seem to be several choices 317 ** here. 318 */ 319 320 #ifndef GIDSET_T 321 # define GIDSET_T int 322 #endif 323 324 /* 325 ** Remaining definitions should never have to be changed. They are 326 ** primarily to provide back compatibility for older systems -- for 327 ** example, it includes some POSIX compatibility definitions 328 */ 329 330 /* System 5 compatibility */ 331 #ifndef S_ISREG 332 #define S_ISREG(foo) ((foo & S_IFREG) == S_IFREG) 333 #endif 334 #ifndef S_IWGRP 335 #define S_IWGRP 020 336 #endif 337 #ifndef S_IWOTH 338 #define S_IWOTH 002 339 #endif 340 341 /* 342 ** Older systems don't have this error code -- it should be in 343 ** /usr/include/sysexits.h. 344 */ 345 346 # ifndef EX_CONFIG 347 # define EX_CONFIG 78 /* configuration error */ 348 # endif 349 350 /* 351 ** These are used in a few cases where we need some special 352 ** error codes, but where the system doesn't provide something 353 ** reasonable. They are printed in errstring. 354 */ 355 356 #ifndef E_PSEUDOBASE 357 # define E_PSEUDOBASE 256 358 #endif 359 360 #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 361 #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 362 363 /* type of arbitrary pointer */ 364 #ifndef ARBPTR_T 365 # define ARBPTR_T void * 366 #endif 367 368 #ifndef __P 369 # include "cdefs.h" 370 #endif 371 372 /* 373 ** Do some required dependencies 374 */ 375 376 #if defined(NETINET) || defined(NETISO) 377 # define SMTP 1 /* enable user and server SMTP */ 378 # define QUEUE 1 /* enable queueing */ 379 # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 380 #endif 381 382 383 /* 384 ** Arrange to use either varargs or stdargs 385 */ 386 387 # ifdef __STDC__ 388 389 # include <stdarg.h> 390 391 # define VA_LOCAL_DECL va_list ap; 392 # define VA_START(f) va_start(ap, f) 393 # define VA_END va_end(ap) 394 395 # else 396 397 # include <varargs.h> 398 399 # define VA_LOCAL_DECL va_list ap; 400 # define VA_START(f) va_start(ap) 401 # define VA_END va_end(ap) 402 403 # endif 404 405 #ifdef HASUNAME 406 # include <sys/utsname.h> 407 # ifdef newstr 408 # undef newstr 409 # endif 410 #else /* ! HASUNAME */ 411 # define NODE_LENGTH 32 412 struct utsname 413 { 414 char nodename[NODE_LENGTH+1]; 415 }; 416 #endif /* HASUNAME */ 417 418 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) 419 # define MAXHOSTNAMELEN 256 420 #endif 421 422 #if !defined(SIGCHLD) && defined(SIGCLD) 423 # define SIGCHLD SIGCLD 424 #endif 425 426 #ifndef STDIN_FILENO 427 #define STDIN_FILENO 0 428 #endif 429 430 #ifndef STDOUT_FILENO 431 #define STDOUT_FILENO 1 432 #endif 433 434 #ifndef STDERR_FILENO 435 #define STDERR_FILENO 2 436 #endif 437 438 #ifdef HASFLOCK 439 # include <sys/file.h> 440 #else 441 # define LOCK_SH 0x01 /* shared lock */ 442 # define LOCK_EX 0x02 /* exclusive lock */ 443 # define LOCK_NB 0x04 /* non-blocking lock */ 444 # define LOCK_UN 0x08 /* unlock */ 445 #endif 446 447 #ifndef SIG_ERR 448 # define SIG_ERR ((void (*)()) -1) 449 #endif 450 451 /* 452 ** Size of tobuf (deliver.c) 453 ** Tweak this to match your syslog implementation. It will have to 454 ** allow for the extra information printed. 455 */ 456 457 #ifndef TOBUFSIZE 458 # define TOBUFSIZE (1024 - 256) 459 #endif 460 461 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 462 # ifndef FORK 463 # define FORK vfork /* function to call to fork mailer */ 464 # endif 465