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.138 (Berkeley) 03/06/95 9 */ 10 11 /* 12 ** CONF.H -- All user-configurable parameters for sendmail 13 */ 14 15 # include <sys/param.h> 16 # include <sys/types.h> 17 # include <sys/stat.h> 18 # include <sys/file.h> 19 # include <sys/wait.h> 20 # include <fcntl.h> 21 # include <signal.h> 22 23 /********************************************************************** 24 ** Table sizes, etc.... 25 ** There shouldn't be much need to change these.... 26 **********************************************************************/ 27 28 # define MAXLINE 2048 /* max line length */ 29 # define MAXNAME 256 /* max length of a name */ 30 # define MAXPV 40 /* max # of parms to mailers */ 31 # define MAXATOM 200 /* max atoms per address */ 32 # define MAXMAILERS 25 /* maximum mailers known to system */ 33 # define MAXRWSETS 200 /* max # of sets of rewriting rules */ 34 # define MAXPRIORITIES 25 /* max values for Precedence: field */ 35 # define MAXMXHOSTS 20 /* max # of MX records */ 36 # define SMTPLINELIM 990 /* maximum SMTP line length */ 37 # define MAXKEY 128 /* maximum size of a database key */ 38 # define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */ 39 # define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */ 40 # define MAXALIASDB 12 /* max # of alias databases */ 41 # define MAXMAPSTACK 12 /* max # of stacked or sequenced maps */ 42 # define MAXTOCLASS 8 /* max # of message timeout classes */ 43 44 # ifndef QUEUESIZE 45 # define QUEUESIZE 1000 /* max # of jobs per queue run */ 46 # endif 47 48 /********************************************************************** 49 ** Compilation options. 50 ** 51 ** #define these if they are available; comment them out otherwise. 52 **********************************************************************/ 53 54 # define LOG 1 /* enable logging */ 55 # define UGLYUUCP 1 /* output ugly UUCP From lines */ 56 # define NETUNIX 1 /* include unix domain support */ 57 # define NETINET 1 /* include internet support */ 58 # define MATCHGECOS 1 /* match user names from gecos field */ 59 # define XDEBUG 1 /* enable extended debugging */ 60 # ifdef NEWDB 61 # define USERDB 1 /* look in user database (requires NEWDB) */ 62 # endif 63 64 /********************************************************************** 65 ** 0/1 Compilation options. 66 ** #define these to 1 if they are available; 67 ** #define them to 0 otherwise. 68 **********************************************************************/ 69 70 # ifndef NAMED_BIND 71 # define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ 72 # endif 73 74 /* 75 ** Most systems have symbolic links today, so default them on. You 76 ** can turn them off by #undef'ing this below. 77 */ 78 79 # define HASLSTAT 1 /* has lstat(2) call */ 80 81 /* 82 ** General "standard C" defines. 83 ** 84 ** These may be undone later, to cope with systems that claim to 85 ** be Standard C but aren't. Gcc is the biggest offender -- it 86 ** doesn't realize that the library is part of the language. 87 ** 88 ** Life would be much easier if we could get rid of this sort 89 ** of bozo problems. 90 */ 91 92 #ifdef __STDC__ 93 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 94 #endif 95 96 /********************************************************************** 97 ** Operating system configuration. 98 ** 99 ** Unless you are porting to a new OS, you shouldn't have to 100 ** change these. 101 **********************************************************************/ 102 103 /* 104 ** Per-Operating System defines 105 */ 106 107 108 /* 109 ** HP-UX -- tested for 8.07, 9.00, and 9.01. 110 */ 111 112 #ifdef __hpux 113 /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */ 114 # undef m_flags 115 # define SYSTEM5 1 /* include all the System V defines */ 116 # define HASINITGROUPS 1 /* has initgroups(3) call */ 117 # define HASSETREUID 1 /* has setreuid(2) call */ 118 # define setreuid(r, e) setresuid(r, e, -1) 119 # define LA_TYPE LA_SUBR 120 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 121 # define GIDSET_T gid_t 122 # define _PATH_UNIX "/hp-ux" 123 # ifndef _PATH_SENDMAILCF 124 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 125 # endif 126 # ifndef IDENTPROTO 127 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 128 # endif 129 # ifndef HASGETUSERSHELL 130 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 131 # endif 132 # define syslog hard_syslog 133 # ifdef __STDC__ 134 extern int syslog(int, char *, ...); 135 # endif 136 #endif 137 138 139 /* 140 ** IBM AIX 3.x -- actually tested for 3.2.3 141 */ 142 143 #ifdef _AIX3 144 # define HASINITGROUPS 1 /* has initgroups(3) call */ 145 # define HASUNAME 1 /* use System V uname(2) system call */ 146 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 147 # define FORK fork /* no vfork primitive available */ 148 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 149 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 150 # define LA_TYPE LA_INT 151 #endif 152 153 154 /* 155 ** Silicon Graphics IRIX 156 ** 157 ** Compiles on 4.0.1. 158 ** 159 ** Use IRIX64 instead of IRIX for 64-bit IRIX. 160 ** 161 ** IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>. 162 */ 163 164 #ifdef IRIX64 165 # define IRIX 166 #endif 167 168 #ifdef IRIX 169 # define SYSTEM5 1 /* this is a System-V derived system */ 170 # define HASSETREUID 1 /* has setreuid(2) call */ 171 # define HASINITGROUPS 1 /* has initgroups(3) call */ 172 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 173 # define FORK fork /* no vfork primitive available */ 174 # ifndef IRIX64 /* IRIX 6.0 */ 175 # define WAITUNION 1 /* use "union wait" as wait argument type */ 176 # endif 177 # define setpgid BSDsetpgrp 178 # define GIDSET_T gid_t 179 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 180 # define SFS_BAVAIL f_bfree /* alternate field name */ 181 # define LA_TYPE LA_INT 182 # ifdef IRIX64 183 # define NAMELISTMASK 0x7fffffffffffffff /* mask for nlist() values */ 184 # else 185 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ 186 # endif 187 #endif 188 189 190 /* 191 ** SunOS and Solaris 192 ** 193 ** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and 194 ** Solaris 2.2 (a.k.a. SunOS 5.2). 195 */ 196 197 #if defined(sun) && !defined(BSD) 198 199 # define HASINITGROUPS 1 /* has initgroups(3) call */ 200 # define HASUNAME 1 /* use System V uname(2) system call */ 201 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 202 # define LA_TYPE LA_INT 203 204 # ifdef SOLARIS_2_3 205 # define SOLARIS /* for back compat only -- use -DSOLARIS=203 */ 206 # endif 207 208 # ifdef SOLARIS 209 /* Solaris 2.x (a.k.a. SunOS 5.x) */ 210 # ifndef __svr4__ 211 # define __svr4__ /* use all System V Releae 4 defines below */ 212 # endif 213 # include <sys/time.h> 214 # define GIDSET_T gid_t 215 # ifndef _PATH_UNIX 216 # define _PATH_UNIX "/dev/ksyms" 217 # endif 218 # ifndef _PATH_SENDMAILCF 219 # define _PATH_SENDMAILCF "/etc/mail/sendmail.cf" 220 # endif 221 # ifndef _PATH_SENDMAILPID 222 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 223 # endif 224 # ifndef SYSLOG_BUFSIZE 225 # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 226 # endif 227 # if SOLARIS < 204 228 # define gethostbyname solaris_gethostbyname /* get good version */ 229 # define gethostbyaddr solaris_gethostbyaddr /* get good version */ 230 # endif 231 232 # else 233 /* SunOS 4.0.3 or 4.1.x */ 234 # define HASSETREUID 1 /* has setreuid(2) call */ 235 # ifndef HASFLOCK 236 # define HASFLOCK 1 /* has flock(2) call */ 237 # endif 238 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 239 # include <vfork.h> 240 241 # ifdef SUNOS403 242 /* special tweaking for SunOS 4.0.3 */ 243 # include <malloc.h> 244 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 245 # define WAITUNION 1 /* use "union wait" as wait argument type */ 246 # undef WIFEXITED 247 # undef WEXITSTATUS 248 # undef HASUNAME 249 # define setpgid setpgrp 250 typedef int pid_t; 251 extern char *getenv(); 252 253 # else 254 /* 4.1.x specifics */ 255 # define HASSETSID 1 /* has Posix setsid(2) call */ 256 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 257 258 # endif 259 # endif 260 #endif 261 262 /* 263 ** DG/UX 264 ** 265 ** Tested on 5.4.2 and 5.4.3. Use DGUX_5_4_2 to get the 266 ** older support. 267 ** 5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>. 268 */ 269 270 #ifdef DGUX_5_4_2 271 # define DGUX 1 272 #endif 273 274 #ifdef DGUX 275 # define SYSTEM5 1 276 # define LA_TYPE LA_SUBR 277 # define HASSETREUID 1 /* has setreuid(2) call */ 278 # define HASUNAME 1 /* use System V uname(2) system call */ 279 # define HASSETSID 1 /* has Posix setsid(2) call */ 280 # define HASINITGROUPS 1 /* has initgroups(3) call */ 281 # define HASGETUSERSHELL 0 /* does not have getusershell(3) */ 282 # ifndef IDENTPROTO 283 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 284 # endif 285 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 286 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 287 288 /* these include files must be included early on DG/UX */ 289 # include <netinet/in.h> 290 # include <arpa/inet.h> 291 292 # ifdef DGUX_5_4_2 293 # define inet_addr dgux_inet_addr 294 extern long dgux_inet_addr(); 295 # endif 296 #endif 297 298 299 /* 300 ** Digital Ultrix 4.2A or 4.3 301 ** 302 ** Apparently, fcntl locking is broken on 4.2A, in that locks are 303 ** not dropped when the process exits. This causes major problems, 304 ** so flock is the only alternative. 305 */ 306 307 #ifdef ultrix 308 # define HASSETREUID 1 /* has setreuid(2) call */ 309 # define HASUNSETENV 1 /* has unsetenv(3) call */ 310 # define HASINITGROUPS 1 /* has initgroups(3) call */ 311 # define HASUNAME 1 /* use System V uname(2) system call */ 312 # ifndef HASFLOCK 313 # define HASFLOCK 1 /* has flock(2) call */ 314 # endif 315 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 316 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 317 # ifdef vax 318 # define LA_TYPE LA_FLOAT 319 # else 320 # define LA_TYPE LA_INT 321 # define LA_AVENRUN "avenrun" 322 # endif 323 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 324 # ifndef IDENTPROTO 325 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 326 # endif 327 #endif 328 329 330 /* 331 ** OSF/1 for Intel Paragon. 332 ** 333 ** Contributed by Jeff A. Earickson <jeff@ssd.intel.com> 334 ** of Intel Scalable Systems Divison. 335 */ 336 337 #ifdef __PARAGON__ 338 # define __osf__ 1 /* get OSF/1 defines below */ 339 # ifndef _PATH_SENDMAILCF 340 # define _PATH_SENDMAILCF "/var/adm/sendmail/sendmail.cf" 341 # endif 342 #endif 343 344 345 /* 346 ** OSF/1 (tested on Alpha) 347 */ 348 349 #ifdef __osf__ 350 # define HASUNSETENV 1 /* has unsetenv(3) call */ 351 # define HASSETREUID 1 /* has setreuid(2) call */ 352 # define HASINITGROUPS 1 /* has initgroups(3) call */ 353 # ifndef HASFLOCK 354 # define HASFLOCK 1 /* has flock(2) call */ 355 # endif 356 # define LA_TYPE LA_INT 357 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 358 # ifndef _PATH_SENDMAILPID 359 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 360 # endif 361 #endif 362 363 364 /* 365 ** NeXTstep 366 */ 367 368 #ifdef NeXT 369 # define HASINITGROUPS 1 /* has initgroups(3) call */ 370 # ifndef HASFLOCK 371 # define HASFLOCK 1 /* has flock(2) call */ 372 # endif 373 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 374 # define WAITUNION 1 /* use "union wait" as wait argument type */ 375 # define sleep sleepX 376 # define setpgid setpgrp 377 # ifndef LA_TYPE 378 # define LA_TYPE LA_MACH 379 # endif 380 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 381 # ifndef _POSIX_SOURCE 382 typedef int pid_t; 383 # undef WEXITSTATUS 384 # undef WIFEXITED 385 # endif 386 # ifndef _PATH_SENDMAILCF 387 # define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf" 388 # endif 389 # ifndef _PATH_SENDMAILPID 390 # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" 391 # endif 392 #endif 393 394 395 /* 396 ** 4.4 BSD 397 ** 398 ** See also BSD defines. 399 */ 400 401 #ifdef BSD4_4 402 # define HASUNSETENV 1 /* has unsetenv(3) call */ 403 # include <sys/cdefs.h> 404 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 405 # ifndef LA_TYPE 406 # define LA_TYPE LA_SUBR 407 # endif 408 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 409 # define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */ 410 #endif 411 412 413 /* 414 ** BSD/386 (all versions) 415 ** From Tony Sanders, BSDI 416 */ 417 418 #ifdef __bsdi__ 419 # define HASUNSETENV 1 /* has the unsetenv(3) call */ 420 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 421 # include <sys/cdefs.h> 422 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 423 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 424 # ifndef LA_TYPE 425 # define LA_TYPE LA_SUBR 426 # endif 427 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 428 /* version 1.1 or later */ 429 # undef SPT_TYPE 430 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 431 # else 432 /* version 1.0 or earlier */ 433 # ifndef OLD_NEWDB 434 # define OLD_NEWDB 1 /* old version of newdb library */ 435 # endif 436 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 437 # endif 438 #endif 439 440 441 442 /* 443 ** 386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions) 444 ** 445 ** 4.3BSD clone, closer to 4.4BSD 446 ** 447 ** See also BSD defines. 448 */ 449 450 #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__) 451 # define HASUNSETENV 1 /* has unsetenv(3) call */ 452 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 453 # ifdef __NetBSD__ 454 # define HASUNAME 1 /* has uname(2) syscall */ 455 # endif 456 # include <sys/cdefs.h> 457 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 458 # ifndef LA_TYPE 459 # define LA_TYPE LA_SUBR 460 # endif 461 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 462 #endif 463 464 465 /* 466 ** Mach386 467 ** 468 ** For mt Xinu's Mach386 system. 469 */ 470 471 #if defined(MACH) && defined(i386) 472 # define MACH386 1 473 # define HASUNSETENV 1 /* has unsetenv(3) call */ 474 # define HASINITGROUPS 1 /* has initgroups(3) call */ 475 # ifndef HASFLOCK 476 # define HASFLOCK 1 /* has flock(2) call */ 477 # endif 478 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 479 # define NEEDSTRTOL 1 /* need the strtol() function */ 480 # define setpgid setpgrp 481 # ifndef LA_TYPE 482 # define LA_TYPE LA_FLOAT 483 # endif 484 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 485 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 486 # undef WEXITSTATUS 487 # undef WIFEXITED 488 # ifndef _PATH_SENDMAILCF 489 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 490 # endif 491 # ifndef _PATH_SENDMAILPID 492 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 493 # endif 494 #endif 495 496 497 /* 498 ** 4.3 BSD -- this is for very old systems 499 ** 500 ** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1. 501 ** 502 ** You'll also have to install a new resolver library. 503 ** I don't guarantee that support for this environment is complete. 504 */ 505 506 #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) 507 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 508 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 509 # define ARBPTR_T char * 510 # define setpgid setpgrp 511 # ifndef LA_TYPE 512 # define LA_TYPE LA_FLOAT 513 # endif 514 # ifndef _PATH_SENDMAILCF 515 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 516 # endif 517 # ifndef IDENTPROTO 518 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 519 # endif 520 # undef WEXITSTATUS 521 # undef WIFEXITED 522 typedef short pid_t; 523 extern int errno; 524 #endif 525 526 527 /* 528 ** SCO Unix 529 ** 530 ** This includes two parts -- the first is for SCO Open Server 3.2v4 531 ** (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). 532 ** The second is, I believe, for an older version. 533 */ 534 535 #ifdef _SCO_unix_4_2 536 # define _SCO_unix_ 537 # define HASSETREUID 1 /* has setreuid(2) call */ 538 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 539 # define _PATH_UNIX "/unix" 540 # ifndef _PATH_SENDMAILCF 541 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 542 # endif 543 # ifndef _PATH_SENDMAILPID 544 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 545 # endif 546 #endif 547 548 #ifdef _SCO_unix_ 549 # define SYSTEM5 1 /* include all the System V defines */ 550 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 551 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 552 # define FORK fork 553 # define MAXPATHLEN PATHSIZE 554 # define LA_TYPE LA_SHORT 555 # define SFS_TYPE SFS_4ARGS /* use <sys/statfs.h> 4-arg impl */ 556 # define SFS_BAVAIL f_bfree /* alternate field name */ 557 # define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */ 558 # undef NETUNIX /* no unix domain socket support */ 559 #endif 560 561 562 /* 563 ** ISC (SunSoft) Unix. 564 ** 565 ** Contributed by J.J. Bailey <jjb@jagware.bcc.com> 566 */ 567 568 #ifdef ISC_UNIX 569 # include <net/errno.h> 570 # define SYSTEM5 1 /* include all the System V defines */ 571 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 572 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 573 # define HASSETREUID 1 /* has setreuid(2) call */ 574 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 575 # undef NETUNIX /* no unix domain socket support */ 576 # define FORK fork 577 # define MAXPATHLEN 1024 578 # define LA_TYPE LA_SHORT 579 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 580 # define SFS_BAVAIL f_bfree /* alternate field name */ 581 # define _PATH_UNIX "/unix" 582 # ifndef _PATH_SENDMAILCF 583 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 584 # endif 585 # ifndef _PATH_SENDMAILPID 586 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 587 # endif 588 589 typedef short pid_t; 590 591 #endif 592 593 594 /* 595 ** Altos System V. 596 ** Contributed by Tim Rice <timr@crl.com>. 597 */ 598 599 #ifdef ALTOS_SYS_V 600 # include <limits.h> 601 # define SYSTEM5 1 /* include all the System V defines */ 602 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 603 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 604 # define WAITUNION 1 /* use "union wait" as wait argument type */ 605 # define NEEDFSYNC 1 /* no fsync(2) in system library */ 606 # define FORK fork 607 # define MAXPATHLEN PATHSIZE 608 # define LA_TYPE LA_SHORT 609 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 610 # define SFS_BAVAIL f_bfree /* alternate field name */ 611 # define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */ 612 # undef NETUNIX /* no unix domain socket support */ 613 # undef WIFEXITED 614 # undef WEXITSTATUS 615 # define strtoul strtol /* gcc library bogosity */ 616 617 typedef unsigned short uid_t; 618 typedef unsigned short gid_t; 619 typedef short pid_t; 620 #endif 621 622 623 /* 624 ** ConvexOS 11.0 and later 625 ** 626 ** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this 627 ** works on 9.1 as well. 628 */ 629 630 #ifdef _CONVEX_SOURCE 631 # define BSD 1 /* include all the BSD defines */ 632 # define HASUNAME 1 /* use System V uname(2) system call */ 633 # define HASSETSID 1 /* has POSIX setsid(2) call */ 634 # define NEEDGETOPT 1 /* need replacement for getopt(3) */ 635 # define LA_TYPE LA_FLOAT 636 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 637 # ifndef _PATH_SENDMAILCF 638 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 639 # endif 640 # ifndef S_IREAD 641 # define S_IREAD _S_IREAD 642 # define S_IWRITE _S_IWRITE 643 # define S_IEXEC _S_IEXEC 644 # define S_IFMT _S_IFMT 645 # define S_IFCHR _S_IFCHR 646 # define S_IFBLK _S_IFBLK 647 # endif 648 # ifndef IDENTPROTO 649 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 650 # endif 651 #endif 652 653 654 /* 655 ** RISC/os 4.52 656 ** 657 ** Gives a ton of warning messages, but otherwise compiles. 658 */ 659 660 #ifdef RISCOS 661 662 # define HASUNSETENV 1 /* has unsetenv(3) call */ 663 # ifndef HASFLOCK 664 # define HASFLOCK 1 /* has flock(2) call */ 665 # endif 666 # define WAITUNION 1 /* use "union wait" as wait argument type */ 667 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 668 # define LA_TYPE LA_INT 669 # define LA_AVENRUN "avenrun" 670 # define _PATH_UNIX "/unix" 671 # undef WIFEXITED 672 673 # define setpgid setpgrp 674 675 extern int errno; 676 typedef int pid_t; 677 #define SIGFUNC_DEFINED 678 typedef int (*sigfunc_t)(); 679 extern char *getenv(); 680 extern void *malloc(); 681 682 #endif 683 684 685 /* 686 ** Linux 0.99pl10 and above... 687 ** 688 ** Thanks to, in reverse order of contact: 689 ** 690 ** John Kennedy <warlock@csuchico.edu> 691 ** Andrew Pam <avatar@aus.xanadu.com> 692 ** Florian La Roche <rzsfl@rz.uni-sb.de> 693 ** Karl London <karl@borg.demon.co.uk> 694 ** 695 ** Last compiled against: [12/14/94 @ 11:38:41 PM (Wednesday)] 696 ** sendmail 8.7.a.5 named 4.9.3-beta12-p1 db-1.85 697 ** gcc 2.6.2 libc.so.4.6.20 698 ** slackware 2.1.0 linux 1.1.70 699 */ 700 701 #ifdef __linux__ 702 # define BSD 1 /* include BSD defines */ 703 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 704 # define HASUNAME 1 /* use System V uname(2) system call */ 705 # define HASUNSETENV 1 /* has unsetenv(3) call */ 706 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 707 # define GIDSET_T gid_t /* from <linux/types.h> */ 708 # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */ 709 # ifndef LA_TYPE 710 # define LA_TYPE LA_PROCSTR 711 # endif 712 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */ 713 # ifndef _PATH_SENDMAILPID 714 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 715 # endif 716 # define TZ_TYPE TZ_TNAME 717 # include <sys/sysmacros.h> 718 # undef atol /* wounded in <stdlib.h> */ 719 #endif 720 721 722 /* 723 ** DELL SVR4 Issue 2.2, and others 724 ** From Kimmo Suominen <kim@grendel.lut.fi> 725 ** 726 ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 727 ** defined, and the definitions conflict. 728 ** 729 ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 730 ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 731 ** (SVR4.0/386 version 3.0). 732 */ 733 734 #ifdef DELL_SVR4 735 /* no changes necessary */ 736 /* see general __svr4__ defines below */ 737 #endif 738 739 740 /* 741 ** Apple A/UX 3.0 742 */ 743 744 #ifdef _AUX_SOURCE 745 # include <sys/sysmacros.h> 746 # define BSD /* has BSD routines */ 747 # define HASUNAME 1 /* use System V uname(2) system call */ 748 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 749 # define SIGFUNC_DEFINED /* sigfunc_t already defined */ 750 # ifndef IDENTPROTO 751 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 752 # endif 753 # define FORK fork 754 # ifndef _PATH_SENDMAILCF 755 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 756 # endif 757 # ifndef LA_TYPE 758 # define LA_TYPE LA_ZERO 759 # endif 760 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 761 # undef WIFEXITED 762 # undef WEXITSTATUS 763 #endif 764 765 766 /* 767 ** Encore UMAX V 768 ** 769 ** Not extensively tested. 770 */ 771 772 #ifdef UMAXV 773 # include <limits.h> 774 # define HASUNAME 1 /* use System V uname(2) system call */ 775 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 776 # define HASINITGROUPS 1 /* has initgroups(3) call */ 777 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 778 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 779 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 780 # define FORK fork /* no vfork(2) primitive available */ 781 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 782 # define MAXPATHLEN PATH_MAX 783 extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 784 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 785 # undef WIFEXITED 786 # undef WEXITSTATUS 787 #endif 788 789 790 /* 791 ** Stardent Titan 3000 running TitanOS 4.2. 792 ** 793 ** Must be compiled in "cc -43" mode. 794 ** 795 ** From Kate Hedstrom <kate@ahab.rutgers.edu>. 796 ** 797 ** Note the tweaking below after the BSD defines are set. 798 */ 799 800 #ifdef titan 801 # define setpgid setpgrp 802 typedef int pid_t; 803 # undef WIFEXITED 804 # undef WEXITSTATUS 805 #endif 806 807 808 /* 809 ** Sequent DYNIX 3.2.0 810 ** 811 ** From Jim Davis <jdavis@cs.arizona.edu>. 812 */ 813 814 #ifdef sequent 815 816 # define BSD 1 817 # define HASUNSETENV 1 818 # define BSD4_3 1 /* to get signal() in conf.c */ 819 # define WAITUNION 1 820 # define LA_TYPE LA_FLOAT 821 # ifdef _POSIX_VERSION 822 # undef _POSIX_VERSION /* set in <unistd.h> */ 823 # endif 824 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 825 # define setpgid setpgrp 826 827 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 828 # undef WIFEXITED 829 # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 830 ((union wait*)&(s))->w_termsig == 0) 831 # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 832 typedef int pid_t; 833 # define isgraph(c) (isprint(c) && (c != ' ')) 834 835 # ifndef IDENTPROTO 836 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 837 # endif 838 839 # ifndef _PATH_UNIX 840 # define _PATH_UNIX "/dynix" 841 # endif 842 # ifndef _PATH_SENDMAILCF 843 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 844 # endif 845 846 #endif 847 848 849 /* 850 ** Sequent DYNIX/ptx v2.0 (and higher) 851 ** 852 ** For DYNIX/ptx v1.x, undefine HASSETREUID. 853 ** 854 ** From Tim Wright <timw@sequent.com>. 855 */ 856 857 #ifdef _SEQUENT_ 858 # define SYSTEM5 1 /* include all the System V defines */ 859 # define HASSETSID 1 /* has POSIX setsid(2) call */ 860 # define HASINITGROUPS 1 /* has initgroups(3) call */ 861 # define HASSETREUID 1 /* has setreuid(2) call */ 862 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 863 # define GIDSET_T gid_t 864 # define LA_TYPE LA_INT 865 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 866 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 867 # ifndef IDENTPROTO 868 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 869 # endif 870 # ifndef _PATH_SENDMAILCF 871 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 872 # endif 873 # ifndef _PATH_SENDMAILPID 874 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 875 # endif 876 #endif 877 878 879 /* 880 ** Cray Unicos 881 ** 882 ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 883 */ 884 885 #ifdef UNICOS 886 # define SYSTEM5 1 /* include all the System V defines */ 887 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 888 # define MAXPATHLEN PATHSIZE 889 # define LA_TYPE LA_ZERO 890 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 891 # define SFS_BAVAIL f_bfree /* alternate field name */ 892 #endif 893 894 895 /* 896 ** Apollo DomainOS 897 ** 898 ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com> 899 ** 900 ** 15 Jan 1994 901 ** 902 */ 903 904 #ifdef apollo 905 # define HASSETREUID 1 /* has setreuid(2) call */ 906 # define HASINITGROUPS 1 /* has initgroups(2) call */ 907 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 908 # define LA_TYPE LA_SUBR /* use getloadavg.c */ 909 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 910 # define SFS_BAVAIL f_bfree /* alternate field name */ 911 # ifndef _PATH_SENDMAILCF 912 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 913 # endif 914 # ifndef _PATH_SENDMAILPID 915 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 916 # endif 917 # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ 918 # undef S_IFIFO 919 # define S_IFIFO 0010000 920 # ifndef IDENTPROTO 921 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 922 # endif 923 #endif 924 925 926 /* 927 ** UnixWare 1.1.2. 928 ** 929 ** From Evan Champion <evanc@spatial.synapse.org>. 930 */ 931 932 #ifdef UNIXWARE 933 # define SYSTEM5 1 934 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 935 # define HASGETDTABLESIZE 1 936 # define HASSETREUID 1 937 # define HASSETSID 1 938 # define HASINITGROUPS 1 939 # define GIDSET_T gid_t 940 # define SLEEP_T unsigned 941 # define SFS_TYPE SFS_STATVFS 942 # define LA_TYPE LA_ZERO 943 # undef WIFEXITED 944 # undef WEXITSTATUS 945 # define _PATH_UNIX "/unix" 946 # ifndef _PATH_SENDMAILCF 947 # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 948 # endif 949 # ifndef _PATH_SENDMAILPID 950 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 951 # endif 952 # define SYSLOG_BUFSIZE 128 953 #endif 954 955 956 /* 957 ** Intergraph CLIX 3.1 958 ** 959 ** From Paul Southworth <pauls@locust.cic.net> 960 */ 961 962 #ifdef CLIX 963 # define SYSTEM5 1 /* looks like System V */ 964 # ifndef HASGETUSERSHELL 965 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 966 # endif 967 # define DEV_BSIZE 512 /* device block size not defined */ 968 # define GIDSET_T gid_t 969 # undef LOG /* syslog not available */ 970 # define NEEDFSYNC 1 /* no fsync in system library */ 971 # define GETSHORT _getshort 972 #endif 973 974 975 /* 976 ** NCR 3000 Series (SysVr4) 977 ** 978 ** From Kevin Darcy <kevin@tech.mis.cfc.com>. 979 */ 980 981 #ifdef NCR3000 982 # define __svr4__ 983 # undef BSD 984 # define LA_AVENRUN "avenrun" 985 #endif 986 987 988 /* 989 ** Tandem NonStop-UX SVR4 990 ** 991 ** From Rick McCarty <mccarty@mpd.tandem.com>. 992 */ 993 994 #ifdef NonStop_UX_BXX 995 # define __svr4__ 996 #endif 997 998 999 /* 1000 ** Hitachi 3050R & 3050RX Workstations running HI-UX/WE2. 1001 ** 1002 ** Tested for 1.04 and 1.03 1003 ** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>. 1004 */ 1005 1006 #ifdef __H3050R 1007 # define SYSTEM5 1 /* include all the System V defines */ 1008 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1009 # define setreuid(r, e) setresuid(r, e, -1) 1010 # define LA_TYPE LA_FLOAT 1011 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1012 # define HASSETVBUF /* HI-UX has no setlinebuf */ 1013 # ifndef GIDSET_T 1014 # define GIDSET_T gid_t 1015 # endif 1016 # ifndef _PATH_UNIX 1017 # define _PATH_UNIX "/HI-UX" 1018 # endif 1019 # ifndef _PATH_SENDMAILCF 1020 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 1021 # endif 1022 # ifndef IDENTPROTO 1023 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1024 # endif 1025 # ifndef HASGETUSERSHELL 1026 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 1027 # endif 1028 1029 /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */ 1030 # undef m_flags 1031 1032 # ifdef __STDC__ 1033 extern int syslog(int, char *, ...); 1034 # endif 1035 1036 #endif 1037 1038 1039 /* 1040 ** Amdahl UTS System V 2.1.5 (SVr3-based) 1041 ** 1042 ** From: Janet Jackson <janet@dialix.oz.au>. 1043 */ 1044 1045 #ifdef _UTS 1046 # include <sys/sysmacros.h> 1047 # undef HASLSTAT /* has symlinks, but they cause problems */ 1048 # define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */ 1049 # define SYS5SIGNALS 1 /* System V signal semantics */ 1050 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 1051 # define HASUNAME 1 /* use System V uname(2) system call */ 1052 # define HASINITGROUPS 1 /* has initgroups(3) function */ 1053 # define HASSETVBUF 1 /* has setvbuf(3) function */ 1054 # define HASSIGSETMASK 0 /* does not have sigsetmask(2) function */ 1055 # ifndef HASGETUSERSHELL 1056 # define HASGETUSERSHELL 0 /* does not have getusershell(3) function */ 1057 # endif 1058 # define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */ 1059 # define LA_TYPE LA_ZERO /* doesn't have load average */ 1060 # define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */ 1061 # define SFS_BAVAIL f_bfree /* alternate field name */ 1062 # define _PATH_UNIX "/unix" 1063 # ifndef _PATH_SENDMAILCF 1064 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 1065 # endif 1066 #endif 1067 1068 /* 1069 ** Cray Computer Corporation's CSOS 1070 ** 1071 ** Contributed by Scott Bolte <scott@craycos.com>. 1072 */ 1073 1074 #ifdef _CRAYCOM 1075 # define SYSTEM5 1 /* include all the System V defines */ 1076 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1077 # define NEEDFSYNC 1 /* no fsync in system library */ 1078 # define MAXPATHLEN PATHSIZE 1079 # define LA_TYPE LA_ZERO 1080 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1081 # define SFS_BAVAIL f_bfree /* alternate field name */ 1082 # define _POSIX_CHOWN_RESTRICTED -1 1083 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 1084 #endif 1085 1086 1087 /********************************************************************** 1088 ** End of Per-Operating System defines 1089 **********************************************************************/ 1090 1091 /********************************************************************** 1092 ** More general defines 1093 **********************************************************************/ 1094 1095 /* general BSD defines */ 1096 #ifdef BSD 1097 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 1098 # define HASSETREUID 1 /* has setreuid(2) call */ 1099 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1100 # ifndef HASSETRLIMIT 1101 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 1102 # endif 1103 # ifndef HASFLOCK 1104 # define HASFLOCK 1 /* has flock(2) call */ 1105 # endif 1106 # ifndef TZ_TYPE 1107 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */ 1108 # endif 1109 #endif 1110 1111 /* general System V Release 4 defines */ 1112 #ifdef __svr4__ 1113 # define SYSTEM5 1 1114 # define HASSETREUID 1 /* has seteuid(2) call & working saved uids */ 1115 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1116 # ifndef HASSETRLIMIT 1117 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 1118 # endif 1119 # ifndef HASGETUSERSHELL 1120 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1121 # endif 1122 # define setreuid(r, e) seteuid(e) 1123 1124 # ifndef _PATH_UNIX 1125 # define _PATH_UNIX "/unix" 1126 # endif 1127 # ifndef _PATH_SENDMAILCF 1128 # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 1129 # endif 1130 # ifndef _PATH_SENDMAILPID 1131 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 1132 # endif 1133 # ifndef SYSLOG_BUFSIZE 1134 # define SYSLOG_BUFSIZE 128 1135 # endif 1136 # ifndef SFS_TYPE 1137 # define SFS_TYPE SFS_STATVFS 1138 # endif 1139 #endif 1140 1141 /* general System V defines */ 1142 #ifdef SYSTEM5 1143 # include <sys/sysmacros.h> 1144 # define HASUNAME 1 /* use System V uname(2) system call */ 1145 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 1146 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 1147 # ifndef HASULIMIT 1148 # define HASULIMIT 1 /* has the ulimit(2) syscall */ 1149 # endif 1150 # ifndef LA_TYPE 1151 # define LA_TYPE LA_INT /* assume integer load average */ 1152 # endif 1153 # ifndef SFS_TYPE 1154 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 1155 # endif 1156 # ifndef TZ_TYPE 1157 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 1158 # endif 1159 # define bcopy(s, d, l) (memmove((d), (s), (l))) 1160 # define bzero(d, l) (memset((d), '\0', (l))) 1161 # define bcmp(s, d, l) (memcmp((s), (d), (l))) 1162 #endif 1163 1164 /* general POSIX defines */ 1165 #ifdef _POSIX_VERSION 1166 # define HASSETSID 1 /* has Posix setsid(2) call */ 1167 # define HASWAITPID 1 /* has Posix waitpid(2) call */ 1168 #endif 1169 1170 /* 1171 ** If no type for argument two of getgroups call is defined, assume 1172 ** it's an integer -- unfortunately, there seem to be several choices 1173 ** here. 1174 */ 1175 1176 #ifndef GIDSET_T 1177 # define GIDSET_T int 1178 #endif 1179 1180 /* 1181 ** Tweaking for systems that (for example) claim to be BSD or POSIX 1182 ** but don't have all the standard BSD or POSIX routines (boo hiss). 1183 */ 1184 1185 #ifdef titan 1186 # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 1187 #endif 1188 1189 #ifdef _CRAYCOM 1190 # undef HASSETSID /* despite POSIX claim, doesn't have setsid */ 1191 #endif 1192 1193 #ifdef ISC_UNIX 1194 # undef bcopy /* despite SystemV claim, uses BSD bcopy */ 1195 #endif 1196 1197 #ifdef ALTOS_SYS_V 1198 # undef bcopy /* despite SystemV claim, uses BSD bcopy */ 1199 # undef bzero /* despite SystemV claim, uses BSD bzero */ 1200 # undef bcmp /* despite SystemV claim, uses BSD bcmp */ 1201 #endif 1202 1203 1204 /* 1205 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 1206 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 1207 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 1208 ** are closed. Some firewalls return this error if you try to connect 1209 ** to the IDENT port (113), so you can't receive email from these hosts 1210 ** on these systems. The firewall really should use a more specific 1211 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If 1212 ** not explicitly set to zero above, default it on. 1213 */ 1214 1215 #ifndef IDENTPROTO 1216 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 1217 #endif 1218 1219 #ifndef HASGETUSERSHELL 1220 # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 1221 #endif 1222 1223 #ifndef HASFLOCK 1224 # define HASFLOCK 0 /* assume no flock(2) support */ 1225 #endif 1226 1227 #ifndef HASSETRLIMIT 1228 # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */ 1229 #endif 1230 1231 #ifndef HASULIMIT 1232 # define HASULIMIT 0 /* assume no ulimit(2) support */ 1233 #endif 1234 1235 #ifndef OLD_NEWDB 1236 # define OLD_NEWDB 0 /* assume newer version of newdb */ 1237 #endif 1238 1239 /* heuristic setting of HASSETSIGMASK; can override above */ 1240 #ifndef HASSIGSETMASK 1241 # ifdef SIGVTALRM 1242 # define HASSETSIGMASK 1 1243 # else 1244 # define HASSETSIGMASK 0 1245 # endif 1246 #endif 1247 1248 1249 /********************************************************************** 1250 ** Remaining definitions should never have to be changed. They are 1251 ** primarily to provide back compatibility for older systems -- for 1252 ** example, it includes some POSIX compatibility definitions 1253 **********************************************************************/ 1254 1255 /* System 5 compatibility */ 1256 #ifndef S_ISREG 1257 # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 1258 #endif 1259 #if !defined(S_ISLNK) && defined(S_IFLNK) 1260 # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 1261 #endif 1262 #ifndef S_IWUSR 1263 # define S_IWUSR 0200 1264 #endif 1265 #ifndef S_IWGRP 1266 # define S_IWGRP 0020 1267 #endif 1268 #ifndef S_IWOTH 1269 # define S_IWOTH 0002 1270 #endif 1271 1272 /* 1273 ** Older systems don't have this error code -- it should be in 1274 ** /usr/include/sysexits.h. 1275 */ 1276 1277 # ifndef EX_CONFIG 1278 # define EX_CONFIG 78 /* configuration error */ 1279 # endif 1280 1281 /* pseudo-code used in server SMTP */ 1282 # define EX_QUIT 22 /* drop out of server immediately */ 1283 1284 1285 /* 1286 ** These are used in a few cases where we need some special 1287 ** error codes, but where the system doesn't provide something 1288 ** reasonable. They are printed in errstring. 1289 */ 1290 1291 #ifndef E_PSEUDOBASE 1292 # define E_PSEUDOBASE 256 1293 #endif 1294 1295 #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 1296 #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 1297 1298 /* type of arbitrary pointer */ 1299 #ifndef ARBPTR_T 1300 # define ARBPTR_T void * 1301 #endif 1302 1303 #ifndef __P 1304 # include "cdefs.h" 1305 #endif 1306 1307 #if NAMED_BIND 1308 # include <arpa/nameser.h> 1309 # ifdef __svr4__ 1310 # ifdef NOERROR 1311 # undef NOERROR /* avoid compiler conflict with stream.h */ 1312 # endif 1313 # endif 1314 #endif 1315 1316 /* 1317 ** The size of an IP address -- can't use sizeof because of problems 1318 ** on Crays, where everything is 64 bits. This will break if/when 1319 ** IP addresses are expanded to eight bytes. 1320 */ 1321 1322 #ifndef INADDRSZ 1323 # define INADDRSZ 4 1324 #endif 1325 1326 /* 1327 ** The size of various known types -- for reading network protocols. 1328 ** Again, we can't use sizeof because of compiler randomness. 1329 */ 1330 1331 #ifndef INT16SZ 1332 # define INT16SZ 2 1333 #endif 1334 #ifndef INT32SZ 1335 # define INT32SZ 4 1336 #endif 1337 1338 /* 1339 ** Do some required dependencies 1340 */ 1341 1342 #if defined(NETINET) || defined(NETISO) 1343 # define SMTP 1 /* enable user and server SMTP */ 1344 # define QUEUE 1 /* enable queueing */ 1345 # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 1346 #endif 1347 1348 1349 /* 1350 ** Arrange to use either varargs or stdargs 1351 */ 1352 1353 # ifdef __STDC__ 1354 1355 # include <stdarg.h> 1356 1357 # define VA_LOCAL_DECL va_list ap; 1358 # define VA_START(f) va_start(ap, f) 1359 # define VA_END va_end(ap) 1360 1361 # else 1362 1363 # include <varargs.h> 1364 1365 # define VA_LOCAL_DECL va_list ap; 1366 # define VA_START(f) va_start(ap) 1367 # define VA_END va_end(ap) 1368 1369 # endif 1370 1371 #ifdef HASUNAME 1372 # include <sys/utsname.h> 1373 # ifdef newstr 1374 # undef newstr 1375 # endif 1376 #else /* ! HASUNAME */ 1377 # define NODE_LENGTH 32 1378 struct utsname 1379 { 1380 char nodename[NODE_LENGTH+1]; 1381 }; 1382 #endif /* HASUNAME */ 1383 1384 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V) 1385 # define MAXHOSTNAMELEN 256 1386 #endif 1387 1388 #if !defined(SIGCHLD) && defined(SIGCLD) 1389 # define SIGCHLD SIGCLD 1390 #endif 1391 1392 #ifndef STDIN_FILENO 1393 #define STDIN_FILENO 0 1394 #endif 1395 1396 #ifndef STDOUT_FILENO 1397 #define STDOUT_FILENO 1 1398 #endif 1399 1400 #ifndef STDERR_FILENO 1401 #define STDERR_FILENO 2 1402 #endif 1403 1404 #ifndef LOCK_SH 1405 # define LOCK_SH 0x01 /* shared lock */ 1406 # define LOCK_EX 0x02 /* exclusive lock */ 1407 # define LOCK_NB 0x04 /* non-blocking lock */ 1408 # define LOCK_UN 0x08 /* unlock */ 1409 #endif 1410 1411 #ifndef SIG_ERR 1412 # define SIG_ERR ((void (*)()) -1) 1413 #endif 1414 1415 #ifndef WEXITSTATUS 1416 # define WEXITSTATUS(st) (((st) >> 8) & 0377) 1417 #endif 1418 #ifndef WIFEXITED 1419 # define WIFEXITED(st) (((st) & 0377) == 0) 1420 #endif 1421 1422 #ifndef SIGFUNC_DEFINED 1423 typedef void (*sigfunc_t) __P((int)); 1424 #endif 1425 1426 /* size of syslog buffer */ 1427 #ifndef SYSLOG_BUFSIZE 1428 # define SYSLOG_BUFSIZE 1024 1429 #endif 1430 1431 /* 1432 ** Size of tobuf (deliver.c) 1433 ** Tweak this to match your syslog implementation. It will have to 1434 ** allow for the extra information printed. 1435 */ 1436 1437 #ifndef TOBUFSIZE 1438 # if (SYSLOG_BUFSIZE) > 512 1439 # define TOBUFSIZE (SYSLOG_BUFSIZE - 256) 1440 # else 1441 # define TOBUFSIZE 256 1442 # endif 1443 #endif 1444 1445 /* 1446 ** Size of prescan buffer. 1447 ** Despite comments in the _sendmail_ book, this probably should 1448 ** not be changed; there are some hard-to-define dependencies. 1449 */ 1450 1451 # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 1452 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 1453 # ifndef FORK 1454 # define FORK vfork /* function to call to fork mailer */ 1455 # endif 1456 1457 /* 1458 ** If we are going to link scanf anyway, use it in readcf 1459 */ 1460 1461 #if !defined(HASUNAME) && !defined(SCANF) 1462 # define SCANF 1 1463 #endif 1464