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.15 (Berkeley) 07/22/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 /* 70 ** Per-Operating System defines 71 */ 72 73 /* 74 ** HP-UX -- tested for 8.07 75 */ 76 77 # ifdef __hpux 78 # define SYSTEM5 1 /* include all the System V defines */ 79 # define HASSETREUID 1 /* have setreuid(2) call */ 80 # define setreuid(r, e) setresuid(r, e, -1) 81 # define LA_TYPE LA_FLOAT 82 # define _PATH_UNIX "/hp-ux" 83 # endif 84 85 /* 86 ** IBM AIX 3.x -- actually tested for 3.2.3 87 */ 88 89 # ifdef _AIX3 90 # define LOCKF 1 /* use System V lockf instead of flock */ 91 # define FORK fork /* no vfork primitive available */ 92 # endif 93 94 /* 95 ** Silicon Graphics IRIX 96 ** 97 ** Compiles on 4.0.1. 98 */ 99 100 # ifdef IRIX 101 # define HASSETREUID 1 /* have setreuid(2) call */ 102 # define FORK fork /* no vfork primitive available */ 103 # define setpgrp BSDsetpgrp 104 # define GIDSET_T gid_t 105 # endif 106 107 108 /* 109 ** SunOS 110 */ 111 112 #if defined(sun) && !defined(BSD) 113 114 # define LA_TYPE LA_INT 115 # define HASSETREUID 1 /* have setreuid(2) call */ 116 117 # ifdef SOLARIS 118 /* Solaris 2.x (a.k.a. SunOS 5.x) */ 119 # define SYSTEM5 1 /* use System V definitions */ 120 # define setreuid(r, e) seteuid(e) 121 # include <sys/time.h> 122 # define _PATH_UNIX "/kernel/unix" 123 # ifndef _PATH_SENDMAILCF 124 # define _PATH_SENDMAILCF "/etc/mail/sendmail.cf" 125 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 126 # endif 127 128 # else 129 /* SunOS 4.1.x */ 130 # define HASSTATFS 1 /* has the statfs(2) syscall */ 131 # include <vfork.h> 132 133 # endif 134 #endif 135 136 /* 137 ** Digital Ultrix 4.2A or 4.3 138 */ 139 140 #ifdef ultrix 141 # define HASSTATFS 1 /* has the statfs(2) syscall */ 142 # define HASSETREUID 1 /* have setreuid(2) call */ 143 # define HASSETENV 1 /* has setenv(3) call */ 144 # define HASUNSETENV 1 /* has unsetenv(3) call */ 145 # define LA_TYPE LA_INT 146 # define LA_AVENRUN "avenrun" 147 #endif 148 149 /* 150 ** OSF/1 (tested on Alpha) 151 */ 152 153 #ifdef __osf__ 154 # define HASSETENV 1 /* has setenv(3) call */ 155 # define HASUNSETENV 1 /* has unsetenv(3) call */ 156 # define HASSETREUID 1 /* have setreuid(2) call */ 157 # define LA_TYPE LA_INT 158 # define LA_AVENRUN "avenrun" 159 #endif 160 161 /* 162 ** NeXTstep 163 */ 164 165 #ifdef __NeXT__ 166 # define sleep sleepX 167 # define LA_TYPE LA_ZERO 168 #endif 169 170 /* 171 ** 4.4 BSD 172 */ 173 174 #ifdef BSD4_4 175 # include <sys/cdefs.h> 176 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 177 #endif 178 179 /* 180 ** 4.3 BSD -- this is for very old systems 181 ** 182 ** You'll also have to install a new resolver library. 183 ** I don't guarantee that support for this environment is complete. 184 */ 185 186 #ifdef oldBSD43 187 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 188 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 189 # define ARBPTR_T char * 190 # ifndef LA_TYPE 191 # define LA_TYPE LA_FLOAT 192 # endif 193 # ifndef _PATH_SENDMAILCF 194 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 195 # endif 196 # ifndef _PATH_SENDMAILFC 197 # define _PATH_SENDMAILFC "/usr/lib/sendmail.fc" 198 # endif 199 #endif 200 201 /* 202 ** SCO Unix 203 */ 204 205 #ifdef _SCO_unix_ 206 # define SYSTEM5 1 /* include all the System V defines */ 207 # define HASSTATFS 1 /* has the statfs(2) syscall */ 208 # define FORK fork 209 # define MAXPATHLEN PATHSIZE 210 # define LA_TYPE LA_ZERO 211 #endif 212 213 /* 214 ** ConvexOS 11.0 and later 215 */ 216 217 #ifdef _CONVEX_SOURCE 218 # define BSD 1 /* include all the BSD defines */ 219 # define HASUNAME 1 /* use System V uname(2) system call */ 220 # define LOCKF 1 /* use System V locking instead of flock */ 221 # define HASSTATFS 1 /* has the statfs(2) syscall */ 222 # define HASSETSID 1 /* has POSIX setsid(2) call */ 223 # define HASINITGROUPS 1 /* has initgroups(2) call */ 224 # define NEEDGETOPT 1 /* need replacement for getopt(3) */ 225 # define LA_TYPE LA_FLOAT 226 #endif 227 228 /* 229 ** RISC/os 4.51 230 ** 231 ** Untested... 232 */ 233 234 #ifdef RISCOS 235 # define HASSETENV 1 /* has setenv(3) call */ 236 # define HASUNSETENV 1 /* has unsetenv(3) call */ 237 # define LA_TYPE LA_INT 238 # define LA_AVENRUN "avenrun" 239 # define _PATH_UNIX "/unix" 240 #endif 241 242 /********************************************************************** 243 ** End of Per-Operating System defines 244 **********************************************************************/ 245 246 /********************************************************************** 247 ** More general defines 248 **********************************************************************/ 249 250 /* general BSD defines */ 251 #ifdef BSD 252 # define HASSETENV 1 /* has setenv(3) call */ 253 # define HASUNSETENV 1 /* has unsetenv(3) call */ 254 # define HASGETDTABLESIZE 1 /* we have getdtablesize(2) call */ 255 # define HASSETREUID 1 /* have setreuid(2) call */ 256 # ifndef LA_TYPE 257 # define LA_TYPE LA_SUBR 258 # endif 259 #endif 260 261 /* general System V defines */ 262 # ifdef SYSTEM5 263 # define LOCKF 1 /* use System V locking instead of flock */ 264 # define HASUNAME 1 /* use System V uname(2) system call */ 265 # define HASUSTAT 1 /* use System V ustat(2) syscall */ 266 # ifndef LA_TYPE 267 # define LA_TYPE LA_INT 268 # endif 269 # define bcopy(s, d, l) (memmove((d), (s), (l))) 270 # define bzero(d, l) (memset((d), '\0', (l))) 271 # define bcmp(s, d, l) (memcmp((s), (d), (l))) 272 # endif 273 274 /* general "standard C" defines */ 275 #if defined(__STDC__) || defined(SYSTEM5) 276 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 277 #endif 278 279 /* general POSIX defines */ 280 #ifdef _POSIX_VERSION 281 # define HASSETSID 1 /* has setsid(2) call */ 282 # define HASWAITPID 1 /* has waitpid(2) call */ 283 #endif 284 285 /* 286 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 287 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 288 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 289 ** are closed. Some firewalls return this error if you try to connect 290 ** to the IDENT port (113), so you can't receive email from these hosts 291 ** on these systems. The firewall really should use a more specific 292 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. 293 */ 294 295 #if !defined(ultrix) && !defined(__hpux) 296 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 297 #endif 298 299 /* 300 ** If no type for argument two of getgroups call is defined, assume 301 ** it's an integer -- unfortunately, there seem to be several choices 302 ** here. 303 */ 304 305 #ifndef GIDSET_T 306 # define GIDSET_T int 307 #endif 308 309 /* 310 ** Remaining definitions should never have to be changed. They are 311 ** primarily to provide back compatibility for older systems -- for 312 ** example, it includes some POSIX compatibility definitions 313 */ 314 315 /* System 5 compatibility */ 316 #ifndef S_ISREG 317 #define S_ISREG(foo) ((foo & S_IFREG) == S_IFREG) 318 #endif 319 #ifndef S_IWGRP 320 #define S_IWGRP 020 321 #endif 322 #ifndef S_IWOTH 323 #define S_IWOTH 002 324 #endif 325 326 /* 327 ** Older systems don't have this error code -- it should be in 328 ** /usr/include/sysexits.h. 329 */ 330 331 # ifndef EX_CONFIG 332 # define EX_CONFIG 78 /* configuration error */ 333 # endif 334 335 /* 336 ** These are used in a few cases where we need some special 337 ** error codes, but where the system doesn't provide something 338 ** reasonable. They are printed in errstring. 339 */ 340 341 #ifndef E_PSEUDOBASE 342 # define E_PSEUDOBASE 256 343 #endif 344 345 #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 346 #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 347 348 /* type of arbitrary pointer */ 349 #ifndef ARBPTR_T 350 # define ARBPTR_T void * 351 #endif 352 353 #ifndef __P 354 # include "cdefs.h" 355 #endif 356 357 /* 358 ** Do some required dependencies 359 */ 360 361 #if defined(NETINET) || defined(NETISO) 362 # define SMTP 1 /* enable user and server SMTP */ 363 # define QUEUE 1 /* enable queueing */ 364 # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 365 #endif 366 367 368 /* 369 ** Arrange to use either varargs or stdargs 370 */ 371 372 # ifdef __STDC__ 373 374 # include <stdarg.h> 375 376 # define VA_LOCAL_DECL va_list ap; 377 # define VA_START(f) va_start(ap, f) 378 # define VA_END va_end(ap) 379 380 # else 381 382 # include <varargs.h> 383 384 # define VA_LOCAL_DECL va_list ap; 385 # define VA_START(f) va_start(ap) 386 # define VA_END va_end(ap) 387 388 # endif 389 390 #ifdef HASUNAME 391 # include <sys/utsname.h> 392 # ifdef newstr 393 # undef newstr 394 # endif 395 #else /* ! HASUNAME */ 396 # define NODE_LENGTH 32 397 struct utsname 398 { 399 char nodename[NODE_LENGTH+1]; 400 }; 401 #endif /* HASUNAME */ 402 403 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) 404 # define MAXHOSTNAMELEN 256 405 #endif 406 407 #if !defined(SIGCHLD) && defined(SIGCLD) 408 # define SIGCHLD SIGCLD 409 #endif 410 411 #ifndef STDIN_FILENO 412 #define STDIN_FILENO 0 413 #endif 414 415 #ifndef STDOUT_FILENO 416 #define STDOUT_FILENO 1 417 #endif 418 419 #ifndef STDERR_FILENO 420 #define STDERR_FILENO 2 421 #endif 422 423 #ifdef LOCKF 424 #define LOCK_SH 0x01 /* shared lock */ 425 #define LOCK_EX 0x02 /* exclusive lock */ 426 #define LOCK_NB 0x04 /* non-blocking lock */ 427 #define LOCK_UN 0x08 /* unlock */ 428 429 #else 430 431 # include <sys/file.h> 432 433 #endif 434 435 /* 436 ** Size of tobuf (deliver.c) 437 ** Tweak this to match your syslog implementation. It will have to 438 ** allow for the extra information printed. 439 */ 440 441 #ifndef TOBUFSIZE 442 # define TOBUFSIZE (1024 - 256) 443 #endif 444 445 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 446 # ifndef FORK 447 # define FORK vfork /* function to call to fork mailer */ 448 # endif 449