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