conf.h revision 132946
1219820Sjeff/*
2219820Sjeff * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
3219820Sjeff *	All rights reserved.
4219820Sjeff * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
5219820Sjeff * Copyright (c) 1988, 1993
6219820Sjeff *	The Regents of the University of California.  All rights reserved.
7219820Sjeff *
8219820Sjeff * By using this file, you agree to the terms and conditions set
9219820Sjeff * forth in the LICENSE file which can be found at the top level of
10219820Sjeff * the sendmail distribution.
11219820Sjeff *
12219820Sjeff *
13219820Sjeff *	$Id: conf.h,v 8.567 2004/07/23 20:45:01 gshapiro Exp $
14219820Sjeff */
15219820Sjeff
16219820Sjeff/*
17219820Sjeff**  CONF.H -- All user-configurable parameters for sendmail
18219820Sjeff**
19219820Sjeff**	Send updates to sendmail@Sendmail.ORG so they will be
20219820Sjeff**	included in the next release.
21219820Sjeff*/
22219820Sjeff
23219820Sjeff#ifndef CONF_H
24219820Sjeff#define CONF_H 1
25219820Sjeff
26219820Sjeff#ifdef __GNUC__
27219820Sjeffstruct rusage;	/* forward declaration to get gcc to shut up in wait.h */
28219820Sjeff#endif /* __GNUC__ */
29219820Sjeff
30219820Sjeff# include <sys/param.h>
31219820Sjeff# include <sys/types.h>
32219820Sjeff# include <sys/stat.h>
33219820Sjeff# ifndef __QNX__
34219820Sjeff/* in QNX this grabs bogus LOCK_* manifests */
35219820Sjeff#  include <sys/file.h>
36219820Sjeff# endif /* ! __QNX__ */
37219820Sjeff# include <sys/wait.h>
38219820Sjeff# include <limits.h>
39219820Sjeff# include <fcntl.h>
40219820Sjeff# include <signal.h>
41219820Sjeff# include <netdb.h>
42219820Sjeff# include <pwd.h>
43219820Sjeff# include <grp.h>
44219820Sjeff
45219820Sjeff/* make sure TOBUFSIZ isn't larger than system limit for size of exec() args */
46219820Sjeff#ifdef ARG_MAX
47219820Sjeff# if ARG_MAX > 4096
48219820Sjeff#  define SM_ARG_MAX	4096
49219820Sjeff# else /* ARG_MAX > 4096 */
50219820Sjeff#  define SM_ARG_MAX	ARG_MAX
51219820Sjeff# endif /* ARG_MAX > 4096 */
52219820Sjeff#else /* ARG_MAX */
53219820Sjeff# define SM_ARG_MAX	4096
54219820Sjeff#endif /* ARG_MAX */
55219820Sjeff
56219820Sjeff/**********************************************************************
57219820Sjeff**  Table sizes, etc....
58219820Sjeff**	There shouldn't be much need to change these....
59219820Sjeff**	If you do, be careful, none should be set anywhere near INT_MAX
60219820Sjeff**********************************************************************/
61219820Sjeff
62219820Sjeff#define MAXLINE		2048		/* max line length */
63219820Sjeff#define MAXNAME		256		/* max length of a name */
64219820Sjeff#ifndef MAXAUTHINFO
65219820Sjeff# define MAXAUTHINFO	100		/* max length of authinfo token */
66219820Sjeff#endif /* ! MAXAUTHINFO */
67219820Sjeff#define MAXPV		256		/* max # of parms to mailers */
68219820Sjeff#define MAXATOM		1000		/* max atoms per address */
69219820Sjeff#define MAXRWSETS	200		/* max # of sets of rewriting rules */
70219820Sjeff#define MAXPRIORITIES	25		/* max values for Precedence: field */
71219820Sjeff#define MAXMXHOSTS	100		/* max # of MX records for one host */
72219820Sjeff#define SMTPLINELIM	990		/* maximum SMTP line length */
73219820Sjeff#define MAXKEY		128		/* maximum size of a database key */
74219820Sjeff#define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
75219820Sjeff#define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
76219820Sjeff#define MAXMAPSTACK	12		/* max # of stacked or sequenced maps */
77219820Sjeff#if MILTER
78219820Sjeff# define MAXFILTERS	25		/* max # of milter filters */
79219820Sjeff# define MAXFILTERMACROS 50		/* max # of macros per milter cmd */
80219820Sjeff#endif /* MILTER */
81219820Sjeff#define MAXSMTPARGS	20		/* max # of ESMTP args for MAIL/RCPT */
82219820Sjeff#define MAXTOCLASS	8		/* max # of message timeout classes */
83219820Sjeff#define MAXRESTOTYPES	3		/* max # of resolver timeout types */
84219820Sjeff#define MAXMIMEARGS	20		/* max args in Content-Type: */
85219820Sjeff#define MAXMIMENESTING	20		/* max MIME multipart nesting */
86219820Sjeff#define QUEUESEGSIZE	1000		/* increment for queue size */
87219820Sjeff
88219820Sjeff/*
89219820Sjeff**  MAXQFNAME == 2 (size of "qf", "df" prefix)
90219820Sjeff**	+ 8 (base 60 encoded date, time & sequence number)
91219820Sjeff**	+ 10 (base 10 encoded 32 bit process id)
92219820Sjeff**	+ 1 (terminating NUL character).
93219820Sjeff*/
94219820Sjeff
95219820Sjeff#define MAXQFNAME	21		/* max qf file name length + 1 */
96219820Sjeff#define MACBUFSIZE	4096		/* max expanded macro buffer size */
97219820Sjeff#define TOBUFSIZE	SM_ARG_MAX	/* max buffer to hold address list */
98219820Sjeff#define MAXSHORTSTR	203		/* max short string length */
99219820Sjeff#define MAXMACNAMELEN	25		/* max macro name length */
100219820Sjeff#define MAXMACROID	0377		/* max macro id number */
101219820Sjeff					/* Must match (BITMAPBITS - 1) */
102219820Sjeff#ifndef MAXHDRSLEN
103219820Sjeff# define MAXHDRSLEN	(32 * 1024)	/* max size of message headers */
104219820Sjeff#endif /* ! MAXHDRSLEN */
105219820Sjeff#define MAXDAEMONS	10		/* max number of ports to listen to */
106219820Sjeff#ifndef MAXINTERFACES
107219820Sjeff# define MAXINTERFACES	512		/* number of interfaces to probe */
108219820Sjeff#endif /* MAXINTERFACES */
109219820Sjeff#ifndef MAXSYMLINKS
110219820Sjeff# define MAXSYMLINKS	32		/* max number of symlinks in a path */
111219820Sjeff#endif /* ! MAXSYMLINKS */
112219820Sjeff#define MAXLINKPATHLEN	(MAXPATHLEN * MAXSYMLINKS) /* max link-expanded file */
113219820Sjeff#define DATA_PROGRESS_TIMEOUT	300	/* how often to check DATA progress */
114219820Sjeff#define ENHSCLEN	10		/* max len of enhanced status code */
115219820Sjeff#define DEFAULT_MAX_RCPT	100	/* max number of RCPTs per envelope */
116219820Sjeff#define MAXQUEUEGROUPS	50		/* max # of queue groups */
117219820Sjeff	/* must be less than BITMAPBITS for DoQueueRun */
118219820Sjeff#define MAXWORKGROUPS	50		/* max # of work groups */
119219820Sjeff#define MAXFILESYS	BITMAPBITS	/* max # of queue file systems
120219820Sjeff					 * must be <= BITMAPBITS */
121219820Sjeff#ifndef FILESYS_UPDATE_INTERVAL
122219820Sjeff# define FILESYS_UPDATE_INTERVAL 300	/* how often to update FileSys table */
123219820Sjeff#endif /* FILESYS_UPDATE_INTERVAL */
124219820Sjeff
125219820Sjeff#ifndef SM_DEFAULT_TTL
126219820Sjeff# define SM_DEFAULT_TTL 3600 /* default TTL for services that don't have one */
127219820Sjeff#endif /* SM_DEFAULT_TTL */
128219820Sjeff
129219820Sjeff#if SASL
130219820Sjeff# ifndef AUTH_MECHANISMS
131219820Sjeff#  if STARTTLS
132219820Sjeff#   define AUTH_MECHANISMS	"EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5"
133219820Sjeff#  else /* STARTTLS */
134219820Sjeff#   define AUTH_MECHANISMS	"GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5"
135219820Sjeff#  endif /* STARTTLS */
136219820Sjeff# endif /* ! AUTH_MECHANISMS */
137219820Sjeff#endif /* SASL */
138219820Sjeff
139219820Sjeff/*
140219820Sjeff**  Default database permissions (alias, maps, etc.)
141219820Sjeff**	Used by sendmail and libsmdb
142219820Sjeff*/
143219820Sjeff
144219820Sjeff#ifndef DBMMODE
145219820Sjeff# define DBMMODE	0640
146219820Sjeff#endif /* ! DBMMODE */
147219820Sjeff
148219820Sjeff/*
149219820Sjeff**  Value which means a uid or gid value should not change
150219820Sjeff*/
151219820Sjeff
152219820Sjeff#ifndef NO_UID
153219820Sjeff# define NO_UID		-1
154219820Sjeff#endif /* ! NO_UID */
155219820Sjeff#ifndef NO_GID
156219820Sjeff# define NO_GID		-1
157219820Sjeff#endif /* ! NO_GID */
158219820Sjeff
159219820Sjeff/**********************************************************************
160219820Sjeff**  Compilation options.
161219820Sjeff**	#define these to 1 if they are available;
162219820Sjeff**	#define them to 0 otherwise.
163219820Sjeff**  All can be overridden from Makefile.
164219820Sjeff**********************************************************************/
165219820Sjeff
166219820Sjeff#ifndef NETINET
167219820Sjeff# define NETINET	1	/* include internet support */
168219820Sjeff#endif /* ! NETINET */
169219820Sjeff
170219820Sjeff#ifndef NETINET6
171219820Sjeff# define NETINET6	0	/* do not include IPv6 support */
172219820Sjeff#endif /* ! NETINET6 */
173219820Sjeff
174219820Sjeff#ifndef NETISO
175219820Sjeff# define NETISO	0		/* do not include ISO socket support */
176219820Sjeff#endif /* ! NETISO */
177219820Sjeff
178219820Sjeff#ifndef NAMED_BIND
179219820Sjeff# define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
180219820Sjeff#endif /* ! NAMED_BIND */
181219820Sjeff
182219820Sjeff#ifndef XDEBUG
183219820Sjeff# define XDEBUG		1	/* enable extended debugging */
184219820Sjeff#endif /* ! XDEBUG */
185219820Sjeff
186219820Sjeff#ifndef MATCHGECOS
187219820Sjeff# define MATCHGECOS	1	/* match user names from gecos field */
188219820Sjeff#endif /* ! MATCHGECOS */
189219820Sjeff
190219820Sjeff#ifndef DSN
191219820Sjeff# define DSN		1	/* include delivery status notification code */
192219820Sjeff#endif /* ! DSN */
193219820Sjeff
194219820Sjeff#if !defined(USERDB) && (defined(NEWDB) || defined(HESIOD))
195219820Sjeff# define USERDB		1	/* look in user database */
196219820Sjeff#endif /* !defined(USERDB) && (defined(NEWDB) || defined(HESIOD)) */
197219820Sjeff
198219820Sjeff#ifndef MIME8TO7
199219820Sjeff# define MIME8TO7	1	/* 8->7 bit MIME conversions */
200219820Sjeff#endif /* ! MIME8TO7 */
201219820Sjeff
202219820Sjeff#ifndef MIME7TO8
203219820Sjeff# define MIME7TO8	1	/* 7->8 bit MIME conversions */
204219820Sjeff#endif /* ! MIME7TO8 */
205219820Sjeff
206219820Sjeff#if NAMED_BIND
207219820Sjeff# ifndef DNSMAP
208219820Sjeff#  define DNSMAP	1	/* DNS map type */
209219820Sjeff# endif /* ! DNSMAP */
210219820Sjeff#endif /* NAMED_BIND */
211219820Sjeff
212219820Sjeff#ifndef PIPELINING
213219820Sjeff# define PIPELINING	1	/* SMTP PIPELINING */
214219820Sjeff#endif /* PIPELINING */
215219820Sjeff
216219820Sjeff/**********************************************************************
217219820Sjeff**  End of site-specific configuration.
218219820Sjeff**********************************************************************/
219219820Sjeff
220219820Sjeff#include <sm/conf.h>
221219820Sjeff
222219820Sjeff#endif /* ! CONF_H */
223219820Sjeff