xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 64314)
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*64314Seric  *	@(#)conf.h	8.25 (Berkeley) 08/21/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 */
3758106Seric # define MAXIPADDR	16		/* max # of IP addrs for this host */
3859667Seric # define MAXALIASDB	12		/* max # of alias databases */
3959303Seric # define PSBUFSIZE	(MAXLINE + MAXATOM)	/* size of prescan buffer */
4057143Seric 
4157143Seric # ifndef QUEUESIZE
4257143Seric # define QUEUESIZE	1000		/* max # of jobs per queue run */
4357143Seric # endif
4457143Seric 
4563902Seric /**********************************************************************
469147Seric **  Compilation options.
4725673Seric **
4825673Seric **	#define these if they are available; comment them out otherwise.
4963902Seric **********************************************************************/
509147Seric 
5125673Seric # define LOG		1	/* enable logging */
5225673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
5358778Seric # define NETINET	1	/* include internet support */
5425673Seric # define SETPROCTITLE	1	/* munge argv to display current status */
5535651Seric # define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
5653735Seric # define MATCHGECOS	1	/* match user names from gecos field */
5763753Seric # define XDEBUG		1	/* enable extended debugging */
5836483Sbostic 
5956337Seric # ifdef NEWDB
6056337Seric # define USERDB		1	/* look in user database (requires NEWDB) */
6156337Seric # endif
6256337Seric 
6364032Seric /*
6464032Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
6564032Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
6664032Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
6764032Seric **  are closed.  Some firewalls return this error if you try to connect
6864032Seric **  to the IDENT port (113), so you can't receive email from these hosts
6964032Seric **  on these systems.  The firewall really should use a more specific
7064032Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  This
7164032Seric **  will get #undefed below as needed.
7264032Seric */
7364032Seric 
7464032Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
7564032Seric 
7663902Seric /**********************************************************************
7759023Seric **  Operating system configuration.
7859023Seric **
7959023Seric **	Unless you are porting to a new OS, you shouldn't have to
8059023Seric **	change these.
8163902Seric **********************************************************************/
8256823Seric 
8363787Seric /*
8463787Seric **  Per-Operating System defines
8563787Seric */
8663787Seric 
87*64314Seric 
8863902Seric /*
8963902Seric **  HP-UX -- tested for 8.07
9063902Seric */
9163902Seric 
9259348Seric # ifdef __hpux
9363787Seric # define SYSTEM5	1	/* include all the System V defines */
9464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
95*64314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
9664035Seric # define HASSETREUID	1	/* has setreuid(2) call */
9763902Seric # define setreuid(r, e)		setresuid(r, e, -1)
9863962Seric # define LA_TYPE	LA_FLOAT
9963962Seric # define _PATH_UNIX	"/hp-ux"
10064032Seric # undef IDENTPROTO
10156823Seric # endif
10256823Seric 
103*64314Seric 
10463902Seric /*
10563902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
10663902Seric */
10763902Seric 
10860224Seric # ifdef _AIX3
10964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
11060219Seric # define FORK		fork	/* no vfork primitive available */
11160219Seric # endif
11260219Seric 
113*64314Seric 
11463902Seric /*
11563902Seric **  Silicon Graphics IRIX
11663902Seric **
11763965Seric **	Compiles on 4.0.1.
11863902Seric */
11963902Seric 
12063753Seric # ifdef IRIX
12164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
12264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
123*64314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
12463753Seric # define FORK		fork	/* no vfork primitive available */
12564155Seric # define setpgid	BSDsetpgrp
12663937Seric # define GIDSET_T	gid_t
12763753Seric # endif
12863753Seric 
12963902Seric 
13063902Seric /*
13163902Seric **  SunOS
13263902Seric */
13363902Seric 
13463787Seric #if defined(sun) && !defined(BSD)
13559074Seric 
13663962Seric # define LA_TYPE	LA_INT
13764035Seric # define HASSETREUID	1	/* has setreuid(2) call */
13864035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
13960564Seric 
14060602Seric # ifdef SOLARIS
14163902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
14263949Seric #  define SYSTEM5	1	/* use System V definitions */
14363977Seric #  define setreuid(r, e)	seteuid(e)
14463787Seric #  include <sys/time.h>
14564125Seric #  define gethostbyname	__switch_gethostbyname	/* get working version */
14664125Seric #  define gethostbyaddr	__switch_gethostbyaddr	/* get working version */
14763962Seric #  define _PATH_UNIX	"/kernel/unix"
14863962Seric #  ifndef _PATH_SENDMAILCF
14963962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
15064072Seric #  endif
15164072Seric #  ifndef _PATH_SENDMAILPID
15263962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
15363962Seric #  endif
15463787Seric 
15560602Seric # else
15663787Seric 			/* SunOS 4.1.x */
15760602Seric #  define HASSTATFS	1	/* has the statfs(2) syscall */
15864035Seric /* #  define HASFLOCK	1	/* has flock(2) call */
15960564Seric #  include <vfork.h>
16063787Seric 
16160564Seric # endif
16259023Seric #endif
16359023Seric 
164*64314Seric 
16563902Seric /*
16663902Seric **  Digital Ultrix 4.2A or 4.3
16764264Seric **
16864264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
16964264Seric **	not dropped when the process exits.  This causes major problems,
17064264Seric **	so flock is the only alternative.
17163902Seric */
17263902Seric 
17360564Seric #ifdef ultrix
17460564Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
17564035Seric # define HASSETREUID	1	/* has setreuid(2) call */
17663962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
17764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
17864264Seric # define HASFLOCK	1	/* has flock(2) call */
17963962Seric # define LA_TYPE	LA_INT
18063962Seric # define LA_AVENRUN	"avenrun"
18164032Seric # undef IDENTPROTO
18260564Seric #endif
18360564Seric 
184*64314Seric 
18563902Seric /*
18663902Seric **  OSF/1 (tested on Alpha)
18763902Seric */
18863902Seric 
18963787Seric #ifdef __osf__
190*64314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
19163962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
19264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
19364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
19464035Seric /* # define HASFLOCK	1	/* has flock(2) call */
19563962Seric # define LA_TYPE	LA_INT
19659287Seric #endif
19759287Seric 
198*64314Seric 
19963902Seric /*
20063902Seric **  NeXTstep
20163902Seric */
20263902Seric 
20364076Seric #ifdef NeXT
20464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
20564035Seric # define HASFLOCK	1	/* has flock(2) call */
20664125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
207*64314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
20863753Seric # define sleep		sleepX
20964155Seric # define setpgid	setpgrp
21064295Seric # ifndef LA_TYPE
21164295Seric #  define LA_TYPE	LA_MACH
21264295Seric # endif
21364035Seric typedef int		pid_t;
21464072Seric # ifndef _PATH_SENDMAILCF
21564072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
21664072Seric # endif
21764072Seric # ifndef _PATH_SENDMAILPID
21864072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
21964072Seric # endif
22059288Seric #endif
22159288Seric 
222*64314Seric 
22363902Seric /*
22463962Seric **  4.4 BSD
22563902Seric */
22663902Seric 
22760568Seric #ifdef BSD4_4
22864072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
229*64314Seric # define HASSTATFS	1	/* has the statfs(2) syscall */
23060568Seric # include <sys/cdefs.h>
23163838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
23264072Seric # ifndef LA_TYPE
23364072Seric #  define LA_TYPE	LA_SUBR
23464072Seric # endif
23560568Seric #endif
23660568Seric 
237*64314Seric 
23863902Seric /*
23963969Seric **  4.3 BSD -- this is for very old systems
24063969Seric **
24163969Seric **	You'll also have to install a new resolver library.
24263969Seric **	I don't guarantee that support for this environment is complete.
24363969Seric */
24463969Seric 
24563969Seric #ifdef oldBSD43
24663969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
24763969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
24863970Seric # define ARBPTR_T	char *
24964155Seric # define setpgid	setpgrp
25063969Seric # ifndef LA_TYPE
25163969Seric #  define LA_TYPE	LA_FLOAT
25263969Seric # endif
25363969Seric # ifndef _PATH_SENDMAILCF
25463969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
25563969Seric # endif
25663969Seric #endif
25763969Seric 
258*64314Seric 
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 
272*64314Seric 
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 
287*64314Seric 
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 
302*64314Seric 
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 
31863902Seric /**********************************************************************
31963787Seric **  End of Per-Operating System defines
32063902Seric **********************************************************************/
32163787Seric 
32263949Seric /**********************************************************************
32363949Seric **  More general defines
32463949Seric **********************************************************************/
32563949Seric 
32663962Seric /* general BSD defines */
32763962Seric #ifdef BSD
32864035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
32964035Seric # define HASSETREUID	1	/* has setreuid(2) call */
33064035Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
33164035Seric # define HASFLOCK	1	/* has flock(2) call */
33263962Seric #endif
33363962Seric 
33463787Seric /* general System V defines */
33563787Seric # ifdef SYSTEM5
33663949Seric # define HASUNAME	1	/* use System V uname(2) system call */
33763949Seric # define HASUSTAT	1	/* use System V ustat(2) syscall */
33863962Seric # ifndef LA_TYPE
33963962Seric #  define LA_TYPE	LA_INT
34063962Seric # endif
34163949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
34263949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
34363949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
34463787Seric # endif
34563787Seric 
34663949Seric /* general "standard C" defines */
34763949Seric #if defined(__STDC__) || defined(SYSTEM5)
34863949Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
34963949Seric #endif
35063949Seric 
35163949Seric /* general POSIX defines */
35263949Seric #ifdef _POSIX_VERSION
35363949Seric # define HASSETSID	1	/* has setsid(2) call */
35463966Seric # define HASWAITPID	1	/* has waitpid(2) call */
35563949Seric #endif
35663949Seric 
35763787Seric /*
35863937Seric **  If no type for argument two of getgroups call is defined, assume
35963937Seric **  it's an integer -- unfortunately, there seem to be several choices
36063937Seric **  here.
36163937Seric */
36263937Seric 
36363937Seric #ifndef GIDSET_T
36463937Seric # define GIDSET_T	int
36563937Seric #endif
36663937Seric 
36763937Seric /*
36859023Seric **  Remaining definitions should never have to be changed.  They are
36959023Seric **  primarily to provide back compatibility for older systems -- for
37059287Seric **  example, it includes some POSIX compatibility definitions
37159287Seric */
37259023Seric 
37359388Seric /* System 5 compatibility */
37459388Seric #ifndef S_ISREG
37559388Seric #define S_ISREG(foo)	((foo & S_IFREG) == S_IFREG)
37659388Seric #endif
37759388Seric #ifndef S_IWGRP
37859388Seric #define S_IWGRP		020
37959388Seric #endif
38059388Seric #ifndef S_IWOTH
38159388Seric #define S_IWOTH		002
38259388Seric #endif
38359388Seric 
38459023Seric /*
38550537Seric **  Older systems don't have this error code -- it should be in
38650537Seric **  /usr/include/sysexits.h.
38750537Seric */
38850537Seric 
38950537Seric # ifndef EX_CONFIG
39050537Seric # define EX_CONFIG	78	/* configuration error */
39150537Seric # endif
39256852Seric 
39363993Seric /*
39463993Seric **  These are used in a few cases where we need some special
39563993Seric **  error codes, but where the system doesn't provide something
39663993Seric **  reasonable.  They are printed in errstring.
39763993Seric */
39863993Seric 
39963993Seric #ifndef E_PSEUDOBASE
40063993Seric # define E_PSEUDOBASE	256
40163993Seric #endif
40263993Seric 
40363993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
40463993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
40563993Seric 
40663970Seric /* type of arbitrary pointer */
40763970Seric #ifndef ARBPTR_T
40863970Seric # define ARBPTR_T	void *
40963970Seric #endif
41063970Seric 
41160568Seric #ifndef __P
41260568Seric # include "cdefs.h"
41360568Seric #endif
41460568Seric 
41556852Seric /*
41658778Seric **  Do some required dependencies
41758778Seric */
41858778Seric 
41958778Seric #if defined(NETINET) || defined(NETISO)
42059107Seric # define SMTP		1	/* enable user and server SMTP */
42159107Seric # define QUEUE		1	/* enable queueing */
42259107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
42358778Seric #endif
42458778Seric 
42558778Seric 
42658778Seric /*
42756852Seric **  Arrange to use either varargs or stdargs
42856852Seric */
42956852Seric 
43056852Seric # ifdef __STDC__
43156852Seric 
43256852Seric # include <stdarg.h>
43356852Seric 
43456852Seric # define VA_LOCAL_DECL	va_list ap;
43556852Seric # define VA_START(f)	va_start(ap, f)
43656852Seric # define VA_END		va_end(ap)
43756852Seric 
43856852Seric # else
43956852Seric 
44056852Seric # include <varargs.h>
44156852Seric 
44256852Seric # define VA_LOCAL_DECL	va_list ap;
44356852Seric # define VA_START(f)	va_start(ap)
44456852Seric # define VA_END		va_end(ap)
44556852Seric 
44656852Seric # endif
44757631Seric 
44857943Seric #ifdef HASUNAME
44957631Seric # include <sys/utsname.h>
45057631Seric # ifdef newstr
45157631Seric #  undef newstr
45257631Seric # endif
45357943Seric #else /* ! HASUNAME */
45457631Seric # define NODE_LENGTH 32
45557631Seric struct utsname
45657631Seric {
45757631Seric 	char nodename[NODE_LENGTH+1];
45857631Seric };
45957943Seric #endif /* HASUNAME */
46057642Seric 
46163838Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
46263838Seric # define MAXHOSTNAMELEN	256
46357735Seric #endif
46458153Seric 
46558153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
46658153Seric # define SIGCHLD	SIGCLD
46758153Seric #endif
46858153Seric 
46958153Seric #ifndef STDIN_FILENO
47058153Seric #define STDIN_FILENO	0
47158153Seric #endif
47258153Seric 
47358153Seric #ifndef STDOUT_FILENO
47458153Seric #define STDOUT_FILENO	1
47558153Seric #endif
47658153Seric 
47758153Seric #ifndef STDERR_FILENO
47858153Seric #define STDERR_FILENO	2
47958153Seric #endif
48058689Seric 
48164035Seric #ifdef HASFLOCK
48264035Seric # include <sys/file.h>
48364072Seric #endif
48464072Seric 
48564072Seric #ifndef LOCK_SH
48664035Seric # define LOCK_SH	0x01	/* shared lock */
48764035Seric # define LOCK_EX	0x02	/* exclusive lock */
48864035Seric # define LOCK_NB	0x04	/* non-blocking lock */
48964035Seric # define LOCK_UN	0x08	/* unlock */
49064035Seric #endif
49158692Seric 
49264035Seric #ifndef SIG_ERR
49364035Seric # define SIG_ERR	((void (*)()) -1)
49458689Seric #endif
49558702Seric 
49658702Seric /*
49758702Seric **  Size of tobuf (deliver.c)
49858702Seric **	Tweak this to match your syslog implementation.  It will have to
49958702Seric **	allow for the extra information printed.
50058702Seric */
50158702Seric 
50258702Seric #ifndef TOBUFSIZE
50358702Seric # define TOBUFSIZE (1024 - 256)
50458702Seric #endif
50560219Seric 
50660219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
50760219Seric # ifndef FORK
50860219Seric # define FORK		vfork		/* function to call to fork mailer */
50960219Seric # endif
510