1 /* 2 * Copyright (c) 1983 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.143 (Berkeley) 03/31/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 # ifdef NEWDB 65 # define USERDB 1 /* look in user database (requires NEWDB) */ 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 SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 186 # define SFS_BAVAIL f_bfree /* alternate field name */ 187 # define LA_TYPE LA_INT 188 # ifdef IRIX64 189 # define NAMELISTMASK 0x7fffffffffffffff /* mask for nlist() values */ 190 # else 191 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ 192 # endif 193 #endif 194 195 196 /* 197 ** SunOS and Solaris 198 ** 199 ** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and 200 ** Solaris 2.2 (a.k.a. SunOS 5.2). 201 */ 202 203 #if defined(sun) && !defined(BSD) 204 205 # define HASINITGROUPS 1 /* has initgroups(3) call */ 206 # define HASUNAME 1 /* use System V uname(2) system call */ 207 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 208 # define LA_TYPE LA_INT 209 210 # ifdef SOLARIS_2_3 211 # define SOLARIS /* for back compat only -- use -DSOLARIS=203 */ 212 # endif 213 214 # ifdef SOLARIS 215 /* Solaris 2.x (a.k.a. SunOS 5.x) */ 216 # ifndef __svr4__ 217 # define __svr4__ /* use all System V Releae 4 defines below */ 218 # endif 219 # include <sys/time.h> 220 # define GIDSET_T gid_t 221 # ifndef _PATH_UNIX 222 # define _PATH_UNIX "/dev/ksyms" 223 # endif 224 # ifndef _PATH_SENDMAILCF 225 # define _PATH_SENDMAILCF "/etc/mail/sendmail.cf" 226 # endif 227 # ifndef _PATH_SENDMAILPID 228 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 229 # endif 230 # ifndef SYSLOG_BUFSIZE 231 # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 232 # endif 233 # if SOLARIS < 204 234 # define gethostbyname solaris_gethostbyname /* get good version */ 235 # define gethostbyaddr solaris_gethostbyaddr /* get good version */ 236 # endif 237 238 # else 239 /* SunOS 4.0.3 or 4.1.x */ 240 # define HASSETREUID 1 /* has setreuid(2) call */ 241 # ifndef HASFLOCK 242 # define HASFLOCK 1 /* has flock(2) call */ 243 # endif 244 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 245 # include <vfork.h> 246 247 # ifdef SUNOS403 248 /* special tweaking for SunOS 4.0.3 */ 249 # include <malloc.h> 250 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 251 # define WAITUNION 1 /* use "union wait" as wait argument type */ 252 # undef WIFEXITED 253 # undef WEXITSTATUS 254 # undef HASUNAME 255 # define setpgid setpgrp 256 typedef int pid_t; 257 extern char *getenv(); 258 259 # else 260 /* 4.1.x specifics */ 261 # define HASSETSID 1 /* has Posix setsid(2) call */ 262 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 263 264 # endif 265 # endif 266 #endif 267 268 /* 269 ** DG/UX 270 ** 271 ** Tested on 5.4.2 and 5.4.3. Use DGUX_5_4_2 to get the 272 ** older support. 273 ** 5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>. 274 */ 275 276 #ifdef DGUX_5_4_2 277 # define DGUX 1 278 #endif 279 280 #ifdef DGUX 281 # define SYSTEM5 1 282 # define LA_TYPE LA_SUBR 283 # define HASSETREUID 1 /* has setreuid(2) call */ 284 # define HASUNAME 1 /* use System V uname(2) system call */ 285 # define HASSETSID 1 /* has Posix setsid(2) call */ 286 # define HASINITGROUPS 1 /* has initgroups(3) call */ 287 # define HASGETUSERSHELL 0 /* does not have getusershell(3) */ 288 # ifndef IDENTPROTO 289 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 290 # endif 291 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 292 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 293 294 /* these include files must be included early on DG/UX */ 295 # include <netinet/in.h> 296 # include <arpa/inet.h> 297 298 # ifdef DGUX_5_4_2 299 # define inet_addr dgux_inet_addr 300 extern long dgux_inet_addr(); 301 # endif 302 #endif 303 304 305 /* 306 ** Digital Ultrix 4.2A or 4.3 307 ** 308 ** Apparently, fcntl locking is broken on 4.2A, in that locks are 309 ** not dropped when the process exits. This causes major problems, 310 ** so flock is the only alternative. 311 */ 312 313 #ifdef ultrix 314 # define HASSETREUID 1 /* has setreuid(2) call */ 315 # define HASUNSETENV 1 /* has unsetenv(3) call */ 316 # define HASINITGROUPS 1 /* has initgroups(3) call */ 317 # define HASUNAME 1 /* use System V uname(2) system call */ 318 # ifndef HASFLOCK 319 # define HASFLOCK 1 /* has flock(2) call */ 320 # endif 321 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 322 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 323 # ifdef vax 324 # define LA_TYPE LA_FLOAT 325 # else 326 # define LA_TYPE LA_INT 327 # define LA_AVENRUN "avenrun" 328 # endif 329 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 330 # ifndef IDENTPROTO 331 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 332 # endif 333 #endif 334 335 336 /* 337 ** OSF/1 for Intel Paragon. 338 ** 339 ** Contributed by Jeff A. Earickson <jeff@ssd.intel.com> 340 ** of Intel Scalable Systems Divison. 341 */ 342 343 #ifdef __PARAGON__ 344 # define __osf__ 1 /* get OSF/1 defines below */ 345 # ifndef _PATH_SENDMAILCF 346 # define _PATH_SENDMAILCF "/var/adm/sendmail/sendmail.cf" 347 # endif 348 #endif 349 350 351 /* 352 ** OSF/1 (tested on Alpha) 353 */ 354 355 #ifdef __osf__ 356 # define HASUNSETENV 1 /* has unsetenv(3) call */ 357 # define HASSETREUID 1 /* has setreuid(2) call */ 358 # define HASINITGROUPS 1 /* has initgroups(3) call */ 359 # ifndef HASFLOCK 360 # define HASFLOCK 1 /* has flock(2) call */ 361 # endif 362 # define LA_TYPE LA_INT 363 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 364 # ifndef _PATH_SENDMAILPID 365 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 366 # endif 367 #endif 368 369 370 /* 371 ** NeXTstep 372 */ 373 374 #ifdef NeXT 375 # define HASINITGROUPS 1 /* has initgroups(3) call */ 376 # ifndef HASFLOCK 377 # define HASFLOCK 1 /* has flock(2) call */ 378 # endif 379 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 380 # define WAITUNION 1 /* use "union wait" as wait argument type */ 381 # define sleep sleepX 382 # define setpgid setpgrp 383 # ifndef LA_TYPE 384 # define LA_TYPE LA_MACH 385 # endif 386 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 387 # ifndef _POSIX_SOURCE 388 typedef int pid_t; 389 # undef WEXITSTATUS 390 # undef WIFEXITED 391 # endif 392 # ifndef _PATH_SENDMAILCF 393 # define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf" 394 # endif 395 # ifndef _PATH_SENDMAILPID 396 # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" 397 # endif 398 #endif 399 400 401 /* 402 ** 4.4 BSD 403 ** 404 ** See also BSD defines. 405 */ 406 407 #ifdef BSD4_4 408 # define HASUNSETENV 1 /* has unsetenv(3) call */ 409 # include <sys/cdefs.h> 410 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 411 # ifndef LA_TYPE 412 # define LA_TYPE LA_SUBR 413 # endif 414 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 415 # define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */ 416 #endif 417 418 419 /* 420 ** BSD/386 (all versions) 421 ** From Tony Sanders, BSDI 422 */ 423 424 #ifdef __bsdi__ 425 # define HASUNSETENV 1 /* has the unsetenv(3) call */ 426 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 427 # include <sys/cdefs.h> 428 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 429 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 430 # ifndef LA_TYPE 431 # define LA_TYPE LA_SUBR 432 # endif 433 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 434 /* version 1.1 or later */ 435 # undef SPT_TYPE 436 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 437 # else 438 /* version 1.0 or earlier */ 439 # ifndef OLD_NEWDB 440 # define OLD_NEWDB 1 /* old version of newdb library */ 441 # endif 442 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 443 # endif 444 #endif 445 446 447 448 /* 449 ** 386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions) 450 ** 451 ** 4.3BSD clone, closer to 4.4BSD 452 ** 453 ** See also BSD defines. 454 */ 455 456 #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__) 457 # define HASUNSETENV 1 /* has unsetenv(3) call */ 458 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 459 # ifdef __NetBSD__ 460 # define HASUNAME 1 /* has uname(2) syscall */ 461 # endif 462 # include <sys/cdefs.h> 463 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 464 # ifndef LA_TYPE 465 # define LA_TYPE LA_SUBR 466 # endif 467 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 468 #endif 469 470 471 /* 472 ** Mach386 473 ** 474 ** For mt Xinu's Mach386 system. 475 */ 476 477 #if defined(MACH) && defined(i386) 478 # define MACH386 1 479 # define HASUNSETENV 1 /* has unsetenv(3) call */ 480 # define HASINITGROUPS 1 /* has initgroups(3) call */ 481 # ifndef HASFLOCK 482 # define HASFLOCK 1 /* has flock(2) call */ 483 # endif 484 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 485 # define NEEDSTRTOL 1 /* need the strtol() function */ 486 # define setpgid setpgrp 487 # ifndef LA_TYPE 488 # define LA_TYPE LA_FLOAT 489 # endif 490 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 491 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 492 # undef WEXITSTATUS 493 # undef WIFEXITED 494 # ifndef _PATH_SENDMAILCF 495 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 496 # endif 497 # ifndef _PATH_SENDMAILPID 498 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 499 # endif 500 #endif 501 502 503 /* 504 ** 4.3 BSD -- this is for very old systems 505 ** 506 ** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1. 507 ** 508 ** You'll also have to install a new resolver library. 509 ** I don't guarantee that support for this environment is complete. 510 */ 511 512 #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) 513 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 514 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 515 # define ARBPTR_T char * 516 # define setpgid setpgrp 517 # ifndef LA_TYPE 518 # define LA_TYPE LA_FLOAT 519 # endif 520 # ifndef _PATH_SENDMAILCF 521 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 522 # endif 523 # ifndef IDENTPROTO 524 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 525 # endif 526 # undef WEXITSTATUS 527 # undef WIFEXITED 528 typedef short pid_t; 529 extern int errno; 530 #endif 531 532 533 /* 534 ** SCO Unix 535 ** 536 ** This includes two parts -- the first is for SCO Open Server 3.2v4 537 ** (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). 538 ** The second is, I believe, for an older version. 539 */ 540 541 #ifdef _SCO_unix_4_2 542 # define _SCO_unix_ 543 # define HASSETREUID 1 /* has setreuid(2) call */ 544 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 545 # define _PATH_UNIX "/unix" 546 # ifndef _PATH_SENDMAILCF 547 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 548 # endif 549 # ifndef _PATH_SENDMAILPID 550 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 551 # endif 552 #endif 553 554 #ifdef _SCO_unix_ 555 # define SYSTEM5 1 /* include all the System V defines */ 556 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 557 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 558 # define FORK fork 559 # define MAXPATHLEN PATHSIZE 560 # define LA_TYPE LA_SHORT 561 # define SFS_TYPE SFS_4ARGS /* use <sys/statfs.h> 4-arg impl */ 562 # define SFS_BAVAIL f_bfree /* alternate field name */ 563 # define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */ 564 # undef NETUNIX /* no unix domain socket support */ 565 #endif 566 567 568 /* 569 ** ISC (SunSoft) Unix. 570 ** 571 ** Contributed by J.J. Bailey <jjb@jagware.bcc.com> 572 */ 573 574 #ifdef ISC_UNIX 575 # include <net/errno.h> 576 # define SYSTEM5 1 /* include all the System V defines */ 577 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 578 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 579 # define HASSETREUID 1 /* has setreuid(2) call */ 580 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 581 # undef NETUNIX /* no unix domain socket support */ 582 # define FORK fork 583 # define MAXPATHLEN 1024 584 # define LA_TYPE LA_SHORT 585 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 586 # define SFS_BAVAIL f_bfree /* alternate field name */ 587 # define _PATH_UNIX "/unix" 588 # ifndef _PATH_SENDMAILCF 589 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 590 # endif 591 # ifndef _PATH_SENDMAILPID 592 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 593 # endif 594 595 typedef short pid_t; 596 597 #endif 598 599 600 /* 601 ** Altos System V. 602 ** Contributed by Tim Rice <timr@crl.com>. 603 */ 604 605 #ifdef ALTOS_SYS_V 606 # include <limits.h> 607 # define SYSTEM5 1 /* include all the System V defines */ 608 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 609 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 610 # define WAITUNION 1 /* use "union wait" as wait argument type */ 611 # define NEEDFSYNC 1 /* no fsync(2) in system library */ 612 # define FORK fork 613 # define MAXPATHLEN PATHSIZE 614 # define LA_TYPE LA_SHORT 615 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 616 # define SFS_BAVAIL f_bfree /* alternate field name */ 617 # define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */ 618 # undef NETUNIX /* no unix domain socket support */ 619 # undef WIFEXITED 620 # undef WEXITSTATUS 621 # define strtoul strtol /* gcc library bogosity */ 622 623 typedef unsigned short uid_t; 624 typedef unsigned short gid_t; 625 typedef short pid_t; 626 #endif 627 628 629 /* 630 ** ConvexOS 11.0 and later 631 ** 632 ** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this 633 ** works on 9.1 as well. 634 */ 635 636 #ifdef _CONVEX_SOURCE 637 # define BSD 1 /* include all the BSD defines */ 638 # define HASUNAME 1 /* use System V uname(2) system call */ 639 # define HASSETSID 1 /* has POSIX setsid(2) call */ 640 # define NEEDGETOPT 1 /* need replacement for getopt(3) */ 641 # define LA_TYPE LA_FLOAT 642 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 643 # ifndef _PATH_SENDMAILCF 644 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 645 # endif 646 # ifndef S_IREAD 647 # define S_IREAD _S_IREAD 648 # define S_IWRITE _S_IWRITE 649 # define S_IEXEC _S_IEXEC 650 # define S_IFMT _S_IFMT 651 # define S_IFCHR _S_IFCHR 652 # define S_IFBLK _S_IFBLK 653 # endif 654 # ifndef IDENTPROTO 655 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 656 # endif 657 #endif 658 659 660 /* 661 ** RISC/os 4.52 662 ** 663 ** Gives a ton of warning messages, but otherwise compiles. 664 */ 665 666 #ifdef RISCOS 667 668 # define HASUNSETENV 1 /* has unsetenv(3) call */ 669 # ifndef HASFLOCK 670 # define HASFLOCK 1 /* has flock(2) call */ 671 # endif 672 # define WAITUNION 1 /* use "union wait" as wait argument type */ 673 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 674 # define LA_TYPE LA_INT 675 # define LA_AVENRUN "avenrun" 676 # define _PATH_UNIX "/unix" 677 # undef WIFEXITED 678 679 # define setpgid setpgrp 680 681 extern int errno; 682 typedef int pid_t; 683 #define SIGFUNC_DEFINED 684 typedef int (*sigfunc_t)(); 685 extern char *getenv(); 686 extern void *malloc(); 687 688 #endif 689 690 691 /* 692 ** Linux 0.99pl10 and above... 693 ** 694 ** Thanks to, in reverse order of contact: 695 ** 696 ** John Kennedy <warlock@csuchico.edu> 697 ** Andrew Pam <avatar@aus.xanadu.com> 698 ** Florian La Roche <rzsfl@rz.uni-sb.de> 699 ** Karl London <karl@borg.demon.co.uk> 700 ** 701 ** Last compiled against: [12/14/94 @ 11:38:41 PM (Wednesday)] 702 ** sendmail 8.7.a.5 named 4.9.3-beta12-p1 db-1.85 703 ** gcc 2.6.2 libc.so.4.6.20 704 ** slackware 2.1.0 linux 1.1.70 705 */ 706 707 #ifdef __linux__ 708 # define BSD 1 /* include BSD defines */ 709 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 710 # define HASUNAME 1 /* use System V uname(2) system call */ 711 # define HASUNSETENV 1 /* has unsetenv(3) call */ 712 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 713 # define GIDSET_T gid_t /* from <linux/types.h> */ 714 # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */ 715 # ifndef HASFLOCK 716 # define HASFLOCK 0 /* flock(2) is broken after 0.99.13 */ 717 # endif 718 # ifndef LA_TYPE 719 # define LA_TYPE LA_PROCSTR 720 # endif 721 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */ 722 # ifndef _PATH_SENDMAILPID 723 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 724 # endif 725 # define TZ_TYPE TZ_TNAME 726 # include <sys/sysmacros.h> 727 # undef atol /* wounded in <stdlib.h> */ 728 #endif 729 730 731 /* 732 ** DELL SVR4 Issue 2.2, and others 733 ** From Kimmo Suominen <kim@grendel.lut.fi> 734 ** 735 ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 736 ** defined, and the definitions conflict. 737 ** 738 ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 739 ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 740 ** (SVR4.0/386 version 3.0). 741 */ 742 743 #ifdef DELL_SVR4 744 /* no changes necessary */ 745 /* see general __svr4__ defines below */ 746 #endif 747 748 749 /* 750 ** Apple A/UX 3.0 751 */ 752 753 #ifdef _AUX_SOURCE 754 # include <sys/sysmacros.h> 755 # define BSD /* has BSD routines */ 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 ** End of Per-Operating System defines 1098 **********************************************************************/ 1099 1100 /********************************************************************** 1101 ** More general defines 1102 **********************************************************************/ 1103 1104 /* general BSD defines */ 1105 #ifdef BSD 1106 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 1107 # define HASSETREUID 1 /* has setreuid(2) call */ 1108 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1109 # ifndef HASSETRLIMIT 1110 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 1111 # endif 1112 # ifndef HASFLOCK 1113 # define HASFLOCK 1 /* has flock(2) call */ 1114 # endif 1115 # ifndef TZ_TYPE 1116 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */ 1117 # endif 1118 #endif 1119 1120 /* general System V Release 4 defines */ 1121 #ifdef __svr4__ 1122 # define SYSTEM5 1 1123 # define HASSETREUID 1 /* has seteuid(2) call & working saved uids */ 1124 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1125 # ifndef HASSETRLIMIT 1126 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 1127 # endif 1128 # ifndef HASGETUSERSHELL 1129 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1130 # endif 1131 # define setreuid(r, e) seteuid(e) 1132 1133 # ifndef _PATH_UNIX 1134 # define _PATH_UNIX "/unix" 1135 # endif 1136 # ifndef _PATH_SENDMAILCF 1137 # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 1138 # endif 1139 # ifndef _PATH_SENDMAILPID 1140 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 1141 # endif 1142 # ifndef SYSLOG_BUFSIZE 1143 # define SYSLOG_BUFSIZE 128 1144 # endif 1145 # ifndef SFS_TYPE 1146 # define SFS_TYPE SFS_STATVFS 1147 # endif 1148 #endif 1149 1150 /* general System V defines */ 1151 #ifdef SYSTEM5 1152 # include <sys/sysmacros.h> 1153 # define HASUNAME 1 /* use System V uname(2) system call */ 1154 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 1155 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 1156 # ifndef HASULIMIT 1157 # define HASULIMIT 1 /* has the ulimit(2) syscall */ 1158 # endif 1159 # ifndef LA_TYPE 1160 # define LA_TYPE LA_INT /* assume integer load average */ 1161 # endif 1162 # ifndef SFS_TYPE 1163 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 1164 # endif 1165 # ifndef TZ_TYPE 1166 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 1167 # endif 1168 # define bcopy(s, d, l) (memmove((d), (s), (l))) 1169 # define bzero(d, l) (memset((d), '\0', (l))) 1170 # define bcmp(s, d, l) (memcmp((s), (d), (l))) 1171 #endif 1172 1173 /* general POSIX defines */ 1174 #ifdef _POSIX_VERSION 1175 # define HASSETSID 1 /* has Posix setsid(2) call */ 1176 # define HASWAITPID 1 /* has Posix waitpid(2) call */ 1177 #endif 1178 1179 /* 1180 ** If no type for argument two of getgroups call is defined, assume 1181 ** it's an integer -- unfortunately, there seem to be several choices 1182 ** here. 1183 */ 1184 1185 #ifndef GIDSET_T 1186 # define GIDSET_T int 1187 #endif 1188 1189 /* 1190 ** Tweaking for systems that (for example) claim to be BSD or POSIX 1191 ** but don't have all the standard BSD or POSIX routines (boo hiss). 1192 */ 1193 1194 #ifdef titan 1195 # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 1196 #endif 1197 1198 #ifdef _CRAYCOM 1199 # undef HASSETSID /* despite POSIX claim, doesn't have setsid */ 1200 #endif 1201 1202 #ifdef ISC_UNIX 1203 # undef bcopy /* despite SystemV claim, uses BSD bcopy */ 1204 #endif 1205 1206 #ifdef ALTOS_SYS_V 1207 # undef bcopy /* despite SystemV claim, uses BSD bcopy */ 1208 # undef bzero /* despite SystemV claim, uses BSD bzero */ 1209 # undef bcmp /* despite SystemV claim, uses BSD bcmp */ 1210 #endif 1211 1212 1213 /* 1214 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 1215 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 1216 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 1217 ** are closed. Some firewalls return this error if you try to connect 1218 ** to the IDENT port (113), so you can't receive email from these hosts 1219 ** on these systems. The firewall really should use a more specific 1220 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If 1221 ** not explicitly set to zero above, default it on. 1222 */ 1223 1224 #ifndef IDENTPROTO 1225 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 1226 #endif 1227 1228 #ifndef HASGETUSERSHELL 1229 # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 1230 #endif 1231 1232 #ifndef HASFLOCK 1233 # define HASFLOCK 0 /* assume no flock(2) support */ 1234 #endif 1235 1236 #ifndef HASSETRLIMIT 1237 # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */ 1238 #endif 1239 1240 #ifndef HASULIMIT 1241 # define HASULIMIT 0 /* assume no ulimit(2) support */ 1242 #endif 1243 1244 #ifndef OLD_NEWDB 1245 # define OLD_NEWDB 0 /* assume newer version of newdb */ 1246 #endif 1247 1248 /* heuristic setting of HASSETSIGMASK; can override above */ 1249 #ifndef HASSIGSETMASK 1250 # ifdef SIGVTALRM 1251 # define HASSETSIGMASK 1 1252 # else 1253 # define HASSETSIGMASK 0 1254 # endif 1255 #endif 1256 1257 1258 /********************************************************************** 1259 ** Remaining definitions should never have to be changed. They are 1260 ** primarily to provide back compatibility for older systems -- for 1261 ** example, it includes some POSIX compatibility definitions 1262 **********************************************************************/ 1263 1264 /* System 5 compatibility */ 1265 #ifndef S_ISREG 1266 # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 1267 #endif 1268 #if !defined(S_ISLNK) && defined(S_IFLNK) 1269 # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 1270 #endif 1271 #ifndef S_IWUSR 1272 # define S_IWUSR 0200 1273 #endif 1274 #ifndef S_IWGRP 1275 # define S_IWGRP 0020 1276 #endif 1277 #ifndef S_IWOTH 1278 # define S_IWOTH 0002 1279 #endif 1280 1281 /* 1282 ** Older systems don't have this error code -- it should be in 1283 ** /usr/include/sysexits.h. 1284 */ 1285 1286 # ifndef EX_CONFIG 1287 # define EX_CONFIG 78 /* configuration error */ 1288 # endif 1289 1290 /* pseudo-code used in server SMTP */ 1291 # define EX_QUIT 22 /* drop out of server immediately */ 1292 1293 1294 /* 1295 ** These are used in a few cases where we need some special 1296 ** error codes, but where the system doesn't provide something 1297 ** reasonable. They are printed in errstring. 1298 */ 1299 1300 #ifndef E_PSEUDOBASE 1301 # define E_PSEUDOBASE 256 1302 #endif 1303 1304 #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 1305 #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 1306 1307 /* type of arbitrary pointer */ 1308 #ifndef ARBPTR_T 1309 # define ARBPTR_T void * 1310 #endif 1311 1312 #ifndef __P 1313 # include "cdefs.h" 1314 #endif 1315 1316 #if NAMED_BIND 1317 # include <arpa/nameser.h> 1318 # ifdef __svr4__ 1319 # ifdef NOERROR 1320 # undef NOERROR /* avoid compiler conflict with stream.h */ 1321 # endif 1322 # endif 1323 #endif 1324 1325 /* 1326 ** The size of an IP address -- can't use sizeof because of problems 1327 ** on Crays, where everything is 64 bits. This will break if/when 1328 ** IP addresses are expanded to eight bytes. 1329 */ 1330 1331 #ifndef INADDRSZ 1332 # define INADDRSZ 4 1333 #endif 1334 1335 /* 1336 ** The size of various known types -- for reading network protocols. 1337 ** Again, we can't use sizeof because of compiler randomness. 1338 */ 1339 1340 #ifndef INT16SZ 1341 # define INT16SZ 2 1342 #endif 1343 #ifndef INT32SZ 1344 # define INT32SZ 4 1345 #endif 1346 1347 /* 1348 ** Do some required dependencies 1349 */ 1350 1351 #if defined(NETINET) || defined(NETISO) 1352 # define SMTP 1 /* enable user and server SMTP */ 1353 # define QUEUE 1 /* enable queueing */ 1354 # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 1355 #endif 1356 1357 1358 /* 1359 ** Arrange to use either varargs or stdargs 1360 */ 1361 1362 # ifdef __STDC__ 1363 1364 # include <stdarg.h> 1365 1366 # define VA_LOCAL_DECL va_list ap; 1367 # define VA_START(f) va_start(ap, f) 1368 # define VA_END va_end(ap) 1369 1370 # else 1371 1372 # include <varargs.h> 1373 1374 # define VA_LOCAL_DECL va_list ap; 1375 # define VA_START(f) va_start(ap) 1376 # define VA_END va_end(ap) 1377 1378 # endif 1379 1380 #ifdef HASUNAME 1381 # include <sys/utsname.h> 1382 # ifdef newstr 1383 # undef newstr 1384 # endif 1385 #else /* ! HASUNAME */ 1386 # define NODE_LENGTH 32 1387 struct utsname 1388 { 1389 char nodename[NODE_LENGTH+1]; 1390 }; 1391 #endif /* HASUNAME */ 1392 1393 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V) 1394 # define MAXHOSTNAMELEN 256 1395 #endif 1396 1397 #if !defined(SIGCHLD) && defined(SIGCLD) 1398 # define SIGCHLD SIGCLD 1399 #endif 1400 1401 #ifndef STDIN_FILENO 1402 #define STDIN_FILENO 0 1403 #endif 1404 1405 #ifndef STDOUT_FILENO 1406 #define STDOUT_FILENO 1 1407 #endif 1408 1409 #ifndef STDERR_FILENO 1410 #define STDERR_FILENO 2 1411 #endif 1412 1413 #ifndef LOCK_SH 1414 # define LOCK_SH 0x01 /* shared lock */ 1415 # define LOCK_EX 0x02 /* exclusive lock */ 1416 # define LOCK_NB 0x04 /* non-blocking lock */ 1417 # define LOCK_UN 0x08 /* unlock */ 1418 #endif 1419 1420 #ifndef SIG_ERR 1421 # define SIG_ERR ((void (*)()) -1) 1422 #endif 1423 1424 #ifndef WEXITSTATUS 1425 # define WEXITSTATUS(st) (((st) >> 8) & 0377) 1426 #endif 1427 #ifndef WIFEXITED 1428 # define WIFEXITED(st) (((st) & 0377) == 0) 1429 #endif 1430 1431 #ifndef SIGFUNC_DEFINED 1432 typedef void (*sigfunc_t) __P((int)); 1433 #endif 1434 1435 /* size of syslog buffer */ 1436 #ifndef SYSLOG_BUFSIZE 1437 # define SYSLOG_BUFSIZE 1024 1438 #endif 1439 1440 /* 1441 ** Size of tobuf (deliver.c) 1442 ** Tweak this to match your syslog implementation. It will have to 1443 ** allow for the extra information printed. 1444 */ 1445 1446 #ifndef TOBUFSIZE 1447 # if (SYSLOG_BUFSIZE) > 512 1448 # define TOBUFSIZE (SYSLOG_BUFSIZE - 256) 1449 # else 1450 # define TOBUFSIZE 256 1451 # endif 1452 #endif 1453 1454 /* 1455 ** Size of prescan buffer. 1456 ** Despite comments in the _sendmail_ book, this probably should 1457 ** not be changed; there are some hard-to-define dependencies. 1458 */ 1459 1460 # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 1461 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 1462 # ifndef FORK 1463 # define FORK vfork /* function to call to fork mailer */ 1464 # endif 1465 1466 /* 1467 ** If we are going to link scanf anyway, use it in readcf 1468 */ 1469 1470 #if !defined(HASUNAME) && !defined(SCANF) 1471 # define SCANF 1 1472 #endif 1473