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