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