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