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