1 /* 2 * Copyright (c) 1983 Eric P. Allman 3 * Copyright (c) 1988, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * %sccs.include.redist.c% 7 * 8 * @(#)conf.h 8.6 (Berkeley) 07/19/93 9 */ 10 11 /* 12 ** CONF.H -- All user-configurable parameters for sendmail 13 */ 14 15 # include <sys/param.h> 16 # include <sys/stat.h> 17 # include <fcntl.h> 18 19 /********************************************************************** 20 ** Table sizes, etc.... 21 ** There shouldn't be much need to change these.... 22 **********************************************************************/ 23 24 # define MAXLINE 2048 /* max line length */ 25 # define MAXNAME 256 /* max length of a name */ 26 # define MAXPV 40 /* max # of parms to mailers */ 27 # define MAXATOM 200 /* max atoms per address */ 28 # define MAXMAILERS 25 /* maximum mailers known to system */ 29 # define MAXRWSETS 100 /* max # of sets of rewriting rules */ 30 # define MAXPRIORITIES 25 /* max values for Precedence: field */ 31 # define MAXMXHOSTS 20 /* max # of MX records */ 32 # define SMTPLINELIM 990 /* maximum SMTP line length */ 33 # define MAXKEY 128 /* maximum size of a database key */ 34 # define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */ 35 # define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */ 36 # define MAXIPADDR 16 /* max # of IP addrs for this host */ 37 # define MAXALIASDB 12 /* max # of alias databases */ 38 # define PSBUFSIZE (MAXLINE + MAXATOM) /* size of prescan buffer */ 39 40 # ifndef QUEUESIZE 41 # define QUEUESIZE 1000 /* max # of jobs per queue run */ 42 # endif 43 44 /********************************************************************** 45 ** Compilation options. 46 ** 47 ** #define these if they are available; comment them out otherwise. 48 **********************************************************************/ 49 50 # define LOG 1 /* enable logging */ 51 # define UGLYUUCP 1 /* output ugly UUCP From lines */ 52 # define NETINET 1 /* include internet support */ 53 # define SETPROCTITLE 1 /* munge argv to display current status */ 54 # define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ 55 # define MATCHGECOS 1 /* match user names from gecos field */ 56 # define XDEBUG 1 /* enable extended debugging */ 57 58 # ifdef NEWDB 59 # define USERDB 1 /* look in user database (requires NEWDB) */ 60 # endif 61 62 /********************************************************************** 63 ** Operating system configuration. 64 ** 65 ** Unless you are porting to a new OS, you shouldn't have to 66 ** change these. 67 **********************************************************************/ 68 69 /* general "standard C" defines */ 70 #ifdef __STDC__ 71 # define HASSETVBUF 1 /* yes, we have setvbuf in libc */ 72 #endif 73 74 /* general POSIX defines */ 75 #ifdef _POSIX_VERSION 76 # define HASSETSID 1 /* has setsid(2) call */ 77 #endif 78 79 /* 80 ** Per-Operating System defines 81 */ 82 83 /* 84 ** HP-UX -- tested for 8.07 85 */ 86 87 # ifdef __hpux 88 # define SYSTEM5 1 /* include all the System V defines */ 89 # define UNSETENV 1 /* need unsetenv(3) support */ 90 # define HASSETREUID 1 /* have setreuid(2) call */ 91 # define setreuid(r, e) setresuid(r, e, -1) 92 # ifndef __STDC__ 93 # define HASSETVBUF 1 /* we have setvbuf in libc (but not __STDC__) */ 94 # endif 95 # endif 96 97 /* 98 ** IBM AIX 3.x -- actually tested for 3.2.3 99 */ 100 101 # ifdef _AIX3 102 # define LOCKF 1 /* use System V lockf instead of flock */ 103 # define FORK fork /* no vfork primitive available */ 104 # define UNSETENV 1 /* need unsetenv(3) support */ 105 # define SYS5TZ 1 /* use System V style timezones */ 106 # endif 107 108 /* 109 ** Silicon Graphics IRIX 110 ** 111 ** I haven't tested this yet myself. 112 */ 113 114 # ifdef IRIX 115 # define FORK fork /* no vfork primitive available */ 116 # define UNSETENV 1 /* need unsetenv(3) support */ 117 # define setpgrp BSDsetpgrp 118 # define HASSETREUID 1 /* have setreuid(2) call */ 119 # define GIDSET_T gid_t 120 # endif 121 122 123 /* 124 ** SunOS 125 */ 126 127 #if defined(sun) && !defined(BSD) 128 129 # define UNSETENV 1 /* need unsetenv(3) support */ 130 131 # ifdef SOLARIS 132 /* Solaris 2.x (a.k.a. SunOS 5.x) */ 133 # define LOCKF 1 /* use System V lockf instead of flock */ 134 # define HASUSTAT 1 /* has the ustat(2) syscall */ 135 # define bcopy(s, d, l) (memmove((d), (s), (l))) 136 # define bzero(d, l) (memset((d), '\0', (l))) 137 # define bcmp(s, d, l) (memcmp((s), (d), (l))) 138 # include <sys/time.h> 139 140 # else 141 /* SunOS 4.1.x */ 142 # define HASSTATFS 1 /* has the statfs(2) syscall */ 143 # define HASSETREUID 1 /* have setreuid(2) call */ 144 # include <vfork.h> 145 146 # endif 147 #endif 148 149 /* 150 ** Digital Ultrix 4.2A or 4.3 151 */ 152 153 #ifdef ultrix 154 # define HASSTATFS 1 /* has the statfs(2) syscall */ 155 # define HASSETREUID 1 /* have setreuid(2) call */ 156 #endif 157 158 /* 159 ** OSF/1 (tested on Alpha) 160 */ 161 162 #ifdef __osf__ 163 # define HASSETREUID 1 /* have setreuid(2) call */ 164 # define seteuid(uid) setreuid(-1, uid) 165 #endif 166 167 /* 168 ** NeXTstep 169 */ 170 171 #ifdef __NeXT__ 172 # define sleep sleepX 173 # define UNSETENV 1 /* need unsetenv(3) support */ 174 #endif 175 176 /* 177 ** BSD 178 */ 179 180 #ifdef BSD 181 # define HASGETDTABLESIZE 1 /* we have getdtablesize(2) call */ 182 #endif 183 184 /* 4.4BSD */ 185 #ifdef BSD4_4 186 # include <sys/cdefs.h> 187 # define HASSETREUID 1 /* have setreuid(2) call */ 188 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 189 #endif 190 191 /* 192 ** SCO Unix 193 */ 194 195 #ifdef _SCO_unix_ 196 # define SYSTEM5 1 /* include all the System V defines */ 197 # define UNSETENV 1 /* need unsetenv(3) support */ 198 # define FORK fork 199 # define MAXPATHLEN PATHSIZE 200 #endif 201 202 /********************************************************************** 203 ** End of Per-Operating System defines 204 **********************************************************************/ 205 206 /* general System V defines */ 207 # ifdef SYSTEM5 208 # define LOCKF 1 /* use System V lockf instead of flock */ 209 # define SYS5TZ 1 /* use System V style timezones */ 210 # define HASUNAME 1 /* use System V uname system call */ 211 # define NEEDGETDTABLESIZE 1 /* needs a replacement getdtablesize */ 212 # endif 213 214 /* 215 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 216 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 217 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 218 ** are closed. Some firewalls return this error if you try to connect 219 ** to the IDENT port (113), so you can't receive email from these hosts 220 ** on these systems. The firewall really should use a more specific 221 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. 222 */ 223 224 #if !defined(ultrix) && !defined(__hpux) 225 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 226 #endif 227 228 /* 229 ** If no type for argument two of getgroups call is defined, assume 230 ** it's an integer -- unfortunately, there seem to be several choices 231 ** here. 232 */ 233 234 #ifndef GIDSET_T 235 # define GIDSET_T int 236 #endif 237 238 /* 239 ** Remaining definitions should never have to be changed. They are 240 ** primarily to provide back compatibility for older systems -- for 241 ** example, it includes some POSIX compatibility definitions 242 */ 243 244 /* System 5 compatibility */ 245 #ifndef S_ISREG 246 #define S_ISREG(foo) ((foo & S_IFREG) == S_IFREG) 247 #endif 248 #ifndef S_IWGRP 249 #define S_IWGRP 020 250 #endif 251 #ifndef S_IWOTH 252 #define S_IWOTH 002 253 #endif 254 255 /* 256 ** Older systems don't have this error code -- it should be in 257 ** /usr/include/sysexits.h. 258 */ 259 260 # ifndef EX_CONFIG 261 # define EX_CONFIG 78 /* configuration error */ 262 # endif 263 264 #ifndef __P 265 # include "cdefs.h" 266 #endif 267 268 /* 269 ** Do some required dependencies 270 */ 271 272 #if defined(NETINET) || defined(NETISO) 273 # define SMTP 1 /* enable user and server SMTP */ 274 # define QUEUE 1 /* enable queueing */ 275 # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 276 #endif 277 278 279 /* 280 ** Arrange to use either varargs or stdargs 281 */ 282 283 # ifdef __STDC__ 284 285 # include <stdarg.h> 286 287 # define VA_LOCAL_DECL va_list ap; 288 # define VA_START(f) va_start(ap, f) 289 # define VA_END va_end(ap) 290 291 # else 292 293 # include <varargs.h> 294 295 # define VA_LOCAL_DECL va_list ap; 296 # define VA_START(f) va_start(ap) 297 # define VA_END va_end(ap) 298 299 # endif 300 301 #ifdef HASUNAME 302 # include <sys/utsname.h> 303 # ifdef newstr 304 # undef newstr 305 # endif 306 #else /* ! HASUNAME */ 307 # define NODE_LENGTH 32 308 struct utsname 309 { 310 char nodename[NODE_LENGTH+1]; 311 }; 312 #endif /* HASUNAME */ 313 314 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) 315 # define MAXHOSTNAMELEN 256 316 #endif 317 318 #if !defined(SIGCHLD) && defined(SIGCLD) 319 # define SIGCHLD SIGCLD 320 #endif 321 322 #ifndef STDIN_FILENO 323 #define STDIN_FILENO 0 324 #endif 325 326 #ifndef STDOUT_FILENO 327 #define STDOUT_FILENO 1 328 #endif 329 330 #ifndef STDERR_FILENO 331 #define STDERR_FILENO 2 332 #endif 333 334 #ifdef LOCKF 335 #define LOCK_SH 0x01 /* shared lock */ 336 #define LOCK_EX 0x02 /* exclusive lock */ 337 #define LOCK_NB 0x04 /* non-blocking lock */ 338 #define LOCK_UN 0x08 /* unlock */ 339 340 #else 341 342 # include <sys/file.h> 343 344 #endif 345 346 /* 347 ** Size of tobuf (deliver.c) 348 ** Tweak this to match your syslog implementation. It will have to 349 ** allow for the extra information printed. 350 */ 351 352 #ifndef TOBUFSIZE 353 # define TOBUFSIZE (1024 - 256) 354 #endif 355 356 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 357 # ifndef FORK 358 # define FORK vfork /* function to call to fork mailer */ 359 # endif 360