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