xref: /freebsd/contrib/sendmail/src/conf.h (revision d39bd2c1)
1 /*
2  * Copyright (c) 1998-2002 Proofpoint, Inc. and its suppliers.
3  *	All rights reserved.
4  * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
5  * Copyright (c) 1988, 1993
6  *	The Regents of the University of California.  All rights reserved.
7  *
8  * By using this file, you agree to the terms and conditions set
9  * forth in the LICENSE file which can be found at the top level of
10  * the sendmail distribution.
11  *
12  *
13  *	$Id: conf.h,v 8.577 2013-11-22 20:51:55 ca Exp $
14  */
15 
16 /*
17 **  CONF.H -- All user-configurable parameters for sendmail
18 **
19 **	Send updates to sendmail-YYYY@support.sendmail.org
20 **	(replace YYYY with the current year)
21 **	so they will be included in the next release.
22 */
23 
24 #ifndef CONF_H
25 #define CONF_H 1
26 
27 #ifdef __GNUC__
28 struct rusage;	/* forward declaration to get gcc to shut up in wait.h */
29 #endif
30 
31 # include <sys/param.h>
32 # include <sys/types.h>
33 # include <sys/stat.h>
34 # ifndef __QNX__
35 /* in QNX this grabs bogus LOCK_* manifests */
36 #  include <sys/file.h>
37 # endif
38 # include <sys/wait.h>
39 # include <limits.h>
40 # include <fcntl.h>
41 # include <signal.h>
42 # include <netdb.h>
43 # include <pwd.h>
44 # include <grp.h>
45 
46 /* make sure TOBUFSIZ isn't larger than system limit for size of exec() args */
47 #ifdef ARG_MAX
48 # if ARG_MAX > 4096
49 #  define SM_ARG_MAX	4096
50 # else
51 #  define SM_ARG_MAX	ARG_MAX
52 # endif
53 #else
54 # define SM_ARG_MAX	4096
55 #endif
56 
57 /**********************************************************************
58 **  Table sizes, etc....
59 **	There shouldn't be much need to change these....
60 **	If you do, be careful, none should be set anywhere near INT_MAX
61 **********************************************************************/
62 
63 #define MAXLINE		2048	/* max line length */
64 #if SASL
65 # define MAXINPLINE	12288	/* max input line length (for AUTH) */
66 #else
67 # define MAXINPLINE	MAXLINE	/* max input line length */
68 #endif
69 #define MAXNAME		256	/* max length of a name */
70 #ifndef MAXAUTHINFO
71 # define MAXAUTHINFO	100	/* max length of authinfo token */
72 #endif
73 #define MAXPV		256	/* max # of parms to mailers */
74 #define MAXATOM		1000	/* max atoms per address */
75 #define MAXRWSETS	200	/* max # of sets of rewriting rules */
76 #define MAXPRIORITIES	25	/* max values for Precedence: field */
77 #define MAXMXHOSTS	100	/* max # of MX records for one host */
78 #define SMTPLINELIM	990	/* max SMTP line length */
79 #define MAXUDBKEY	128	/* max size of a database key (udb only) */
80 #define MAXKEY		1024	/* max size of a database key */
81 #define MEMCHUNKSIZE	4096	/* chunk size for memory allocation */
82 #if MEMCHUNKSIZE < MAXLINE
83 /* see usage in collect.c */
84 # error "MEMCHUNKSIZE must be at least MAXLINE"
85 #endif
86 #define MAXUSERENVIRON	100	/* max envars saved, must be >= 3 */
87 #define MAXMAPSTACK	12	/* max # of stacked or sequenced maps */
88 #if MILTER
89 # define MAXFILTERS	25	/* max # of milter filters */
90 # define MAXFILTERMACROS 50	/* max # of macros per milter cmd */
91 #endif
92 #define MAXSMTPARGS	20	/* max # of ESMTP args for MAIL/RCPT */
93 #define MAXTOCLASS	8	/* max # of message timeout classes */
94 #define MAXRESTOTYPES	3	/* max # of resolver timeout types */
95 #define MAXMIMEARGS	20	/* max args in Content-Type: */
96 #define MAXMIMENESTING	20	/* max MIME multipart nesting */
97 #define QUEUESEGSIZE	1000	/* increment for queue size */
98 
99 #ifndef MAXNOOPCOMMANDS
100 # define MAXNOOPCOMMANDS 20	/* max "noise" commands before slowdown */
101 #endif
102 
103 /*
104 **  MAXQFNAME == 2 (size of "qf", "df" prefix)
105 **	+ 8 (base 60 encoded date, time & sequence number)
106 **	+ 10 (base 10 encoded 32 bit process id)
107 **	+ 1 (terminating NUL character).
108 */
109 
110 #define MAXQFNAME	21		/* max qf file name length + 1 */
111 #define MACBUFSIZE	4096		/* max expanded macro buffer size */
112 #define TOBUFSIZE	SM_ARG_MAX	/* max buffer to hold address list */
113 #define MAXSHORTSTR	203		/* max short string length */
114 #define MAXMACNAMELEN	25		/* max macro name length */
115 #define MAXMACROID	0377		/* max macro id number */
116 	/* Must match (BITMAPBITS - 1), checked in macro.c */
117 #ifndef MAXHDRSLEN
118 # define MAXHDRSLEN	(32 * 1024)	/* max size of message headers */
119 #endif
120 #ifndef MAXDAEMONS
121 # define MAXDAEMONS	10		/* max number of ports to listen to */
122 	/* XREF: conf.c: MAXDAEMONS != 10 */
123 #endif
124 #ifndef MAXINTERFACES
125 # define MAXINTERFACES	512		/* number of interfaces to probe */
126 #endif
127 #ifndef MAXSYMLINKS
128 # define MAXSYMLINKS	32		/* max number of symlinks in a path */
129 #endif
130 #define MAXLINKPATHLEN	(MAXPATHLEN * MAXSYMLINKS) /* max link-expanded file */
131 #define DATA_PROGRESS_TIMEOUT	300	/* how often to check DATA progress */
132 #define ENHSCLEN	10		/* max len of enhanced status code */
133 #define DEFAULT_MAX_RCPT	100	/* max number of RCPTs per envelope */
134 #ifndef MAXQUEUEGROUPS
135 # define MAXQUEUEGROUPS	50		/* max # of queue groups */
136 	/* must be less than BITMAPBITS for DoQueueRun */
137 #endif
138 #if MAXQUEUEGROUPS >= BITMAPBITS
139 # error "MAXQUEUEGROUPS must be less than BITMAPBITS"
140 #endif
141 
142 #ifndef MAXWORKGROUPS
143 # define MAXWORKGROUPS	50		/* max # of work groups */
144 #endif
145 
146 #define MAXFILESYS	BITMAPBITS	/* max # of queue file systems
147 					 * must be <= BITMAPBITS */
148 #ifndef FILESYS_UPDATE_INTERVAL
149 # define FILESYS_UPDATE_INTERVAL 300	/* how often to update FileSys table */
150 #endif
151 
152 #ifndef SM_DEFAULT_TTL
153 # define SM_DEFAULT_TTL 3600 /* default TTL for services that don't have one */
154 #endif
155 
156 #if SASL
157 # ifndef AUTH_MECHANISMS
158 #  if STARTTLS
159 #   define AUTH_MECHANISMS	"EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5"
160 #  else
161 #   define AUTH_MECHANISMS	"GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5"
162 #  endif
163 # endif /* ! AUTH_MECHANISMS */
164 #endif /* SASL */
165 
166 /*
167 **  Default database permissions (alias, maps, etc.)
168 **	Used by sendmail and libsmdb
169 */
170 
171 #ifndef DBMMODE
172 # define DBMMODE	0640
173 #endif
174 
175 /*
176 **  Value which means a uid or gid value should not change
177 */
178 
179 #ifndef NO_UID
180 # define NO_UID		-1
181 #endif
182 #ifndef NO_GID
183 # define NO_GID		-1
184 #endif
185 
186 /**********************************************************************
187 **  Compilation options.
188 **	#define these to 1 if they are available;
189 **	#define them to 0 otherwise.
190 **  All can be overridden from Makefile.
191 **********************************************************************/
192 
193 #ifndef NETINET
194 # define NETINET	1	/* include internet support */
195 #endif
196 
197 #ifndef NETINET6
198 # define NETINET6	0	/* do not include IPv6 support */
199 #endif
200 
201 #ifndef NETISO
202 # define NETISO	0		/* do not include ISO socket support */
203 #endif
204 
205 #ifndef NAMED_BIND
206 # define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
207 #endif
208 
209 #ifndef XDEBUG
210 # define XDEBUG		1	/* enable extended debugging */
211 #endif
212 
213 #ifndef MATCHGECOS
214 # define MATCHGECOS	1	/* match user names from gecos field */
215 #endif
216 
217 #ifndef DSN
218 # define DSN		1	/* include delivery status notification code */
219 #endif
220 
221 #if !defined(USERDB) && (defined(NEWDB) || defined(HESIOD))
222 # define USERDB		1	/* look in user database */
223 #endif
224 
225 #ifndef MIME8TO7
226 # define MIME8TO7	1	/* 8->7 bit MIME conversions */
227 #endif
228 
229 #ifndef MIME7TO8
230 # define MIME7TO8	1	/* 7->8 bit MIME conversions */
231 #endif
232 
233 #if NAMED_BIND
234 # ifndef DNSMAP
235 #  define DNSMAP	1	/* DNS map type */
236 # endif
237 #endif
238 
239 #ifndef PIPELINING
240 # define PIPELINING	1	/* SMTP PIPELINING */
241 #endif
242 
243 /**********************************************************************
244 **  End of site-specific configuration.
245 **********************************************************************/
246 
247 #if CDB >= 2
248 # define CDBEXT ".db"
249 # define CDBext "db"
250 #else
251 # define CDBEXT ".cdb"
252 # define CDBext "cdb"
253 #endif
254 
255 #include <sm/conf.h>
256 
257 #endif /* ! CONF_H */
258