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