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