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.110 (Berkeley) 06/19/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 MATCHGECOS 1 /* match user names from gecos field */ 58 # define XDEBUG 1 /* enable extended debugging */ 59 # ifdef NEWDB 60 # define USERDB 1 /* look in user database (requires NEWDB) */ 61 # endif 62 63 /********************************************************************** 64 ** 0/1 Compilation options. 65 ** #define these to 1 if they are available; 66 ** #define them to 0 otherwise. 67 **********************************************************************/ 68 69 # ifndef NAMED_BIND 70 # define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ 71 # endif 72 73 /* 74 ** Most systems have symbolic links today, so default them on. You 75 ** can turn them off by #undef'ing this below. 76 */ 77 78 # define HASLSTAT 1 /* has lstat(2) call */ 79 80 /* 81 ** General "standard C" defines. 82 ** 83 ** These may be undone later, to cope with systems that claim to 84 ** be Standard C but aren't. Gcc is the biggest offender -- it 85 ** doesn't realize that the library is part of the language. 86 ** 87 ** Life would be much easier if we could get rid of this sort 88 ** of bozo problems. 89 */ 90 91 #ifdef __STDC__ 92 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 93 #endif 94 95 /********************************************************************** 96 ** Operating system configuration. 97 ** 98 ** Unless you are porting to a new OS, you shouldn't have to 99 ** change these. 100 **********************************************************************/ 101 102 /* 103 ** Per-Operating System defines 104 */ 105 106 107 /* 108 ** HP-UX -- tested for 8.07, 9.00, and 9.01. 109 */ 110 111 # ifdef __hpux 112 /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */ 113 # undef m_flags 114 # define SYSTEM5 1 /* include all the System V defines */ 115 # define HASINITGROUPS 1 /* has initgroups(3) call */ 116 # define HASSETREUID 1 /* has setreuid(2) call */ 117 # define setreuid(r, e) setresuid(r, e, -1) 118 # define LA_TYPE LA_FLOAT 119 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 120 # define GIDSET_T gid_t 121 # define _PATH_UNIX "/hp-ux" 122 # ifndef _PATH_SENDMAILCF 123 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 124 # endif 125 # ifndef IDENTPROTO 126 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 127 # endif 128 # ifndef HASGETUSERSHELL 129 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 130 # endif 131 # define syslog hard_syslog 132 # ifdef __STDC__ 133 extern int syslog(int, char *, ...); 134 # endif 135 # endif 136 137 138 /* 139 ** IBM AIX 3.x -- actually tested for 3.2.3 140 */ 141 142 # ifdef _AIX3 143 # define HASINITGROUPS 1 /* has initgroups(3) call */ 144 # define HASUNAME 1 /* use System V uname(2) system call */ 145 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 146 # define FORK fork /* no vfork primitive available */ 147 # undef SETPROCTITLE /* setproctitle confuses AIX */ 148 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 149 # endif 150 151 152 /* 153 ** Silicon Graphics IRIX 154 ** 155 ** Compiles on 4.0.1. 156 */ 157 158 # ifdef IRIX 159 # define SYSTEM5 1 /* this is a System-V derived system */ 160 # define HASSETREUID 1 /* has setreuid(2) call */ 161 # define HASINITGROUPS 1 /* has initgroups(3) call */ 162 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 163 # define FORK fork /* no vfork primitive available */ 164 # define WAITUNION 1 /* use "union wait" as wait argument type */ 165 # define setpgid BSDsetpgrp 166 # define GIDSET_T gid_t 167 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 168 # define LA_TYPE LA_INT 169 # endif 170 171 172 /* 173 ** SunOS and Solaris 174 ** 175 ** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and 176 ** Solaris 2.2 (a.k.a. SunOS 5.2). 177 */ 178 179 #if defined(sun) && !defined(BSD) 180 181 # define HASINITGROUPS 1 /* has initgroups(3) call */ 182 # define HASUNAME 1 /* use System V uname(2) system call */ 183 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 184 # define LA_TYPE LA_INT 185 186 # ifdef SOLARIS_2_3 187 # define SOLARIS 188 # endif 189 190 # ifdef SOLARIS 191 /* Solaris 2.x (a.k.a. SunOS 5.x) */ 192 # ifndef __svr4__ 193 # define __svr4__ /* use all System V Releae 4 defines below */ 194 # endif 195 # include <sys/time.h> 196 # define gethostbyname solaris_gethostbyname /* get working version */ 197 # define gethostbyaddr solaris_gethostbyaddr /* get working version */ 198 # define GIDSET_T gid_t 199 # ifndef _PATH_UNIX 200 # define _PATH_UNIX "/dev/ksyms" 201 # endif 202 # ifndef _PATH_SENDMAILCF 203 # define _PATH_SENDMAILCF "/etc/mail/sendmail.cf" 204 # endif 205 # ifndef _PATH_SENDMAILPID 206 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 207 # endif 208 # ifndef SYSLOG_BUFSIZE 209 # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 210 # endif 211 212 # else 213 /* SunOS 4.0.3 or 4.1.x */ 214 # define HASSETREUID 1 /* has setreuid(2) call */ 215 # ifndef HASFLOCK 216 # define HASFLOCK 1 /* has flock(2) call */ 217 # endif 218 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 219 # include <vfork.h> 220 221 # ifdef SUNOS403 222 /* special tweaking for SunOS 4.0.3 */ 223 # include <malloc.h> 224 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 225 # define WAITUNION 1 /* use "union wait" as wait argument type */ 226 # undef WIFEXITED 227 # undef WEXITSTATUS 228 # undef HASUNAME 229 # define setpgid setpgrp 230 typedef int pid_t; 231 extern char *getenv(); 232 233 # else 234 /* 4.1.x specifics */ 235 # define HASSETSID 1 /* has Posix setsid(2) call */ 236 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 237 238 # endif 239 # endif 240 #endif 241 242 /* 243 ** DG/UX 244 ** 245 ** Tested on 5.4.2 and 5.4.3. Use DGUX_5_4_2 to get the 246 ** older support. 247 ** 5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>. 248 */ 249 250 #ifdef DGUX_5_4_2 251 # define DGUX 1 252 #endif 253 254 #ifdef DGUX 255 # define SYSTEM5 1 256 # define LA_TYPE LA_SUBR 257 # define HASSETREUID 1 /* has setreuid(2) call */ 258 # define HASUNAME 1 /* use System V uname(2) system call */ 259 # define HASSETSID 1 /* has Posix setsid(2) call */ 260 # define HASINITGROUPS 1 /* has initgroups(3) call */ 261 # define HASGETUSERSHELL 0 /* does not have getusershell(3) */ 262 # ifndef IDENTPROTO 263 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 264 # endif 265 # undef SETPROCTITLE 266 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 267 268 /* these include files must be included early on DG/UX */ 269 # include <netinet/in.h> 270 # include <arpa/inet.h> 271 272 # ifdef DGUX_5_4_2 273 # define inet_addr dgux_inet_addr 274 extern long dgux_inet_addr(); 275 # endif 276 #endif 277 278 279 /* 280 ** Digital Ultrix 4.2A or 4.3 281 ** 282 ** Apparently, fcntl locking is broken on 4.2A, in that locks are 283 ** not dropped when the process exits. This causes major problems, 284 ** so flock is the only alternative. 285 */ 286 287 #ifdef ultrix 288 # define HASSETREUID 1 /* has setreuid(2) call */ 289 # define HASUNSETENV 1 /* has unsetenv(3) call */ 290 # define HASINITGROUPS 1 /* has initgroups(3) call */ 291 # define HASUNAME 1 /* use System V uname(2) system call */ 292 # ifndef HASFLOCK 293 # define HASFLOCK 1 /* has flock(2) call */ 294 # endif 295 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 296 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 297 # ifdef vax 298 # define LA_TYPE LA_FLOAT 299 # else 300 # define LA_TYPE LA_INT 301 # define LA_AVENRUN "avenrun" 302 # endif 303 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 304 # ifndef IDENTPROTO 305 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 306 # endif 307 #endif 308 309 310 /* 311 ** OSF/1 (tested on Alpha) 312 */ 313 314 #ifdef __osf__ 315 # define HASUNSETENV 1 /* has unsetenv(3) call */ 316 # define HASSETREUID 1 /* has setreuid(2) call */ 317 # define HASINITGROUPS 1 /* has initgroups(3) call */ 318 # ifndef HASFLOCK 319 # define HASFLOCK 1 /* has flock(2) call */ 320 # endif 321 # define LA_TYPE LA_INT 322 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 323 # ifndef _PATH_SENDMAILPID 324 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 325 # endif 326 #endif 327 328 329 /* 330 ** NeXTstep 331 */ 332 333 #ifdef NeXT 334 # define HASINITGROUPS 1 /* has initgroups(3) call */ 335 # ifndef HASFLOCK 336 # define HASFLOCK 1 /* has flock(2) call */ 337 # endif 338 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 339 # define WAITUNION 1 /* use "union wait" as wait argument type */ 340 # define sleep sleepX 341 # define setpgid setpgrp 342 # ifndef LA_TYPE 343 # define LA_TYPE LA_MACH 344 # endif 345 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 346 # ifndef _POSIX_SOURCE 347 typedef int pid_t; 348 # undef WEXITSTATUS 349 # undef WIFEXITED 350 # endif 351 # ifndef _PATH_SENDMAILCF 352 # define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf" 353 # endif 354 # ifndef _PATH_SENDMAILPID 355 # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" 356 # endif 357 #endif 358 359 360 /* 361 ** 4.4 BSD 362 ** 363 ** See also BSD defines. 364 */ 365 366 #ifdef BSD4_4 367 # define HASUNSETENV 1 /* has unsetenv(3) call */ 368 # include <sys/cdefs.h> 369 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 370 # ifndef LA_TYPE 371 # define LA_TYPE LA_SUBR 372 # endif 373 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 374 #endif 375 376 377 /* 378 ** BSD/386 (all versions) 379 ** From Tony Sanders, BSDI 380 */ 381 382 #ifdef __bsdi__ 383 # define HASUNSETENV 1 /* has the unsetenv(3) call */ 384 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 385 # include <sys/cdefs.h> 386 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 387 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 388 # ifndef LA_TYPE 389 # define LA_TYPE LA_SUBR 390 # endif 391 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 392 /* version 1.1 or later */ 393 # define HASSETPROCTITLE 1 /* setproctitle is in libc */ 394 # undef SETPROCTITLE /* so don't redefine it in conf.c */ 395 # else 396 /* version 1.0 or earlier */ 397 # ifndef OLD_NEWDB 398 # define OLD_NEWDB 1 /* old version of newdb library */ 399 # endif 400 # endif 401 #endif 402 403 404 405 /* 406 ** 386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions) 407 ** 408 ** 4.3BSD clone, closer to 4.4BSD 409 ** 410 ** See also BSD defines. 411 */ 412 413 #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__) 414 # define HASUNSETENV 1 /* has unsetenv(3) call */ 415 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 416 # ifdef __NetBSD__ 417 # define HASUNAME 1 /* has uname(2) syscall */ 418 # endif 419 # include <sys/cdefs.h> 420 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 421 # ifndef LA_TYPE 422 # define LA_TYPE LA_SUBR 423 # endif 424 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 425 #endif 426 427 428 /* 429 ** Mach386 430 ** 431 ** For mt Xinu's Mach386 system. 432 */ 433 434 #if defined(MACH) && defined(i386) 435 # define MACH386 1 436 # define HASUNSETENV 1 /* has unsetenv(3) call */ 437 # define HASINITGROUPS 1 /* has initgroups(3) call */ 438 # ifndef HASFLOCK 439 # define HASFLOCK 1 /* has flock(2) call */ 440 # endif 441 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 442 # define NEEDSTRTOL 1 /* need the strtol() function */ 443 # define setpgid setpgrp 444 # ifndef LA_TYPE 445 # define LA_TYPE LA_FLOAT 446 # endif 447 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 448 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 449 # undef WEXITSTATUS 450 # undef WIFEXITED 451 # ifndef _PATH_SENDMAILCF 452 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 453 # endif 454 # ifndef _PATH_SENDMAILPID 455 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 456 # endif 457 #endif 458 459 460 /* 461 ** 4.3 BSD -- this is for very old systems 462 ** 463 ** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1. 464 ** 465 ** You'll also have to install a new resolver library. 466 ** I don't guarantee that support for this environment is complete. 467 */ 468 469 #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) 470 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 471 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 472 # define ARBPTR_T char * 473 # define setpgid setpgrp 474 # ifndef LA_TYPE 475 # define LA_TYPE LA_FLOAT 476 # endif 477 # ifndef _PATH_SENDMAILCF 478 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 479 # endif 480 # ifndef IDENTPROTO 481 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 482 # endif 483 # undef WEXITSTATUS 484 # undef WIFEXITED 485 typedef short pid_t; 486 extern int errno; 487 #endif 488 489 490 /* 491 ** SCO Unix 492 ** 493 ** This includes two parts -- the first is for SCO Open Server 3.2v4 494 ** (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). 495 ** The second is, I believe, for an older version. 496 */ 497 498 #ifdef _SCO_unix_4_2 499 # define _SCO_unix_ 500 # define HASSETREUID 1 /* has setreuid(2) call */ 501 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 502 # define _PATH_UNIX "/unix" 503 # ifndef _PATH_SENDMAILCF 504 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 505 # endif 506 # ifndef _PATH_SENDMAILPID 507 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 508 # endif 509 #endif 510 511 #ifdef _SCO_unix_ 512 # define SYSTEM5 1 /* include all the System V defines */ 513 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 514 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 515 # define FORK fork 516 # define MAXPATHLEN PATHSIZE 517 # define LA_TYPE LA_SHORT 518 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 519 # undef NETUNIX /* no unix domain socket support */ 520 #endif 521 522 523 /* 524 ** ConvexOS 11.0 and later 525 ** 526 ** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this 527 ** works on 9.1 as well. 528 */ 529 530 #ifdef _CONVEX_SOURCE 531 # define BSD 1 /* include all the BSD defines */ 532 # define HASUNAME 1 /* use System V uname(2) system call */ 533 # define HASSETSID 1 /* has POSIX setsid(2) call */ 534 # define NEEDGETOPT 1 /* need replacement for getopt(3) */ 535 # define LA_TYPE LA_FLOAT 536 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 537 # ifndef _PATH_SENDMAILCF 538 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 539 # endif 540 # ifndef S_IREAD 541 # define S_IREAD _S_IREAD 542 # define S_IWRITE _S_IWRITE 543 # define S_IEXEC _S_IEXEC 544 # define S_IFMT _S_IFMT 545 # define S_IFCHR _S_IFCHR 546 # define S_IFBLK _S_IFBLK 547 # endif 548 # ifndef IDENTPROTO 549 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 550 # endif 551 #endif 552 553 554 /* 555 ** RISC/os 4.52 556 ** 557 ** Gives a ton of warning messages, but otherwise compiles. 558 */ 559 560 #ifdef RISCOS 561 562 # define HASUNSETENV 1 /* has unsetenv(3) call */ 563 # ifndef HASFLOCK 564 # define HASFLOCK 1 /* has flock(2) call */ 565 # endif 566 # define WAITUNION 1 /* use "union wait" as wait argument type */ 567 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 568 # define LA_TYPE LA_INT 569 # define LA_AVENRUN "avenrun" 570 # define _PATH_UNIX "/unix" 571 # undef WIFEXITED 572 573 # define setpgid setpgrp 574 575 extern int errno; 576 typedef int pid_t; 577 #define SIGFUNC_DEFINED 578 typedef int (*sigfunc_t)(); 579 extern char *getenv(); 580 extern void *malloc(); 581 582 #endif 583 584 585 /* 586 ** Linux 0.99pl10 and above... 587 ** 588 ** Thanks to, in reverse order of contact: 589 ** 590 ** John Kennedy <warlock@csuchico.edu> 591 ** Florian La Roche <rzsfl@rz.uni-sb.de> 592 ** Karl London <karl@borg.demon.co.uk> 593 ** 594 ** Last compiled against: [03/02/94 @ 05:34 PM (Wednesday)] 595 ** sendmail 8.6.6.b9 named 4.9.2-931205-p1 db-1.73 596 ** gcc 2.5.8 libc.so.4.5.19 597 ** slackware 1.1.2 linux 0.99.15 598 */ 599 600 #ifdef __linux__ 601 # define BSD 1 /* include BSD defines */ 602 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 603 # define HASUNAME 1 /* use System V uname(2) system call */ 604 # define HASUNSETENV 1 /* has unsetenv(3) call */ 605 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 606 # define GIDSET_T gid_t /* from <linux/types.h> */ 607 # ifndef LA_TYPE 608 # define LA_TYPE LA_PROCSTR 609 # endif 610 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */ 611 # include <sys/sysmacros.h> 612 # undef atol /* wounded in <stdlib.h> */ 613 #endif 614 615 616 /* 617 ** DELL SVR4 Issue 2.2, and others 618 ** From Kimmo Suominen <kim@grendel.lut.fi> 619 ** 620 ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 621 ** defined, and the definitions conflict. 622 ** 623 ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 624 ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 625 ** (SVR4.0/386 version 3.0). 626 */ 627 628 #ifdef DELL_SVR4 629 /* no changes necessary */ 630 /* see general __svr4__ defines below */ 631 #endif 632 633 634 /* 635 ** Apple A/UX 3.0 636 */ 637 638 #ifdef _AUX_SOURCE 639 # include <sys/sysmacros.h> 640 # define BSD /* has BSD routines */ 641 # define HASUNAME 1 /* use System V uname(2) system call */ 642 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 643 # define SIGFUNC_DEFINED /* sigfunc_t already defined */ 644 # ifndef IDENTPROTO 645 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 646 # endif 647 # define FORK fork 648 # ifndef _PATH_SENDMAILCF 649 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 650 # endif 651 # ifndef LA_TYPE 652 # define LA_TYPE LA_ZERO 653 # endif 654 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 655 # undef WIFEXITED 656 # undef WEXITSTATUS 657 #endif 658 659 660 /* 661 ** Encore UMAX V 662 ** 663 ** Not extensively tested. 664 */ 665 666 #ifdef UMAXV 667 # include <limits.h> 668 # define HASUNAME 1 /* use System V uname(2) system call */ 669 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 670 # define HASINITGROUPS 1 /* has initgroups(3) call */ 671 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 672 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 673 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 674 # define FORK fork /* no vfork(2) primitive available */ 675 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 676 # define MAXPATHLEN PATH_MAX 677 extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 678 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 679 # undef WIFEXITED 680 # undef WEXITSTATUS 681 #endif 682 683 684 /* 685 ** Stardent Titan 3000 running TitanOS 4.2. 686 ** 687 ** Must be compiled in "cc -43" mode. 688 ** 689 ** From Kate Hedstrom <kate@ahab.rutgers.edu>. 690 ** 691 ** Note the tweaking below after the BSD defines are set. 692 */ 693 694 #ifdef titan 695 # define setpgid setpgrp 696 typedef int pid_t; 697 # undef WIFEXITED 698 # undef WEXITSTATUS 699 #endif 700 701 702 /* 703 ** Sequent DYNIX 3.2.0 704 ** 705 ** From Jim Davis <jdavis@cs.arizona.edu>. 706 */ 707 708 #ifdef sequent 709 710 # define BSD 1 711 # define HASUNSETENV 1 712 # define BSD4_3 1 /* to get signal() in conf.c */ 713 # define WAITUNION 1 714 # define LA_TYPE LA_FLOAT 715 # ifdef _POSIX_VERSION 716 # undef _POSIX_VERSION /* set in <unistd.h> */ 717 # endif 718 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 719 # define setpgid setpgrp 720 721 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 722 # undef WIFEXITED 723 # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 724 ((union wait*)&(s))->w_termsig == 0) 725 # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 726 typedef int pid_t; 727 # define isgraph(c) (isprint(c) && (c != ' ')) 728 729 # ifndef IDENTPROTO 730 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 731 # endif 732 733 # ifndef _PATH_UNIX 734 # define _PATH_UNIX "/dynix" 735 # endif 736 # ifndef _PATH_SENDMAILCF 737 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 738 # endif 739 740 #endif 741 742 743 /* 744 ** Sequent DYNIX/ptx v2.0 (and higher) 745 ** 746 ** For DYNIX/ptx v1.x, undefine HASSETREUID. 747 ** 748 ** From Tim Wright <timw@sequent.com>. 749 */ 750 751 #ifdef _SEQUENT_ 752 # define SYSTEM5 1 /* include all the System V defines */ 753 # define HASSETSID 1 /* has POSIX setsid(2) call */ 754 # define HASINITGROUPS 1 /* has initgroups(3) call */ 755 # define HASSETREUID 1 /* has setreuid(2) call */ 756 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 757 # define GIDSET_T gid_t 758 # define LA_TYPE LA_INT 759 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 760 # undef SETPROCTITLE 761 # ifndef IDENTPROTO 762 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 763 # endif 764 # ifndef _PATH_SENDMAILCF 765 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 766 # endif 767 # ifndef _PATH_SENDMAILPID 768 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 769 # endif 770 #endif 771 772 773 /* 774 ** Cray Unicos 775 ** 776 ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 777 */ 778 779 #ifdef UNICOS 780 # define SYSTEM5 1 /* include all the System V defines */ 781 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 782 # define MAXPATHLEN PATHSIZE 783 # define LA_TYPE LA_ZERO 784 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 785 #endif 786 787 788 /* 789 ** Apollo DomainOS 790 ** 791 ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com> 792 ** 793 ** 15 Jan 1994 794 ** 795 */ 796 797 #ifdef apollo 798 # define HASSETREUID 1 /* has setreuid(2) call */ 799 # define HASINITGROUPS 1 /* has initgroups(2) call */ 800 # undef SETPROCTITLE 801 # define LA_TYPE LA_SUBR /* use getloadavg.c */ 802 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 803 # ifndef _PATH_SENDMAILCF 804 # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 805 # endif 806 # ifndef _PATH_SENDMAILPID 807 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 808 # endif 809 # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ 810 # undef S_IFIFO 811 # define S_IFIFO 0010000 812 # ifndef IDENTPROTO 813 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 814 # endif 815 #endif 816 817 818 /* 819 ** UnixWare 820 ** 821 ** From Evan Champion <evanc@spatial.synapse.org>. 822 */ 823 824 #ifdef UNIXWARE 825 # define SYSTEM5 1 826 # ifndef HASGETUSERSHELL 827 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 828 # endif 829 # define GIDSET_T int 830 # define SLEEP_T int 831 # define SFS_TYPE SFS_STATVFS 832 # define LA_TYPE LA_ZERO 833 # undef WIFEXITED 834 # undef WEXITSTATUS 835 # define _PATH_UNIX "/unix" 836 # ifndef _PATH_SENDMAILCF 837 # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 838 # endif 839 # ifndef _PATH_SENDMAILPID 840 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 841 # endif 842 # define SYSLOG_BUFSIZE 128 843 #endif 844 845 846 /* 847 ** Intergraph CLIX 3.1 848 ** 849 ** From Paul Southworth <pauls@locust.cic.net> 850 */ 851 852 #ifdef CLIX 853 # define SYSTEM5 1 /* looks like System V */ 854 # ifndef HASGETUSERSHELL 855 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 856 # endif 857 # define DEV_BSIZE 512 /* device block size not defined */ 858 # define GIDSET_T gid_t 859 # undef LOG /* syslog not available */ 860 # define NEEDFSYNC 1 /* no fsync in system library */ 861 # define GETSHORT _getshort 862 #endif 863 864 865 /* 866 ** NCR 3000 Series (SysVr4) 867 ** 868 ** From From: Kevin Darcy <kevin@tech.mis.cfc.com>. 869 */ 870 871 #ifdef NCR3000 872 # define __svr4__ 873 # undef BSD 874 # define LA_AVENRUN "avenrun" 875 #endif 876 877 878 879 880 881 /********************************************************************** 882 ** End of Per-Operating System defines 883 **********************************************************************/ 884 885 /********************************************************************** 886 ** More general defines 887 **********************************************************************/ 888 889 /* general BSD defines */ 890 #ifdef BSD 891 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 892 # define HASSETREUID 1 /* has setreuid(2) call */ 893 # define HASINITGROUPS 1 /* has initgroups(2) call */ 894 # ifndef HASSETRLIMIT 895 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 896 # endif 897 # ifndef HASFLOCK 898 # define HASFLOCK 1 /* has flock(2) call */ 899 # endif 900 #endif 901 902 /* general System V Release 4 defines */ 903 #ifdef __svr4__ 904 # define SYSTEM5 1 905 # define HASSETREUID 1 /* has seteuid(2) call & working saved uids */ 906 # ifndef HASGETUSERSHELL 907 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 908 # endif 909 # define setreuid(r, e) seteuid(e) 910 911 # ifndef _PATH_UNIX 912 # define _PATH_UNIX "/unix" 913 # endif 914 # ifndef _PATH_SENDMAILCF 915 # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 916 # endif 917 # ifndef _PATH_SENDMAILPID 918 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 919 # endif 920 # ifndef SYSLOG_BUFSIZE 921 # define SYSLOG_BUFSIZE 128 922 # endif 923 # ifndef SFS_TYPE 924 # define SFS_TYPE SFS_STATVFS 925 # endif 926 #endif 927 928 /* general System V defines */ 929 #ifdef SYSTEM5 930 # include <sys/sysmacros.h> 931 # define HASUNAME 1 /* use System V uname(2) system call */ 932 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 933 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 934 # ifndef HASULIMIT 935 # define HASULIMIT 1 /* has the ulimit(2) syscall */ 936 # endif 937 # ifndef LA_TYPE 938 # define LA_TYPE LA_INT /* assume integer load average */ 939 # endif 940 # ifndef SFS_TYPE 941 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 942 # endif 943 # define bcopy(s, d, l) (memmove((d), (s), (l))) 944 # define bzero(d, l) (memset((d), '\0', (l))) 945 # define bcmp(s, d, l) (memcmp((s), (d), (l))) 946 #endif 947 948 /* general POSIX defines */ 949 #ifdef _POSIX_VERSION 950 # define HASSETSID 1 /* has Posix setsid(2) call */ 951 # define HASWAITPID 1 /* has Posix waitpid(2) call */ 952 #endif 953 954 /* 955 ** If no type for argument two of getgroups call is defined, assume 956 ** it's an integer -- unfortunately, there seem to be several choices 957 ** here. 958 */ 959 960 #ifndef GIDSET_T 961 # define GIDSET_T int 962 #endif 963 964 /* 965 ** Tweaking for systems that (for example) claim to be BSD but 966 ** don't have all the standard BSD routines (boo hiss). 967 */ 968 969 #ifdef titan 970 # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 971 #endif 972 973 974 /* 975 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 976 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 977 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 978 ** are closed. Some firewalls return this error if you try to connect 979 ** to the IDENT port (113), so you can't receive email from these hosts 980 ** on these systems. The firewall really should use a more specific 981 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If 982 ** not explicitly set to zero above, default it on. 983 */ 984 985 #ifndef IDENTPROTO 986 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 987 #endif 988 989 #ifndef HASGETUSERSHELL 990 # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 991 #endif 992 993 #ifndef HASFLOCK 994 # define HASFLOCK 0 /* assume no flock(2) support */ 995 #endif 996 997 #ifndef HASSETRLIMIT 998 # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */ 999 #endif 1000 1001 #ifndef HASULIMIT 1002 # define HASULIMIT 0 /* assume no ulimit(2) support */ 1003 #endif 1004 1005 #ifndef OLD_NEWDB 1006 # define OLD_NEWDB 0 /* assume newer version of newdb */ 1007 #endif 1008 1009 1010 /********************************************************************** 1011 ** Remaining definitions should never have to be changed. They are 1012 ** primarily to provide back compatibility for older systems -- for 1013 ** example, it includes some POSIX compatibility definitions 1014 **********************************************************************/ 1015 1016 /* System 5 compatibility */ 1017 #ifndef S_ISREG 1018 # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 1019 #endif 1020 #if !defined(S_ISLNK) && defined(S_IFLNK) 1021 # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 1022 #endif 1023 #ifndef S_IWGRP 1024 #define S_IWGRP 020 1025 #endif 1026 #ifndef S_IWOTH 1027 #define S_IWOTH 002 1028 #endif 1029 1030 /* 1031 ** Older systems don't have this error code -- it should be in 1032 ** /usr/include/sysexits.h. 1033 */ 1034 1035 # ifndef EX_CONFIG 1036 # define EX_CONFIG 78 /* configuration error */ 1037 # endif 1038 1039 /* pseudo-code used in server SMTP */ 1040 # define EX_QUIT 22 /* drop out of server immediately */ 1041 1042 1043 /* 1044 ** These are used in a few cases where we need some special 1045 ** error codes, but where the system doesn't provide something 1046 ** reasonable. They are printed in errstring. 1047 */ 1048 1049 #ifndef E_PSEUDOBASE 1050 # define E_PSEUDOBASE 256 1051 #endif 1052 1053 #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 1054 #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 1055 1056 /* type of arbitrary pointer */ 1057 #ifndef ARBPTR_T 1058 # define ARBPTR_T void * 1059 #endif 1060 1061 #ifndef __P 1062 # include "cdefs.h" 1063 #endif 1064 1065 #if NAMED_BIND 1066 # include <arpa/nameser.h> 1067 #endif 1068 1069 /* 1070 ** The size of an IP address -- can't use sizeof because of problems 1071 ** on Crays, where everything is 64 bits. This will break if/when 1072 ** IP addresses are expanded to eight bytes. 1073 */ 1074 1075 #ifndef INADDRSZ 1076 # define INADDRSZ 4 1077 #endif 1078 1079 /* 1080 ** The size of various known types -- for reading network protocols. 1081 ** Again, we can't use sizeof because of compiler randomness. 1082 */ 1083 1084 #ifndef INT16SZ 1085 # define INT16SZ 2 1086 #endif 1087 #ifndef INT32SZ 1088 # define INT32SZ 4 1089 #endif 1090 1091 /* 1092 ** Do some required dependencies 1093 */ 1094 1095 #if defined(NETINET) || defined(NETISO) 1096 # define SMTP 1 /* enable user and server SMTP */ 1097 # define QUEUE 1 /* enable queueing */ 1098 # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 1099 #endif 1100 1101 1102 /* 1103 ** Arrange to use either varargs or stdargs 1104 */ 1105 1106 # ifdef __STDC__ 1107 1108 # include <stdarg.h> 1109 1110 # define VA_LOCAL_DECL va_list ap; 1111 # define VA_START(f) va_start(ap, f) 1112 # define VA_END va_end(ap) 1113 1114 # else 1115 1116 # include <varargs.h> 1117 1118 # define VA_LOCAL_DECL va_list ap; 1119 # define VA_START(f) va_start(ap) 1120 # define VA_END va_end(ap) 1121 1122 # endif 1123 1124 #ifdef HASUNAME 1125 # include <sys/utsname.h> 1126 # ifdef newstr 1127 # undef newstr 1128 # endif 1129 #else /* ! HASUNAME */ 1130 # define NODE_LENGTH 32 1131 struct utsname 1132 { 1133 char nodename[NODE_LENGTH+1]; 1134 }; 1135 #endif /* HASUNAME */ 1136 1137 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) 1138 # define MAXHOSTNAMELEN 256 1139 #endif 1140 1141 #if !defined(SIGCHLD) && defined(SIGCLD) 1142 # define SIGCHLD SIGCLD 1143 #endif 1144 1145 #ifndef STDIN_FILENO 1146 #define STDIN_FILENO 0 1147 #endif 1148 1149 #ifndef STDOUT_FILENO 1150 #define STDOUT_FILENO 1 1151 #endif 1152 1153 #ifndef STDERR_FILENO 1154 #define STDERR_FILENO 2 1155 #endif 1156 1157 #ifndef LOCK_SH 1158 # define LOCK_SH 0x01 /* shared lock */ 1159 # define LOCK_EX 0x02 /* exclusive lock */ 1160 # define LOCK_NB 0x04 /* non-blocking lock */ 1161 # define LOCK_UN 0x08 /* unlock */ 1162 #endif 1163 1164 #ifndef SIG_ERR 1165 # define SIG_ERR ((void (*)()) -1) 1166 #endif 1167 1168 #ifndef WEXITSTATUS 1169 # define WEXITSTATUS(st) (((st) >> 8) & 0377) 1170 #endif 1171 #ifndef WIFEXITED 1172 # define WIFEXITED(st) (((st) & 0377) == 0) 1173 #endif 1174 1175 #ifndef SIGFUNC_DEFINED 1176 typedef void (*sigfunc_t) __P((int)); 1177 #endif 1178 1179 /* size of syslog buffer */ 1180 #ifndef SYSLOG_BUFSIZE 1181 # define SYSLOG_BUFSIZE 1024 1182 #endif 1183 1184 /* 1185 ** Size of tobuf (deliver.c) 1186 ** Tweak this to match your syslog implementation. It will have to 1187 ** allow for the extra information printed. 1188 */ 1189 1190 #ifndef TOBUFSIZE 1191 # if (SYSLOG_BUFSIZE) > 512 1192 # define TOBUFSIZE (SYSLOG_BUFSIZE - 256) 1193 # else 1194 # define TOBUFSIZE 256 1195 # endif 1196 #endif 1197 1198 /* 1199 ** Size of prescan buffer. 1200 ** Despite comments in the _sendmail_ book, this probably should 1201 ** not be changed; there are some hard-to-define dependencies. 1202 */ 1203 1204 # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 1205 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 1206 # ifndef FORK 1207 # define FORK vfork /* function to call to fork mailer */ 1208 # endif 1209 1210 /* 1211 ** If we are going to link scanf anyway, use it in readcf 1212 */ 1213 1214 #if !defined(HASUNAME) && !defined(SCANF) 1215 # define SCANF 1 1216 #endif 1217