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*65748Seric * @(#)conf.h 8.76 (Berkeley) 01/15/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 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 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 638*65748Seric /* 639*65748Seric ** Cray Unicos 640*65748Seric ** 641*65748Seric ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 642*65748Seric */ 64364962Seric 644*65748Seric #ifdef UNICOS 645*65748Seric # define SYSTEM5 1 /* include all the System V defines */ 646*65748Seric # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 647*65748Seric # define HASSTATFS 1 /* has the statfs(2) syscall */ 648*65748Seric # define MAXPATHLEN PATHSIZE 649*65748Seric # define LA_TYPE LA_ZERO 650*65748Seric #endif 65164962Seric 652*65748Seric 653*65748Seric 65463902Seric /********************************************************************** 65563787Seric ** End of Per-Operating System defines 65663902Seric **********************************************************************/ 65763787Seric 65863949Seric /********************************************************************** 65963949Seric ** More general defines 66063949Seric **********************************************************************/ 66163949Seric 66263962Seric /* general BSD defines */ 66363962Seric #ifdef BSD 66464035Seric # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 66564035Seric # define HASSETREUID 1 /* has setreuid(2) call */ 66664035Seric # define HASINITGROUPS 1 /* has initgroups(2) call */ 66764035Seric # define HASFLOCK 1 /* has flock(2) call */ 66863962Seric #endif 66963962Seric 67065189Seric /* general System V Release 4 defines */ 67165189Seric #ifdef __svr4__ 67265189Seric # define SYSTEM5 1 67365189Seric # define HASSETREUID 1 /* has seteuid(2) call & working saved uids */ 67465211Seric # ifndef HASGETUSERSHELL 67565211Seric # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 67665210Seric # endif 67765189Seric # define setreuid(r, e) seteuid(e) 67865189Seric 67965189Seric # ifndef _PATH_UNIX 68065189Seric # define _PATH_UNIX "/unix" 68165189Seric # endif 68265189Seric # ifndef _PATH_SENDMAILCF 68365189Seric # define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf" 68465189Seric # endif 68565189Seric # ifndef _PATH_SENDMAILPID 68665189Seric # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 68765189Seric # endif 68865189Seric # ifndef SYSLOG_BUFSIZE 68965189Seric # define SYSLOG_BUFSIZE 128 69065189Seric # endif 69165189Seric #endif 69265189Seric 69363787Seric /* general System V defines */ 69463787Seric # ifdef SYSTEM5 69564813Seric # include <sys/sysmacros.h> 69663949Seric # define HASUNAME 1 /* use System V uname(2) system call */ 69763949Seric # define HASUSTAT 1 /* use System V ustat(2) syscall */ 69864705Seric # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 69964962Seric # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 70063962Seric # ifndef LA_TYPE 70163962Seric # define LA_TYPE LA_INT 70263962Seric # endif 70363949Seric # define bcopy(s, d, l) (memmove((d), (s), (l))) 70463949Seric # define bzero(d, l) (memset((d), '\0', (l))) 70563949Seric # define bcmp(s, d, l) (memcmp((s), (d), (l))) 70663787Seric # endif 70763787Seric 70863949Seric /* general POSIX defines */ 70963949Seric #ifdef _POSIX_VERSION 71064718Seric # define HASSETSID 1 /* has Posix setsid(2) call */ 71164718Seric # define HASWAITPID 1 /* has Posix waitpid(2) call */ 71263949Seric #endif 71363949Seric 71463787Seric /* 71563937Seric ** If no type for argument two of getgroups call is defined, assume 71663937Seric ** it's an integer -- unfortunately, there seem to be several choices 71763937Seric ** here. 71863937Seric */ 71963937Seric 72063937Seric #ifndef GIDSET_T 72163937Seric # define GIDSET_T int 72263937Seric #endif 72363937Seric 72464939Seric /* 72564939Seric ** Tweaking for systems that (for example) claim to be BSD but 72664939Seric ** don't have all the standard BSD routines (boo hiss). 72764939Seric */ 72864439Seric 72964939Seric #ifdef titan 73064939Seric # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 73164939Seric #endif 73264939Seric 73365167Seric /* 73465167Seric ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 73565167Seric ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 73665167Seric ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 73765167Seric ** are closed. Some firewalls return this error if you try to connect 73865167Seric ** to the IDENT port (113), so you can't receive email from these hosts 73965167Seric ** on these systems. The firewall really should use a more specific 74065167Seric ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If 74165167Seric ** not explicitly set to zero above, default it on. 74265167Seric */ 74364939Seric 74465167Seric #ifndef IDENTPROTO 74565167Seric # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 74665167Seric #endif 74765167Seric 74865211Seric #ifndef HASGETUSERSHELL 74965211Seric # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 75065210Seric #endif 75165167Seric 75265210Seric 75364439Seric /********************************************************************** 75459023Seric ** Remaining definitions should never have to be changed. They are 75559023Seric ** primarily to provide back compatibility for older systems -- for 75659287Seric ** example, it includes some POSIX compatibility definitions 75764439Seric **********************************************************************/ 75859023Seric 75959388Seric /* System 5 compatibility */ 76059388Seric #ifndef S_ISREG 76164944Seric # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 76259388Seric #endif 76364944Seric #if !defined(S_ISLNK) && defined(S_IFLNK) 76464944Seric # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 76564944Seric #endif 76659388Seric #ifndef S_IWGRP 76759388Seric #define S_IWGRP 020 76859388Seric #endif 76959388Seric #ifndef S_IWOTH 77059388Seric #define S_IWOTH 002 77159388Seric #endif 77259388Seric 77359023Seric /* 77450537Seric ** Older systems don't have this error code -- it should be in 77550537Seric ** /usr/include/sysexits.h. 77650537Seric */ 77750537Seric 77850537Seric # ifndef EX_CONFIG 77950537Seric # define EX_CONFIG 78 /* configuration error */ 78050537Seric # endif 78156852Seric 78264718Seric /* pseudo-code used in server SMTP */ 78364718Seric # define EX_QUIT 22 /* drop out of server immediately */ 78464718Seric 78564718Seric 78663993Seric /* 78763993Seric ** These are used in a few cases where we need some special 78863993Seric ** error codes, but where the system doesn't provide something 78963993Seric ** reasonable. They are printed in errstring. 79063993Seric */ 79163993Seric 79263993Seric #ifndef E_PSEUDOBASE 79363993Seric # define E_PSEUDOBASE 256 79463993Seric #endif 79563993Seric 79663993Seric #define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */ 79763993Seric #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 79863993Seric 79963970Seric /* type of arbitrary pointer */ 80063970Seric #ifndef ARBPTR_T 80163970Seric # define ARBPTR_T void * 80263970Seric #endif 80363970Seric 80460568Seric #ifndef __P 80560568Seric # include "cdefs.h" 80660568Seric #endif 80760568Seric 80856852Seric /* 80958778Seric ** Do some required dependencies 81058778Seric */ 81158778Seric 81258778Seric #if defined(NETINET) || defined(NETISO) 81359107Seric # define SMTP 1 /* enable user and server SMTP */ 81459107Seric # define QUEUE 1 /* enable queueing */ 81559107Seric # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 81658778Seric #endif 81758778Seric 81858778Seric 81958778Seric /* 82056852Seric ** Arrange to use either varargs or stdargs 82156852Seric */ 82256852Seric 82356852Seric # ifdef __STDC__ 82456852Seric 82556852Seric # include <stdarg.h> 82656852Seric 82756852Seric # define VA_LOCAL_DECL va_list ap; 82856852Seric # define VA_START(f) va_start(ap, f) 82956852Seric # define VA_END va_end(ap) 83056852Seric 83156852Seric # else 83256852Seric 83356852Seric # include <varargs.h> 83456852Seric 83556852Seric # define VA_LOCAL_DECL va_list ap; 83656852Seric # define VA_START(f) va_start(ap) 83756852Seric # define VA_END va_end(ap) 83856852Seric 83956852Seric # endif 84057631Seric 84157943Seric #ifdef HASUNAME 84257631Seric # include <sys/utsname.h> 84357631Seric # ifdef newstr 84457631Seric # undef newstr 84557631Seric # endif 84657943Seric #else /* ! HASUNAME */ 84757631Seric # define NODE_LENGTH 32 84857631Seric struct utsname 84957631Seric { 85057631Seric char nodename[NODE_LENGTH+1]; 85157631Seric }; 85257943Seric #endif /* HASUNAME */ 85357642Seric 85463838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) 85563838Seric # define MAXHOSTNAMELEN 256 85657735Seric #endif 85758153Seric 85858153Seric #if !defined(SIGCHLD) && defined(SIGCLD) 85958153Seric # define SIGCHLD SIGCLD 86058153Seric #endif 86158153Seric 86258153Seric #ifndef STDIN_FILENO 86358153Seric #define STDIN_FILENO 0 86458153Seric #endif 86558153Seric 86658153Seric #ifndef STDOUT_FILENO 86758153Seric #define STDOUT_FILENO 1 86858153Seric #endif 86958153Seric 87058153Seric #ifndef STDERR_FILENO 87158153Seric #define STDERR_FILENO 2 87258153Seric #endif 87358689Seric 87464072Seric #ifndef LOCK_SH 87564035Seric # define LOCK_SH 0x01 /* shared lock */ 87664035Seric # define LOCK_EX 0x02 /* exclusive lock */ 87764035Seric # define LOCK_NB 0x04 /* non-blocking lock */ 87864035Seric # define LOCK_UN 0x08 /* unlock */ 87964035Seric #endif 88058692Seric 88164035Seric #ifndef SIG_ERR 88264035Seric # define SIG_ERR ((void (*)()) -1) 88358689Seric #endif 88458702Seric 88564500Seric #ifndef WEXITSTATUS 88664500Seric # define WEXITSTATUS(st) (((st) >> 8) & 0377) 88764500Seric #endif 88864500Seric #ifndef WIFEXITED 88964500Seric # define WIFEXITED(st) (((st) & 0377) == 0) 89064500Seric #endif 89164500Seric 89264561Seric #ifndef SIGFUNC_DEFINED 89364561Seric typedef void (*sigfunc_t) __P((int)); 89464561Seric #endif 89564561Seric 89665053Seric /* size of syslog buffer */ 89765053Seric #ifndef SYSLOG_BUFSIZE 89865053Seric # define SYSLOG_BUFSIZE 1024 89965053Seric #endif 90065053Seric 90158702Seric /* 90258702Seric ** Size of tobuf (deliver.c) 90358702Seric ** Tweak this to match your syslog implementation. It will have to 90458702Seric ** allow for the extra information printed. 90558702Seric */ 90658702Seric 90758702Seric #ifndef TOBUFSIZE 90865053Seric # if (SYSLOG_BUFSIZE) > 512 90965053Seric # define TOBUFSIZE (SYSLOG_BUFSIZE - 256) 91065053Seric # else 91165053Seric # define TOBUFSIZE 256 91265053Seric # endif 91358702Seric #endif 91460219Seric 91565015Seric /* 91665015Seric ** Size of prescan buffer. 91765015Seric ** Despite comments in the _sendmail_ book, this probably should 91865015Seric ** not be changed; there are some hard-to-define dependencies. 91965015Seric */ 92065015Seric 92165015Seric # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 92260219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 92360219Seric # ifndef FORK 92460219Seric # define FORK vfork /* function to call to fork mailer */ 92560219Seric # endif 926