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