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