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*65581Seric * @(#)conf.h 8.75 (Berkeley) 01/08/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 */ 10864314Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 10964035Seric # define HASSETREUID 1 /* has setreuid(2) call */ 11063902Seric # define setreuid(r, e) setresuid(r, e, -1) 11163962Seric # define LA_TYPE LA_FLOAT 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 120*65581Seric # ifndef HASGETUSERSHELL 121*65581Seric # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 122*65581Seric # endif 12365504Seric # define syslog hard_syslog 124*65581Seric # ifdef __STDC__ 125*65581Seric extern int syslog(int, char *, ...); 12665167Seric # endif 127*65581Seric # 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 HASSTATFS 1 /* has the statfs(2) syscall */ 13764840Seric # define HASUNAME 1 /* use System V uname(2) system call */ 13865211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 13960219Seric # define FORK fork /* no vfork primitive available */ 14064494Seric # undef SETPROCTITLE /* setproctitle confuses AIX */ 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 */ 15464314Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 15565211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 15663753Seric # define FORK fork /* no vfork primitive available */ 15764562Seric # define WAITUNION 1 /* use "union wait" as wait argument type */ 15864155Seric # define setpgid BSDsetpgrp 15963937Seric # define GIDSET_T gid_t 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 17263962Seric # define LA_TYPE LA_INT 17364035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 17464813Seric # define HASUNAME 1 /* use System V uname(2) system call */ 17565211Seric # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 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 19963787Seric 20060602Seric # else 20165105Seric /* SunOS 4.0.3 or 4.1.x */ 20265189Seric # define HASSETREUID 1 /* has setreuid(2) call */ 20360602Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 20464831Seric # define HASFLOCK 1 /* has flock(2) call */ 20560564Seric # include <vfork.h> 20663787Seric 20765105Seric # ifdef SUNOS403 20865105Seric /* special tweaking for SunOS 4.0.3 */ 20965105Seric # include <malloc.h> 21065105Seric # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 21165105Seric # define WAITUNION 1 /* use "union wait" as wait argument type */ 21265105Seric # undef WIFEXITED 21365105Seric # undef WEXITSTATUS 21465105Seric # undef HASUNAME 21565105Seric # define setpgid setpgrp 21665105Seric typedef int pid_t; 21765105Seric extern char *getenv(); 21865105Seric 21965105Seric # endif 22060564Seric # endif 22159023Seric #endif 22259023Seric 22364718Seric /* 22464813Seric ** DG/UX 22564813Seric ** 22664813Seric ** Tested on 5.4.2 22764718Seric */ 22864314Seric 22964718Seric #ifdef DGUX 23064718Seric # define SYSTEM5 1 23164718Seric # define LA_TYPE LA_SUBR 23264718Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 23364718Seric # define HASSETREUID 1 /* has setreuid(2) call */ 23464718Seric # define HASUNAME 1 /* use System V uname(2) system call */ 23564718Seric # define HASSETSID 1 /* has Posix setsid(2) call */ 23664718Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 23765167Seric # ifndef IDENTPROTO 23865167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 23965167Seric # endif 24064718Seric # undef SETPROCTITLE 24164813Seric 24264813Seric /* these include files must be included early on DG/UX */ 24364813Seric # include <netinet/in.h> 24464813Seric # include <arpa/inet.h> 24564813Seric 24664718Seric # define inet_addr dgux_inet_addr 24764718Seric extern long dgux_inet_addr(); 24864718Seric #endif 24964718Seric 25064718Seric 25163902Seric /* 25263902Seric ** Digital Ultrix 4.2A or 4.3 25364264Seric ** 25464264Seric ** Apparently, fcntl locking is broken on 4.2A, in that locks are 25564264Seric ** not dropped when the process exits. This causes major problems, 25664264Seric ** so flock is the only alternative. 25763902Seric */ 25863902Seric 25960564Seric #ifdef ultrix 26060564Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 26164035Seric # define HASSETREUID 1 /* has setreuid(2) call */ 26263962Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 26364035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 26464264Seric # define HASFLOCK 1 /* has flock(2) call */ 26565211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 26665135Seric # ifdef vax 26765135Seric # define LA_TYPE LA_FLOAT 26865135Seric # else 26965135Seric # define LA_TYPE LA_INT 27065135Seric # define LA_AVENRUN "avenrun" 27165135Seric # endif 27265167Seric # ifndef IDENTPROTO 27365167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 27465167Seric # endif 27560564Seric #endif 27660564Seric 27764314Seric 27863902Seric /* 27963902Seric ** OSF/1 (tested on Alpha) 28063902Seric */ 28163902Seric 28263787Seric #ifdef __osf__ 28364314Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 28463962Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 28564035Seric # define HASSETREUID 1 /* has setreuid(2) call */ 28664035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 28764831Seric # define HASFLOCK 1 /* has flock(2) call */ 28863962Seric # define LA_TYPE LA_INT 28964813Seric # ifndef _PATH_SENDMAILPID 29065504Seric # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 29164813Seric # endif 29259287Seric #endif 29359287Seric 29464314Seric 29563902Seric /* 29663902Seric ** NeXTstep 29763902Seric */ 29863902Seric 29964076Seric #ifdef NeXT 30064035Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 30164035Seric # define HASFLOCK 1 /* has flock(2) call */ 30264125Seric # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 30364314Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 30464563Seric # define WAITUNION 1 /* use "union wait" as wait argument type */ 30563753Seric # define sleep sleepX 30664155Seric # define setpgid setpgrp 30764295Seric # ifndef LA_TYPE 30864295Seric # define LA_TYPE LA_MACH 30964295Seric # endif 31064500Seric # ifndef _POSIX_SOURCE 31164035Seric typedef int pid_t; 31264500Seric # undef WEXITSTATUS 31364500Seric # undef WIFEXITED 31464500Seric # endif 31564072Seric # ifndef _PATH_SENDMAILCF 31664072Seric # define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf" 31764072Seric # endif 31864072Seric # ifndef _PATH_SENDMAILPID 31964072Seric # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" 32064072Seric # endif 32159288Seric #endif 32259288Seric 32364314Seric 32463902Seric /* 32563962Seric ** 4.4 BSD 32664831Seric ** 32764831Seric ** See also BSD defines. 32863902Seric */ 32963902Seric 33060568Seric #ifdef BSD4_4 33164072Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 33264314Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 33360568Seric # include <sys/cdefs.h> 33463838Seric # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 33564072Seric # ifndef LA_TYPE 33664072Seric # define LA_TYPE LA_SUBR 33764072Seric # endif 33860568Seric #endif 33960568Seric 34064314Seric 34163902Seric /* 34265049Seric ** 386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions) 34364733Seric ** 34464733Seric ** 4.3BSD clone, closer to 4.4BSD 34564831Seric ** 34664831Seric ** See also BSD defines. 34764733Seric */ 34864733Seric 34965049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__) 35064733Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 35164733Seric # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 35264733Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 35364733Seric # include <sys/cdefs.h> 35464733Seric # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 35564733Seric # ifndef LA_TYPE 35664733Seric # define LA_TYPE LA_SUBR 35764733Seric # endif 35864733Seric #endif 35964733Seric 36064733Seric 36164733Seric /* 36264813Seric ** Mach386 36364813Seric ** 36464813Seric ** For mt Xinu's Mach386 system. 36564813Seric */ 36664813Seric 36764813Seric #if defined(MACH) && defined(i386) 36864813Seric # define MACH386 1 36964813Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 37064813Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 37164813Seric # define HASFLOCK 1 /* has flock(2) call */ 37264813Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 37364813Seric # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 37464813Seric # define NEEDSTRTOL 1 /* need the strtol() function */ 37564813Seric # define setpgid setpgrp 37664813Seric # ifndef LA_TYPE 37764813Seric # define LA_TYPE LA_FLOAT 37864813Seric # endif 37964962Seric # undef HASSETVBUF /* don't actually have setvbuf(3) */ 38064813Seric # undef WEXITSTATUS 38164813Seric # undef WIFEXITED 38264813Seric # ifndef _PATH_SENDMAILCF 38364813Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 38464813Seric # endif 38564813Seric # ifndef _PATH_SENDMAILPID 38664813Seric # define _PATH_SENDMAILPID "/etc/sendmail.pid" 38764813Seric # endif 38864813Seric #endif 38964813Seric 39064813Seric 39164813Seric /* 39263969Seric ** 4.3 BSD -- this is for very old systems 39363969Seric ** 39463969Seric ** You'll also have to install a new resolver library. 39563969Seric ** I don't guarantee that support for this environment is complete. 39663969Seric */ 39763969Seric 39863969Seric #ifdef oldBSD43 39963969Seric # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 40063969Seric # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 40163970Seric # define ARBPTR_T char * 40264155Seric # define setpgid setpgrp 40363969Seric # ifndef LA_TYPE 40463969Seric # define LA_TYPE LA_FLOAT 40563969Seric # endif 40663969Seric # ifndef _PATH_SENDMAILCF 40763969Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 40863969Seric # endif 40965167Seric # ifndef IDENTPROTO 41065167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 41165167Seric # endif 41264834Seric # undef WEXITSTATUS 41364834Seric # undef WIFEXITED 41464834Seric typedef short pid_t; 41564834Seric extern int errno; 41663969Seric #endif 41763969Seric 41864314Seric 41963969Seric /* 42063902Seric ** SCO Unix 42165087Seric ** 42265087Seric ** This includes two parts -- the first is for SCO Open Server 3.2v4 42365087Seric ** (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). 42465087Seric ** The second is, I believe, for an older version. 42563902Seric */ 42663902Seric 42765087Seric #ifdef _SCO_unix_4_2 42865087Seric # define _SCO_unix_ 42965087Seric # define HASSETREUID 1 /* has setreuid(2) call */ 43065087Seric # define _PATH_UNIX "/unix" 43165087Seric # ifndef _PATH_SENDMAILCF 43265087Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 43365087Seric # endif 43465087Seric # ifndef _PATH_SENDMAILPID 43565087Seric # define _PATH_SENDMAILPID "/etc/sendmail.pid" 43665087Seric # endif 43765087Seric #endif 43865087Seric 43963838Seric #ifdef _SCO_unix_ 44063838Seric # define SYSTEM5 1 /* include all the System V defines */ 44164035Seric # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 44263987Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 44365212Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 44463838Seric # define FORK fork 44563838Seric # define MAXPATHLEN PATHSIZE 44664718Seric # define LA_TYPE LA_SHORT 44764813Seric # undef NETUNIX /* no unix domain socket support */ 44863838Seric #endif 44963838Seric 45064314Seric 45163962Seric /* 45263962Seric ** ConvexOS 11.0 and later 45363962Seric */ 45463962Seric 45563962Seric #ifdef _CONVEX_SOURCE 45663977Seric # define BSD 1 /* include all the BSD defines */ 45763977Seric # define HASUNAME 1 /* use System V uname(2) system call */ 45863962Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 45963962Seric # define HASSETSID 1 /* has POSIX setsid(2) call */ 46063977Seric # define NEEDGETOPT 1 /* need replacement for getopt(3) */ 46163962Seric # define LA_TYPE LA_FLOAT 46265167Seric # ifndef IDENTPROTO 46365167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 46465167Seric # endif 46563962Seric #endif 46663962Seric 46764314Seric 46863962Seric /* 46964999Seric ** RISC/os 4.52 47063962Seric ** 47164999Seric ** Gives a ton of warning messages, but otherwise compiles. 47263962Seric */ 47363962Seric 47463965Seric #ifdef RISCOS 47564999Seric 47663962Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 47764831Seric # define HASFLOCK 1 /* has flock(2) call */ 47864999Seric # define WAITUNION 1 /* use "union wait" as wait argument type */ 47964999Seric # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 48063962Seric # define LA_TYPE LA_INT 48163962Seric # define LA_AVENRUN "avenrun" 48263962Seric # define _PATH_UNIX "/unix" 48364999Seric # undef WIFEXITED 48464999Seric 48564999Seric # define setpgid setpgrp 48664999Seric 48764999Seric extern int errno; 48864999Seric typedef int pid_t; 48964999Seric #define SIGFUNC_DEFINED 49064999Seric typedef int (*sigfunc_t)(); 49164999Seric extern char *getenv(); 49264999Seric extern void *malloc(); 49364999Seric 49463962Seric #endif 49563962Seric 49664314Seric 49764155Seric /* 49864155Seric ** Linux 0.99pl10 and above... 49964155Seric ** From Karl London <karl@borg.demon.co.uk>. 50064155Seric */ 50164155Seric 50264770Seric #ifdef __linux__ 50364155Seric # define BSD 1 /* pretend to be BSD based today */ 50464155Seric # undef NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 50564155Seric # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 50664380Seric # define HASUNSETENV 1 /* has unsetenv(3) call */ 50764155Seric # ifndef LA_TYPE 50864155Seric # define LA_TYPE LA_FLOAT 50964155Seric # endif 51064763Seric # include <sys/sysmacros.h> 51165046Seric # define GIDSET_T gid_t 51264155Seric #endif 51364155Seric 51464155Seric 51564345Seric /* 51664345Seric ** DELL SVR4 Issue 2.2, and others 51764345Seric ** From Kimmo Suominen <kim@grendel.lut.fi> 51864345Seric ** 51964345Seric ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 52064345Seric ** defined, and the definitions conflict. 52164924Seric ** 52264924Seric ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 52364924Seric ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 52464924Seric ** (SVR4.0/386 version 3.0). 52564345Seric */ 52664345Seric 52764345Seric #ifdef DELL_SVR4 52865189Seric /* no changes necessary */ 52965189Seric /* see general __svr4__ defines below */ 53064345Seric #endif 53164345Seric 53264345Seric 53364380Seric /* 53464380Seric ** Apple A/UX 3.0 53564380Seric */ 53664345Seric 53764380Seric #ifdef _AUX_SOURCE 53864729Seric # include <sys/sysmacros.h> 53964380Seric # define BSD /* has BSD routines */ 54064380Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 54164380Seric # define HASUNAME 1 /* use System V uname(2) system call */ 54264380Seric # define HASUSTAT 1 /* use System V ustat(2) syscall */ 54364380Seric # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 54464561Seric # define SIGFUNC_DEFINED /* sigfunc_t already defined */ 54565167Seric # ifndef IDENTPROTO 54665167Seric # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 54765167Seric # endif 54864380Seric # define FORK fork 54964380Seric # ifndef _PATH_SENDMAILCF 55064380Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 55164380Seric # endif 55264380Seric # ifndef LA_TYPE 55364380Seric # define LA_TYPE LA_ZERO 55464380Seric # endif 55564560Seric # undef WIFEXITED 55664560Seric # undef WEXITSTATUS 55764380Seric #endif 55864380Seric 55964380Seric 56064705Seric /* 56164705Seric ** Encore UMAX V 56264705Seric ** 56364705Seric ** Not extensively tested. 56464705Seric */ 56564380Seric 56664705Seric #ifdef UMAXV 56764705Seric # include <limits.h> 56864705Seric # define HASUNAME 1 /* use System V uname(2) system call */ 56964705Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 57064705Seric # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 57164705Seric # define HASINITGROUPS 1 /* has initgroups(3) call */ 57265211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 57364705Seric # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 57464705Seric # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 57564705Seric # define FORK fork /* no vfork(2) primitive available */ 57664705Seric # define MAXPATHLEN PATH_MAX 57764705Seric extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 57864705Seric extern struct group *getgrent(), *getgrnam(), *getgrgid(); 57964705Seric # undef WIFEXITED 58064705Seric # undef WEXITSTATUS 58164705Seric #endif 58264705Seric 58364705Seric 58464939Seric /* 58564939Seric ** Stardent Titan 3000 running TitanOS 4.2. 58664939Seric ** 58764939Seric ** Must be compiled in "cc -43" mode. 58864939Seric ** 58964944Seric ** From Kate Hedstrom <kate@ahab.rutgers.edu>. 59064939Seric ** 59164939Seric ** Note the tweaking below after the BSD defines are set. 59264939Seric */ 59364705Seric 59464939Seric #ifdef titan 59564939Seric # define setpgid setpgrp 59664939Seric typedef int pid_t; 59764939Seric # undef WIFEXITED 59864939Seric # undef WEXITSTATUS 59964939Seric #endif 60064939Seric 60164939Seric 60264962Seric /* 60364962Seric ** Sequent DYNIX 3.2.0 60464962Seric ** 60564962Seric ** From Jim Davis <jdavis@cs.arizona.edu>. 60664962Seric */ 60764939Seric 60864962Seric #ifdef sequent 60964962Seric # define BSD 1 61064962Seric # define HASUNSETENV 1 61164962Seric # define BSD4_3 1 /* to get signal() in conf.c */ 61264962Seric # define WAITUNION 1 61364962Seric # define LA_TYPE LA_FLOAT 61464962Seric # ifdef _POSIX_VERSION 61564962Seric # undef _POSIX_VERSION /* set in <unistd.h> */ 61664962Seric # endif 61764962Seric # undef HASSETVBUF /* don't actually have setvbuf(3) */ 61864962Seric # define setpgid setpgrp 61964962Seric 62064962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 62164962Seric # undef WIFEXITED 62264962Seric # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 62364962Seric ((union wait*)&(s))->w_termsig == 0) 62464962Seric # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 62564962Seric typedef int pid_t; 62664962Seric # define isgraph(c) (isprint(c) && (c != ' ')) 62764962Seric 62864962Seric # ifndef _PATH_UNIX 62964962Seric # define _PATH_UNIX "/dynix" 63064962Seric # endif 63164962Seric # ifndef _PATH_SENDMAILCF 63264962Seric # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" 63364962Seric # endif 63464962Seric 63564962Seric #endif 63664962Seric 63764962Seric 63864962Seric 63964962Seric 64063902Seric /********************************************************************** 64163787Seric ** End of Per-Operating System defines 64263902Seric **********************************************************************/ 64363787Seric 64463949Seric /********************************************************************** 64563949Seric ** More general defines 64663949Seric **********************************************************************/ 64763949Seric 64863962Seric /* general BSD defines */ 64963962Seric #ifdef BSD 65064035Seric # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 65164035Seric # define HASSETREUID 1 /* has setreuid(2) call */ 65264035Seric # define HASINITGROUPS 1 /* has initgroups(2) call */ 65364035Seric # define HASFLOCK 1 /* has flock(2) call */ 65463962Seric #endif 65563962Seric 65665189Seric /* general System V Release 4 defines */ 65765189Seric #ifdef __svr4__ 65865189Seric # define SYSTEM5 1 65965189Seric # define HASSETREUID 1 /* has seteuid(2) call & working saved uids */ 66065211Seric # ifndef HASGETUSERSHELL 66165211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 66265210Seric # endif 66365189Seric # define setreuid(r, e) seteuid(e) 66465189Seric 66565189Seric # ifndef _PATH_UNIX 66665189Seric # define _PATH_UNIX "/unix" 66765189Seric # endif 66865189Seric # ifndef _PATH_SENDMAILCF 66965189Seric # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 67065189Seric # endif 67165189Seric # ifndef _PATH_SENDMAILPID 67265189Seric # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 67365189Seric # endif 67465189Seric # ifndef SYSLOG_BUFSIZE 67565189Seric # define SYSLOG_BUFSIZE 128 67665189Seric # endif 67765189Seric #endif 67865189Seric 67963787Seric /* general System V defines */ 68063787Seric # ifdef SYSTEM5 68164813Seric # include <sys/sysmacros.h> 68263949Seric # define HASUNAME 1 /* use System V uname(2) system call */ 68363949Seric # define HASUSTAT 1 /* use System V ustat(2) syscall */ 68464705Seric # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 68564962Seric # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 68663962Seric # ifndef LA_TYPE 68763962Seric # define LA_TYPE LA_INT 68863962Seric # endif 68963949Seric # define bcopy(s, d, l) (memmove((d), (s), (l))) 69063949Seric # define bzero(d, l) (memset((d), '\0', (l))) 69163949Seric # define bcmp(s, d, l) (memcmp((s), (d), (l))) 69263787Seric # endif 69363787Seric 69463949Seric /* general POSIX defines */ 69563949Seric #ifdef _POSIX_VERSION 69664718Seric # define HASSETSID 1 /* has Posix setsid(2) call */ 69764718Seric # define HASWAITPID 1 /* has Posix waitpid(2) call */ 69863949Seric #endif 69963949Seric 70063787Seric /* 70163937Seric ** If no type for argument two of getgroups call is defined, assume 70263937Seric ** it's an integer -- unfortunately, there seem to be several choices 70363937Seric ** here. 70463937Seric */ 70563937Seric 70663937Seric #ifndef GIDSET_T 70763937Seric # define GIDSET_T int 70863937Seric #endif 70963937Seric 71064939Seric /* 71164939Seric ** Tweaking for systems that (for example) claim to be BSD but 71264939Seric ** don't have all the standard BSD routines (boo hiss). 71364939Seric */ 71464439Seric 71564939Seric #ifdef titan 71664939Seric # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 71764939Seric #endif 71864939Seric 71965167Seric /* 72065167Seric ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 72165167Seric ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 72265167Seric ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 72365167Seric ** are closed. Some firewalls return this error if you try to connect 72465167Seric ** to the IDENT port (113), so you can't receive email from these hosts 72565167Seric ** on these systems. The firewall really should use a more specific 72665167Seric ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If 72765167Seric ** not explicitly set to zero above, default it on. 72865167Seric */ 72964939Seric 73065167Seric #ifndef IDENTPROTO 73165167Seric # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 73265167Seric #endif 73365167Seric 73465211Seric #ifndef HASGETUSERSHELL 73565211Seric # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 73665210Seric #endif 73765167Seric 73865210Seric 73964439Seric /********************************************************************** 74059023Seric ** Remaining definitions should never have to be changed. They are 74159023Seric ** primarily to provide back compatibility for older systems -- for 74259287Seric ** example, it includes some POSIX compatibility definitions 74364439Seric **********************************************************************/ 74459023Seric 74559388Seric /* System 5 compatibility */ 74659388Seric #ifndef S_ISREG 74764944Seric # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 74859388Seric #endif 74964944Seric #if !defined(S_ISLNK) && defined(S_IFLNK) 75064944Seric # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 75164944Seric #endif 75259388Seric #ifndef S_IWGRP 75359388Seric #define S_IWGRP 020 75459388Seric #endif 75559388Seric #ifndef S_IWOTH 75659388Seric #define S_IWOTH 002 75759388Seric #endif 75859388Seric 75959023Seric /* 76050537Seric ** Older systems don't have this error code -- it should be in 76150537Seric ** /usr/include/sysexits.h. 76250537Seric */ 76350537Seric 76450537Seric # ifndef EX_CONFIG 76550537Seric # define EX_CONFIG 78 /* configuration error */ 76650537Seric # endif 76756852Seric 76864718Seric /* pseudo-code used in server SMTP */ 76964718Seric # define EX_QUIT 22 /* drop out of server immediately */ 77064718Seric 77164718Seric 77263993Seric /* 77363993Seric ** These are used in a few cases where we need some special 77463993Seric ** error codes, but where the system doesn't provide something 77563993Seric ** reasonable. They are printed in errstring. 77663993Seric */ 77763993Seric 77863993Seric #ifndef E_PSEUDOBASE 77963993Seric # define E_PSEUDOBASE 256 78063993Seric #endif 78163993Seric 78263993Seric #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 78363993Seric #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 78463993Seric 78563970Seric /* type of arbitrary pointer */ 78663970Seric #ifndef ARBPTR_T 78763970Seric # define ARBPTR_T void * 78863970Seric #endif 78963970Seric 79060568Seric #ifndef __P 79160568Seric # include "cdefs.h" 79260568Seric #endif 79360568Seric 79456852Seric /* 79558778Seric ** Do some required dependencies 79658778Seric */ 79758778Seric 79858778Seric #if defined(NETINET) || defined(NETISO) 79959107Seric # define SMTP 1 /* enable user and server SMTP */ 80059107Seric # define QUEUE 1 /* enable queueing */ 80159107Seric # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 80258778Seric #endif 80358778Seric 80458778Seric 80558778Seric /* 80656852Seric ** Arrange to use either varargs or stdargs 80756852Seric */ 80856852Seric 80956852Seric # ifdef __STDC__ 81056852Seric 81156852Seric # include <stdarg.h> 81256852Seric 81356852Seric # define VA_LOCAL_DECL va_list ap; 81456852Seric # define VA_START(f) va_start(ap, f) 81556852Seric # define VA_END va_end(ap) 81656852Seric 81756852Seric # else 81856852Seric 81956852Seric # include <varargs.h> 82056852Seric 82156852Seric # define VA_LOCAL_DECL va_list ap; 82256852Seric # define VA_START(f) va_start(ap) 82356852Seric # define VA_END va_end(ap) 82456852Seric 82556852Seric # endif 82657631Seric 82757943Seric #ifdef HASUNAME 82857631Seric # include <sys/utsname.h> 82957631Seric # ifdef newstr 83057631Seric # undef newstr 83157631Seric # endif 83257943Seric #else /* ! HASUNAME */ 83357631Seric # define NODE_LENGTH 32 83457631Seric struct utsname 83557631Seric { 83657631Seric char nodename[NODE_LENGTH+1]; 83757631Seric }; 83857943Seric #endif /* HASUNAME */ 83957642Seric 84063838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) 84163838Seric # define MAXHOSTNAMELEN 256 84257735Seric #endif 84358153Seric 84458153Seric #if !defined(SIGCHLD) && defined(SIGCLD) 84558153Seric # define SIGCHLD SIGCLD 84658153Seric #endif 84758153Seric 84858153Seric #ifndef STDIN_FILENO 84958153Seric #define STDIN_FILENO 0 85058153Seric #endif 85158153Seric 85258153Seric #ifndef STDOUT_FILENO 85358153Seric #define STDOUT_FILENO 1 85458153Seric #endif 85558153Seric 85658153Seric #ifndef STDERR_FILENO 85758153Seric #define STDERR_FILENO 2 85858153Seric #endif 85958689Seric 86064072Seric #ifndef LOCK_SH 86164035Seric # define LOCK_SH 0x01 /* shared lock */ 86264035Seric # define LOCK_EX 0x02 /* exclusive lock */ 86364035Seric # define LOCK_NB 0x04 /* non-blocking lock */ 86464035Seric # define LOCK_UN 0x08 /* unlock */ 86564035Seric #endif 86658692Seric 86764035Seric #ifndef SIG_ERR 86864035Seric # define SIG_ERR ((void (*)()) -1) 86958689Seric #endif 87058702Seric 87164500Seric #ifndef WEXITSTATUS 87264500Seric # define WEXITSTATUS(st) (((st) >> 8) & 0377) 87364500Seric #endif 87464500Seric #ifndef WIFEXITED 87564500Seric # define WIFEXITED(st) (((st) & 0377) == 0) 87664500Seric #endif 87764500Seric 87864561Seric #ifndef SIGFUNC_DEFINED 87964561Seric typedef void (*sigfunc_t) __P((int)); 88064561Seric #endif 88164561Seric 88265053Seric /* size of syslog buffer */ 88365053Seric #ifndef SYSLOG_BUFSIZE 88465053Seric # define SYSLOG_BUFSIZE 1024 88565053Seric #endif 88665053Seric 88758702Seric /* 88858702Seric ** Size of tobuf (deliver.c) 88958702Seric ** Tweak this to match your syslog implementation. It will have to 89058702Seric ** allow for the extra information printed. 89158702Seric */ 89258702Seric 89358702Seric #ifndef TOBUFSIZE 89465053Seric # if (SYSLOG_BUFSIZE) > 512 89565053Seric # define TOBUFSIZE (SYSLOG_BUFSIZE - 256) 89665053Seric # else 89765053Seric # define TOBUFSIZE 256 89865053Seric # endif 89958702Seric #endif 90060219Seric 90165015Seric /* 90265015Seric ** Size of prescan buffer. 90365015Seric ** Despite comments in the _sendmail_ book, this probably should 90465015Seric ** not be changed; there are some hard-to-define dependencies. 90565015Seric */ 90665015Seric 90765015Seric # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 90860219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 90960219Seric # ifndef FORK 91060219Seric # define FORK vfork /* function to call to fork mailer */ 91160219Seric # endif 912