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.190 (Berkeley) 06/15/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 HASSETRLIMIT 0 /* ... but not setrlimit(2) */ 827 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 828 # define HASUNAME 1 /* use System V uname(2) system call */ 829 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 830 # define SIGFUNC_DEFINED /* sigfunc_t already defined */ 831 # ifndef IDENTPROTO 832 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 833 # endif 834 # define FORK fork 835 # ifndef _PATH_SENDMAILCF 836 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 837 # endif 838 # ifndef LA_TYPE 839 # define LA_TYPE LA_INT 840 # define FSHIFT 16 841 # endif 842 # define LA_AVENRUN "avenrun" 843 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 844 # define TZ_TYPE TZ_TZNAME 845 # ifndef _PATH_UNIX 846 # define _PATH_UNIX "/unix" /* should be in <paths.h> */ 847 # endif 848 # undef WIFEXITED 849 # undef WEXITSTATUS 850 #endif 851 852 853 /* 854 ** Encore UMAX V 855 ** 856 ** Not extensively tested. 857 */ 858 859 #ifdef UMAXV 860 # include <limits.h> 861 # define HASUNAME 1 /* use System V uname(2) system call */ 862 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 863 # define HASINITGROUPS 1 /* has initgroups(3) call */ 864 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 865 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 866 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 867 # define FORK fork /* no vfork(2) primitive available */ 868 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 869 # define MAXPATHLEN PATH_MAX 870 extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 871 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 872 # undef WIFEXITED 873 # undef WEXITSTATUS 874 #endif 875 876 877 /* 878 ** Stardent Titan 3000 running TitanOS 4.2. 879 ** 880 ** Must be compiled in "cc -43" mode. 881 ** 882 ** From Kate Hedstrom <kate@ahab.rutgers.edu>. 883 ** 884 ** Note the tweaking below after the BSD defines are set. 885 */ 886 887 #ifdef titan 888 # define setpgid setpgrp 889 typedef int pid_t; 890 # undef WIFEXITED 891 # undef WEXITSTATUS 892 #endif 893 894 895 /* 896 ** Sequent DYNIX 3.2.0 897 ** 898 ** From Jim Davis <jdavis@cs.arizona.edu>. 899 */ 900 901 #ifdef sequent 902 903 # define BSD 1 904 # define HASUNSETENV 1 905 # define BSD4_3 1 /* to get signal() in conf.c */ 906 # define WAITUNION 1 907 # define LA_TYPE LA_FLOAT 908 # ifdef _POSIX_VERSION 909 # undef _POSIX_VERSION /* set in <unistd.h> */ 910 # endif 911 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 912 # define setpgid setpgrp 913 914 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 915 # undef WIFEXITED 916 # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 917 ((union wait*)&(s))->w_termsig == 0) 918 # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 919 typedef int pid_t; 920 # define isgraph(c) (isprint(c) && (c != ' ')) 921 922 # ifndef IDENTPROTO 923 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 924 # endif 925 926 # ifndef _PATH_UNIX 927 # define _PATH_UNIX "/dynix" 928 # endif 929 # ifndef _PATH_SENDMAILCF 930 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 931 # endif 932 933 #endif 934 935 936 /* 937 ** Sequent DYNIX/ptx v2.0 (and higher) 938 ** 939 ** For DYNIX/ptx v1.x, undefine HASSETREUID. 940 ** 941 ** From Tim Wright <timw@sequent.com>. 942 */ 943 944 #ifdef _SEQUENT_ 945 # define SYSTEM5 1 /* include all the System V defines */ 946 # define HASSETSID 1 /* has POSIX setsid(2) call */ 947 # define HASINITGROUPS 1 /* has initgroups(3) call */ 948 # define HASSETREUID 1 /* has setreuid(2) call */ 949 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 950 # define GIDSET_T gid_t 951 # define LA_TYPE LA_INT 952 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 953 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 954 # ifndef IDENTPROTO 955 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 956 # endif 957 # ifndef _PATH_SENDMAILCF 958 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 959 # endif 960 # ifndef _PATH_SENDMAILPID 961 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 962 # endif 963 #endif 964 965 966 /* 967 ** Cray Unicos 968 ** 969 ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 970 */ 971 972 #ifdef UNICOS 973 # define SYSTEM5 1 /* include all the System V defines */ 974 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 975 # define MAXPATHLEN PATHSIZE 976 # define LA_TYPE LA_ZERO 977 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 978 # define SFS_BAVAIL f_bfree /* alternate field name */ 979 #endif 980 981 982 /* 983 ** Apollo DomainOS 984 ** 985 ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com> 986 ** 987 ** 15 Jan 1994 988 ** 989 */ 990 991 #ifdef apollo 992 # define HASSETREUID 1 /* has setreuid(2) call */ 993 # define HASINITGROUPS 1 /* has initgroups(2) call */ 994 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 995 # define LA_TYPE LA_SUBR /* use getloadavg.c */ 996 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 997 # define SFS_BAVAIL f_bfree /* alternate field name */ 998 # ifndef _PATH_SENDMAILCF 999 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 1000 # endif 1001 # ifndef _PATH_SENDMAILPID 1002 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 1003 # endif 1004 # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ 1005 # undef S_IFIFO 1006 # define S_IFIFO 0010000 1007 # ifndef IDENTPROTO 1008 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1009 # endif 1010 #endif 1011 1012 1013 /* 1014 ** UnixWare 1.1.2. 1015 ** 1016 ** Updated by Petr Lampa <lampa@fee.vutbr.cz>. 1017 ** From Evan Champion <evanc@spatial.synapse.org>. 1018 */ 1019 1020 #ifdef UNIXWARE 1021 # include <sys/mkdev.h> 1022 # define SYSTEM5 1 1023 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1024 # define HASSETREUID 1 1025 # define HASSETSID 1 1026 # define HASINITGROUPS 1 1027 # define GIDSET_T gid_t 1028 # define SLEEP_T unsigned 1029 # define SFS_TYPE SFS_STATVFS 1030 # define LA_TYPE LA_ZERO 1031 # undef WIFEXITED 1032 # undef WEXITSTATUS 1033 # define _PATH_UNIX "/unix" 1034 # ifndef _PATH_SENDMAILCF 1035 # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 1036 # endif 1037 # ifndef _PATH_SENDMAILPID 1038 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 1039 # endif 1040 # define SYSLOG_BUFSIZE 128 1041 #endif 1042 1043 1044 /* 1045 ** Intergraph CLIX 3.1 1046 ** 1047 ** From Paul Southworth <pauls@locust.cic.net> 1048 */ 1049 1050 #ifdef CLIX 1051 # define SYSTEM5 1 /* looks like System V */ 1052 # ifndef HASGETUSERSHELL 1053 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1054 # endif 1055 # define DEV_BSIZE 512 /* device block size not defined */ 1056 # define GIDSET_T gid_t 1057 # undef LOG /* syslog not available */ 1058 # define NEEDFSYNC 1 /* no fsync in system library */ 1059 # define GETSHORT _getshort 1060 #endif 1061 1062 1063 /* 1064 ** NCR 3000 Series (SysVr4) 1065 ** 1066 ** From Kevin Darcy <kevin@tech.mis.cfc.com>. 1067 */ 1068 1069 #ifdef NCR3000 1070 # include <sys/sockio.h> 1071 # define __svr4__ 1072 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 1073 # undef BSD 1074 # define LA_AVENRUN "avenrun" 1075 #endif 1076 1077 1078 /* 1079 ** Tandem NonStop-UX SVR4 1080 ** 1081 ** From Rick McCarty <mccarty@mpd.tandem.com>. 1082 */ 1083 1084 #ifdef NonStop_UX_BXX 1085 # define __svr4__ 1086 #endif 1087 1088 1089 /* 1090 ** Hitachi 3050R & 3050RX Workstations running HI-UX/WE2. 1091 ** 1092 ** Tested for 1.04 and 1.03 1093 ** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>. 1094 */ 1095 1096 #ifdef __H3050R 1097 # define SYSTEM5 1 /* include all the System V defines */ 1098 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1099 # define setreuid(r, e) setresuid(r, e, -1) 1100 # define LA_TYPE LA_FLOAT 1101 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1102 # define HASSETVBUF /* HI-UX has no setlinebuf */ 1103 # ifndef GIDSET_T 1104 # define GIDSET_T gid_t 1105 # endif 1106 # ifndef _PATH_UNIX 1107 # define _PATH_UNIX "/HI-UX" 1108 # endif 1109 # ifndef _PATH_SENDMAILCF 1110 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 1111 # endif 1112 # ifndef IDENTPROTO 1113 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1114 # endif 1115 # ifndef HASGETUSERSHELL 1116 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 1117 # endif 1118 1119 /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */ 1120 # undef m_flags 1121 1122 # ifdef __STDC__ 1123 extern int syslog(int, char *, ...); 1124 # endif 1125 1126 #endif 1127 1128 1129 /* 1130 ** Amdahl UTS System V 2.1.5 (SVr3-based) 1131 ** 1132 ** From: Janet Jackson <janet@dialix.oz.au>. 1133 */ 1134 1135 #ifdef _UTS 1136 # include <sys/sysmacros.h> 1137 # undef HASLSTAT /* has symlinks, but they cause problems */ 1138 # define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */ 1139 # define SYS5SIGNALS 1 /* System V signal semantics */ 1140 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 1141 # define HASUNAME 1 /* use System V uname(2) system call */ 1142 # define HASINITGROUPS 1 /* has initgroups(3) function */ 1143 # define HASSETVBUF 1 /* has setvbuf(3) function */ 1144 # define HASSIGSETMASK 0 /* does not have sigsetmask(2) function */ 1145 # ifndef HASGETUSERSHELL 1146 # define HASGETUSERSHELL 0 /* does not have getusershell(3) function */ 1147 # endif 1148 # define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */ 1149 # define LA_TYPE LA_ZERO /* doesn't have load average */ 1150 # define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */ 1151 # define SFS_BAVAIL f_bfree /* alternate field name */ 1152 # define _PATH_UNIX "/unix" 1153 # ifndef _PATH_SENDMAILCF 1154 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 1155 # endif 1156 #endif 1157 1158 /* 1159 ** Cray Computer Corporation's CSOS 1160 ** 1161 ** From Scott Bolte <scott@craycos.com>. 1162 */ 1163 1164 #ifdef _CRAYCOM 1165 # define SYSTEM5 1 /* include all the System V defines */ 1166 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1167 # define NEEDFSYNC 1 /* no fsync in system library */ 1168 # define MAXPATHLEN PATHSIZE 1169 # define LA_TYPE LA_ZERO 1170 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1171 # define SFS_BAVAIL f_bfree /* alternate field name */ 1172 # define _POSIX_CHOWN_RESTRICTED -1 1173 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 1174 #endif 1175 1176 1177 /* 1178 ** Sony NEWS-OS 4.2.1R and 6.0.3 1179 ** 1180 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 1181 */ 1182 1183 #ifdef sony_news 1184 # ifndef __svr4 1185 /* NEWS-OS 4.2.1R */ 1186 # ifndef BSD 1187 # define BSD /* has BSD routines */ 1188 # endif 1189 # define HASUNSETENV 1 /* has unsetenv(2) call */ 1190 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 1191 # define WAITUNION 1 /* use "union wait" as wait argument type */ 1192 # define LA_TYPE LA_INT 1193 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1194 # ifndef HASFLOCK 1195 # define HASFLOCK 1 /* has flock(2) call */ 1196 # endif 1197 # define setpgid setpgrp 1198 # undef WIFEXITED 1199 # undef WEXITSTATUS 1200 typedef int pid_t; 1201 typedef int (*sigfunc_t)(); 1202 # define SIGFUNC_DEFINED 1203 1204 # else 1205 /* NEWS-OS 6.0.3 with /bin/cc */ 1206 # ifndef __svr4__ 1207 # define __svr4__ /* use all System V Releae 4 defines below */ 1208 # endif 1209 # define HASSETSID 1 /* has Posix setsid(2) call */ 1210 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 1211 # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ 1212 # ifndef SPT_TYPE 1213 # define SPT_TYPE SPT_SYSMIPS /* use sysmips() (OS 6.0.2 or later) */ 1214 # endif 1215 # define GIDSET_T gid_t 1216 # undef WIFEXITED 1217 # undef WEXITSTATUS 1218 # ifndef SYSLOG_BUFSIZE 1219 # define SYSLOG_BUFSIZE 1024 1220 # endif 1221 # define _PATH_UNIX "/stand/unix" 1222 # ifndef _PATH_SENDMAILCF 1223 # define _PATH_SENDMAILCF "/etc/mail/sendmail.cf" 1224 # endif 1225 # ifndef _PATH_SENDMAILPID 1226 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 1227 # endif 1228 1229 # endif 1230 #endif 1231 1232 1233 /* 1234 ** Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach 1235 ** 1236 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 1237 */ 1238 1239 #ifdef luna 1240 # ifndef IDENTPROTO 1241 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1242 # endif 1243 # ifdef uniosb 1244 # include <sys/time.h> 1245 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 1246 # endif 1247 # define HASUNSETENV 1 /* has unsetenv(2) call */ 1248 # define NEEDPUTENV 1 /* need putenv(3) call */ 1249 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 1250 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 1251 # define WAITUNION 1 /* use "union wait" as wait argument type */ 1252 # ifdef uniosb 1253 # define LA_TYPE LA_INT 1254 # endif 1255 # ifdef luna2m 1256 # define LA_TYPE LA_SUBR 1257 # endif 1258 # ifdef luna88k 1259 # define LA_TYPE LA_INT 1260 # endif 1261 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1262 # define setpgid setpgrp 1263 # undef WIFEXITED 1264 # undef WEXITSTATUS 1265 typedef int pid_t; 1266 typedef int (*sigfunc_t)(); 1267 # define SIGFUNC_DEFINED 1268 extern char *getenv(); 1269 extern int errno; 1270 # ifndef _PATH_SENDMAILCF 1271 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 1272 # endif 1273 #endif 1274 1275 1276 /* 1277 ** NEC EWS-UX/V 4.2 (with /usr/ucb/cc) 1278 ** 1279 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 1280 */ 1281 1282 #ifdef nec_ews_svr4 1283 # ifndef __svr4__ 1284 # define __svr4__ /* use all System V Releae 4 defines below */ 1285 # endif 1286 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1287 # define HASSETSID 1 /* has Posix setsid(2) call */ 1288 # define LA_TYPE LA_READKSYM /* use MIOC_READSYM ioctl */ 1289 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 1290 # define GIDSET_T gid_t 1291 # undef WIFEXITED 1292 # undef WEXITSTATUS 1293 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ 1294 #endif 1295 1296 1297 1298 /********************************************************************** 1299 ** End of Per-Operating System defines 1300 **********************************************************************/ 1301 /********************************************************************** 1302 ** More general defines 1303 **********************************************************************/ 1304 1305 /* general BSD defines */ 1306 #ifdef BSD 1307 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 1308 # define HASSETREUID 1 /* has setreuid(2) call */ 1309 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1310 # ifndef IP_SRCROUTE 1311 # define IP_SRCROUTE 1 /* can check IP source routing */ 1312 # endif 1313 # ifndef HASSETRLIMIT 1314 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 1315 # endif 1316 # ifndef HASFLOCK 1317 # define HASFLOCK 1 /* has flock(2) call */ 1318 # endif 1319 # ifndef TZ_TYPE 1320 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */ 1321 # endif 1322 #endif 1323 1324 /* general System V Release 4 defines */ 1325 #ifdef __svr4__ 1326 # define SYSTEM5 1 1327 # define USESETEUID 1 /* has useable seteuid(2) call */ 1328 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1329 # define BSD_COMP 1 /* get BSD ioctl calls */ 1330 # ifndef HASSETRLIMIT 1331 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 1332 # endif 1333 # ifndef HASGETUSERSHELL 1334 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1335 # endif 1336 1337 # ifndef _PATH_UNIX 1338 # define _PATH_UNIX "/unix" 1339 # endif 1340 # ifndef _PATH_SENDMAILCF 1341 # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 1342 # endif 1343 # ifndef _PATH_SENDMAILPID 1344 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 1345 # endif 1346 # ifndef SYSLOG_BUFSIZE 1347 # define SYSLOG_BUFSIZE 128 1348 # endif 1349 # ifndef SFS_TYPE 1350 # define SFS_TYPE SFS_STATVFS 1351 # endif 1352 #endif 1353 1354 /* general System V defines */ 1355 #ifdef SYSTEM5 1356 # include <sys/sysmacros.h> 1357 # define HASUNAME 1 /* use System V uname(2) system call */ 1358 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 1359 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 1360 # ifndef HASULIMIT 1361 # define HASULIMIT 1 /* has the ulimit(2) syscall */ 1362 # endif 1363 # ifndef LA_TYPE 1364 # ifdef MIOC_READKSYM 1365 # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ 1366 # else 1367 # define LA_TYPE LA_INT /* assume integer load average */ 1368 # endif 1369 # endif 1370 # ifndef SFS_TYPE 1371 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 1372 # endif 1373 # ifndef TZ_TYPE 1374 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 1375 # endif 1376 # define bcopy(s, d, l) (memmove((d), (s), (l))) 1377 # define bzero(d, l) (memset((d), '\0', (l))) 1378 # define bcmp(s, d, l) (memcmp((s), (d), (l))) 1379 #endif 1380 1381 /* general POSIX defines */ 1382 #ifdef _POSIX_VERSION 1383 # define HASSETSID 1 /* has Posix setsid(2) call */ 1384 # define HASWAITPID 1 /* has Posix waitpid(2) call */ 1385 # if _POSIX_VERSION >= 199500 && !defined(USESETEUID) 1386 # define USESETEUID 1 /* has useable seteuid(2) call */ 1387 # endif 1388 #endif 1389 /* 1390 ** Tweaking for systems that (for example) claim to be BSD or POSIX 1391 ** but don't have all the standard BSD or POSIX routines (boo hiss). 1392 */ 1393 1394 #ifdef titan 1395 # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 1396 #endif 1397 1398 #ifdef _CRAYCOM 1399 # undef HASSETSID /* despite POSIX claim, doesn't have setsid */ 1400 #endif 1401 1402 #ifdef ISC_UNIX 1403 # undef bcopy /* despite SystemV claim, uses BSD bcopy */ 1404 #endif 1405 1406 #ifdef ALTOS_SYS_V 1407 # undef bcopy /* despite SystemV claim, uses BSD bcopy */ 1408 # undef bzero /* despite SystemV claim, uses BSD bzero */ 1409 # undef bcmp /* despite SystemV claim, uses BSD bcmp */ 1410 #endif 1411 1412 1413 /* 1414 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 1415 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 1416 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 1417 ** are closed. Some firewalls return this error if you try to connect 1418 ** to the IDENT port (113), so you can't receive email from these hosts 1419 ** on these systems. The firewall really should use a more specific 1420 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If 1421 ** not explicitly set to zero above, default it on. 1422 */ 1423 1424 #ifndef IDENTPROTO 1425 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 1426 #endif 1427 1428 #ifndef IP_SRCROUTE 1429 # define IP_SRCROUTE 1 /* Detect IP source routing */ 1430 #endif 1431 1432 #ifndef HASGETUSERSHELL 1433 # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 1434 #endif 1435 1436 #ifndef NETUNIX 1437 # define NETUNIX 1 /* include unix domain support */ 1438 #endif 1439 1440 #ifndef HASFLOCK 1441 # define HASFLOCK 0 /* assume no flock(2) support */ 1442 #endif 1443 1444 #ifndef HASSETREUID 1445 # define HASSETREUID 0 /* assume no setreuid(2) call */ 1446 #endif 1447 1448 #ifndef USESETEUID 1449 # define USESETEUID 0 /* assume no seteuid(2) call or no saved ids */ 1450 #endif 1451 1452 #ifndef HASSETRLIMIT 1453 # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */ 1454 #endif 1455 1456 #ifndef HASULIMIT 1457 # define HASULIMIT 0 /* assume no ulimit(2) support */ 1458 #endif 1459 1460 #ifndef OLD_NEWDB 1461 # define OLD_NEWDB 0 /* assume newer version of newdb */ 1462 #endif 1463 1464 /* heuristic setting of HASSETSIGMASK; can override above */ 1465 #ifndef HASSIGSETMASK 1466 # ifdef SIGVTALRM 1467 # define HASSETSIGMASK 1 1468 # else 1469 # define HASSETSIGMASK 0 1470 # endif 1471 #endif 1472 1473 /* 1474 ** If no type for argument two of getgroups call is defined, assume 1475 ** it's an integer -- unfortunately, there seem to be several choices 1476 ** here. 1477 */ 1478 1479 #ifndef GIDSET_T 1480 # define GIDSET_T int 1481 #endif 1482 1483 #ifndef UID_T 1484 # define UID_T uid_t 1485 #endif 1486 1487 #ifndef SIZE_T 1488 # define SIZE_T size_t 1489 #endif 1490 1491 #ifndef ARGV_T 1492 # define ARGV_T char ** 1493 #endif 1494 /********************************************************************** 1495 ** Remaining definitions should never have to be changed. They are 1496 ** primarily to provide back compatibility for older systems -- for 1497 ** example, it includes some POSIX compatibility definitions 1498 **********************************************************************/ 1499 1500 /* System 5 compatibility */ 1501 #ifndef S_ISREG 1502 # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 1503 #endif 1504 #if !defined(S_ISLNK) && defined(S_IFLNK) 1505 # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 1506 #endif 1507 #ifndef S_IWUSR 1508 # define S_IWUSR 0200 1509 #endif 1510 #ifndef S_IWGRP 1511 # define S_IWGRP 0020 1512 #endif 1513 #ifndef S_IWOTH 1514 # define S_IWOTH 0002 1515 #endif 1516 1517 /* 1518 ** Older systems don't have this error code -- it should be in 1519 ** /usr/include/sysexits.h. 1520 */ 1521 1522 # ifndef EX_CONFIG 1523 # define EX_CONFIG 78 /* configuration error */ 1524 # endif 1525 1526 /* pseudo-code used in server SMTP */ 1527 # define EX_QUIT 22 /* drop out of server immediately */ 1528 1529 1530 /* 1531 ** These are used in a few cases where we need some special 1532 ** error codes, but where the system doesn't provide something 1533 ** reasonable. They are printed in errstring. 1534 */ 1535 1536 #ifndef E_PSEUDOBASE 1537 # define E_PSEUDOBASE 256 1538 #endif 1539 1540 #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 1541 #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 1542 1543 /* type of arbitrary pointer */ 1544 #ifndef ARBPTR_T 1545 # define ARBPTR_T void * 1546 #endif 1547 1548 #ifndef __P 1549 # include "cdefs.h" 1550 #endif 1551 1552 #if NAMED_BIND 1553 # include <arpa/nameser.h> 1554 # ifdef __svr4__ 1555 # ifdef NOERROR 1556 # undef NOERROR /* avoid compiler conflict with stream.h */ 1557 # endif 1558 # endif 1559 #endif 1560 1561 /* 1562 ** The size of an IP address -- can't use sizeof because of problems 1563 ** on Crays, where everything is 64 bits. This will break if/when 1564 ** IP addresses are expanded to eight bytes. 1565 */ 1566 1567 #ifndef INADDRSZ 1568 # define INADDRSZ 4 1569 #endif 1570 1571 /* 1572 ** The size of various known types -- for reading network protocols. 1573 ** Again, we can't use sizeof because of compiler randomness. 1574 */ 1575 1576 #ifndef INT16SZ 1577 # define INT16SZ 2 1578 #endif 1579 #ifndef INT32SZ 1580 # define INT32SZ 4 1581 #endif 1582 1583 /* 1584 ** Do some required dependencies 1585 */ 1586 1587 #if defined(NETINET) || defined(NETISO) 1588 # define SMTP 1 /* enable user and server SMTP */ 1589 # define QUEUE 1 /* enable queueing */ 1590 # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 1591 #endif 1592 1593 1594 /* 1595 ** Arrange to use either varargs or stdargs 1596 */ 1597 1598 # ifdef __STDC__ 1599 1600 # include <stdarg.h> 1601 1602 # define VA_LOCAL_DECL va_list ap; 1603 # define VA_START(f) va_start(ap, f) 1604 # define VA_END va_end(ap) 1605 1606 # else 1607 1608 # include <varargs.h> 1609 1610 # define VA_LOCAL_DECL va_list ap; 1611 # define VA_START(f) va_start(ap) 1612 # define VA_END va_end(ap) 1613 1614 # endif 1615 1616 #ifdef HASUNAME 1617 # include <sys/utsname.h> 1618 # ifdef newstr 1619 # undef newstr 1620 # endif 1621 #else /* ! HASUNAME */ 1622 # define NODE_LENGTH 32 1623 struct utsname 1624 { 1625 char nodename[NODE_LENGTH+1]; 1626 }; 1627 #endif /* HASUNAME */ 1628 1629 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V) 1630 # define MAXHOSTNAMELEN 256 1631 #endif 1632 1633 #if !defined(SIGCHLD) && defined(SIGCLD) 1634 # define SIGCHLD SIGCLD 1635 #endif 1636 1637 #ifndef STDIN_FILENO 1638 # define STDIN_FILENO 0 1639 #endif 1640 1641 #ifndef STDOUT_FILENO 1642 # define STDOUT_FILENO 1 1643 #endif 1644 1645 #ifndef STDERR_FILENO 1646 # define STDERR_FILENO 2 1647 #endif 1648 1649 #ifndef LOCK_SH 1650 # define LOCK_SH 0x01 /* shared lock */ 1651 # define LOCK_EX 0x02 /* exclusive lock */ 1652 # define LOCK_NB 0x04 /* non-blocking lock */ 1653 # define LOCK_UN 0x08 /* unlock */ 1654 #endif 1655 1656 #ifndef SEEK_SET 1657 # define SEEK_SET 0 1658 # define SEEK_CUR 1 1659 # define SEEK_END 2 1660 #endif 1661 1662 #ifndef SIG_ERR 1663 # define SIG_ERR ((void (*)()) -1) 1664 #endif 1665 1666 #ifndef WEXITSTATUS 1667 # define WEXITSTATUS(st) (((st) >> 8) & 0377) 1668 #endif 1669 #ifndef WIFEXITED 1670 # define WIFEXITED(st) (((st) & 0377) == 0) 1671 #endif 1672 1673 #ifndef SIGFUNC_DEFINED 1674 typedef void (*sigfunc_t) __P((int)); 1675 #endif 1676 1677 /* size of syslog buffer */ 1678 #ifndef SYSLOG_BUFSIZE 1679 # define SYSLOG_BUFSIZE 1024 1680 #endif 1681 1682 /* 1683 ** Size of tobuf (deliver.c) 1684 ** Tweak this to match your syslog implementation. It will have to 1685 ** allow for the extra information printed. 1686 */ 1687 1688 #ifndef TOBUFSIZE 1689 # if (SYSLOG_BUFSIZE) > 512 1690 # define TOBUFSIZE (SYSLOG_BUFSIZE - 256) 1691 # else 1692 # define TOBUFSIZE 256 1693 # endif 1694 #endif 1695 1696 /* 1697 ** Size of prescan buffer. 1698 ** Despite comments in the _sendmail_ book, this probably should 1699 ** not be changed; there are some hard-to-define dependencies. 1700 */ 1701 1702 # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 1703 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 1704 # ifndef FORK 1705 # define FORK vfork /* function to call to fork mailer */ 1706 # endif 1707 1708 /* 1709 ** If we are going to link scanf anyway, use it in readcf 1710 */ 1711 1712 #if !defined(HASUNAME) && !defined(SCANF) 1713 # define SCANF 1 1714 #endif 1715