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