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.79 (Berkeley) 01/22/94 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 23 /********************************************************************** 24 ** Table sizes, etc.... 25 ** There shouldn't be much need to change these.... 26 **********************************************************************/ 27 28 # define MAXLINE 2048 /* max line length */ 29 # define MAXNAME 256 /* max length of a name */ 30 # define MAXPV 40 /* max # of parms to mailers */ 31 # define MAXATOM 200 /* max atoms per address */ 32 # define MAXMAILERS 25 /* maximum mailers known to system */ 33 # define MAXRWSETS 100 /* max # of sets of rewriting rules */ 34 # define MAXPRIORITIES 25 /* max values for Precedence: field */ 35 # define MAXMXHOSTS 20 /* max # of MX records */ 36 # define SMTPLINELIM 990 /* maximum SMTP line length */ 37 # define MAXKEY 128 /* maximum size of a database key */ 38 # define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */ 39 # define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */ 40 # define MAXALIASDB 12 /* max # of alias databases */ 41 42 # ifndef QUEUESIZE 43 # define QUEUESIZE 1000 /* max # of jobs per queue run */ 44 # endif 45 46 /********************************************************************** 47 ** Compilation options. 48 ** 49 ** #define these if they are available; comment them out otherwise. 50 **********************************************************************/ 51 52 # define LOG 1 /* enable logging */ 53 # define UGLYUUCP 1 /* output ugly UUCP From lines */ 54 # define NETUNIX 1 /* include unix domain support */ 55 # define NETINET 1 /* include internet support */ 56 # define SETPROCTITLE 1 /* munge argv to display current status */ 57 # define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ 58 # define MATCHGECOS 1 /* match user names from gecos field */ 59 # define XDEBUG 1 /* enable extended debugging */ 60 61 # ifdef NEWDB 62 # define USERDB 1 /* look in user database (requires NEWDB) */ 63 # endif 64 65 /* 66 ** Most systems have symbolic links today, so default them on. You 67 ** can turn them off by #undef'ing this below. 68 */ 69 70 # define HASLSTAT 1 /* has lstat(2) call */ 71 72 /* 73 ** General "standard C" defines. 74 ** 75 ** These may be undone later, to cope with systems that claim to 76 ** be Standard C but aren't. Gcc is the biggest offender -- it 77 ** doesn't realize that the library is part of the language. 78 ** 79 ** Life would be much easier if we could get rid of this sort 80 ** of bozo problems. 81 */ 82 83 #ifdef __STDC__ 84 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 85 #endif 86 87 /********************************************************************** 88 ** Operating system configuration. 89 ** 90 ** Unless you are porting to a new OS, you shouldn't have to 91 ** change these. 92 **********************************************************************/ 93 94 /* 95 ** Per-Operating System defines 96 */ 97 98 99 /* 100 ** HP-UX -- tested for 8.07, 9.00, and 9.01. 101 */ 102 103 # ifdef __hpux 104 /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */ 105 # undef m_flags 106 # define SYSTEM5 1 /* include all the System V defines */ 107 # define HASINITGROUPS 1 /* has initgroups(3) call */ 108 # define HASSETREUID 1 /* has setreuid(2) call */ 109 # define setreuid(r, e) setresuid(r, e, -1) 110 # define LA_TYPE LA_FLOAT 111 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 112 # define GIDSET_T gid_t 113 # define _PATH_UNIX "/hp-ux" 114 # ifndef _PATH_SENDMAILCF 115 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 116 # endif 117 # ifndef IDENTPROTO 118 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 119 # endif 120 # ifndef HASGETUSERSHELL 121 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 122 # endif 123 # define syslog hard_syslog 124 # ifdef __STDC__ 125 extern int syslog(int, char *, ...); 126 # endif 127 # endif 128 129 130 /* 131 ** IBM AIX 3.x -- actually tested for 3.2.3 132 */ 133 134 # ifdef _AIX3 135 # define HASINITGROUPS 1 /* has initgroups(3) call */ 136 # define HASUNAME 1 /* use System V uname(2) system call */ 137 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 138 # define FORK fork /* no vfork primitive available */ 139 # undef SETPROCTITLE /* setproctitle confuses AIX */ 140 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 141 # endif 142 143 144 /* 145 ** Silicon Graphics IRIX 146 ** 147 ** Compiles on 4.0.1. 148 */ 149 150 # ifdef IRIX 151 # include <sys/sysmacros.h> 152 # define HASSETREUID 1 /* has setreuid(2) call */ 153 # define HASINITGROUPS 1 /* has initgroups(3) call */ 154 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 155 # define FORK fork /* no vfork primitive available */ 156 # define WAITUNION 1 /* use "union wait" as wait argument type */ 157 # define setpgid BSDsetpgrp 158 # define GIDSET_T gid_t 159 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 160 # endif 161 162 163 /* 164 ** SunOS and Solaris 165 ** 166 ** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and 167 ** Solaris 2.2 (a.k.a. SunOS 5.2). 168 */ 169 170 #if defined(sun) && !defined(BSD) 171 172 # define HASINITGROUPS 1 /* has initgroups(3) call */ 173 # define HASUNAME 1 /* use System V uname(2) system call */ 174 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 175 # define LA_TYPE LA_INT 176 177 # ifdef SOLARIS_2_3 178 # define SOLARIS 179 # endif 180 181 # ifdef SOLARIS 182 /* Solaris 2.x (a.k.a. SunOS 5.x) */ 183 # ifndef __svr4__ 184 # define __svr4__ /* use all System V Releae 4 defines below */ 185 # endif 186 # include <sys/time.h> 187 # define gethostbyname solaris_gethostbyname /* get working version */ 188 # define gethostbyaddr solaris_gethostbyaddr /* get working version */ 189 # define GIDSET_T gid_t 190 # ifndef _PATH_UNIX 191 # define _PATH_UNIX "/kernel/unix" 192 # endif 193 # ifndef _PATH_SENDMAILCF 194 # define _PATH_SENDMAILCF "/etc/mail/sendmail.cf" 195 # endif 196 # ifndef _PATH_SENDMAILPID 197 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 198 # endif 199 200 # else 201 /* SunOS 4.0.3 or 4.1.x */ 202 # define HASSETREUID 1 /* has setreuid(2) call */ 203 # ifndef HASFLOCK 204 # define HASFLOCK 1 /* has flock(2) call */ 205 # endif 206 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 207 # include <vfork.h> 208 209 # ifdef SUNOS403 210 /* special tweaking for SunOS 4.0.3 */ 211 # include <malloc.h> 212 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 213 # define WAITUNION 1 /* use "union wait" as wait argument type */ 214 # undef WIFEXITED 215 # undef WEXITSTATUS 216 # undef HASUNAME 217 # define setpgid setpgrp 218 typedef int pid_t; 219 extern char *getenv(); 220 221 # endif 222 # endif 223 #endif 224 225 /* 226 ** DG/UX 227 ** 228 ** Tested on 5.4.2 229 */ 230 231 #ifdef DGUX 232 # define SYSTEM5 1 233 # define LA_TYPE LA_SUBR 234 # define HASSETREUID 1 /* has setreuid(2) call */ 235 # define HASUNAME 1 /* use System V uname(2) system call */ 236 # define HASSETSID 1 /* has Posix setsid(2) call */ 237 # define HASINITGROUPS 1 /* has initgroups(3) call */ 238 # ifndef IDENTPROTO 239 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 240 # endif 241 # undef SETPROCTITLE 242 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 243 244 /* these include files must be included early on DG/UX */ 245 # include <netinet/in.h> 246 # include <arpa/inet.h> 247 248 # define inet_addr dgux_inet_addr 249 extern long dgux_inet_addr(); 250 #endif 251 252 253 /* 254 ** Digital Ultrix 4.2A or 4.3 255 ** 256 ** Apparently, fcntl locking is broken on 4.2A, in that locks are 257 ** not dropped when the process exits. This causes major problems, 258 ** so flock is the only alternative. 259 */ 260 261 #ifdef ultrix 262 # define HASSETREUID 1 /* has setreuid(2) call */ 263 # define HASUNSETENV 1 /* has unsetenv(3) call */ 264 # define HASINITGROUPS 1 /* has initgroups(3) call */ 265 # ifndef HASFLOCK 266 # define HASFLOCK 1 /* has flock(2) call */ 267 # endif 268 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 269 # ifdef vax 270 # define LA_TYPE LA_FLOAT 271 # else 272 # define LA_TYPE LA_INT 273 # define LA_AVENRUN "avenrun" 274 # endif 275 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 276 # ifndef IDENTPROTO 277 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 278 # endif 279 #endif 280 281 282 /* 283 ** OSF/1 (tested on Alpha) 284 */ 285 286 #ifdef __osf__ 287 # define HASUNSETENV 1 /* has unsetenv(3) call */ 288 # define HASSETREUID 1 /* has setreuid(2) call */ 289 # define HASINITGROUPS 1 /* has initgroups(3) call */ 290 # ifdef HASFLOCK 291 # define HASFLOCK 1 /* has flock(2) call */ 292 # endif 293 # define LA_TYPE LA_INT 294 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 295 # ifndef _PATH_SENDMAILPID 296 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 297 # endif 298 #endif 299 300 301 /* 302 ** NeXTstep 303 */ 304 305 #ifdef NeXT 306 # define HASINITGROUPS 1 /* has initgroups(3) call */ 307 # ifndef HASFLOCK 308 # define HASFLOCK 1 /* has flock(2) call */ 309 # endif 310 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 311 # define WAITUNION 1 /* use "union wait" as wait argument type */ 312 # define sleep sleepX 313 # define setpgid setpgrp 314 # ifndef LA_TYPE 315 # define LA_TYPE LA_MACH 316 # endif 317 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 318 # ifndef _POSIX_SOURCE 319 typedef int pid_t; 320 # undef WEXITSTATUS 321 # undef WIFEXITED 322 # endif 323 # ifndef _PATH_SENDMAILCF 324 # define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf" 325 # endif 326 # ifndef _PATH_SENDMAILPID 327 # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" 328 # endif 329 #endif 330 331 332 /* 333 ** 4.4 BSD 334 ** 335 ** See also BSD defines. 336 */ 337 338 #ifdef BSD4_4 339 # define HASUNSETENV 1 /* has unsetenv(3) call */ 340 # include <sys/cdefs.h> 341 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 342 # ifndef LA_TYPE 343 # define LA_TYPE LA_SUBR 344 # endif 345 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 346 #endif 347 348 349 /* 350 ** 386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions) 351 ** 352 ** 4.3BSD clone, closer to 4.4BSD 353 ** 354 ** See also BSD defines. 355 */ 356 357 #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__) 358 # define HASUNSETENV 1 /* has unsetenv(3) call */ 359 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 360 # include <sys/cdefs.h> 361 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 362 # ifndef LA_TYPE 363 # define LA_TYPE LA_SUBR 364 # endif 365 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 366 #endif 367 368 369 /* 370 ** Mach386 371 ** 372 ** For mt Xinu's Mach386 system. 373 */ 374 375 #if defined(MACH) && defined(i386) 376 # define MACH386 1 377 # define HASUNSETENV 1 /* has unsetenv(3) call */ 378 # define HASINITGROUPS 1 /* has initgroups(3) call */ 379 # ifdef HASFLOCK 380 # define HASFLOCK 1 /* has flock(2) call */ 381 # endif 382 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 383 # define NEEDSTRTOL 1 /* need the strtol() function */ 384 # define setpgid setpgrp 385 # ifndef LA_TYPE 386 # define LA_TYPE LA_FLOAT 387 # endif 388 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 389 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 390 # undef WEXITSTATUS 391 # undef WIFEXITED 392 # ifndef _PATH_SENDMAILCF 393 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 394 # endif 395 # ifndef _PATH_SENDMAILPID 396 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 397 # endif 398 #endif 399 400 401 /* 402 ** 4.3 BSD -- this is for very old systems 403 ** 404 ** You'll also have to install a new resolver library. 405 ** I don't guarantee that support for this environment is complete. 406 */ 407 408 #ifdef oldBSD43 409 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 410 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 411 # define ARBPTR_T char * 412 # define setpgid setpgrp 413 # ifndef LA_TYPE 414 # define LA_TYPE LA_FLOAT 415 # endif 416 # ifndef _PATH_SENDMAILCF 417 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 418 # endif 419 # ifndef IDENTPROTO 420 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 421 # endif 422 # undef WEXITSTATUS 423 # undef WIFEXITED 424 typedef short pid_t; 425 extern int errno; 426 #endif 427 428 429 /* 430 ** SCO Unix 431 ** 432 ** This includes two parts -- the first is for SCO Open Server 3.2v4 433 ** (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). 434 ** The second is, I believe, for an older version. 435 */ 436 437 #ifdef _SCO_unix_4_2 438 # define _SCO_unix_ 439 # define HASSETREUID 1 /* has setreuid(2) call */ 440 # define _PATH_UNIX "/unix" 441 # ifndef _PATH_SENDMAILCF 442 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 443 # endif 444 # ifndef _PATH_SENDMAILPID 445 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 446 # endif 447 #endif 448 449 #ifdef _SCO_unix_ 450 # define SYSTEM5 1 /* include all the System V defines */ 451 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 452 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 453 # define FORK fork 454 # define MAXPATHLEN PATHSIZE 455 # define LA_TYPE LA_SHORT 456 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 457 # undef NETUNIX /* no unix domain socket support */ 458 #endif 459 460 461 /* 462 ** ConvexOS 11.0 and later 463 */ 464 465 #ifdef _CONVEX_SOURCE 466 # define BSD 1 /* include all the BSD defines */ 467 # define HASUNAME 1 /* use System V uname(2) system call */ 468 # define HASSETSID 1 /* has POSIX setsid(2) call */ 469 # define NEEDGETOPT 1 /* need replacement for getopt(3) */ 470 # define LA_TYPE LA_FLOAT 471 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 472 # ifndef IDENTPROTO 473 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 474 # endif 475 #endif 476 477 478 /* 479 ** RISC/os 4.52 480 ** 481 ** Gives a ton of warning messages, but otherwise compiles. 482 */ 483 484 #ifdef RISCOS 485 486 # define HASUNSETENV 1 /* has unsetenv(3) call */ 487 # ifdef HASFLOCK 488 # define HASFLOCK 1 /* has flock(2) call */ 489 # endif 490 # define WAITUNION 1 /* use "union wait" as wait argument type */ 491 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 492 # define LA_TYPE LA_INT 493 # define LA_AVENRUN "avenrun" 494 # define _PATH_UNIX "/unix" 495 # undef WIFEXITED 496 497 # define setpgid setpgrp 498 499 extern int errno; 500 typedef int pid_t; 501 #define SIGFUNC_DEFINED 502 typedef int (*sigfunc_t)(); 503 extern char *getenv(); 504 extern void *malloc(); 505 506 #endif 507 508 509 /* 510 ** Linux 0.99pl10 and above... 511 ** From Karl London <karl@borg.demon.co.uk>. 512 */ 513 514 #ifdef __linux__ 515 # define BSD 1 /* pretend to be BSD based today */ 516 # ifndef HASFLOCK 517 # define HASFLOCK 0 /* don't have a functioning flock(2) */ 518 # endif 519 # undef NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 520 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 521 # define HASUNSETENV 1 /* has unsetenv(3) call */ 522 # ifndef LA_TYPE 523 # define LA_TYPE LA_FLOAT 524 # endif 525 # include <sys/sysmacros.h> 526 # define GIDSET_T gid_t 527 #endif 528 529 530 /* 531 ** DELL SVR4 Issue 2.2, and others 532 ** From Kimmo Suominen <kim@grendel.lut.fi> 533 ** 534 ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 535 ** defined, and the definitions conflict. 536 ** 537 ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 538 ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 539 ** (SVR4.0/386 version 3.0). 540 */ 541 542 #ifdef DELL_SVR4 543 /* no changes necessary */ 544 /* see general __svr4__ defines below */ 545 #endif 546 547 548 /* 549 ** Apple A/UX 3.0 550 */ 551 552 #ifdef _AUX_SOURCE 553 # include <sys/sysmacros.h> 554 # define BSD /* has BSD routines */ 555 # define HASUNAME 1 /* use System V uname(2) system call */ 556 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 557 # define SIGFUNC_DEFINED /* sigfunc_t already defined */ 558 # ifndef IDENTPROTO 559 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 560 # endif 561 # define FORK fork 562 # ifndef _PATH_SENDMAILCF 563 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 564 # endif 565 # ifndef LA_TYPE 566 # define LA_TYPE LA_ZERO 567 # endif 568 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 569 # undef WIFEXITED 570 # undef WEXITSTATUS 571 #endif 572 573 574 /* 575 ** Encore UMAX V 576 ** 577 ** Not extensively tested. 578 */ 579 580 #ifdef UMAXV 581 # include <limits.h> 582 # define HASUNAME 1 /* use System V uname(2) system call */ 583 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 584 # define HASINITGROUPS 1 /* has initgroups(3) call */ 585 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 586 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 587 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 588 # define FORK fork /* no vfork(2) primitive available */ 589 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 590 # define MAXPATHLEN PATH_MAX 591 extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 592 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 593 # undef WIFEXITED 594 # undef WEXITSTATUS 595 #endif 596 597 598 /* 599 ** Stardent Titan 3000 running TitanOS 4.2. 600 ** 601 ** Must be compiled in "cc -43" mode. 602 ** 603 ** From Kate Hedstrom <kate@ahab.rutgers.edu>. 604 ** 605 ** Note the tweaking below after the BSD defines are set. 606 */ 607 608 #ifdef titan 609 # define setpgid setpgrp 610 typedef int pid_t; 611 # undef WIFEXITED 612 # undef WEXITSTATUS 613 #endif 614 615 616 /* 617 ** Sequent DYNIX 3.2.0 618 ** 619 ** From Jim Davis <jdavis@cs.arizona.edu>. 620 */ 621 622 #ifdef sequent 623 # define BSD 1 624 # define HASUNSETENV 1 625 # define BSD4_3 1 /* to get signal() in conf.c */ 626 # define WAITUNION 1 627 # define LA_TYPE LA_FLOAT 628 # ifdef _POSIX_VERSION 629 # undef _POSIX_VERSION /* set in <unistd.h> */ 630 # endif 631 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 632 # define setpgid setpgrp 633 634 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 635 # undef WIFEXITED 636 # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 637 ((union wait*)&(s))->w_termsig == 0) 638 # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 639 typedef int pid_t; 640 # define isgraph(c) (isprint(c) && (c != ' ')) 641 642 # ifndef _PATH_UNIX 643 # define _PATH_UNIX "/dynix" 644 # endif 645 # ifndef _PATH_SENDMAILCF 646 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 647 # endif 648 649 #endif 650 651 652 /* 653 ** Cray Unicos 654 ** 655 ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 656 */ 657 658 #ifdef UNICOS 659 # define SYSTEM5 1 /* include all the System V defines */ 660 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 661 # define MAXPATHLEN PATHSIZE 662 # define LA_TYPE LA_ZERO 663 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 664 #endif 665 666 667 /* 668 ** Apollo DomainOS 669 ** 670 ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com> 671 ** 672 ** 15 Jan 1994 673 ** 674 */ 675 676 #ifdef apollo 677 # define HASSTATFS 1 /* has the statfs(2) syscall */ 678 # define HASSETREUID 1 /* has setreuid(2) call */ 679 # define HASINITGROUPS 1 /* has initgroups(2) call */ 680 # undef SETPROCTITLE 681 # define LA_TYPE LA_SUBR /* use getloadavg.c */ 682 # define SFS_TYPE SFS_MOUNT 683 # ifndef _PATH_SENDMAILCF 684 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 685 # endif 686 # ifndef _PATH_SENDMAILPID 687 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 688 # endif 689 # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ 690 # undef S_IFIFO 691 # define S_IFIFO 0010000 692 # ifndef IDENTPROTO 693 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 694 # endif 695 #endif 696 697 698 699 700 /********************************************************************** 701 ** End of Per-Operating System defines 702 **********************************************************************/ 703 704 /********************************************************************** 705 ** More general defines 706 **********************************************************************/ 707 708 /* general BSD defines */ 709 #ifdef BSD 710 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 711 # define HASSETREUID 1 /* has setreuid(2) call */ 712 # define HASINITGROUPS 1 /* has initgroups(2) call */ 713 # ifndef HASFLOCK 714 # define HASFLOCK 1 /* has flock(2) call */ 715 # endif 716 #endif 717 718 /* general System V Release 4 defines */ 719 #ifdef __svr4__ 720 # define SYSTEM5 1 721 # define HASSETREUID 1 /* has seteuid(2) call & working saved uids */ 722 # ifndef HASGETUSERSHELL 723 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 724 # endif 725 # define setreuid(r, e) seteuid(e) 726 727 # ifndef _PATH_UNIX 728 # define _PATH_UNIX "/unix" 729 # endif 730 # ifndef _PATH_SENDMAILCF 731 # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 732 # endif 733 # ifndef _PATH_SENDMAILPID 734 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 735 # endif 736 # ifndef SYSLOG_BUFSIZE 737 # define SYSLOG_BUFSIZE 128 738 # endif 739 #endif 740 741 /* general System V defines */ 742 # ifdef SYSTEM5 743 # include <sys/sysmacros.h> 744 # define HASUNAME 1 /* use System V uname(2) system call */ 745 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 746 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 747 # ifndef LA_TYPE 748 # define LA_TYPE LA_INT /* assume integer load average */ 749 # endif 750 # ifndef SFS_TYPE 751 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 752 # endif 753 # define bcopy(s, d, l) (memmove((d), (s), (l))) 754 # define bzero(d, l) (memset((d), '\0', (l))) 755 # define bcmp(s, d, l) (memcmp((s), (d), (l))) 756 # endif 757 758 /* general POSIX defines */ 759 #ifdef _POSIX_VERSION 760 # define HASSETSID 1 /* has Posix setsid(2) call */ 761 # define HASWAITPID 1 /* has Posix waitpid(2) call */ 762 #endif 763 764 /* 765 ** If no type for argument two of getgroups call is defined, assume 766 ** it's an integer -- unfortunately, there seem to be several choices 767 ** here. 768 */ 769 770 #ifndef GIDSET_T 771 # define GIDSET_T int 772 #endif 773 774 /* 775 ** Tweaking for systems that (for example) claim to be BSD but 776 ** don't have all the standard BSD routines (boo hiss). 777 */ 778 779 #ifdef titan 780 # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 781 #endif 782 783 784 /* 785 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 786 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 787 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 788 ** are closed. Some firewalls return this error if you try to connect 789 ** to the IDENT port (113), so you can't receive email from these hosts 790 ** on these systems. The firewall really should use a more specific 791 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If 792 ** not explicitly set to zero above, default it on. 793 */ 794 795 #ifndef IDENTPROTO 796 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 797 #endif 798 799 #ifndef HASGETUSERSHELL 800 # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 801 #endif 802 803 #ifndef HASFLOCK 804 # define HASFLOCK 0 /* assume no flock(2) support */ 805 #endif 806 807 808 /********************************************************************** 809 ** Remaining definitions should never have to be changed. They are 810 ** primarily to provide back compatibility for older systems -- for 811 ** example, it includes some POSIX compatibility definitions 812 **********************************************************************/ 813 814 /* System 5 compatibility */ 815 #ifndef S_ISREG 816 # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 817 #endif 818 #if !defined(S_ISLNK) && defined(S_IFLNK) 819 # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 820 #endif 821 #ifndef S_IWGRP 822 #define S_IWGRP 020 823 #endif 824 #ifndef S_IWOTH 825 #define S_IWOTH 002 826 #endif 827 828 /* 829 ** Older systems don't have this error code -- it should be in 830 ** /usr/include/sysexits.h. 831 */ 832 833 # ifndef EX_CONFIG 834 # define EX_CONFIG 78 /* configuration error */ 835 # endif 836 837 /* pseudo-code used in server SMTP */ 838 # define EX_QUIT 22 /* drop out of server immediately */ 839 840 841 /* 842 ** These are used in a few cases where we need some special 843 ** error codes, but where the system doesn't provide something 844 ** reasonable. They are printed in errstring. 845 */ 846 847 #ifndef E_PSEUDOBASE 848 # define E_PSEUDOBASE 256 849 #endif 850 851 #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 852 #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 853 854 /* type of arbitrary pointer */ 855 #ifndef ARBPTR_T 856 # define ARBPTR_T void * 857 #endif 858 859 #ifndef __P 860 # include "cdefs.h" 861 #endif 862 863 /* 864 ** Do some required dependencies 865 */ 866 867 #if defined(NETINET) || defined(NETISO) 868 # define SMTP 1 /* enable user and server SMTP */ 869 # define QUEUE 1 /* enable queueing */ 870 # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 871 #endif 872 873 874 /* 875 ** Arrange to use either varargs or stdargs 876 */ 877 878 # ifdef __STDC__ 879 880 # include <stdarg.h> 881 882 # define VA_LOCAL_DECL va_list ap; 883 # define VA_START(f) va_start(ap, f) 884 # define VA_END va_end(ap) 885 886 # else 887 888 # include <varargs.h> 889 890 # define VA_LOCAL_DECL va_list ap; 891 # define VA_START(f) va_start(ap) 892 # define VA_END va_end(ap) 893 894 # endif 895 896 #ifdef HASUNAME 897 # include <sys/utsname.h> 898 # ifdef newstr 899 # undef newstr 900 # endif 901 #else /* ! HASUNAME */ 902 # define NODE_LENGTH 32 903 struct utsname 904 { 905 char nodename[NODE_LENGTH+1]; 906 }; 907 #endif /* HASUNAME */ 908 909 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) 910 # define MAXHOSTNAMELEN 256 911 #endif 912 913 #if !defined(SIGCHLD) && defined(SIGCLD) 914 # define SIGCHLD SIGCLD 915 #endif 916 917 #ifndef STDIN_FILENO 918 #define STDIN_FILENO 0 919 #endif 920 921 #ifndef STDOUT_FILENO 922 #define STDOUT_FILENO 1 923 #endif 924 925 #ifndef STDERR_FILENO 926 #define STDERR_FILENO 2 927 #endif 928 929 #ifndef LOCK_SH 930 # define LOCK_SH 0x01 /* shared lock */ 931 # define LOCK_EX 0x02 /* exclusive lock */ 932 # define LOCK_NB 0x04 /* non-blocking lock */ 933 # define LOCK_UN 0x08 /* unlock */ 934 #endif 935 936 #ifndef SIG_ERR 937 # define SIG_ERR ((void (*)()) -1) 938 #endif 939 940 #ifndef WEXITSTATUS 941 # define WEXITSTATUS(st) (((st) >> 8) & 0377) 942 #endif 943 #ifndef WIFEXITED 944 # define WIFEXITED(st) (((st) & 0377) == 0) 945 #endif 946 947 #ifndef SIGFUNC_DEFINED 948 typedef void (*sigfunc_t) __P((int)); 949 #endif 950 951 /* size of syslog buffer */ 952 #ifndef SYSLOG_BUFSIZE 953 # define SYSLOG_BUFSIZE 1024 954 #endif 955 956 /* 957 ** Size of tobuf (deliver.c) 958 ** Tweak this to match your syslog implementation. It will have to 959 ** allow for the extra information printed. 960 */ 961 962 #ifndef TOBUFSIZE 963 # if (SYSLOG_BUFSIZE) > 512 964 # define TOBUFSIZE (SYSLOG_BUFSIZE - 256) 965 # else 966 # define TOBUFSIZE 256 967 # endif 968 #endif 969 970 /* 971 ** Size of prescan buffer. 972 ** Despite comments in the _sendmail_ book, this probably should 973 ** not be changed; there are some hard-to-define dependencies. 974 */ 975 976 # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 977 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 978 # ifndef FORK 979 # define FORK vfork /* function to call to fork mailer */ 980 # endif 981