xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 64358)
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*64358Seric  *	@(#)conf.h	8.28 (Berkeley) 08/26/93
933728Sbostic  */
109147Seric 
1122726Sdist /*
1222726Sdist **  CONF.H -- All user-configurable parameters for sendmail
1322726Sdist */
149147Seric 
1557232Seric # include <sys/param.h>
1659389Seric # include <sys/stat.h>
1758689Seric # include <fcntl.h>
1864035Seric # include <signal.h>
1957232Seric 
2063902Seric /**********************************************************************
219147Seric **  Table sizes, etc....
229147Seric **	There shouldn't be much need to change these....
2363902Seric **********************************************************************/
249147Seric 
2559303Seric # define MAXLINE	2048		/* max line length */
2624945Seric # define MAXNAME	256		/* max length of a name */
279147Seric # define MAXPV		40		/* max # of parms to mailers */
2859303Seric # define MAXATOM	200		/* max atoms per address */
299147Seric # define MAXMAILERS	25		/* maximum mailers known to system */
3057143Seric # define MAXRWSETS	100		/* max # of sets of rewriting rules */
319147Seric # define MAXPRIORITIES	25		/* max values for Precedence: field */
3257143Seric # define MAXMXHOSTS	20		/* max # of MX records */
3352106Seric # define SMTPLINELIM	990		/* maximum SMTP line length */
3457232Seric # define MAXKEY		128		/* maximum size of a database key */
3557232Seric # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
3659056Seric # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
3759667Seric # define MAXALIASDB	12		/* max # of alias databases */
3859303Seric # define PSBUFSIZE	(MAXLINE + MAXATOM)	/* size of prescan buffer */
3957143Seric 
4057143Seric # ifndef QUEUESIZE
4157143Seric # define QUEUESIZE	1000		/* max # of jobs per queue run */
4257143Seric # endif
4357143Seric 
4463902Seric /**********************************************************************
459147Seric **  Compilation options.
4625673Seric **
4725673Seric **	#define these if they are available; comment them out otherwise.
4863902Seric **********************************************************************/
499147Seric 
5025673Seric # define LOG		1	/* enable logging */
5125673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
5258778Seric # define NETINET	1	/* include internet support */
5325673Seric # define SETPROCTITLE	1	/* munge argv to display current status */
5435651Seric # define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
5553735Seric # define MATCHGECOS	1	/* match user names from gecos field */
5663753Seric # define XDEBUG		1	/* enable extended debugging */
5736483Sbostic 
5856337Seric # ifdef NEWDB
5956337Seric # define USERDB		1	/* look in user database (requires NEWDB) */
6056337Seric # endif
6156337Seric 
6264032Seric /*
6364032Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
6464032Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
6564032Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
6664032Seric **  are closed.  Some firewalls return this error if you try to connect
6764032Seric **  to the IDENT port (113), so you can't receive email from these hosts
6864032Seric **  on these systems.  The firewall really should use a more specific
6964032Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  This
7064032Seric **  will get #undefed below as needed.
7164032Seric */
7264032Seric 
7364032Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
7464032Seric 
7563902Seric /**********************************************************************
7659023Seric **  Operating system configuration.
7759023Seric **
7859023Seric **	Unless you are porting to a new OS, you shouldn't have to
7959023Seric **	change these.
8063902Seric **********************************************************************/
8156823Seric 
8263787Seric /*
8363787Seric **  Per-Operating System defines
8463787Seric */
8563787Seric 
8664314Seric 
8763902Seric /*
8863902Seric **  HP-UX -- tested for 8.07
8963902Seric */
9063902Seric 
9159348Seric # ifdef __hpux
9263787Seric # define SYSTEM5	1	/* include all the System V defines */
9364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
9464314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
9564035Seric # define HASSETREUID	1	/* has setreuid(2) call */
9663902Seric # define setreuid(r, e)		setresuid(r, e, -1)
9763962Seric # define LA_TYPE	LA_FLOAT
9863962Seric # define _PATH_UNIX	"/hp-ux"
99*64358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
10056823Seric # endif
10156823Seric 
10264314Seric 
10363902Seric /*
10463902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
10563902Seric */
10663902Seric 
10760224Seric # ifdef _AIX3
10864035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
10960219Seric # define FORK		fork	/* no vfork primitive available */
11060219Seric # endif
11160219Seric 
11264314Seric 
11363902Seric /*
11463902Seric **  Silicon Graphics IRIX
11563902Seric **
11663965Seric **	Compiles on 4.0.1.
11763902Seric */
11863902Seric 
11963753Seric # ifdef IRIX
12064035Seric # define HASSETREUID	1	/* has setreuid(2) call */
12164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
12264314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
12363753Seric # define FORK		fork	/* no vfork primitive available */
12464155Seric # define setpgid	BSDsetpgrp
12563937Seric # define GIDSET_T	gid_t
12663753Seric # endif
12763753Seric 
12863902Seric 
12963902Seric /*
13063902Seric **  SunOS
13163902Seric */
13263902Seric 
13363787Seric #if defined(sun) && !defined(BSD)
13459074Seric 
13563962Seric # define LA_TYPE	LA_INT
13664035Seric # define HASSETREUID	1	/* has setreuid(2) call */
13764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
13860564Seric 
13960602Seric # ifdef SOLARIS
14063902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
14163949Seric #  define SYSTEM5	1	/* use System V definitions */
14263977Seric #  define setreuid(r, e)	seteuid(e)
14363787Seric #  include <sys/time.h>
14464125Seric #  define gethostbyname	__switch_gethostbyname	/* get working version */
14564125Seric #  define gethostbyaddr	__switch_gethostbyaddr	/* get working version */
14663962Seric #  define _PATH_UNIX	"/kernel/unix"
14763962Seric #  ifndef _PATH_SENDMAILCF
14863962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
14964072Seric #  endif
15064072Seric #  ifndef _PATH_SENDMAILPID
15163962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
15263962Seric #  endif
15363787Seric 
15460602Seric # else
15563787Seric 			/* SunOS 4.1.x */
15660602Seric #  define HASSTATFS	1	/* has the statfs(2) syscall */
15764035Seric /* #  define HASFLOCK	1	/* has flock(2) call */
15860564Seric #  include <vfork.h>
15963787Seric 
16060564Seric # endif
16159023Seric #endif
16259023Seric 
16364314Seric 
16463902Seric /*
16563902Seric **  Digital Ultrix 4.2A or 4.3
16664264Seric **
16764264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
16864264Seric **	not dropped when the process exits.  This causes major problems,
16964264Seric **	so flock is the only alternative.
17063902Seric */
17163902Seric 
17260564Seric #ifdef ultrix
17360564Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
17464035Seric # define HASSETREUID	1	/* has setreuid(2) call */
17563962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
17664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
17764264Seric # define HASFLOCK	1	/* has flock(2) call */
17863962Seric # define LA_TYPE	LA_INT
17963962Seric # define LA_AVENRUN	"avenrun"
180*64358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
18160564Seric #endif
18260564Seric 
18364314Seric 
18463902Seric /*
18563902Seric **  OSF/1 (tested on Alpha)
18663902Seric */
18763902Seric 
18863787Seric #ifdef __osf__
18964314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
19063962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
19164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
19264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
19364035Seric /* # define HASFLOCK	1	/* has flock(2) call */
19463962Seric # define LA_TYPE	LA_INT
19559287Seric #endif
19659287Seric 
19764314Seric 
19863902Seric /*
19963902Seric **  NeXTstep
20063902Seric */
20163902Seric 
20264076Seric #ifdef NeXT
20364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
20464035Seric # define HASFLOCK	1	/* has flock(2) call */
20564125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
20664314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
20763753Seric # define sleep		sleepX
20864155Seric # define setpgid	setpgrp
20964295Seric # ifndef LA_TYPE
21064295Seric #  define LA_TYPE	LA_MACH
21164295Seric # endif
21264035Seric typedef int		pid_t;
21364072Seric # ifndef _PATH_SENDMAILCF
21464072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
21564072Seric # endif
21664072Seric # ifndef _PATH_SENDMAILPID
21764072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
21864072Seric # endif
21959288Seric #endif
22059288Seric 
22164314Seric 
22263902Seric /*
22363962Seric **  4.4 BSD
22463902Seric */
22563902Seric 
22660568Seric #ifdef BSD4_4
22764072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
22864314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
22960568Seric # include <sys/cdefs.h>
23063838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
23164072Seric # ifndef LA_TYPE
23264072Seric #  define LA_TYPE	LA_SUBR
23364072Seric # endif
23460568Seric #endif
23560568Seric 
23664314Seric 
23763902Seric /*
23863969Seric **  4.3 BSD -- this is for very old systems
23963969Seric **
24063969Seric **	You'll also have to install a new resolver library.
24163969Seric **	I don't guarantee that support for this environment is complete.
24263969Seric */
24363969Seric 
24463969Seric #ifdef oldBSD43
24563969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
24663969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
24763970Seric # define ARBPTR_T	char *
24864155Seric # define setpgid	setpgrp
24963969Seric # ifndef LA_TYPE
25063969Seric #  define LA_TYPE	LA_FLOAT
25163969Seric # endif
25263969Seric # ifndef _PATH_SENDMAILCF
25363969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
25463969Seric # endif
255*64358Seric # undef IDENTPROTO		/* TCP/IP implementation is broken */
25663969Seric #endif
25763969Seric 
25864314Seric 
25963969Seric /*
26063902Seric **  SCO Unix
26163902Seric */
26263902Seric 
26363838Seric #ifdef _SCO_unix_
26463838Seric # define SYSTEM5	1	/* include all the System V defines */
26564035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
26663987Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
26763838Seric # define FORK		fork
26863838Seric # define MAXPATHLEN	PATHSIZE
26963962Seric # define LA_TYPE	LA_ZERO
27063838Seric #endif
27163838Seric 
27264314Seric 
27363962Seric /*
27463962Seric **  ConvexOS 11.0 and later
27563962Seric */
27663962Seric 
27763962Seric #ifdef _CONVEX_SOURCE
27863977Seric # define BSD		1	/* include all the BSD defines */
27963977Seric # define HASUNAME	1	/* use System V uname(2) system call */
28063962Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
28163962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
28263977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
28363962Seric # define LA_TYPE	LA_FLOAT
28464032Seric # undef IDENTPROTO
28563962Seric #endif
28663962Seric 
28764314Seric 
28863962Seric /*
28963962Seric **  RISC/os 4.51
29063962Seric **
29163962Seric **	Untested...
29263962Seric */
29363962Seric 
29463965Seric #ifdef RISCOS
29563962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
29664035Seric /* # define HASFLOCK	1	/* has flock(2) call */
29763962Seric # define LA_TYPE	LA_INT
29863962Seric # define LA_AVENRUN	"avenrun"
29963962Seric # define _PATH_UNIX	"/unix"
30063962Seric #endif
30163962Seric 
30264314Seric 
30364155Seric /*
30464155Seric **  Linux 0.99pl10 and above...
30564155Seric **	From Karl London <karl@borg.demon.co.uk>.
30664155Seric */
30764155Seric 
30864155Seric #ifdef linux
30964155Seric # define BSD		1	/* pretend to be BSD based today */
31064155Seric # undef  NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
31164155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
31264155Seric # ifndef LA_TYPE
31364155Seric #  define LA_TYPE	LA_FLOAT
31464155Seric # endif
31564155Seric #endif
31664155Seric 
31764155Seric 
31864345Seric /*
31964345Seric **  DELL SVR4 Issue 2.2, and others
32064345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
32164345Seric **
32264345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
32364345Seric **	defined, and the definitions conflict.
32464345Seric */
32564345Seric 
32664345Seric #ifdef DELL_SVR4
32764345Seric # define SYSTEM5	1
32864345Seric /* # define setreuid(r, e)	seteuid(e) */
32964345Seric /* # include <sys/time.h> */
33064345Seric # define _PATH_UNIX	"/unix"
33164345Seric # ifndef _PATH_SENDMAILCF
33264345Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
33364345Seric # endif
33464345Seric # ifndef _PATH_SENDMAILPID
33564345Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
33664345Seric # endif
33764345Seric #endif
33864345Seric 
33964345Seric 
34064345Seric 
34163902Seric /**********************************************************************
34263787Seric **  End of Per-Operating System defines
34363902Seric **********************************************************************/
34463787Seric 
34563949Seric /**********************************************************************
34663949Seric **  More general defines
34763949Seric **********************************************************************/
34863949Seric 
34963962Seric /* general BSD defines */
35063962Seric #ifdef BSD
35164035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
35264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
35364035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
35464035Seric # define HASFLOCK	1	/* has flock(2) call */
35563962Seric #endif
35663962Seric 
35763787Seric /* general System V defines */
35863787Seric # ifdef SYSTEM5
35963949Seric # define HASUNAME	1	/* use System V uname(2) system call */
36063949Seric # define HASUSTAT	1	/* use System V ustat(2) syscall */
36163962Seric # ifndef LA_TYPE
36263962Seric #  define LA_TYPE	LA_INT
36363962Seric # endif
36463949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
36563949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
36663949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
36763787Seric # endif
36863787Seric 
36963949Seric /* general "standard C" defines */
37063949Seric #if defined(__STDC__) || defined(SYSTEM5)
37163949Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
37263949Seric #endif
37363949Seric 
37463949Seric /* general POSIX defines */
37563949Seric #ifdef _POSIX_VERSION
37663949Seric # define HASSETSID	1	/* has setsid(2) call */
37763966Seric # define HASWAITPID	1	/* has waitpid(2) call */
37863949Seric #endif
37963949Seric 
38063787Seric /*
38163937Seric **  If no type for argument two of getgroups call is defined, assume
38263937Seric **  it's an integer -- unfortunately, there seem to be several choices
38363937Seric **  here.
38463937Seric */
38563937Seric 
38663937Seric #ifndef GIDSET_T
38763937Seric # define GIDSET_T	int
38863937Seric #endif
38963937Seric 
39063937Seric /*
39159023Seric **  Remaining definitions should never have to be changed.  They are
39259023Seric **  primarily to provide back compatibility for older systems -- for
39359287Seric **  example, it includes some POSIX compatibility definitions
39459287Seric */
39559023Seric 
39659388Seric /* System 5 compatibility */
39759388Seric #ifndef S_ISREG
39859388Seric #define S_ISREG(foo)	((foo & S_IFREG) == S_IFREG)
39959388Seric #endif
40059388Seric #ifndef S_IWGRP
40159388Seric #define S_IWGRP		020
40259388Seric #endif
40359388Seric #ifndef S_IWOTH
40459388Seric #define S_IWOTH		002
40559388Seric #endif
40659388Seric 
40759023Seric /*
40850537Seric **  Older systems don't have this error code -- it should be in
40950537Seric **  /usr/include/sysexits.h.
41050537Seric */
41150537Seric 
41250537Seric # ifndef EX_CONFIG
41350537Seric # define EX_CONFIG	78	/* configuration error */
41450537Seric # endif
41556852Seric 
41663993Seric /*
41763993Seric **  These are used in a few cases where we need some special
41863993Seric **  error codes, but where the system doesn't provide something
41963993Seric **  reasonable.  They are printed in errstring.
42063993Seric */
42163993Seric 
42263993Seric #ifndef E_PSEUDOBASE
42363993Seric # define E_PSEUDOBASE	256
42463993Seric #endif
42563993Seric 
42663993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
42763993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
42863993Seric 
42963970Seric /* type of arbitrary pointer */
43063970Seric #ifndef ARBPTR_T
43163970Seric # define ARBPTR_T	void *
43263970Seric #endif
43363970Seric 
43460568Seric #ifndef __P
43560568Seric # include "cdefs.h"
43660568Seric #endif
43760568Seric 
43856852Seric /*
43958778Seric **  Do some required dependencies
44058778Seric */
44158778Seric 
44258778Seric #if defined(NETINET) || defined(NETISO)
44359107Seric # define SMTP		1	/* enable user and server SMTP */
44459107Seric # define QUEUE		1	/* enable queueing */
44559107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
44658778Seric #endif
44758778Seric 
44858778Seric 
44958778Seric /*
45056852Seric **  Arrange to use either varargs or stdargs
45156852Seric */
45256852Seric 
45356852Seric # ifdef __STDC__
45456852Seric 
45556852Seric # include <stdarg.h>
45656852Seric 
45756852Seric # define VA_LOCAL_DECL	va_list ap;
45856852Seric # define VA_START(f)	va_start(ap, f)
45956852Seric # define VA_END		va_end(ap)
46056852Seric 
46156852Seric # else
46256852Seric 
46356852Seric # include <varargs.h>
46456852Seric 
46556852Seric # define VA_LOCAL_DECL	va_list ap;
46656852Seric # define VA_START(f)	va_start(ap)
46756852Seric # define VA_END		va_end(ap)
46856852Seric 
46956852Seric # endif
47057631Seric 
47157943Seric #ifdef HASUNAME
47257631Seric # include <sys/utsname.h>
47357631Seric # ifdef newstr
47457631Seric #  undef newstr
47557631Seric # endif
47657943Seric #else /* ! HASUNAME */
47757631Seric # define NODE_LENGTH 32
47857631Seric struct utsname
47957631Seric {
48057631Seric 	char nodename[NODE_LENGTH+1];
48157631Seric };
48257943Seric #endif /* HASUNAME */
48357642Seric 
48463838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
48563838Seric # define MAXHOSTNAMELEN	256
48657735Seric #endif
48758153Seric 
48858153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
48958153Seric # define SIGCHLD	SIGCLD
49058153Seric #endif
49158153Seric 
49258153Seric #ifndef STDIN_FILENO
49358153Seric #define STDIN_FILENO	0
49458153Seric #endif
49558153Seric 
49658153Seric #ifndef STDOUT_FILENO
49758153Seric #define STDOUT_FILENO	1
49858153Seric #endif
49958153Seric 
50058153Seric #ifndef STDERR_FILENO
50158153Seric #define STDERR_FILENO	2
50258153Seric #endif
50358689Seric 
50464035Seric #ifdef HASFLOCK
50564035Seric # include <sys/file.h>
50664072Seric #endif
50764072Seric 
50864072Seric #ifndef LOCK_SH
50964035Seric # define LOCK_SH	0x01	/* shared lock */
51064035Seric # define LOCK_EX	0x02	/* exclusive lock */
51164035Seric # define LOCK_NB	0x04	/* non-blocking lock */
51264035Seric # define LOCK_UN	0x08	/* unlock */
51364035Seric #endif
51458692Seric 
51564035Seric #ifndef SIG_ERR
51664035Seric # define SIG_ERR	((void (*)()) -1)
51758689Seric #endif
51858702Seric 
51958702Seric /*
52058702Seric **  Size of tobuf (deliver.c)
52158702Seric **	Tweak this to match your syslog implementation.  It will have to
52258702Seric **	allow for the extra information printed.
52358702Seric */
52458702Seric 
52558702Seric #ifndef TOBUFSIZE
52658702Seric # define TOBUFSIZE (1024 - 256)
52758702Seric #endif
52860219Seric 
52960219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
53060219Seric # ifndef FORK
53160219Seric # define FORK		vfork		/* function to call to fork mailer */
53260219Seric # endif
533