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