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.89 (Berkeley) 02/17/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 # ifndef SYSLOG_BUFSIZE 200 # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 201 # endif 202 203 # else 204 /* SunOS 4.0.3 or 4.1.x */ 205 # define HASSETREUID 1 /* has setreuid(2) call */ 206 # ifndef HASFLOCK 207 # define HASFLOCK 1 /* has flock(2) call */ 208 # endif 209 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 210 # include <vfork.h> 211 212 # ifdef SUNOS403 213 /* special tweaking for SunOS 4.0.3 */ 214 # include <malloc.h> 215 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 216 # define WAITUNION 1 /* use "union wait" as wait argument type */ 217 # undef WIFEXITED 218 # undef WEXITSTATUS 219 # undef HASUNAME 220 # define setpgid setpgrp 221 typedef int pid_t; 222 extern char *getenv(); 223 224 # endif 225 # endif 226 #endif 227 228 /* 229 ** DG/UX 230 ** 231 ** Tested on 5.4.2 232 */ 233 234 #ifdef DGUX 235 # define SYSTEM5 1 236 # define LA_TYPE LA_SUBR 237 # define HASSETREUID 1 /* has setreuid(2) call */ 238 # define HASUNAME 1 /* use System V uname(2) system call */ 239 # define HASSETSID 1 /* has Posix setsid(2) call */ 240 # define HASINITGROUPS 1 /* has initgroups(3) call */ 241 # define HASGETUSERSHELL 0 /* does not have getusershell(3) */ 242 # ifndef IDENTPROTO 243 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 244 # endif 245 # undef SETPROCTITLE 246 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 247 248 /* these include files must be included early on DG/UX */ 249 # include <netinet/in.h> 250 # include <arpa/inet.h> 251 252 # define inet_addr dgux_inet_addr 253 extern long dgux_inet_addr(); 254 #endif 255 256 257 /* 258 ** Digital Ultrix 4.2A or 4.3 259 ** 260 ** Apparently, fcntl locking is broken on 4.2A, in that locks are 261 ** not dropped when the process exits. This causes major problems, 262 ** so flock is the only alternative. 263 */ 264 265 #ifdef ultrix 266 # define HASSETREUID 1 /* has setreuid(2) call */ 267 # define HASUNSETENV 1 /* has unsetenv(3) call */ 268 # define HASINITGROUPS 1 /* has initgroups(3) call */ 269 # ifndef HASFLOCK 270 # define HASFLOCK 1 /* has flock(2) call */ 271 # endif 272 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 273 # ifdef vax 274 # define LA_TYPE LA_FLOAT 275 # else 276 # define LA_TYPE LA_INT 277 # define LA_AVENRUN "avenrun" 278 # endif 279 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 280 # ifndef IDENTPROTO 281 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 282 # endif 283 #endif 284 285 286 /* 287 ** OSF/1 (tested on Alpha) 288 */ 289 290 #ifdef __osf__ 291 # define HASUNSETENV 1 /* has unsetenv(3) call */ 292 # define HASSETREUID 1 /* has setreuid(2) call */ 293 # define HASINITGROUPS 1 /* has initgroups(3) call */ 294 # ifdef HASFLOCK 295 # define HASFLOCK 1 /* has flock(2) call */ 296 # endif 297 # define LA_TYPE LA_INT 298 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 299 # ifndef _PATH_SENDMAILPID 300 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 301 # endif 302 #endif 303 304 305 /* 306 ** NeXTstep 307 */ 308 309 #ifdef NeXT 310 # define HASINITGROUPS 1 /* has initgroups(3) call */ 311 # ifndef HASFLOCK 312 # define HASFLOCK 1 /* has flock(2) call */ 313 # endif 314 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 315 # define WAITUNION 1 /* use "union wait" as wait argument type */ 316 # define sleep sleepX 317 # define setpgid setpgrp 318 # ifndef LA_TYPE 319 # define LA_TYPE LA_MACH 320 # endif 321 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 322 # ifndef _POSIX_SOURCE 323 typedef int pid_t; 324 # undef WEXITSTATUS 325 # undef WIFEXITED 326 # endif 327 # ifndef _PATH_SENDMAILCF 328 # define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf" 329 # endif 330 # ifndef _PATH_SENDMAILPID 331 # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" 332 # endif 333 #endif 334 335 336 /* 337 ** 4.4 BSD 338 ** 339 ** See also BSD defines. 340 */ 341 342 #ifdef BSD4_4 343 # define HASUNSETENV 1 /* has unsetenv(3) call */ 344 # include <sys/cdefs.h> 345 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 346 # ifndef LA_TYPE 347 # define LA_TYPE LA_SUBR 348 # endif 349 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 350 #endif 351 352 353 /* 354 ** BSD/386 (all versions) 355 ** From Tony Sanders, BSDI 356 */ 357 358 #ifdef __bsdi__ 359 # define HASUNSETENV 1 /* has the unsetenv(3) call */ 360 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 361 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 362 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 363 # define HASSETPROCTITLE 1 /* setproctitle is in libc */ 364 # else 365 # define SETPROCTITLE 1 366 # endif 367 # include <sys/cdefs.h> 368 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 369 # ifndef LA_TYPE 370 # define LA_TYPE LA_SUBR 371 # endif 372 #endif 373 374 375 376 /* 377 ** 386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions) 378 ** 379 ** 4.3BSD clone, closer to 4.4BSD 380 ** 381 ** See also BSD defines. 382 */ 383 384 #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__) 385 # define HASUNSETENV 1 /* has unsetenv(3) call */ 386 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 387 # include <sys/cdefs.h> 388 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 389 # ifndef LA_TYPE 390 # define LA_TYPE LA_SUBR 391 # endif 392 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 393 #endif 394 395 396 /* 397 ** Mach386 398 ** 399 ** For mt Xinu's Mach386 system. 400 */ 401 402 #if defined(MACH) && defined(i386) 403 # define MACH386 1 404 # define HASUNSETENV 1 /* has unsetenv(3) call */ 405 # define HASINITGROUPS 1 /* has initgroups(3) call */ 406 # ifdef HASFLOCK 407 # define HASFLOCK 1 /* has flock(2) call */ 408 # endif 409 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 410 # define NEEDSTRTOL 1 /* need the strtol() function */ 411 # define setpgid setpgrp 412 # ifndef LA_TYPE 413 # define LA_TYPE LA_FLOAT 414 # endif 415 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 416 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 417 # undef WEXITSTATUS 418 # undef WIFEXITED 419 # ifndef _PATH_SENDMAILCF 420 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 421 # endif 422 # ifndef _PATH_SENDMAILPID 423 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 424 # endif 425 #endif 426 427 428 /* 429 ** 4.3 BSD -- this is for very old systems 430 ** 431 ** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1. 432 ** 433 ** You'll also have to install a new resolver library. 434 ** I don't guarantee that support for this environment is complete. 435 */ 436 437 #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) 438 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 439 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 440 # define ARBPTR_T char * 441 # define setpgid setpgrp 442 # ifndef LA_TYPE 443 # define LA_TYPE LA_FLOAT 444 # endif 445 # ifndef _PATH_SENDMAILCF 446 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 447 # endif 448 # ifndef IDENTPROTO 449 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 450 # endif 451 # undef WEXITSTATUS 452 # undef WIFEXITED 453 typedef short pid_t; 454 extern int errno; 455 #endif 456 457 458 /* 459 ** SCO Unix 460 ** 461 ** This includes two parts -- the first is for SCO Open Server 3.2v4 462 ** (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). 463 ** The second is, I believe, for an older version. 464 */ 465 466 #ifdef _SCO_unix_4_2 467 # define _SCO_unix_ 468 # define HASSETREUID 1 /* has setreuid(2) call */ 469 # define _PATH_UNIX "/unix" 470 # ifndef _PATH_SENDMAILCF 471 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 472 # endif 473 # ifndef _PATH_SENDMAILPID 474 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 475 # endif 476 #endif 477 478 #ifdef _SCO_unix_ 479 # define SYSTEM5 1 /* include all the System V defines */ 480 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 481 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 482 # define FORK fork 483 # define MAXPATHLEN PATHSIZE 484 # define LA_TYPE LA_SHORT 485 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 486 # undef NETUNIX /* no unix domain socket support */ 487 #endif 488 489 490 /* 491 ** ConvexOS 11.0 and later 492 ** 493 ** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this 494 ** works on 9.1 as well. 495 */ 496 497 #ifdef _CONVEX_SOURCE 498 # define BSD 1 /* include all the BSD defines */ 499 # define HASUNAME 1 /* use System V uname(2) system call */ 500 # define HASSETSID 1 /* has POSIX setsid(2) call */ 501 # define NEEDGETOPT 1 /* need replacement for getopt(3) */ 502 # define LA_TYPE LA_FLOAT 503 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 504 # ifndef _PATH_SENDMAILCF 505 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 506 # endif 507 # ifndef S_IREAD 508 # define S_IREAD _S_IREAD 509 # define S_IWRITE _S_IWRITE 510 # define S_IEXEC _S_IEXEC 511 # define S_IFMT _S_IFMT 512 # define S_IFCHR _S_IFCHR 513 # define S_IFBLK _S_IFBLK 514 # endif 515 # ifndef IDENTPROTO 516 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 517 # endif 518 #endif 519 520 521 /* 522 ** RISC/os 4.52 523 ** 524 ** Gives a ton of warning messages, but otherwise compiles. 525 */ 526 527 #ifdef RISCOS 528 529 # define HASUNSETENV 1 /* has unsetenv(3) call */ 530 # ifdef HASFLOCK 531 # define HASFLOCK 1 /* has flock(2) call */ 532 # endif 533 # define WAITUNION 1 /* use "union wait" as wait argument type */ 534 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 535 # define LA_TYPE LA_INT 536 # define LA_AVENRUN "avenrun" 537 # define _PATH_UNIX "/unix" 538 # undef WIFEXITED 539 540 # define setpgid setpgrp 541 542 extern int errno; 543 typedef int pid_t; 544 #define SIGFUNC_DEFINED 545 typedef int (*sigfunc_t)(); 546 extern char *getenv(); 547 extern void *malloc(); 548 549 #endif 550 551 552 /* 553 ** Linux 0.99pl10 and above... 554 ** From Karl London <karl@borg.demon.co.uk>. 555 */ 556 557 #ifdef __linux__ 558 # define BSD 1 /* pretend to be BSD based today */ 559 # undef NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 560 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 561 # define HASUNSETENV 1 /* has unsetenv(3) call */ 562 # ifndef LA_TYPE 563 # define LA_TYPE LA_FLOAT 564 # endif 565 # include <sys/sysmacros.h> 566 # define GIDSET_T gid_t 567 #endif 568 569 570 /* 571 ** DELL SVR4 Issue 2.2, and others 572 ** From Kimmo Suominen <kim@grendel.lut.fi> 573 ** 574 ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 575 ** defined, and the definitions conflict. 576 ** 577 ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 578 ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 579 ** (SVR4.0/386 version 3.0). 580 */ 581 582 #ifdef DELL_SVR4 583 /* no changes necessary */ 584 /* see general __svr4__ defines below */ 585 #endif 586 587 588 /* 589 ** Apple A/UX 3.0 590 */ 591 592 #ifdef _AUX_SOURCE 593 # include <sys/sysmacros.h> 594 # define BSD /* has BSD routines */ 595 # define HASUNAME 1 /* use System V uname(2) system call */ 596 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 597 # define SIGFUNC_DEFINED /* sigfunc_t already defined */ 598 # ifndef IDENTPROTO 599 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 600 # endif 601 # define FORK fork 602 # ifndef _PATH_SENDMAILCF 603 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 604 # endif 605 # ifndef LA_TYPE 606 # define LA_TYPE LA_ZERO 607 # endif 608 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 609 # undef WIFEXITED 610 # undef WEXITSTATUS 611 #endif 612 613 614 /* 615 ** Encore UMAX V 616 ** 617 ** Not extensively tested. 618 */ 619 620 #ifdef UMAXV 621 # include <limits.h> 622 # define HASUNAME 1 /* use System V uname(2) system call */ 623 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 624 # define HASINITGROUPS 1 /* has initgroups(3) call */ 625 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 626 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 627 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 628 # define FORK fork /* no vfork(2) primitive available */ 629 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 630 # define MAXPATHLEN PATH_MAX 631 extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 632 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 633 # undef WIFEXITED 634 # undef WEXITSTATUS 635 #endif 636 637 638 /* 639 ** Stardent Titan 3000 running TitanOS 4.2. 640 ** 641 ** Must be compiled in "cc -43" mode. 642 ** 643 ** From Kate Hedstrom <kate@ahab.rutgers.edu>. 644 ** 645 ** Note the tweaking below after the BSD defines are set. 646 */ 647 648 #ifdef titan 649 # define setpgid setpgrp 650 typedef int pid_t; 651 # undef WIFEXITED 652 # undef WEXITSTATUS 653 #endif 654 655 656 /* 657 ** Sequent DYNIX 3.2.0 658 ** 659 ** From Jim Davis <jdavis@cs.arizona.edu>. 660 */ 661 662 #ifdef sequent 663 664 # define BSD 1 665 # define HASUNSETENV 1 666 # define BSD4_3 1 /* to get signal() in conf.c */ 667 # define WAITUNION 1 668 # define LA_TYPE LA_FLOAT 669 # ifdef _POSIX_VERSION 670 # undef _POSIX_VERSION /* set in <unistd.h> */ 671 # endif 672 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 673 # define setpgid setpgrp 674 675 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 676 # undef WIFEXITED 677 # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 678 ((union wait*)&(s))->w_termsig == 0) 679 # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 680 typedef int pid_t; 681 # define isgraph(c) (isprint(c) && (c != ' ')) 682 683 # ifndef IDENTPROTO 684 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 685 # endif 686 687 # ifndef _PATH_UNIX 688 # define _PATH_UNIX "/dynix" 689 # endif 690 # ifndef _PATH_SENDMAILCF 691 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 692 # endif 693 694 #endif 695 696 697 /* 698 ** Sequent DYNIX/ptx v2.0 (and higher) 699 ** 700 ** For DYNIX/ptx v1.x, undefine HASSETREUID. 701 ** 702 ** From Tim Wright <timw@sequent.com>. 703 */ 704 705 #ifdef _SEQUENT_ 706 # define SYSTEM5 1 /* include all the System V defines */ 707 # define HASSETSID 1 /* has POSIX setsid(2) call */ 708 # define HASINITGROUPS 1 /* has initgroups(3) call */ 709 # define HASSETREUID 1 /* has setreuid(2) call */ 710 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 711 # define GIDSET_T gid_t 712 # define LA_TYPE LA_INT 713 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 714 # undef SETPROCTITLE 715 # ifndef IDENTPROTO 716 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 717 # endif 718 # ifndef _PATH_SENDMAILCF 719 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 720 # endif 721 # ifndef _PATH_SENDMAILPID 722 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 723 # endif 724 #endif 725 726 727 /* 728 ** Cray Unicos 729 ** 730 ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 731 */ 732 733 #ifdef UNICOS 734 # define SYSTEM5 1 /* include all the System V defines */ 735 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 736 # define MAXPATHLEN PATHSIZE 737 # define LA_TYPE LA_ZERO 738 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 739 #endif 740 741 742 /* 743 ** Apollo DomainOS 744 ** 745 ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com> 746 ** 747 ** 15 Jan 1994 748 ** 749 */ 750 751 #ifdef apollo 752 # define HASSETREUID 1 /* has setreuid(2) call */ 753 # define HASINITGROUPS 1 /* has initgroups(2) call */ 754 # undef SETPROCTITLE 755 # define LA_TYPE LA_SUBR /* use getloadavg.c */ 756 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 757 # ifndef _PATH_SENDMAILCF 758 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 759 # endif 760 # ifndef _PATH_SENDMAILPID 761 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 762 # endif 763 # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ 764 # undef S_IFIFO 765 # define S_IFIFO 0010000 766 # ifndef IDENTPROTO 767 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 768 # endif 769 #endif 770 771 772 773 774 /********************************************************************** 775 ** End of Per-Operating System defines 776 **********************************************************************/ 777 778 /********************************************************************** 779 ** More general defines 780 **********************************************************************/ 781 782 /* general BSD defines */ 783 #ifdef BSD 784 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 785 # define HASSETREUID 1 /* has setreuid(2) call */ 786 # define HASINITGROUPS 1 /* has initgroups(2) call */ 787 # ifndef HASFLOCK 788 # define HASFLOCK 1 /* has flock(2) call */ 789 # endif 790 #endif 791 792 /* general System V Release 4 defines */ 793 #ifdef __svr4__ 794 # define SYSTEM5 1 795 # define HASSETREUID 1 /* has seteuid(2) call & working saved uids */ 796 # ifndef HASGETUSERSHELL 797 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 798 # endif 799 # define setreuid(r, e) seteuid(e) 800 801 # ifndef _PATH_UNIX 802 # define _PATH_UNIX "/unix" 803 # endif 804 # ifndef _PATH_SENDMAILCF 805 # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 806 # endif 807 # ifndef _PATH_SENDMAILPID 808 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 809 # endif 810 # ifndef SYSLOG_BUFSIZE 811 # define SYSLOG_BUFSIZE 128 812 # endif 813 #endif 814 815 /* general System V defines */ 816 # ifdef SYSTEM5 817 # include <sys/sysmacros.h> 818 # define HASUNAME 1 /* use System V uname(2) system call */ 819 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 820 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 821 # ifndef LA_TYPE 822 # define LA_TYPE LA_INT /* assume integer load average */ 823 # endif 824 # ifndef SFS_TYPE 825 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 826 # endif 827 # define bcopy(s, d, l) (memmove((d), (s), (l))) 828 # define bzero(d, l) (memset((d), '\0', (l))) 829 # define bcmp(s, d, l) (memcmp((s), (d), (l))) 830 # endif 831 832 /* general POSIX defines */ 833 #ifdef _POSIX_VERSION 834 # define HASSETSID 1 /* has Posix setsid(2) call */ 835 # define HASWAITPID 1 /* has Posix waitpid(2) call */ 836 #endif 837 838 /* 839 ** If no type for argument two of getgroups call is defined, assume 840 ** it's an integer -- unfortunately, there seem to be several choices 841 ** here. 842 */ 843 844 #ifndef GIDSET_T 845 # define GIDSET_T int 846 #endif 847 848 /* 849 ** Tweaking for systems that (for example) claim to be BSD but 850 ** don't have all the standard BSD routines (boo hiss). 851 */ 852 853 #ifdef titan 854 # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 855 #endif 856 857 858 /* 859 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 860 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 861 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 862 ** are closed. Some firewalls return this error if you try to connect 863 ** to the IDENT port (113), so you can't receive email from these hosts 864 ** on these systems. The firewall really should use a more specific 865 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If 866 ** not explicitly set to zero above, default it on. 867 */ 868 869 #ifndef IDENTPROTO 870 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 871 #endif 872 873 #ifndef HASGETUSERSHELL 874 # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 875 #endif 876 877 #ifndef HASFLOCK 878 # define HASFLOCK 0 /* assume no flock(2) support */ 879 #endif 880 881 882 /********************************************************************** 883 ** Remaining definitions should never have to be changed. They are 884 ** primarily to provide back compatibility for older systems -- for 885 ** example, it includes some POSIX compatibility definitions 886 **********************************************************************/ 887 888 /* System 5 compatibility */ 889 #ifndef S_ISREG 890 # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 891 #endif 892 #if !defined(S_ISLNK) && defined(S_IFLNK) 893 # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 894 #endif 895 #ifndef S_IWGRP 896 #define S_IWGRP 020 897 #endif 898 #ifndef S_IWOTH 899 #define S_IWOTH 002 900 #endif 901 902 /* 903 ** Older systems don't have this error code -- it should be in 904 ** /usr/include/sysexits.h. 905 */ 906 907 # ifndef EX_CONFIG 908 # define EX_CONFIG 78 /* configuration error */ 909 # endif 910 911 /* pseudo-code used in server SMTP */ 912 # define EX_QUIT 22 /* drop out of server immediately */ 913 914 915 /* 916 ** These are used in a few cases where we need some special 917 ** error codes, but where the system doesn't provide something 918 ** reasonable. They are printed in errstring. 919 */ 920 921 #ifndef E_PSEUDOBASE 922 # define E_PSEUDOBASE 256 923 #endif 924 925 #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 926 #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 927 928 /* type of arbitrary pointer */ 929 #ifndef ARBPTR_T 930 # define ARBPTR_T void * 931 #endif 932 933 #ifndef __P 934 # include "cdefs.h" 935 #endif 936 937 /* 938 ** Do some required dependencies 939 */ 940 941 #if defined(NETINET) || defined(NETISO) 942 # define SMTP 1 /* enable user and server SMTP */ 943 # define QUEUE 1 /* enable queueing */ 944 # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 945 #endif 946 947 948 /* 949 ** Arrange to use either varargs or stdargs 950 */ 951 952 # ifdef __STDC__ 953 954 # include <stdarg.h> 955 956 # define VA_LOCAL_DECL va_list ap; 957 # define VA_START(f) va_start(ap, f) 958 # define VA_END va_end(ap) 959 960 # else 961 962 # include <varargs.h> 963 964 # define VA_LOCAL_DECL va_list ap; 965 # define VA_START(f) va_start(ap) 966 # define VA_END va_end(ap) 967 968 # endif 969 970 #ifdef HASUNAME 971 # include <sys/utsname.h> 972 # ifdef newstr 973 # undef newstr 974 # endif 975 #else /* ! HASUNAME */ 976 # define NODE_LENGTH 32 977 struct utsname 978 { 979 char nodename[NODE_LENGTH+1]; 980 }; 981 #endif /* HASUNAME */ 982 983 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) 984 # define MAXHOSTNAMELEN 256 985 #endif 986 987 #if !defined(SIGCHLD) && defined(SIGCLD) 988 # define SIGCHLD SIGCLD 989 #endif 990 991 #ifndef STDIN_FILENO 992 #define STDIN_FILENO 0 993 #endif 994 995 #ifndef STDOUT_FILENO 996 #define STDOUT_FILENO 1 997 #endif 998 999 #ifndef STDERR_FILENO 1000 #define STDERR_FILENO 2 1001 #endif 1002 1003 #ifndef LOCK_SH 1004 # define LOCK_SH 0x01 /* shared lock */ 1005 # define LOCK_EX 0x02 /* exclusive lock */ 1006 # define LOCK_NB 0x04 /* non-blocking lock */ 1007 # define LOCK_UN 0x08 /* unlock */ 1008 #endif 1009 1010 #ifndef SIG_ERR 1011 # define SIG_ERR ((void (*)()) -1) 1012 #endif 1013 1014 #ifndef WEXITSTATUS 1015 # define WEXITSTATUS(st) (((st) >> 8) & 0377) 1016 #endif 1017 #ifndef WIFEXITED 1018 # define WIFEXITED(st) (((st) & 0377) == 0) 1019 #endif 1020 1021 #ifndef SIGFUNC_DEFINED 1022 typedef void (*sigfunc_t) __P((int)); 1023 #endif 1024 1025 /* size of syslog buffer */ 1026 #ifndef SYSLOG_BUFSIZE 1027 # define SYSLOG_BUFSIZE 1024 1028 #endif 1029 1030 /* 1031 ** Size of tobuf (deliver.c) 1032 ** Tweak this to match your syslog implementation. It will have to 1033 ** allow for the extra information printed. 1034 */ 1035 1036 #ifndef TOBUFSIZE 1037 # if (SYSLOG_BUFSIZE) > 512 1038 # define TOBUFSIZE (SYSLOG_BUFSIZE - 256) 1039 # else 1040 # define TOBUFSIZE 256 1041 # endif 1042 #endif 1043 1044 /* 1045 ** Size of prescan buffer. 1046 ** Despite comments in the _sendmail_ book, this probably should 1047 ** not be changed; there are some hard-to-define dependencies. 1048 */ 1049 1050 # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 1051 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 1052 # ifndef FORK 1053 # define FORK vfork /* function to call to fork mailer */ 1054 # endif 1055 1056 /* 1057 ** If we are going to link scanf anyway, use it in readcf 1058 */ 1059 1060 #if !defined(HASUNAME) && !defined(SCANF) 1061 # define SCANF 1 1062 #endif 1063