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