19147Seric /* 234920Sbostic * Copyright (c) 1983 Eric P. Allman 362522Sbostic * Copyright (c) 1988, 1993 462522Sbostic * The Regents of the University of California. All rights reserved. 533728Sbostic * 642825Sbostic * %sccs.include.redist.c% 733728Sbostic * 8*66036Seric * @(#)conf.h 8.86 (Berkeley) 02/09/94 933728Sbostic */ 109147Seric 1122726Sdist /* 1222726Sdist ** CONF.H -- All user-configurable parameters for sendmail 1322726Sdist */ 149147Seric 1557232Seric # include <sys/param.h> 1664705Seric # include <sys/types.h> 1759389Seric # include <sys/stat.h> 1864380Seric # include <sys/file.h> 1964500Seric # include <sys/wait.h> 2058689Seric # include <fcntl.h> 2164035Seric # include <signal.h> 2257232Seric 2363902Seric /********************************************************************** 249147Seric ** Table sizes, etc.... 259147Seric ** There shouldn't be much need to change these.... 2663902Seric **********************************************************************/ 279147Seric 2859303Seric # define MAXLINE 2048 /* max line length */ 2924945Seric # define MAXNAME 256 /* max length of a name */ 309147Seric # define MAXPV 40 /* max # of parms to mailers */ 3159303Seric # define MAXATOM 200 /* max atoms per address */ 329147Seric # define MAXMAILERS 25 /* maximum mailers known to system */ 3357143Seric # define MAXRWSETS 100 /* max # of sets of rewriting rules */ 349147Seric # define MAXPRIORITIES 25 /* max values for Precedence: field */ 3557143Seric # define MAXMXHOSTS 20 /* max # of MX records */ 3652106Seric # define SMTPLINELIM 990 /* maximum SMTP line length */ 3757232Seric # define MAXKEY 128 /* maximum size of a database key */ 3857232Seric # define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */ 3959056Seric # define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */ 4059667Seric # define MAXALIASDB 12 /* max # of alias databases */ 4157143Seric 4257143Seric # ifndef QUEUESIZE 4357143Seric # define QUEUESIZE 1000 /* max # of jobs per queue run */ 4457143Seric # endif 4557143Seric 4663902Seric /********************************************************************** 479147Seric ** Compilation options. 4825673Seric ** 4925673Seric ** #define these if they are available; comment them out otherwise. 5063902Seric **********************************************************************/ 519147Seric 5225673Seric # define LOG 1 /* enable logging */ 5325673Seric # define UGLYUUCP 1 /* output ugly UUCP From lines */ 5464813Seric # define NETUNIX 1 /* include unix domain support */ 5558778Seric # define NETINET 1 /* include internet support */ 5625673Seric # define SETPROCTITLE 1 /* munge argv to display current status */ 5735651Seric # define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ 5853735Seric # define MATCHGECOS 1 /* match user names from gecos field */ 5963753Seric # define XDEBUG 1 /* enable extended debugging */ 6036483Sbostic 6156337Seric # ifdef NEWDB 6256337Seric # define USERDB 1 /* look in user database (requires NEWDB) */ 6356337Seric # endif 6456337Seric 6564032Seric /* 6664944Seric ** Most systems have symbolic links today, so default them on. You 6764944Seric ** can turn them off by #undef'ing this below. 6864944Seric */ 6964944Seric 7064944Seric # define HASLSTAT 1 /* has lstat(2) call */ 7164944Seric 7264962Seric /* 7364962Seric ** General "standard C" defines. 7464962Seric ** 7564962Seric ** These may be undone later, to cope with systems that claim to 7664962Seric ** be Standard C but aren't. Gcc is the biggest offender -- it 7764962Seric ** doesn't realize that the library is part of the language. 7864962Seric ** 7964962Seric ** Life would be much easier if we could get rid of this sort 8064962Seric ** of bozo problems. 8164962Seric */ 8264962Seric 8364962Seric #ifdef __STDC__ 8464962Seric # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 8564962Seric #endif 8664962Seric 8763902Seric /********************************************************************** 8859023Seric ** Operating system configuration. 8959023Seric ** 9059023Seric ** Unless you are porting to a new OS, you shouldn't have to 9159023Seric ** change these. 9263902Seric **********************************************************************/ 9356823Seric 9463787Seric /* 9563787Seric ** Per-Operating System defines 9663787Seric */ 9763787Seric 9864314Seric 9963902Seric /* 10065565Seric ** HP-UX -- tested for 8.07, 9.00, and 9.01. 10163902Seric */ 10263902Seric 10359348Seric # ifdef __hpux 10464727Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */ 10564727Seric # undef m_flags 10663787Seric # define SYSTEM5 1 /* include all the System V defines */ 10764035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 10864035Seric # define HASSETREUID 1 /* has setreuid(2) call */ 10965982Seric # define setreuid(r, e) setresuid(r, e, -1) 11063962Seric # define LA_TYPE LA_FLOAT 11165749Seric # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 11265354Seric # define GIDSET_T gid_t 11363962Seric # define _PATH_UNIX "/hp-ux" 11465354Seric # ifndef _PATH_SENDMAILCF 11565354Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 11665354Seric # endif 11765167Seric # ifndef IDENTPROTO 11865167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 11956823Seric # endif 12065581Seric # ifndef HASGETUSERSHELL 12165581Seric # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 12265581Seric # endif 12365504Seric # define syslog hard_syslog 12465581Seric # ifdef __STDC__ 12565581Seric extern int syslog(int, char *, ...); 12665167Seric # endif 12765581Seric # endif 12856823Seric 12964314Seric 13063902Seric /* 13163902Seric ** IBM AIX 3.x -- actually tested for 3.2.3 13263902Seric */ 13363902Seric 13460224Seric # ifdef _AIX3 13564035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 13664840Seric # define HASUNAME 1 /* use System V uname(2) system call */ 13765211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 13860219Seric # define FORK fork /* no vfork primitive available */ 13964494Seric # undef SETPROCTITLE /* setproctitle confuses AIX */ 14065749Seric # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 14160219Seric # endif 14260219Seric 14364314Seric 14463902Seric /* 14563902Seric ** Silicon Graphics IRIX 14663902Seric ** 14763965Seric ** Compiles on 4.0.1. 14863902Seric */ 14963902Seric 15063753Seric # ifdef IRIX 15164727Seric # include <sys/sysmacros.h> 15264035Seric # define HASSETREUID 1 /* has setreuid(2) call */ 15364035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 15465211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 15563753Seric # define FORK fork /* no vfork primitive available */ 15664562Seric # define WAITUNION 1 /* use "union wait" as wait argument type */ 15764155Seric # define setpgid BSDsetpgrp 15863937Seric # define GIDSET_T gid_t 15965749Seric # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 16063753Seric # endif 16163753Seric 16263902Seric 16363902Seric /* 16464813Seric ** SunOS and Solaris 16564813Seric ** 16664813Seric ** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and 16764813Seric ** Solaris 2.2 (a.k.a. SunOS 5.2). 16863902Seric */ 16963902Seric 17063787Seric #if defined(sun) && !defined(BSD) 17159074Seric 17264035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 17364813Seric # define HASUNAME 1 /* use System V uname(2) system call */ 17465211Seric # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 17565749Seric # define LA_TYPE LA_INT 17660564Seric 17764842Seric # ifdef SOLARIS_2_3 17864842Seric # define SOLARIS 17964842Seric # endif 18064842Seric 18160602Seric # ifdef SOLARIS 18263902Seric /* Solaris 2.x (a.k.a. SunOS 5.x) */ 18365222Seric # ifndef __svr4__ 18465222Seric # define __svr4__ /* use all System V Releae 4 defines below */ 18565222Seric # endif 18663787Seric # include <sys/time.h> 18764832Seric # define gethostbyname solaris_gethostbyname /* get working version */ 18864832Seric # define gethostbyaddr solaris_gethostbyaddr /* get working version */ 18965172Seric # define GIDSET_T gid_t 19065189Seric # ifndef _PATH_UNIX 19165189Seric # define _PATH_UNIX "/kernel/unix" 19265189Seric # endif 19363962Seric # ifndef _PATH_SENDMAILCF 19463962Seric # define _PATH_SENDMAILCF "/etc/mail/sendmail.cf" 19564072Seric # endif 19664072Seric # ifndef _PATH_SENDMAILPID 19763962Seric # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 19863962Seric # endif 19966022Seric # ifndef SYSLOG_BUFSIZE 20066022Seric # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 20166022Seric # endif 20263787Seric 20360602Seric # else 20465105Seric /* SunOS 4.0.3 or 4.1.x */ 20565189Seric # define HASSETREUID 1 /* has setreuid(2) call */ 20665830Seric # ifndef HASFLOCK 20765830Seric # define HASFLOCK 1 /* has flock(2) call */ 20865830Seric # endif 20965749Seric # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 21060564Seric # include <vfork.h> 21163787Seric 21265105Seric # ifdef SUNOS403 21365105Seric /* special tweaking for SunOS 4.0.3 */ 21465105Seric # include <malloc.h> 21565105Seric # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 21665105Seric # define WAITUNION 1 /* use "union wait" as wait argument type */ 21765105Seric # undef WIFEXITED 21865105Seric # undef WEXITSTATUS 21965105Seric # undef HASUNAME 22065105Seric # define setpgid setpgrp 22165105Seric typedef int pid_t; 22265105Seric extern char *getenv(); 22365105Seric 22465105Seric # endif 22560564Seric # endif 22659023Seric #endif 22759023Seric 22864718Seric /* 22964813Seric ** DG/UX 23064813Seric ** 23164813Seric ** Tested on 5.4.2 23264718Seric */ 23364314Seric 23464718Seric #ifdef DGUX 23564718Seric # define SYSTEM5 1 23664718Seric # define LA_TYPE LA_SUBR 23764718Seric # define HASSETREUID 1 /* has setreuid(2) call */ 23864718Seric # define HASUNAME 1 /* use System V uname(2) system call */ 23964718Seric # define HASSETSID 1 /* has Posix setsid(2) call */ 24064718Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 241*66036Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) */ 24265167Seric # ifndef IDENTPROTO 24365167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 24465167Seric # endif 24564718Seric # undef SETPROCTITLE 24665749Seric # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 24764813Seric 24864813Seric /* these include files must be included early on DG/UX */ 24964813Seric # include <netinet/in.h> 25064813Seric # include <arpa/inet.h> 25164813Seric 25264718Seric # define inet_addr dgux_inet_addr 25364718Seric extern long dgux_inet_addr(); 25464718Seric #endif 25564718Seric 25664718Seric 25763902Seric /* 25863902Seric ** Digital Ultrix 4.2A or 4.3 25964264Seric ** 26064264Seric ** Apparently, fcntl locking is broken on 4.2A, in that locks are 26164264Seric ** not dropped when the process exits. This causes major problems, 26264264Seric ** so flock is the only alternative. 26363902Seric */ 26463902Seric 26560564Seric #ifdef ultrix 26664035Seric # define HASSETREUID 1 /* has setreuid(2) call */ 26763962Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 26864035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 26965830Seric # ifndef HASFLOCK 27065830Seric # define HASFLOCK 1 /* has flock(2) call */ 27165830Seric # endif 27265211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 27365135Seric # ifdef vax 27465135Seric # define LA_TYPE LA_FLOAT 27565135Seric # else 27665135Seric # define LA_TYPE LA_INT 27765135Seric # define LA_AVENRUN "avenrun" 27865135Seric # endif 27965749Seric # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 28065167Seric # ifndef IDENTPROTO 28165167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 28265167Seric # endif 28360564Seric #endif 28460564Seric 28564314Seric 28663902Seric /* 28763902Seric ** OSF/1 (tested on Alpha) 28863902Seric */ 28963902Seric 29063787Seric #ifdef __osf__ 29163962Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 29264035Seric # define HASSETREUID 1 /* has setreuid(2) call */ 29364035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 29465830Seric # ifdef HASFLOCK 29565830Seric # define HASFLOCK 1 /* has flock(2) call */ 29665830Seric # endif 29763962Seric # define LA_TYPE LA_INT 29865749Seric # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 29964813Seric # ifndef _PATH_SENDMAILPID 30065504Seric # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 30164813Seric # endif 30259287Seric #endif 30359287Seric 30464314Seric 30563902Seric /* 30663902Seric ** NeXTstep 30763902Seric */ 30863902Seric 30964076Seric #ifdef NeXT 31064035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 31165830Seric # ifndef HASFLOCK 31265830Seric # define HASFLOCK 1 /* has flock(2) call */ 31365830Seric # endif 31464125Seric # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 31564563Seric # define WAITUNION 1 /* use "union wait" as wait argument type */ 31663753Seric # define sleep sleepX 31764155Seric # define setpgid setpgrp 31864295Seric # ifndef LA_TYPE 31964295Seric # define LA_TYPE LA_MACH 32064295Seric # endif 32165749Seric # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 32264500Seric # ifndef _POSIX_SOURCE 32364035Seric typedef int pid_t; 32464500Seric # undef WEXITSTATUS 32564500Seric # undef WIFEXITED 32664500Seric # endif 32764072Seric # ifndef _PATH_SENDMAILCF 32864072Seric # define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf" 32964072Seric # endif 33064072Seric # ifndef _PATH_SENDMAILPID 33164072Seric # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" 33264072Seric # endif 33359288Seric #endif 33459288Seric 33564314Seric 33663902Seric /* 33763962Seric ** 4.4 BSD 33864831Seric ** 33964831Seric ** See also BSD defines. 34063902Seric */ 34163902Seric 34260568Seric #ifdef BSD4_4 34364072Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 34460568Seric # include <sys/cdefs.h> 34563838Seric # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 34664072Seric # ifndef LA_TYPE 34764072Seric # define LA_TYPE LA_SUBR 34864072Seric # endif 34965749Seric # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 35060568Seric #endif 35160568Seric 35264314Seric 35363902Seric /* 35465982Seric ** BSD/386 (all versions) 35565982Seric ** From Tony Sanders, BSDI 35665982Seric */ 35765982Seric 35865982Seric #ifdef __bsdi__ 35965982Seric # define HASUNSETENV 1 /* has the unsetenv(3) call */ 36065982Seric # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 36166030Seric # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 36265982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 36365982Seric # define HASSETPROCTITLE 1 /* setproctitle is in libc */ 36465982Seric # else 36565982Seric # define SETPROCTITLE 1 36665982Seric # endif 36765982Seric # include <sys/cdefs.h> 36865982Seric # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 36965982Seric # ifndef LA_TYPE 37065982Seric # define LA_TYPE LA_SUBR 37165982Seric # endif 37265982Seric #endif 37365982Seric 37465982Seric 37565982Seric 37665982Seric /* 37765049Seric ** 386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions) 37864733Seric ** 37964733Seric ** 4.3BSD clone, closer to 4.4BSD 38064831Seric ** 38164831Seric ** See also BSD defines. 38264733Seric */ 38364733Seric 38465049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__) 38564733Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 38664733Seric # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 38764733Seric # include <sys/cdefs.h> 38864733Seric # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 38964733Seric # ifndef LA_TYPE 39064733Seric # define LA_TYPE LA_SUBR 39164733Seric # endif 39265749Seric # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 39364733Seric #endif 39464733Seric 39564733Seric 39664733Seric /* 39764813Seric ** Mach386 39864813Seric ** 39964813Seric ** For mt Xinu's Mach386 system. 40064813Seric */ 40164813Seric 40264813Seric #if defined(MACH) && defined(i386) 40364813Seric # define MACH386 1 40464813Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 40564813Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 40665830Seric # ifdef HASFLOCK 40765830Seric # define HASFLOCK 1 /* has flock(2) call */ 40865830Seric # endif 40964813Seric # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 41064813Seric # define NEEDSTRTOL 1 /* need the strtol() function */ 41164813Seric # define setpgid setpgrp 41264813Seric # ifndef LA_TYPE 41364813Seric # define LA_TYPE LA_FLOAT 41464813Seric # endif 41565749Seric # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 41664962Seric # undef HASSETVBUF /* don't actually have setvbuf(3) */ 41764813Seric # undef WEXITSTATUS 41864813Seric # undef WIFEXITED 41964813Seric # ifndef _PATH_SENDMAILCF 42064813Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 42164813Seric # endif 42264813Seric # ifndef _PATH_SENDMAILPID 42364813Seric # define _PATH_SENDMAILPID "/etc/sendmail.pid" 42464813Seric # endif 42564813Seric #endif 42664813Seric 42764813Seric 42864813Seric /* 42963969Seric ** 4.3 BSD -- this is for very old systems 43063969Seric ** 43165949Seric ** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1. 43265949Seric ** 43363969Seric ** You'll also have to install a new resolver library. 43463969Seric ** I don't guarantee that support for this environment is complete. 43563969Seric */ 43663969Seric 43765949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) 43863969Seric # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 43963969Seric # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 44063970Seric # define ARBPTR_T char * 44164155Seric # define setpgid setpgrp 44263969Seric # ifndef LA_TYPE 44363969Seric # define LA_TYPE LA_FLOAT 44463969Seric # endif 44563969Seric # ifndef _PATH_SENDMAILCF 44663969Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 44763969Seric # endif 44865167Seric # ifndef IDENTPROTO 44965167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 45065167Seric # endif 45164834Seric # undef WEXITSTATUS 45264834Seric # undef WIFEXITED 45364834Seric typedef short pid_t; 45464834Seric extern int errno; 45563969Seric #endif 45663969Seric 45764314Seric 45863969Seric /* 45963902Seric ** SCO Unix 46065087Seric ** 46165087Seric ** This includes two parts -- the first is for SCO Open Server 3.2v4 46265087Seric ** (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). 46365087Seric ** The second is, I believe, for an older version. 46463902Seric */ 46563902Seric 46665087Seric #ifdef _SCO_unix_4_2 46765087Seric # define _SCO_unix_ 46865087Seric # define HASSETREUID 1 /* has setreuid(2) call */ 46965087Seric # define _PATH_UNIX "/unix" 47065087Seric # ifndef _PATH_SENDMAILCF 47165087Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 47265087Seric # endif 47365087Seric # ifndef _PATH_SENDMAILPID 47465087Seric # define _PATH_SENDMAILPID "/etc/sendmail.pid" 47565087Seric # endif 47665087Seric #endif 47765087Seric 47863838Seric #ifdef _SCO_unix_ 47963838Seric # define SYSTEM5 1 /* include all the System V defines */ 48064035Seric # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 48165212Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 48263838Seric # define FORK fork 48363838Seric # define MAXPATHLEN PATHSIZE 48464718Seric # define LA_TYPE LA_SHORT 48565749Seric # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 48664813Seric # undef NETUNIX /* no unix domain socket support */ 48763838Seric #endif 48863838Seric 48964314Seric 49063962Seric /* 49163962Seric ** ConvexOS 11.0 and later 49265949Seric ** 49365949Seric ** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this 49465949Seric ** works on 9.1 as well. 49563962Seric */ 49663962Seric 49763962Seric #ifdef _CONVEX_SOURCE 49863977Seric # define BSD 1 /* include all the BSD defines */ 49963977Seric # define HASUNAME 1 /* use System V uname(2) system call */ 50063962Seric # define HASSETSID 1 /* has POSIX setsid(2) call */ 50163977Seric # define NEEDGETOPT 1 /* need replacement for getopt(3) */ 50263962Seric # define LA_TYPE LA_FLOAT 50365749Seric # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 50465949Seric # ifndef _PATH_SENDMAILCF 50565949Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 50665949Seric # endif 50765949Seric # ifndef S_IREAD 50865949Seric # define S_IREAD _S_IREAD 50965949Seric # define S_IWRITE _S_IWRITE 51065949Seric # define S_IEXEC _S_IEXEC 51165949Seric # define S_IFMT _S_IFMT 51265949Seric # define S_IFCHR _S_IFCHR 51365949Seric # define S_IFBLK _S_IFBLK 51465949Seric # endif 51565167Seric # ifndef IDENTPROTO 51665167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 51765167Seric # endif 51863962Seric #endif 51963962Seric 52064314Seric 52163962Seric /* 52264999Seric ** RISC/os 4.52 52363962Seric ** 52464999Seric ** Gives a ton of warning messages, but otherwise compiles. 52563962Seric */ 52663962Seric 52763965Seric #ifdef RISCOS 52864999Seric 52963962Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 53065830Seric # ifdef HASFLOCK 53165830Seric # define HASFLOCK 1 /* has flock(2) call */ 53265830Seric # endif 53364999Seric # define WAITUNION 1 /* use "union wait" as wait argument type */ 53464999Seric # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 53563962Seric # define LA_TYPE LA_INT 53663962Seric # define LA_AVENRUN "avenrun" 53763962Seric # define _PATH_UNIX "/unix" 53864999Seric # undef WIFEXITED 53964999Seric 54064999Seric # define setpgid setpgrp 54164999Seric 54264999Seric extern int errno; 54364999Seric typedef int pid_t; 54464999Seric #define SIGFUNC_DEFINED 54564999Seric typedef int (*sigfunc_t)(); 54664999Seric extern char *getenv(); 54764999Seric extern void *malloc(); 54864999Seric 54963962Seric #endif 55063962Seric 55164314Seric 55264155Seric /* 55364155Seric ** Linux 0.99pl10 and above... 55464155Seric ** From Karl London <karl@borg.demon.co.uk>. 55564155Seric */ 55664155Seric 55764770Seric #ifdef __linux__ 55864155Seric # define BSD 1 /* pretend to be BSD based today */ 55964155Seric # undef NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 56064155Seric # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 56164380Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 56264155Seric # ifndef LA_TYPE 56364155Seric # define LA_TYPE LA_FLOAT 56464155Seric # endif 56564763Seric # include <sys/sysmacros.h> 56665046Seric # define GIDSET_T gid_t 56764155Seric #endif 56864155Seric 56964155Seric 57064345Seric /* 57164345Seric ** DELL SVR4 Issue 2.2, and others 57264345Seric ** From Kimmo Suominen <kim@grendel.lut.fi> 57364345Seric ** 57464345Seric ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 57564345Seric ** defined, and the definitions conflict. 57664924Seric ** 57764924Seric ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 57864924Seric ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 57964924Seric ** (SVR4.0/386 version 3.0). 58064345Seric */ 58164345Seric 58264345Seric #ifdef DELL_SVR4 58365189Seric /* no changes necessary */ 58465189Seric /* see general __svr4__ defines below */ 58564345Seric #endif 58664345Seric 58764345Seric 58864380Seric /* 58964380Seric ** Apple A/UX 3.0 59064380Seric */ 59164345Seric 59264380Seric #ifdef _AUX_SOURCE 59364729Seric # include <sys/sysmacros.h> 59464380Seric # define BSD /* has BSD routines */ 59564380Seric # define HASUNAME 1 /* use System V uname(2) system call */ 59664380Seric # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 59764561Seric # define SIGFUNC_DEFINED /* sigfunc_t already defined */ 59865167Seric # ifndef IDENTPROTO 59965167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 60065167Seric # endif 60164380Seric # define FORK fork 60264380Seric # ifndef _PATH_SENDMAILCF 60364380Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 60464380Seric # endif 60564380Seric # ifndef LA_TYPE 60664380Seric # define LA_TYPE LA_ZERO 60764380Seric # endif 60865749Seric # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 60964560Seric # undef WIFEXITED 61064560Seric # undef WEXITSTATUS 61164380Seric #endif 61264380Seric 61364380Seric 61464705Seric /* 61564705Seric ** Encore UMAX V 61664705Seric ** 61764705Seric ** Not extensively tested. 61864705Seric */ 61964380Seric 62064705Seric #ifdef UMAXV 62164705Seric # include <limits.h> 62264705Seric # define HASUNAME 1 /* use System V uname(2) system call */ 62364705Seric # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 62464705Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 62565211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 62664705Seric # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 62764705Seric # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 62864705Seric # define FORK fork /* no vfork(2) primitive available */ 62965749Seric # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 63064705Seric # define MAXPATHLEN PATH_MAX 63164705Seric extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 63264705Seric extern struct group *getgrent(), *getgrnam(), *getgrgid(); 63364705Seric # undef WIFEXITED 63464705Seric # undef WEXITSTATUS 63564705Seric #endif 63664705Seric 63764705Seric 63864939Seric /* 63964939Seric ** Stardent Titan 3000 running TitanOS 4.2. 64064939Seric ** 64164939Seric ** Must be compiled in "cc -43" mode. 64264939Seric ** 64364944Seric ** From Kate Hedstrom <kate@ahab.rutgers.edu>. 64464939Seric ** 64564939Seric ** Note the tweaking below after the BSD defines are set. 64664939Seric */ 64764705Seric 64864939Seric #ifdef titan 64964939Seric # define setpgid setpgrp 65064939Seric typedef int pid_t; 65164939Seric # undef WIFEXITED 65264939Seric # undef WEXITSTATUS 65364939Seric #endif 65464939Seric 65564939Seric 65664962Seric /* 65764962Seric ** Sequent DYNIX 3.2.0 65864962Seric ** 65964962Seric ** From Jim Davis <jdavis@cs.arizona.edu>. 66064962Seric */ 66164939Seric 66264962Seric #ifdef sequent 66364962Seric # define BSD 1 66464962Seric # define HASUNSETENV 1 66564962Seric # define BSD4_3 1 /* to get signal() in conf.c */ 66664962Seric # define WAITUNION 1 66764962Seric # define LA_TYPE LA_FLOAT 66864962Seric # ifdef _POSIX_VERSION 66964962Seric # undef _POSIX_VERSION /* set in <unistd.h> */ 67064962Seric # endif 67164962Seric # undef HASSETVBUF /* don't actually have setvbuf(3) */ 67264962Seric # define setpgid setpgrp 67364962Seric 67464962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 67564962Seric # undef WIFEXITED 67664962Seric # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 67764962Seric ((union wait*)&(s))->w_termsig == 0) 67864962Seric # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 67964962Seric typedef int pid_t; 68064962Seric # define isgraph(c) (isprint(c) && (c != ' ')) 68164962Seric 68264962Seric # ifndef _PATH_UNIX 68364962Seric # define _PATH_UNIX "/dynix" 68464962Seric # endif 68564962Seric # ifndef _PATH_SENDMAILCF 68664962Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 68764962Seric # endif 68864962Seric 68964962Seric #endif 69064962Seric 69164962Seric 69265748Seric /* 69365748Seric ** Cray Unicos 69465748Seric ** 69565748Seric ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 69665748Seric */ 69764962Seric 69865748Seric #ifdef UNICOS 69965748Seric # define SYSTEM5 1 /* include all the System V defines */ 70065748Seric # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 70165748Seric # define MAXPATHLEN PATHSIZE 70265748Seric # define LA_TYPE LA_ZERO 70365749Seric # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 70465748Seric #endif 70564962Seric 70665748Seric 70765820Seric /* 70865820Seric ** Apollo DomainOS 70965820Seric ** 71065820Seric ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com> 71165982Seric ** 71265820Seric ** 15 Jan 1994 71365820Seric ** 71465820Seric */ 71565748Seric 71665820Seric #ifdef apollo 71765820Seric # define HASSETREUID 1 /* has setreuid(2) call */ 71865820Seric # define HASINITGROUPS 1 /* has initgroups(2) call */ 71965820Seric # undef SETPROCTITLE 72065820Seric # define LA_TYPE LA_SUBR /* use getloadavg.c */ 72166030Seric # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 72265820Seric # ifndef _PATH_SENDMAILCF 72365820Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 72465820Seric # endif 72565820Seric # ifndef _PATH_SENDMAILPID 72665820Seric # define _PATH_SENDMAILPID "/etc/sendmail.pid" 72765820Seric # endif 72865820Seric # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ 72965820Seric # undef S_IFIFO 73065820Seric # define S_IFIFO 0010000 73165820Seric # ifndef IDENTPROTO 73265820Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 73365820Seric # endif 73465982Seric #endif 73565820Seric 73665820Seric 73765820Seric 73865820Seric 73963902Seric /********************************************************************** 74063787Seric ** End of Per-Operating System defines 74163902Seric **********************************************************************/ 74263787Seric 74363949Seric /********************************************************************** 74463949Seric ** More general defines 74563949Seric **********************************************************************/ 74663949Seric 74763962Seric /* general BSD defines */ 74863962Seric #ifdef BSD 74964035Seric # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 75064035Seric # define HASSETREUID 1 /* has setreuid(2) call */ 75164035Seric # define HASINITGROUPS 1 /* has initgroups(2) call */ 75265830Seric # ifndef HASFLOCK 75365830Seric # define HASFLOCK 1 /* has flock(2) call */ 75465830Seric # endif 75563962Seric #endif 75663962Seric 75765189Seric /* general System V Release 4 defines */ 75865189Seric #ifdef __svr4__ 75965189Seric # define SYSTEM5 1 76065189Seric # define HASSETREUID 1 /* has seteuid(2) call & working saved uids */ 76165211Seric # ifndef HASGETUSERSHELL 76265211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 76365210Seric # endif 76465189Seric # define setreuid(r, e) seteuid(e) 76565189Seric 76665189Seric # ifndef _PATH_UNIX 76765189Seric # define _PATH_UNIX "/unix" 76865189Seric # endif 76965189Seric # ifndef _PATH_SENDMAILCF 77065189Seric # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 77165189Seric # endif 77265189Seric # ifndef _PATH_SENDMAILPID 77365189Seric # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 77465189Seric # endif 77565189Seric # ifndef SYSLOG_BUFSIZE 77665189Seric # define SYSLOG_BUFSIZE 128 77765189Seric # endif 77865189Seric #endif 77965189Seric 78063787Seric /* general System V defines */ 78163787Seric # ifdef SYSTEM5 78264813Seric # include <sys/sysmacros.h> 78363949Seric # define HASUNAME 1 /* use System V uname(2) system call */ 78464705Seric # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 78564962Seric # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 78663962Seric # ifndef LA_TYPE 78765749Seric # define LA_TYPE LA_INT /* assume integer load average */ 78863962Seric # endif 78965749Seric # ifndef SFS_TYPE 79065749Seric # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 79165749Seric # endif 79263949Seric # define bcopy(s, d, l) (memmove((d), (s), (l))) 79363949Seric # define bzero(d, l) (memset((d), '\0', (l))) 79463949Seric # define bcmp(s, d, l) (memcmp((s), (d), (l))) 79563787Seric # endif 79663787Seric 79763949Seric /* general POSIX defines */ 79863949Seric #ifdef _POSIX_VERSION 79964718Seric # define HASSETSID 1 /* has Posix setsid(2) call */ 80064718Seric # define HASWAITPID 1 /* has Posix waitpid(2) call */ 80163949Seric #endif 80263949Seric 80363787Seric /* 80463937Seric ** If no type for argument two of getgroups call is defined, assume 80563937Seric ** it's an integer -- unfortunately, there seem to be several choices 80663937Seric ** here. 80763937Seric */ 80863937Seric 80963937Seric #ifndef GIDSET_T 81063937Seric # define GIDSET_T int 81163937Seric #endif 81263937Seric 81364939Seric /* 81464939Seric ** Tweaking for systems that (for example) claim to be BSD but 81564939Seric ** don't have all the standard BSD routines (boo hiss). 81664939Seric */ 81764439Seric 81864939Seric #ifdef titan 81964939Seric # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 82064939Seric #endif 82164939Seric 82265830Seric 82365167Seric /* 82465167Seric ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 82565167Seric ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 82665167Seric ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 82765167Seric ** are closed. Some firewalls return this error if you try to connect 82865167Seric ** to the IDENT port (113), so you can't receive email from these hosts 82965167Seric ** on these systems. The firewall really should use a more specific 83065167Seric ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If 83165167Seric ** not explicitly set to zero above, default it on. 83265167Seric */ 83364939Seric 83465167Seric #ifndef IDENTPROTO 83565167Seric # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 83665167Seric #endif 83765167Seric 83865211Seric #ifndef HASGETUSERSHELL 83965211Seric # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 84065210Seric #endif 84165167Seric 84265830Seric #ifndef HASFLOCK 84365830Seric # define HASFLOCK 0 /* assume no flock(2) support */ 84465830Seric #endif 84565210Seric 84665830Seric 84764439Seric /********************************************************************** 84859023Seric ** Remaining definitions should never have to be changed. They are 84959023Seric ** primarily to provide back compatibility for older systems -- for 85059287Seric ** example, it includes some POSIX compatibility definitions 85164439Seric **********************************************************************/ 85259023Seric 85359388Seric /* System 5 compatibility */ 85459388Seric #ifndef S_ISREG 85564944Seric # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 85659388Seric #endif 85764944Seric #if !defined(S_ISLNK) && defined(S_IFLNK) 85864944Seric # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 85964944Seric #endif 86059388Seric #ifndef S_IWGRP 86159388Seric #define S_IWGRP 020 86259388Seric #endif 86359388Seric #ifndef S_IWOTH 86459388Seric #define S_IWOTH 002 86559388Seric #endif 86659388Seric 86759023Seric /* 86850537Seric ** Older systems don't have this error code -- it should be in 86950537Seric ** /usr/include/sysexits.h. 87050537Seric */ 87150537Seric 87250537Seric # ifndef EX_CONFIG 87350537Seric # define EX_CONFIG 78 /* configuration error */ 87450537Seric # endif 87556852Seric 87664718Seric /* pseudo-code used in server SMTP */ 87764718Seric # define EX_QUIT 22 /* drop out of server immediately */ 87864718Seric 87964718Seric 88063993Seric /* 88163993Seric ** These are used in a few cases where we need some special 88263993Seric ** error codes, but where the system doesn't provide something 88363993Seric ** reasonable. They are printed in errstring. 88463993Seric */ 88563993Seric 88663993Seric #ifndef E_PSEUDOBASE 88763993Seric # define E_PSEUDOBASE 256 88863993Seric #endif 88963993Seric 89063993Seric #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 89163993Seric #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 89263993Seric 89363970Seric /* type of arbitrary pointer */ 89463970Seric #ifndef ARBPTR_T 89563970Seric # define ARBPTR_T void * 89663970Seric #endif 89763970Seric 89860568Seric #ifndef __P 89960568Seric # include "cdefs.h" 90060568Seric #endif 90160568Seric 90256852Seric /* 90358778Seric ** Do some required dependencies 90458778Seric */ 90558778Seric 90658778Seric #if defined(NETINET) || defined(NETISO) 90759107Seric # define SMTP 1 /* enable user and server SMTP */ 90859107Seric # define QUEUE 1 /* enable queueing */ 90959107Seric # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 91058778Seric #endif 91158778Seric 91258778Seric 91358778Seric /* 91456852Seric ** Arrange to use either varargs or stdargs 91556852Seric */ 91656852Seric 91756852Seric # ifdef __STDC__ 91856852Seric 91956852Seric # include <stdarg.h> 92056852Seric 92156852Seric # define VA_LOCAL_DECL va_list ap; 92256852Seric # define VA_START(f) va_start(ap, f) 92356852Seric # define VA_END va_end(ap) 92456852Seric 92556852Seric # else 92656852Seric 92756852Seric # include <varargs.h> 92856852Seric 92956852Seric # define VA_LOCAL_DECL va_list ap; 93056852Seric # define VA_START(f) va_start(ap) 93156852Seric # define VA_END va_end(ap) 93256852Seric 93356852Seric # endif 93457631Seric 93557943Seric #ifdef HASUNAME 93657631Seric # include <sys/utsname.h> 93757631Seric # ifdef newstr 93857631Seric # undef newstr 93957631Seric # endif 94057943Seric #else /* ! HASUNAME */ 94157631Seric # define NODE_LENGTH 32 94257631Seric struct utsname 94357631Seric { 94457631Seric char nodename[NODE_LENGTH+1]; 94557631Seric }; 94657943Seric #endif /* HASUNAME */ 94757642Seric 94863838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) 94963838Seric # define MAXHOSTNAMELEN 256 95057735Seric #endif 95158153Seric 95258153Seric #if !defined(SIGCHLD) && defined(SIGCLD) 95358153Seric # define SIGCHLD SIGCLD 95458153Seric #endif 95558153Seric 95658153Seric #ifndef STDIN_FILENO 95758153Seric #define STDIN_FILENO 0 95858153Seric #endif 95958153Seric 96058153Seric #ifndef STDOUT_FILENO 96158153Seric #define STDOUT_FILENO 1 96258153Seric #endif 96358153Seric 96458153Seric #ifndef STDERR_FILENO 96558153Seric #define STDERR_FILENO 2 96658153Seric #endif 96758689Seric 96864072Seric #ifndef LOCK_SH 96964035Seric # define LOCK_SH 0x01 /* shared lock */ 97064035Seric # define LOCK_EX 0x02 /* exclusive lock */ 97164035Seric # define LOCK_NB 0x04 /* non-blocking lock */ 97264035Seric # define LOCK_UN 0x08 /* unlock */ 97364035Seric #endif 97458692Seric 97564035Seric #ifndef SIG_ERR 97664035Seric # define SIG_ERR ((void (*)()) -1) 97758689Seric #endif 97858702Seric 97964500Seric #ifndef WEXITSTATUS 98064500Seric # define WEXITSTATUS(st) (((st) >> 8) & 0377) 98164500Seric #endif 98264500Seric #ifndef WIFEXITED 98364500Seric # define WIFEXITED(st) (((st) & 0377) == 0) 98464500Seric #endif 98564500Seric 98664561Seric #ifndef SIGFUNC_DEFINED 98764561Seric typedef void (*sigfunc_t) __P((int)); 98864561Seric #endif 98964561Seric 99065053Seric /* size of syslog buffer */ 99165053Seric #ifndef SYSLOG_BUFSIZE 99265053Seric # define SYSLOG_BUFSIZE 1024 99365053Seric #endif 99465053Seric 99558702Seric /* 99658702Seric ** Size of tobuf (deliver.c) 99758702Seric ** Tweak this to match your syslog implementation. It will have to 99858702Seric ** allow for the extra information printed. 99958702Seric */ 100058702Seric 100158702Seric #ifndef TOBUFSIZE 100265053Seric # if (SYSLOG_BUFSIZE) > 512 100365053Seric # define TOBUFSIZE (SYSLOG_BUFSIZE - 256) 100465053Seric # else 100565053Seric # define TOBUFSIZE 256 100665053Seric # endif 100758702Seric #endif 100860219Seric 100965015Seric /* 101065015Seric ** Size of prescan buffer. 101165015Seric ** Despite comments in the _sendmail_ book, this probably should 101265015Seric ** not be changed; there are some hard-to-define dependencies. 101365015Seric */ 101465015Seric 101565015Seric # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 101660219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 101760219Seric # ifndef FORK 101860219Seric # define FORK vfork /* function to call to fork mailer */ 101960219Seric # endif 102065955Seric 102165955Seric /* 102265955Seric ** If we are going to link scanf anyway, use it in readcf 102365955Seric */ 102465955Seric 102565955Seric #if !defined(HASUNAME) && !defined(SCANF) 102665955Seric # define SCANF 1 102765955Seric #endif 1028