In this section we present
each #define macro (or group of them) in alphabetical order
rather than in the order in which they appear in your Makefile.
Note that the Tune column of
Table 18.3
recommends whether or not you should adjust
(tune) the values for any particular #define. Those marked
tune may be adjusted from within your Makefile.
Those marked with port should be changed
only in the rare event that you need to port sendmail
to a new operating system.
[11]
Those marked with debug should only be defined during
porting to help debug the new binary but (for security reasons)
should never be defined for the final production version.
[11] But note that final porting should be done in conf.h and conf.c instead of Makefile.
Also note that the -d column shows which debugging switches can be used to determine whether the corresponding macro was defined when a sendmail binary was compiled (see Section 37.5.1, -d0.1 for a description of this process).
| #define | Tune | -d | Description | |
|---|---|---|---|---|
| AUTO_NIS_ALIASES | Section 18.8.1 | Tune | Add fallback alias techniques | |
| BROKEN_RES_SEARCH | Section 18.8.2, BROKEN-RES-SEARCH | Port | Broken resolver fix (e.g. Ultrix) | |
| BSD4_3 | Section 18.8.3, BSD4-3 | Port | Use BSD 4.3 style signal handling | |
| BSD4_4 | Section 18.8.4, BSD4-4 | Port | Compile for BSD 4.4 UNIX | |
| DSN | Section 18.8.5, DSN | Tune | Support Delivery Status Notification | |
| ERRLIST_PREDEFINED | Section 18.8.6 | Port | Correct type conflicts on sys_errlist | |
| _FFR_... | Section 18.8.7, -FFR-... | Debug | For Future Release | |
| FORK | Section 18.8.8, FORK | Port | The type of fork(5) to use | |
| HAS... | Section 18.8.9, HAS... | Port | 0.10 | Has specific system call support |
| HESIOD | Section 18.8.10 | Tune | 0.1 | Support hesiod database maps |
| HES_GETMAILHOST | Section 18.8.11, HES-GETMAILHOST | Tune | 0.1 | Use hesiod hes_getmailhost(3) |
| IDENTPROTO | Section 18.8.12, IDENTPROTO | Port | 0.10 | See Timeout.ident (Section 34.8.70.10) |
| IP_SRCROUTE | Section 18.8.13, IP-SRCROUTE | Port | 0.10 | Add IP source-routing to $_ |
| LA_TYPE | Section 18.8.14, LA-TYPE | Port | 3.5 | Define your load-average support |
| LDAPMAP | Section 18.8.15 | Tune | 0.1 | Enable use of ldap databases |
| LOG | Section 18.8.16, LOG | Tune | 0.1 | Perform logging |
| LOTUS_NOTES_HACK | Section 18.8.17, LOTUS-NOTES-HACK | V8.7.5 | Strip newlines from From: headers | |
| MATCHGECOS | Section 18.8.18, MATCHGECOS | Tune | 0.1 | Support for fuzzy name matching |
| MAX... | Section 18.8.19, MAX... | Tune | Redefine maximums | |
| MEMCHUNKSIZE | Section 18.8.20, MEMCHUNKSIZE | Tune | Specify memory allocation size | |
| MIME7TO8 | Section 18.8.21, MIME7TO8 | Tune | 0.1 | Support MIME 7- to 8-bit conversion |
| MIME8TO7 | Section 18.8.22, MIME8TO7 | Tune | 0.1 | Support MIME 8- to 7-bit conversion |
| NAMED_BIND | Section 18.8.23 | Tune | 0.1 | Support DNS name resolution |
| NDBM | Section 18.8.24 | Tune | 0.1 | Support UNIX ndbm(3) Databases |
| NEED... | Section 18.8.25, NEED... | Port | Something amiss with your OS? | |
| NET... | Section 18.8.26, NET... | Tune | 0.1 | Select network type |
| NETINFO | Section 18.8.27 | Tune | 0.1 | Support NeXT netinfo(3) databases |
| NEWDB | Section 18.8.28 | Tune | 0.1 | Support Berkeley db(3) Databases |
| NIS | Section 18.8.29 | Tune | 0.1 | Support nis maps |
| NISPLUS | Section 18.8.30 | Tune | 0.1 | Support nis+ maps |
| NO_GROUP_SET | Section 18.8.31, NO-GROUP-SET | Port | Prevent multi-group file access | |
| NOTUNIX | Section 18.8.32, NOTUNIX | Port | 30.2 | Exclude From line support |
| OLD_NEWDB | Section 18.8.33 | Port | 0.1 | Support the old form of db(3) |
| _PATH... | Section 18.8.34 | Debug | Hard-code paths inside sendmail | |
| PICKY... | Section 18.8.35, PICKY... | Tune | Make a pickier sendmail | |
| PSBUFSIZE | Section 18.8.36, PSBUFSIZ | Tune | Size of prescan() buffer | |
| QUEUE | Section 18.8.37, QUEUE | Tune | Enable queueing | |
| QUEUESEGSIZE | Section 18.8.38, QUEUESEGSIZE | Tune | Amount to grow queue work list | |
| SCANF | Section 18.8.39, SCANF | Tune | 0.10 | Support scanf(3) with F command |
| SFS_TYPE | Section 18.8.40, SFS-TYPE | Port | How to determine free disk space | |
| SMTP | Section 18.8.41, SMTP | Tune | Enable SMTP | |
| SMTPDEBUG | Section 18.8.42, SMTPDEBUG | Debug | Enable remote debugging | |
| SMTPLINELIM | Section 18.8.43, SMTPLINELIM | n/a | Default for obsolete F=L flag | |
| SOLARIS | Section 18.8.44, SOLARIS | Port | Support Sun's Solaris 2.x | |
| SPT_TYPE | Section 18.8.45, SPT-TYPE | Port | Adapt/exclude process title support | |
| SUID_ROOT_FILES_OK | Section 18.8.46, SUID-ROOT-FILES-OK | Debug | 0.1 | Allow root delivery to files |
| SYSLOG_BUFSIZE | Section 18.8.47, SYSLOG-BUFSIZE | Port | Limit syslog(3) buffer size | |
| SYSTEM5 | Section 18.8.48, SYSTEM5 | Port | 0.10 | Support SysV derived machines |
| SYS5SIGNALS | Section 18.8.48 | Port | 0.10 | Use SysV style signals |
| TCPWRAPPERS | Section 18.8.49, TCPWRAPPERS | Tune | 0.1 | Use libwrap.a for connects |
| TOBUFSIZE | Section 18.8.50, TOBUFSIZE | Tune | Set buffer for recipient list | |
| TRUST_POPEN | Section 18.8.51, TRUST-POPEN | Debug | Allow use of popen(3) | |
| TTYNAME | Section 18.8.52, TTYNAME | Debug | 35.9 | Set $y to tty name (obsolete) |
| UDB_DEFAULT_SPEC | Section 18.8.53 | Tune | Default User Database location | |
| USERDB | Section 18.8.54 | Tune | 0.1 | Support the User Database |
| USESETEUID | Section 18.8.55, USESETEUID | Port | 0.10 | Support seteuid(2) identity changes |
| WILDCARD_SHELL | Section 18.8.56, WILDCARD-SHELL | Debug | Redefine wildcard shell | |
| XDEBUG | Section 18.8.57, XDEBUG | Debug | 0.1 | Support sanity checks |
Add fallback alias techniques
(tune with DBMDEF= in Makefile)Ordinarily, sendmail will first look for a service-switch (see Section 34.8.61) to see how it should look up its aliases. If it finds one, and if the service aliases is listed, it uses the techniques listed with the service-switch to look up its aliases. In the absence of a service-switch, or if the service-switch could not be opened, sendmail's fallback position is to use the technique called files to look up its aliases.
This AUTO_NIS_ALIASES definition, when specified during compilation, also causes sendmail to automatically add the technique nis if NIS was defined or nis+ if NISPLUS was defined:
DBMDEF= -DNIS -DAUTO_NIS_ALIASES DBMDEF= -DNISPLUS -DAUTO_NIS_ALIASESThe first line causes the fallback list of techniques to become files then nis, and the second causes it to become files then nisplus. Note that AUTO_NIS_ALIASES is not defined in any Makefile distributed with sendmail.
Broken resolver fix (e.g. Ultrix)
(port, edit conf.h)On Ultrix, and possibly other systems, the res_search(2) routine incorrectly sets h_errno to 0 instead of HOST_NOT_FOUND if a host name is unknown. On such systems you can define BROKEN_RES_SEARCH in your Makefile, which tells sendmail to consider 0 the same as HOST_NOT_FOUND:
ENVDEF= -DBROKEN_RES_SEARCHAs distributed, this is not declared for any of the supplied Makefile files. If you are running Ultrix you should test your resolver library. If it fails, you should upgrade to the latest resolver library. If, for some reason, upgrading is not possible, you may define this as a workaround. When porting to a new system, you can test with the above ENVDEF= statement and, if successful, put a permanent porting entry into conf.h.
Use old style signal handling
(port, edit conf.h)Old BSD-based versions of UNIX, such as SunOS 4.0.x and BSD 4.3, used the signal(2) and sigsetmask(2) calls to set and release signals. Modern versions of UNIX use the sigaction(2) and sigprocmask(2) pair of routines. For all currently supported systems, BSD4_3 is already correctly defined in src/Makefiles or in conf.h. You should need to define BSD4_3 only if you are porting to a previously unsupported old BSD-based system:
ENVDEF= -DBSD4_3When porting to a new system, you can test with the above ENVDEF= statement and, if successful, put a permanent porting entry into conf.h.
Compile for BSD 4.4 Unix
(port, edit conf.h)BSD4_4 will automatically be defined when sendmail is built under the BSD 4.4 release of UNIX. You will need to redefine this only if you are porting to a new operating system that is based on BSD 4.4.
Support Delivery Status Notification
(tune with ENVDEF= in Makefile)Delivery Status Notification (DSN) replaces certain SMTP error codes and the
Return-Receipt-To:header (Section 35.10.29, Return-Receipt-To:) as a means of handling multiple delivery status requests and problems. DSN is an improvement over earlier mechanisms for returning delivery status information. It can, for example, supply different status information for each recipient when multiple recipients are specified. It can also be used to generate return receipts on a per recipient basis. DSN status is returned in the MIME encapsulated portion of a mail message's body.DSN is defined in RFC1891, RFC1892, RFC1893, and RFC1894. If you wish to exclude DSN support (not recommended), you may turn it off like this:
ENVDEF= -DDSN=0turn off DSN support
MIME is described under the
EightBitMode(8) option (see Section 34.8.22, EightBitMode (8)).
Correct conflicts on sys-errlist
(port, edit conf.h)Some systems define a type for sys_errlist[] that differs from the internal declaration made by sendmail. In such instances you will get a warning about sys_errlist being redefined when you compile. Such warnings are usually harmless, but they are unattractive. To eliminate them, add the following to your Makefile:
ENVDEF= -DERRLIST_PREDEFINEDWhen porting to a new system, you can test with the above ENVDEF= statement and, if successful, put a permanent porting entry into conf.h.
For Future Release
(debug with ENVDEF= in Makefile)Most releases of sendmail contain, within the C language code, sections that are commented out. These are initial stabs at solutions that either did not work as is, are incomplete or untested, or are dreams for the future.
If you have a good reason and thoroughly understand the code and why it is excluded (and if you are brave), you may include it by adding an appropriate _FFR_ (For Future Release) definition to ENVDEF= in Makefile:
ENVDEF= -D_FFR_whatHere,
whatdescribes the appropriate future item that you want to include (as found in the source). We categorize this as a debugging technique (not a porting or tuning one) because you may want to include future code for testing, but should probably not include it in your production version.
The type of fork to use
(port, edit conf.h)The sendmail program forks often to do its job in the most efficient way possible. Prior to V8.8, sendmail used vfork(2) whenever possible. Beginning with V8.8, sendmail now defaults to fork(2). [12] You should have to redefine FORK only when porting to a new system or when you are certain that vfork(2) is indeed faster on your system and is reliable.
[12] Bugs in the interaction between NIS and vfork(2) at the system level with Solaris and systems that lacked vfork(2) altogether, such as IRIX, caused V8.8 to favor fork(2). This is really okay because in modern systems, fork(2) is just as fast as vfork(2).
ENVDEF= -DFORK=vforkYou can test with the above ENVDEF= statement and, if successful, put a permanent porting entry into conf.h.
Has specific system call support
(port, edit conf.h)Macros that begin with HAS tell sendmail whether or not your system supports (has) certain system-library routines. In general, you should need to define or undefine the macros shown in Table 18.4 only if you are porting sendmail to a new system. In that instance you should also read src/READ_ME for the latest information and pitfalls.
Each of these is turned on or off with an assignment of 1 or 0:
ENVDEF= -DHASSETSID=1turn on ENVDEF= -DHASSETSID=0
turn off
Turning on tells sendmail that your site has support for this system call (setsid(2) in this instance). Turning off tells sendmail to work around the lack of that support. When porting to a new system, you can test with one of the above ENVDEF= statements and, if successful, put a permanent porting entry into conf.h.
These have probably been correctly defined for your system already. Therefore you should need to change them only when porting sendmail to a completely new system.
Table 18.4: HAS... #defines for Specific System Call Support #define System Call HASFCHMOD fchmod(2) HASFLOCK flock(2) HASGETDTABLESIZE getdtablesize(2) HASGETUSERSHELL getusershell(3) HASINITGROUPS initgroups(3) HASLSTAT lstat(2) HASSETREUID setreuid(2) HASSETRLIMIT setrlimit(2) HASSETSID setsid(2) HASSETUSERCONTEXT setusercontext(3) HASSETVBUF setvbuf(3) HASSIGSETMASK sigsetmask(2) HASSNPRINTF snprintf(3) and vsnprintf(3) HASULIMIT ulimit(2) HASUNAME uname(2) HASUNSETENV unsetenv(3) HASWAITPID waitpid(2) If you are running a precompiled binary of sendmail, you can determine whether any of these were defined when sendmail was compiled by using the
-d0.10debugging switch (see Section 37.5.3, -d0.10).
Support hesiod database maps
(tune with DBMDEF= in Makefile)Named after the 8th century B.C.E. [13] Greek poet Hesiod, the hesiod system is a network information system developed as Project Athena. Information that is shared among many machines on a network can be accessed by each machine using a common set of library routines. Files that are commonly represented in this form are the passwd(4) and aliases(4) files used by sendmail. The hesiod system is patterned after the Internet Domain Naming System and uses modified BIND source:
[13] Before Christian Era, although an alternative proposal that is making the rounds calls for signed years, thus the -8th century.
DBMDEF= -DHESIODIf HESIOD is defined when sendmail is built, support is included to look up aliases and user information via the hesiod interface. Support is also included to declare and use hesiod class maps (see Section 33.3.2, "The class") with the
Kconfiguration command. Support is also included for the User Database if USERDB is also defined.Hesiod documentation and source are available from:
If you are running a precompiled sendmail binary, you may use the
-d0.1switch (see Section 37.5.1) to determine whether HESIOD support is included.
Use hesiod hes-getmailhost()
(tune with ENVDEF= in Makefile)The MIT distribution of hesiod supports the hes_getmailhost(3) call for looking up a user's postoffice. If your site is running MIT's hesiod, you should define this. If your are running DEC's hesiod, you should not.
ENVDEF= -DHES_GETMAILHOSTHES_GETMAILHOST is by default not defined. If you need it, you must define it in your Makefile. If you are running a precompiled version of sendmail, you may use the
-d0.1debugging switch (see Section 37.5.1) to determine whether HES_GETMAILHOST has been included. The-d28.8(see Section 37.5.100, -d28.8) debugging flag can be used to trace the behavior of the hes_getmailhost(3) routine.
See Timeout.ident in Section 34.8.70.10
(port)Defining out IDENTPROTO neither includes nor excludes RFC1413 code. All it does is change the default value for the
Timeout.identoption (see Section 34.8.70.10):ENVDEF= -DIDENTPROTO=0set Timeout.ident=0 by default ENVDEF= -DIDENTPROTO=1
set Timeout.ident=30 by default
If you are running a precompiled sendmail binary, you may use the
-d0.10switch (see Section 37.5.3) to determine whether IDENTPROTO was defined as nonzero.
Add IP source-routing to $-
(port, edit conf.h)Mail is normally transported over networks with TCP/IP. At the IP layer, packets are usually constructed to be point-to-point - from one host to another. IP packets can also be constructed to contain source-routing information - from one host, through a second, then to a final host.
Although such source routing (when used) is generally legitimate, it can also be used to generate fraudulent mail. V8.7 sendmail attempts to extract source-routing information from the initial connection's IP information. If any is found, sendmail adds that information to the
$_macro (see Section 31.10.1, $-) for use in theReceived:header (see Section 35.10.25, Received:). The$_macro is usually used like this:Received: from $s ($_) ...where
$_will contain information like that shown below when IP source-routing information is found:IP source-routing informationuser@host.domain [!@hostC@hostB:hostA]
RFC1413 identd information
IP source-routing information is presented inside square brackets. If routing is strict, the information is prefixed with an exclamation mark. The format of the information is made to resemble that of source-route addressing (see the
DontPruneRoutesoption, Section 34.8.20, DontPruneRoutes (R)). In this example the IP packets will go first tohostC, then tohostB, and finally tohostA.The inclusion of code to support this reporting is determined by the IP_SRCROUTE definition in your Makefile. It is predefined correctly for all supported systems in conf.h, so you should need to redefine it only if you are porting sendmail to a completely new system. Be sure to read src/READ_ME for the latest information about IP_SRCROUTE.
If you are running a precompiled sendmail binary, you may use the
-d0.10switch (see Section 37.5.3) to determine whether IP_SRCROUTE support was included.
Define your load-average support
(port, edit conf.h)The load average is the average number of blocked processes (processes that are runnable but not able to run because of a lack of resources) over the last minute. The sendmail program can vary its behavior appropriately as the load average changes. Thresholds for change are defined by the options shown in Table 34.9 (see Section 34.6.4, "Controlling Machine Load").
The method that is used to get the current load average from the operating system varies widely. This LA_TYPE definition determines which method to use. It is correctly defined inside conf.h for all currently supported operating systems. Porting sendmail to a new system may require that you define LA_TYPE yourself. The possible values and their meanings are shown in Table 18.5.
Table 18.5: LA_ Methods for Getting the Load Average LA_ Does What LA_ZERO Always returns 0. Essentially disables load average checking. This is portable to all systems. LA_INT Read /dev/kmem for the symbol avenrun. If found, interpret the result as a native (usually long) integer. LA_FLOAT Read /dev/kmem for the symbol avenrun. If found, interpret the result as a floating-point value. LA_SHORT Read /dev/kmem for the symbol avenrun. If found, interpret the result as a short integer. LA_SUBR Call the library routine getloadavg(3) and use the result returned. LA_MACH Call the MACH-specific processor_set_info(2) routine and use the result returned. LA_PROCSTR Read the Linux-specific /proc/loadavg file and interpret the result as a floating-point value. LA_READKSYM Use the (some SysV versions) ioctl of MIOC_READKSYM to read /dev/kmem. LA_DGUX DG/UX specific support for using the pstat_getdynamic(2)function to read the load average. The LA_INT, LA_SHORT, LA_FLOAT, and LA_READKSYM settings require additional tuning. For these, three additional definitions are used as shown in Table 18.6.
Table 18.6: Tuning for LA_INT, LA_SHORT, LA_FLOAT, and LA_READKSYM #define Tunes FSHIFT Number of bits to shift right when using LA_INT, LA_SHORT, and LA_READKSYM. Default is 8. _PATH_UNIX The pathname of your kernel. This is required for LA_INT and LA_SHORT. Default is /unix for SysV; /hp_ux for HP/UX V9; /stand/unix for HP/UX V10, News, and UXP/OS; /dev/ksyms for Solaris; /dynix for DYNIX; otherwise /vmunix.
_PATH_KMEM The pathname of your kernel memory. This is required for LA_INT, LA_SHORT, LA_FLOAT, and LA_READKSYM. Default is /dev/kmem. LA_AVENRUN The name of the kernel variable that holds the load average. Used by LA_INT, LA_SHORT, and LA_FLOAT. Default is averun for SysV, otherwise _averun. NAMELISTMASK The mask to bitwise-AND against the return value of nlist(3). If this is undefined, the return value is used as is. A common value is 0x7fffffff to strip off the high bit.
Enable use of ldap databases
(tune with DBMDEF= in Makefile)LDAP stands for Lightweight Directory Access Protocol. LDAP provides lightweight access to the X.500 directory and is defined in RFC1777 and RFC1778.
The software and documentation for LDAP is available from
It is used by defining a map class called
ldapx(see Section 33.8.9, ldapx) in your configuration file. Its use is enabled by defining LDAPMAP at compile time:DBMDEF=LDAPMAP
Perform logging
(port, edit conf.h)If defined, LOG enables sendmail to use the syslog(3) facility to log error messages and other useful information that is often important for security and debugging. Logging and syslog(3) are described in Chapter 26, Logging and Statistics. Defining LOG should be considered mandatory, and it should be turned off only if you have a well-thought-out reason for doing so. LOG cannot be turned off in the Makefile. Instead, you must edit conf.h directly and undefine it by commenting it out:
/*# define LOG /* enable logging - don't turn off */comment out to remove support
LOG requires that your system support syslog(3). If you lack syslog(3), consider porting it to your system.
Defining LOG is meaningless unless the
LogLevel(L) option (see Section 34.8.33, LogLevel (L)) is also nonzero. Fortunately, this is usually the case because the default is 9.See also SYSLOG_BUFSIZE for a way to tune syslog(3)'s buffer size if necessary.
If you are running a precompiled sendmail binary, you may use the
-d0.1switch to determine whether LOG support was included (see Section 37.5.1).
Strip newlines from From: header
(V8.7.2 through V8.7.5 only)The Lotus Notes mail-gateway SMTP software can produce sender header lines that contain newlines when the username part becomes too long:
From: Long Full Name/LongSite/Country <user@site.domain>Although perfectly legal under RFC822, such split sender headers can cause MUAs to fail in ways that are difficult to diagnose. If your site receives mail from Lotus Notes gateways, you should define LOTUS_NOTES_HACK when compiling sendmail:
ENVDEF= -DLOTUS_NOTES_HACKDefining LOTUS_NOTES_HACK causes sendmail to include code in support of the
SingleLineFromHeaderoption (see Section 34.8.63, SingleLineFromHeader). Setting that option to true causes the newlines in the above address to be stripped and produces a single line:From: Long Full Name/LongSite/Country <user@site.domain>If you are running a precompiled sendmail binary, you can define
SingleLineFromHeaderin your configuration file. If you don't get a warning about a bad option name, then you have this support. Note that under V8.8 sendmail, LOTUS_NOTES_HACK is no longer required forSingleLineFromHeadersupport.
Support fuzzy name matching
(tune with ENVDEF= in Makefile)Defining MATCHGECOS causes code to be included inside sendmail for support of limited fuzzy name matching. This process is described under the
MatchGECOS(G) option (see Section 34.8.34, MatchGECOS (G)). MATCHGECOS is normally defined by default. If you want to turn it off, use ENVDEF= in Makefile:ENVDEF= -DMATCHGECOS=0If you are running a vendor-supplied binary, you can check to see whether MATCHGECOS was defined by using the
-d0.1debugging switch (see Section 37.5.1).
Redefine maximums
(port, edit specific files)In porting sendmail to a new system or tuning sendmail for special needs, it may be necessary to adjust one of its defined maximums. These cannot be tuned in Makefile. Instead, each needs to be changed in the file indicated by the third column of Table 18.7. In general, maximums should never be lowered without first examining the code for possible side effects; also, review the code to see whether any minimums are required or whether there are warnings about maximums.
Table 18.7: MAX... #defines to Redefine Maximums #define Default File Maximum MAXALIASDB 12 conf.h Number of alias databases MAXATOM 200 conf.h Atoms (tokens) in an address MAXDNSRCH 6 domain.c Possible domains to search MAXHOSTNAMELEN 256 conf.h Length of a hostname MAXKEY 128 conf.h Length of a database key MAXLINE 2048 conf.h Length of an input line MAXMAILERS 25 conf.h Number of delivery agents MAXMAPSTACK 12 conf.h Size of sequenced map stack MAXMIMEARGS 20 conf.h Arguments per Content-Type:headerMAXMXHOSTS 100 conf.h Number of per host MX records MAXMIMENESTING 20 conf.h Multipart MIME nesting depth MAXNAME 256 conf.h Length of a name MAXPRIORITIES 25 conf.h Number of Priority lines MAXPV 40 conf.h Arguments to a delivery agent MAXRULERECURSION 50 conf.c Ruleset recursion MAXRWSETS 200 conf.h Number of rule sets MAXTOCLASS 8 conf.h Message timeout classes MAXUSERENVIRON 100 conf.h Environment items per delivery agent Also see QUEUESEGSIZE and SYSLOG_BUFSIZE for the discussion of two other definitions that affect sizes.
Note that there are no debugging switches to display compiled maximums. If you are running a binary distribution and a maximum is of concern, you should get the source and build sendmail yourself.
Specify memory allocation size
(tune, edit conf.h)When sendmail reads lines of text from the configuration file or from
qfqueue files, it calls an internal routine named fgetfolded(). That routine is initially passed a buffer of size MAXLINE into which to fit the read line. If the line is longer than MAXLINE, the sendmail program dynamically increases the space required to hold the line by MEMCHUNKSIZE.When collecting the headers of a mail message, sendmail also begins with a buffer sized to MAXLINE. If a header arrives that is larger than MAXLINE characters, sendmail will increase the size of its buffer by MEMCHUNKSIZE as many times as is necessary to fully contain that header's data.
The default value assigned to MEMCHUNKSIZE is 1024 bytes. If you need to change that value (for example, to port to a new system's strange malloc(3) requirements or for performance reasons), you must edit conf.h:
# define MEMCHUNKSIZE1024/* chunk size for memory allocation */change this
Support MIME 7- to 8-bit conversion
(tune with ENVDEF= in Makefile)V8.8 sendmail contains the internal ability to convert messages that were converted into either quoted-printable or base64 (see Section 34.8.22) back into their original eight-bit form. The decision of whether or not to do this conversion is based on the
F=9delivery agent flag (see Section 30.8.6, F=9).Defining MIME7TO8 to a value of 1 causes support for conversion to be included in sendmail. It is defined as 1 by default. To disable the inclusion of conversion code, use ENVDEF= in Makefile to define it as 0:
ENVDEF= -DMIME7TO8=0exclude support
Unless you have a compelling reason to do otherwise, we recommend that MIME7TO8 remain enabled.
If you are running a precompiled sendmail binary, you may use the
-d0.1switch to determine whether MIME7TO8 support (see Section 37.5.1) was included.
Support MIME 8- to 7-bit conversion
(tune with ENVDEF= in Makefile)V8 sendmail contains the internal ability to convert 8-bit MIME message contents into 7-bit MIME so that mail can be transported to non-8-bit gateways. The methods used and the circumstances required to trigger conversion are described under the
EightBitMode(8) option (see Section 34.8.22). The conversion itself can be watched with the-d43debugging switch (see Section 37.5.150, -d43.1).Defining MIME8TO7 to a value of 1 causes support for conversion to be included in sendmail. It is defined as 1 by default. To disable the inclusion of conversion code, use ENVDEF= in Makefile to define it as 0:
ENVDEF= -DMIME8TO7=0exclude support
One side effect of excluding MIME8TO7 support is that defining it to 0 causes all MIME support to also be excluded. Unless you have a compelling reason to do otherwise, we recommend that MIME8TO7 remain enabled.
If you are running a precompiled sendmail binary, you may use the
-d0.1switch to determine whether MIME8TO7 support (see Section 37.5.1) was included.
Support DNS name resolution
(tune with ENVDEF= in Makefile)The sendmail program automatically takes advantage of DNS lookups or MX records to resolve addresses and canonical hostnames. If your site is a UUCP-only site (or is otherwise not connected to the Internet) and does not run named(8) locally, you should probably disable NAMED_BIND:
ENVDEF= -DNAMED_BIND=0disable DNS lookups
If you are not currently running named(8) but plan to connect to the Internet, you should define NAMED_BIND but set the
ResolverOptions(I) (see Section 34.8.55, ResolverOptions (I)) to false in the configuration file. Later, when you connect to the Internet, you can then simply change it to true. (See also the service-switch file, Section 34.8.61, for an another way to achieve the same effect.)If you are running a precompiled sendmail binary, you may use the
-d0.1switch to determine whether NAMED_BIND support was included (see Section 37.5.1).
Support Unix ndbm(3) Databases
(tune with DBMDEF= in Makefile)The ndbm(3) form of database uses two files (.pag and .dir) for each database. Databases cannot be shared by different architectures across a network. If you intend to support aliasing in an efficient manner, you should at least define this NDBM (or NEWDB described below) in your Makefile.
DBMDEF= -DNDBMThe ndbm(3) routines are used primarily to look up aliases. They can also be used to declare dbm class maps (see Section 33.3.2) with the
Kconfiguration command.Library routines to support ndbm(3) are available with most modern versions of UNIX. You may have to specify library support with a
-lndbmin the LIBS= line of your Makefile. If you are running a precompiled sendmail binary, you may use the-d0.1switch to determine whether ndbm(3) support was included (see Section 37.5.1).
Something amiss with your OS?
(port, edit conf.h)The sendmail program requires certain C language library routines to exist. If any is missing from your library, define one of the needs listed in Table 18.8 and sendmail will try to emulate it.
Each is defined with ENVDEF= in Makefile by setting it to a value of 1 (NEEDPUTENV is an exception in that 1 or 2 can be used).
ENVDEF= -DNEEDFSYNC=1When porting to a new system, you can test with this ENVDEF= statement and, if successful, put a permanent porting entry into conf.h. Note that these are correctly defined for all currently supported systems. You should need to redefine them only if you are porting sendmail to a completely new system.
Table 18.8: Define Replacements for Missing C Library Routines #define Emulates NEEDFSYNC Replaces a missing fsync(2). The sendmail program will try to simulate it by using fcntl(2), if available; otherwise, sendmail will not "sync" to disk. This latter circumstance is undesirable and may result in unreliable mail delivery, but it works. NEEDGETOPT The sendmail program calls getopt(3) twice when parsing its command-line arguments. Some version of getopt(3) do odd things when called twice. If yours is one of these, replace it. NEEDPUTENV Replace a missing putenv(3). If this is defined as 1, sendmail emulates by using setenv(3). If this is defined as 2, sendmail emulates by directly modifying the environmental section of memory.
NEEDSTRSTR Replace a missing strstr(3) with a well-written internalversion. NEEDSTRTOL Replace a missing strtol(3) with a well-written internalversion. NEEDVPRINTF Replace a missing vprintf(3). Note that the emulation supplied is not very elegant. It may not even work on some systems. See conf.h for a glimpse of systems that require this. If you are running a precompiled sendmail binary, there is no way to discover whether any of these were defined when it was built.
Define Network Support
(tune with ENVDEF= in Makefile)V8 sendmail is designed to support four kinds of networks, as listed in Table 18.9. Currently, only NETINET and NETISO are supported.
Table 18.9: Define for Network Support Define Description NETINET A TCP/IP-based network NETISO An ISO 8022 network NETNS A Xerox NS protocol network (tentative) NETX25 A CCITT\*[=a] X.25 network (tentative) International Telephone and Telegraph Consultative Committee.
Stubs are included in the source code for any programmer who is interested in implementing NETNS or NETX25. NETINET is defined by default. If you don't want it, you need to turn it off in your Makefile:
ENVDEF= -DNETINET=0NETISO is undefined by default. If you want to include ISO support, you need to specifically define it in your Makefile:
ENVDEF= -DNETISO=1Defining NETINET or NETISO has the side effect of causing SMTP and QUEUE also to be automatically defined.
Defining network support only causes the code for that network to be included in sendmail. The network serviced by a particular invocation of sendmail is selected with the
Familyparameter of theDaemonPortOptions(O) option (see Section 34.8.13, DaemonPortOptions (O)). In the absence of an option declaration, inet (for NETINET) is used as the default.If you are running a precompiled version of sendmail, you can determine which network types are supported by using the
-d0.1debugging switch (see Section 37.5.1).
Support NeXT netinfo(3) databases
(tune with DBMDEF= in Makefile)The netinfo(3) form of database is supplied with the NeXT and NeXTSTeP operating systems. It is a network information service that provides file contents such as aliases and passwd, and locations such as the location of the sendmail.cf file. If you are running on a NeXT or under NeXTSTeP, this NETINFO will automatically be defined in your Makefile:
DBMDEF= -DNETINFOThe netinfo(3) databases can also be used to declare netinfo class maps (see Section 33.3.2) with the
Kconfiguration command. If you are running a precompiled sendmail binary, you may use the-d0.1switch to determine whether NETINFO support was included (see Section 37.5.1).
Support Berkeley db(3) Databases
(tune with DBMDEF= in Makefile)The db(3) form of database uses a single file and can be shared by different architectures. If you intend to support aliasing in an efficient manner, you should at least define this NEWDB (or the NDBM described above) in your Makefile. The db(3) routines are used to look up aliases and are the routines used by the User Database (see Section 33.5, "The User Database"). They can also be used to declare hash and btree class maps (see Section 33.3.2) with the
Kconfiguration command.The db(3) libraries have overcome many of the limitations of the earlier ndbm(3) libraries. If possible, you should get and install the db(3) libraries before you build sendmail. The db(3) source is available from
Do not use the Net2 distribution. (See OLD_NEWDB below if you already have that distribution and can't easily get rid of it.) The src/READ_ME file contains critical information [14] about installing db(3).
[14] Such as why you must remove ndbm.h and ndbm.o from libdb.a before installing it for use by sendmail.
If you are running a precompiled sendmail binary, you may use the
-d0.1switch (see Section 37.5.1) to determine whether db(3) support was included in it.
Support for NIS
(tune with DBMDEF= in Makefile)If you intend to have sendmail support nis (formerly Yellow Pages) maps, you need to define NIS as part of your DBMDEF= line in Makefile:
DBMDEF= -DNISIf NIS is defined, the
AliasFile(A) option can be specified asOAnis:mail.aliasesV8.6 O AliasFile=nis:mail.aliases
V8.7 and above (if no service-switch file)
See Section 34.8.1, AliasFile (A) for more details about the
AliasFile(A) option. See Section 34.8.61 for a description of theServiceSwitchFileoption and its effect on nis aliases. Be aware that the aboveAliasFile(A) option declaration will override the lack of an nis entry in the service-switch file.NDBM also needs to be defined to allow sendmail to rebuild its alias files for use by nis:
DBMDEF= -DNIS -DNDBMFor this to work, the path of the alias file needs to contain the substring "/yp/". A typical /var/yp/Makefile will contain a line like this:
/usr/lib/sendmail -bi -oA$(YPDBDIR)/$(DOM)/mail.aliasesHere, $(YPDBDIR)/ is usually /var/yp/, so the substring is found. When "/yp/" is found, sendmail augments the aliases database with two special entries that are needed by nis:
YP_LAST_MODIFIED YP_MASTER_NAMEThese allow the newly built aliases file to successfully be distributed for use by nis clients. Without these entries you will see an error like that shown below when pushing your nis maps:
Status received from ypxfr onnisslave: Failed - no local order number in map - use -f flag to ypxfr.The solution here is to rebuild sendmail with both NDBM and NIS defined.
Defining NIS also causes support to be included for declaring and using nis class maps (see Section 33.3.2) with the
Kconfiguration command.Note that defining NIS without also defining NAMED_BIND will cause delivery to MX records to mysteriously fail.
If you are running a precompiled sendmail binary, you may use the
-d0.1switch to determine whether NIS support was included (see Section 37.5.1).
Support for NIS+
(tune with DBMDEF= in Makefile)If you intend to have sendmail support nisplus maps, you need to define NISPLUS as part of your DBMDEF= line in Makefile. (The use of nisplus aliases and other maps is determined by the /etc/nsswitch.conf file.)
DBMDEF= -DNISPLUSIf NISPLUS is defined, the
AliasFile(A) option can be used to override the setting of the /etc/nsswitch.conf file:O AliasFile=nisplus:mail.aliasesV8.7 and above
Here,
nisplusaliases will be used even if the /etc/nsswitch.conf file excludes them.See Section 34.8.1 for details about the
AliasFile(A) option. Note that NISPLUS is new to V8.7 and not supported under earlier versions of sendmail.With NISPLUS defined, support is also included to declare and use nisplus class maps (see Section 33.3.2) with the
Kconfiguration command.If you are running a precompiled sendmail binary, you may use the
-d0.1switch to determine whether NISPLUS support was included (see Section 37.5.1).
Prevent multi-group file access
(port, edit conf.h)When checking files and directories for group read and write permissions, sendmail checks the group of the controlling user. On systems that allow a user to belong to one group at a time, failure stops here; on systems that allow users to belong to many groups at once, failure causes sendmail to check any other groups to which the controlling user may belong. It finds the list of groups by calling getgrgid(3).
If your system lacks the getgrgid(3) call or doesn't need it, you should exclude this code by defining NO_GROUP_SET in conf.h. NO_GROUP_SET causes the code containing the call to getgrgid(3) to be excluded from sendmail. Be aware that excluding getgrgid(3) support on systems that need it can cause delivery to files to fail in mysterious ways.
If you are running a precompiled version of sendmail, be aware that there is no debugging switch that can tell you what the setting of NO_GROUP_SET was set to at compile time.
Note that NO_GROUP_SET affects only inclusion of the getgrgid(3) system call. See the
DontInitGroupsoption (see Section 34.8.19, DontInitGroups) for a means to exclude the getgrgid(3) and initgroups(3) system calls.
Exclude From line support
(port, edit conf.h)Under UNIX a file of many mail messages normally has one message separated from another by a blank line and then a line that begins with the five characters "
From" (four letters and a space). On such systems, sendmail saves important information from such lines for later use.On non-UNIX machines (VMS or MS-DOS) the conventions are different, so you won't want sendmail to treat such lines as special. Similarly, if your UNIX site has converted entirely away from this convention (with mhs or the like), you might not want this special treatment.
To disable special treatment of "
From" lines, define the NOTUNIX macro in your Makefile:ENVDEF= -DNOTUNIXWhen porting to a new system, you can test with this ENVDEF= statement and, if successful, put a permanent porting entry into conf.h. Defining NOTUNIX causes the code for eatfrom() to be excluded from sendmail. The
-d30.2debugging switch (see Section 37.5.109, -d30.2) can be used to watch eatfrom() and to determine whether NOTUNIX was declared when compiling sendmail.
Support the old form of db(3)
(port with DBMDEF= in Makefile)BSDI(BSD/386) 1.0, NetBSD 0.9, and FreeBSD 1.0 were distributed with an old version of the db(3) library. These systems will not use the file locking of the latest version. For such systems you must define
DBMDEF= -DNEWDB -DOLD_NEWDB=1don't support new file locking
Although you can get and install the latest version of db(3), you should not do so unless you can rebuild your entire UNIX system. The old form of database is used throughout, and just building sendmail with the new form will cause password lookups and the like to fail.
In general, you should never have to declare OLD_NEWDB (instead, we recommend upgrading your operating system). OLD_NEWDB is automatically included in the Makefile for the systems that need it.
Hardcode paths inside sendmail
(debug with ENVDEF= in Makefile)Only a few pathnames are hard-coded into sendmail. The most obvious is its configuration file, because that file lists the locations of nearly all other files. For various reasons a few other file locations are also hard-coded. Here, we describe those that you can change. Note that the general form for all such changes uses the ENVDEF= declaration of your Makefile:
ENVDEF= -D_PATH...=\"/new/path/filename\"The new path must be surrounded by backslashed quotation marks so that the compiler will correctly interpret it as a string. /etc/sendmail.cf The sendmail.cf file is pivotal to all of the sendmail program's operations (see Chapter 27, The Configuration File). V8.7 sendmail recommends that it always be called sendmail.cf and always be located in the /etc directory. For testing, debugging, or other legitimate reasons you may prefer to locate that file elsewhere (at least temporarily). You do that with the _PATH_SENDMAILCF definition:
ENVDEF= -D_PATH_SENDMAILCF=\"/src/tests/test.cf\"/etc/sendmail.pid The sendmail.pid file contains two lines of information. The first line is text representation of the pid of the current running daemon. The second is a copy of the command line that was originally used to start sendmail. This file is handy for killing and restarting the daemon (see Section 4.1.1, "Daemon Mode (-bd)"). If BSD4_4 is defined, the default becomes /var/run/sendmail.pid; otherwise, the default is /etc/sendmail.pid. You can change this default (and you must if you intend to run a test daemon in parallel to the original), with the ENVDEF= of your Makefile:
ENVDEF= -D_PATH_SENDMAILPID=\"/src/tests/test.pid\"Ordinarily, two daemons cannot run simultaneously on a single host. If you need to run a second daemon, you must change the port that it listens to with the
Portparameter of theDaemonPortOptions(O) option (see Section 34.8.13). /etc/hosts Ordinarily, sendmail will first look for a service-switch (see Section 34.8.61) to see how it should look up the canonical names of hosts. If it finds one and if the service hosts is listed, it uses the techniques listed with the service-switch to look up its hosts. When a technique is files, sendmail reads the file named by _PATH_HOSTS to get its canonical information. Ordinarily, that file is called /etc/hosts. If that file is different or has been customized on your system, you can redefine the location like this:ENVDEF= -D_PATH_HOSTS=\"/etc/privatehosts\"In general, most other techniques are preferred over the linear parse of a hosts file. However, this file is useful in determining the canonical name of the local host. Note that the location of the hosts file can also be changed with the
HostsFileoption (see Section 34.8.30, HostsFile). /dev/kmem The sendmail program decides when to refuse connections and when to only queue mail on the basis of its perception of the machine load average. The process of determining that average is hugely complex and varies greatly from vendor to vendor. Three pathnames that may be used in determining the load are _PATH_KMEM, _PATH_LOADAVG, and _PATH_UNIX. These should need to be changed only in the rare event that you are porting sendmail to a previously unsupported platform. Read the file conf.c to see the complex way they are presently used. Also see Table 18.6 to see how to use these to find the load average. /etc/shells A user is not allowed to run programs from a .forward file unless that user has a valid login shell (see Section 25.7.4, "Piping Through Programs"). Nor is a user allowed to save mail directly to files without a valid shell. To determine whether the login shell is valid, sendmail calls getusershell(3). If sendmail was defined without HASGETUSERSHELL defined (see Table 18.4), it instead tries to look up the shell in the /etc/shells file. If that file cannot be opened, sendmail gets valid shell names from an internal list calledDefaultUserShellsthat is defined in conf.c. This _PATH_SHELLS definition can be used to change the location of the /etc/shells file. /usr/tmp In a panic situation (such as when sendmail cannot figure out how to deliver or bounce a mail message) the message is saved into the /usr/tmp/dead.letter file (see theErrorMode(e) option Section 34.8.24, ErrorMode (e)). The _PATH_VARTMP definition is used to tune the location of the /usr/tmp directory. For some systems it is defined as /usr/tmp; for others it will need to be named /var/tmp. As distributed, it is undefined in all Makefiles, and it defaults to /usr/tmp.There is no debugging flag that will display the defaults for these file locations. If any are of concern, you should build sendmail yourself.
Make sendmail pickier
(tune with ENVDEF= in Makefile)The sendmail program can be made pickier by tuning its
PrivacyOptions(p) option (see Section 34.8.47, PrivacyOptions (p)) or by defining two macros when compiling: PICKY_HELO_CHECK The SMTP HELO command is used to introduce the calling machine to the receiving machine. The form of that command isHELO calling host name hereNote that HELO and EHLO are equivalent in this regard. Ordinarily, sendmail doesn't care what the calling host calls itself. All sendmail cares about is that this name is the canonical name of a machine. If you care whether the HELO hostname matches the real hostname of the calling machine, you can define PICKY_HELO_CHECK.
ENVDEF= -DPICKY_HELO_CHECKWith PICKY_HELO_CHECK defined, a mismatch (other than the local machine calling itself localhost) will result in this being logged:
Hostrealnameclaimed to behelonameNote that this check is ordinarily turned off [15] because a large number of hosts on the Internet use a name that is different from their canonical name. PICKY_QF_NAME_CHECK The name of a queue file's control file is narrowly defined inside sendmail (see Section 23.2.1, "The Queue Identifier"). If only sendmail will be placing files into your queue, you might wish to turn on this macro for additional protection:
[15] Eric was getting complaints that the continual insertion of this warning was misleading and tended to cause people to ignore it entirely.
ENVDEF= -DPICKY_QF_NAME_CHECKWith PICKY_QF_NAME_CHECK defined, sendmail will log an error if the name of the
qffile is incorrectly formed and will rename theqffile into aQffile (see Section 23.3 for details of this process).
Size of prescan() buffer
(tune, edit conf.h)Whenever an address (including rules) is tokenized, it is stored in a single buffer, one token following the next with a zero-value byte separating them. The size of this buffer is defined by PSBUFSIZ. The default size is defined in conf.h as (MAXNAME + MAXATOM).
In general, this definition should never be changed. If you start getting warning messages such as
Address too longlook elsewhere (such as rule sets) for the cause. You should consider changing the size of PSBUFSIZ only as a last resort.
Enable queueing
(tune, edit conf.h)If sendmail cannot immediately deliver a mail message, it places that message in a queue to await another try. The QUEUE definition causes queue-handling code to be included in sendmail. If queueing is not enabled and you need to queue, sendmail prints the following message and either bounces or discards the message:
dropenvelope: queueupA word to the wise: Always define QUEUE. Even if you have only a pure UUCP machine, mail can fail (for a reason such as a full disk). Without queueing, such mail will bounce when instead it should be queued for a later try.
The default is to always define QUEUE if NETINET or NETISO are defined; otherwise, QUEUE is undefined. There is no debugging flag to show whether QUEUE is defined, but the the
-bpswitch (see Section 23.4, "Printing the Queue") can be used to determine whether it is supported.
Amount to grow queue work list
(tune, edit conf.h)During a queue run, sendmail holds information in memory about all the files being processed. It does this so that it can sort them by priority for delivery. Beginning with V8.7 sendmail, there is no longer a limit (other than consuming all memory) on how many queued messages can be processed during any queue run. Prior to V8.7, that number was fixed by the constant QUEUESIZE. QUEUESIZE has been retired and replaced with QUEUESEGSIZE, which is defined in conf.h as:
# define QUEUESEGSIZE 1000 /* increment for queue size */It should be changed only if your queue continually contains a huge number of messages. If you notice many messages like this being logged:
grew WorkList for...you may need to modify QUEUESEGSIZE. Doing so requires that you edit conf.h and recompile.
QUEUESEGSIZE can be traced with the
-d41debugging switch (see Section 37.5.144, -d41.1).
Support scanf(3) with F command
(tune with ENVDEF= in Makefile)The
Fconfiguration command (see Section 32.1.2, "The F Class Command") allows the specification of a scanf(3) style string to aid in parsing files (see Section 32.1.2.1, "scanf(3) variations"). In general this is not recommended because a misdesigned input file can cause sendmail to core dump. However, because of its popularity, it is enabled at compile time by default. If you don't need it, we recommend you exclude its support with ENVDEF= in Makefile.ENVDEF= -DSCANF=0disable scanf(3)
The scanf(3) is used only in reading files into a class with the
Fconfiguration command. If you are running a precompiled version of sendmail, you can determine whether SCANF was included by using the-d0.1debugging switch (see Section 37.5.1).
How to determine free disk space
(port, edit conf.h)The sendmail program can reject incoming mail messages if they are too large for the queueing disk. This ability is enabled by giving a positive, nonzero size to the
MinFreeBlocks(b) option (see Section 34.8.40, MinFreeBlocks (b)). The method that sendmail uses to measure the free space on a disk varies from system to system. SFS_TYPE defines which of several methods sendmail will use. Those available are shown in Table 18.10.
Table 18.10: Method to Determine Free Disk Space