<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style xmlns="" type="text/css"> div.added { background-color: #ffff99; } div.deleted { text-decoration: line-through; background-color: #FF7F7F; } div.changed { background-color: #99ff99; } div.off { } span.added { background-color: #ffff99; } span.deleted { text-decoration: line-through; background-color: #FF7F7F; } span.changed { background-color: #99ff99; } span.off { } pre.literallayout { background-color: #E8E8D0; padding-left: 0.5cm; padding-top: 5px; padding-bottom: 5px; } div[class=changed] pre.literallayout { background-color: #99ff99; padding-left: 0.5cm; padding-top: 5px; padding-bottom: 5px; } div.literallayout { background-color: #E8E8D0; padding-left: 0.5cm; padding-top: 5px; padding-bottom: 5px; } div[class=changed] div.literallayout { background-color: #99ff99; padding-left: 0.5cm; padding-top: 5px; padding-bottom: 5px; } </style><title>4. Building and installing Exim</title><meta name="generator" content="DocBook XSL Stylesheets V1.72.0" /><link rel="start" href="index.html" title="Specification of the Exim Mail Transfer Agent" /><link rel="up" href="index.html" title="Specification of the Exim Mail Transfer Agent" /><link rel="prev" href="ch03.html" title="3. How Exim receives and delivers mail" /><link rel="next" href="ch05.html" title="5. The Exim command line" /></head><body><div class="navheader"> <table width="100%" summary="Navigation header"><tr><td width="20%" align="left"><a accesskey="p" href="ch03.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr></table></div> <div class="chapter" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h2 class="title"><a href="index.html#toc0031" id="CHID3">4. Building and installing Exim</a></h2></div> </div> </div> <p> <a id="IIDbuex" class="indexterm"></a> </p> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0032" id="SECID23">4.1 Unpacking</a></h3></div> </div> </div> <p> Exim is distributed as a gzipped or bzipped tar file which, when unpacked, creates a directory with the name of the current release (for example, <em class="filename">exim-4.69</em>) into which the following files are placed: </p> <div class="informaltable"> <table border="0"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"> <em class="filename">ACKNOWLEDGMENTS</em></td><td align="left">contains some acknowledgments</td></tr><tr><td align="left"> <em class="filename">CHANGES</em></td><td align="left">contains a reference to where changes are documented</td></tr><tr><td align="left"> <em class="filename">LICENCE</em></td><td align="left">the GNU General Public Licence</td></tr><tr><td align="left"> <em class="filename">Makefile</em></td><td align="left">top-level make file</td></tr><tr><td align="left"> <em class="filename">NOTICE</em></td><td align="left">conditions for the use of Exim</td></tr><tr><td align="left"> <em class="filename">README</em></td><td align="left">list of files, directories and simple build instructions</td></tr></tbody></table></div> <p> Other files whose names begin with <em class="filename">README</em> may also be present. The following subdirectories are created: </p> <div class="informaltable"> <table border="0"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"> <em class="filename">Local</em></td><td align="left">an empty directory for local configuration files</td></tr><tr><td align="left"> <em class="filename">OS</em></td><td align="left">OS-specific files</td></tr><tr><td align="left"> <em class="filename">doc</em></td><td align="left">documentation files</td></tr><tr><td align="left"> <em class="filename">exim_monitor</em></td><td align="left">source files for the Exim monitor</td></tr><tr><td align="left"> <em class="filename">scripts</em></td><td align="left">scripts used in the build process</td></tr><tr><td align="left"> <em class="filename">src</em></td><td align="left">remaining source files</td></tr><tr><td align="left"> <em class="filename">util</em></td><td align="left">independent utilities</td></tr></tbody></table></div> <p> The main utility programs are contained in the <em class="filename">src</em> directory, and are built with the Exim binary. The <em class="filename">util</em> directory contains a few optional scripts that may be useful to some sites. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0033" id="SECID24">4.2 Multiple machine architectures and operating systems</a></h3></div> </div> </div> <p> <a id="id474642" class="indexterm"></a> The building process for Exim is arranged to make it easy to build binaries for a number of different architectures and operating systems from the same set of source files. Compilation does not take place in the <em class="filename">src</em> directory. Instead, a <span class="emphasis"><em>build directory</em></span> is created for each architecture and operating system. <a id="id474671" class="indexterm"></a> Symbolic links to the sources are installed in this directory, which is where the actual building takes place. In most cases, Exim can discover the machine architecture and operating system for itself, but the defaults can be overridden if necessary. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0034" id="SECTdb">4.3 DBM libraries</a></h3></div> </div> </div> <p> <a id="id474703" class="indexterm"></a> <a id="id474717" class="indexterm"></a> Even if you do not use any DBM files in your configuration, Exim still needs a DBM library in order to operate, because it uses indexed files for its hints databases. Unfortunately, there are a number of DBM libraries in existence, and different operating systems often have different ones installed. </p> <p> <a id="id474740" class="indexterm"></a> <a id="id474754" class="indexterm"></a> <a id="id474766" class="indexterm"></a> <a id="id474777" class="indexterm"></a> If you are using Solaris, IRIX, one of the modern BSD systems, or a modern Linux distribution, the DBM configuration should happen automatically, and you may be able to ignore this section. Otherwise, you may have to learn more than you would like about DBM libraries from what follows. </p> <p> <a id="id474796" class="indexterm"></a> Licensed versions of Unix normally contain a library of DBM functions operating via the <span class="emphasis"><em>ndbm</em></span> interface, and this is what Exim expects by default. Free versions of Unix seem to vary in what they contain as standard. In particular, some early versions of Linux have no default DBM library, and different distributors have chosen to bundle different libraries with their packaged versions. However, the more recent releases seem to have standardized on the Berkeley DB library. </p> <p> Different DBM libraries have different conventions for naming the files they use. When a program opens a file called <em class="filename">dbmfile</em>, there are several possibilities: </p> <div class="orderedlist"> <ol type="1"><li><p> A traditional <span class="emphasis"><em>ndbm</em></span> implementation, such as that supplied as part of Solaris, operates on two files called <em class="filename">dbmfile.dir</em> and <em class="filename">dbmfile.pag</em>. </p> </li><li><p> <a id="id474870" class="indexterm"></a> The GNU library, <span class="emphasis"><em>gdbm</em></span>, operates on a single file. If used via its <span class="emphasis"><em>ndbm</em></span> compatibility interface it makes two different hard links to it with names <em class="filename">dbmfile.dir</em> and <em class="filename">dbmfile.pag</em>, but if used via its native interface, the file name is used unmodified. </p> </li><li><p> <a id="id474912" class="indexterm"></a> The Berkeley DB package, if called via its <span class="emphasis"><em>ndbm</em></span> compatibility interface, operates on a single file called <em class="filename">dbmfile.db</em>, but otherwise looks to the programmer exactly the same as the traditional <span class="emphasis"><em>ndbm</em></span> implementation. </p> </li><li><p> If the Berkeley package is used in its native mode, it operates on a single file called <em class="filename">dbmfile</em>; the programmer’s interface is somewhat different to the traditional <span class="emphasis"><em>ndbm</em></span> interface. </p> </li><li><p> To complicate things further, there are several very different versions of the Berkeley DB package. Version 1.85 was stable for a very long time, releases 2.<span class="emphasis"><em>x</em></span> and 3.<span class="emphasis"><em>x</em></span> were current for a while, but the latest versions are now numbered 4.<span class="emphasis"><em>x</em></span>. Maintenance of some of the earlier releases has ceased. All versions of Berkeley DB can be obtained from <span class="bold"><strong><a href="http://www.sleepycat.com/" target="_top">http://www.sleepycat.com/</a></strong></span>. </p> </li><li><p> <a id="id474998" class="indexterm"></a> Yet another DBM library, called <span class="emphasis"><em>tdb</em></span>, is available from <span class="bold"><strong><a href="http://download.sourceforge.net/tdb" target="_top">http://download.sourceforge.net/tdb</a></strong></span>. It has its own interface, and also operates on a single file. </p> </li></ol></div> <p> <a id="id475032" class="indexterm"></a> <a id="id475043" class="indexterm"></a> Exim and its utilities can be compiled to use any of these interfaces. In order to use any version of the Berkeley DB package in native mode, you must set USE_DB in an appropriate configuration file (typically <em class="filename">Local/Makefile</em>). For example: </p> <pre class="literallayout">USE_DB=yes </pre><p> Similarly, for gdbm you set USE_GDBM, and for tdb you set USE_TDB. An error is diagnosed if you set more than one of these. </p> <p> At the lowest level, the build-time configuration sets none of these options, thereby assuming an interface of type (1). However, some operating system configuration files (for example, those for the BSD operating systems and Linux) assume type (4) by setting USE_DB as their default, and the configuration files for Cygwin set USE_GDBM. Anything you set in <em class="filename">Local/Makefile</em>, however, overrides these system defaults. </p> <p> As well as setting USE_DB, USE_GDBM, or USE_TDB, it may also be necessary to set DBMLIB, to cause inclusion of the appropriate library, as in one of these lines: </p> <pre class="literallayout">DBMLIB = -ldb DBMLIB = -ltdb </pre><p> Settings like that will work if the DBM library is installed in the standard place. Sometimes it is not, and the library’s header file may also not be in the default path. You may need to set INCLUDE to specify where the header file is, and to specify the path to the library more fully in DBMLIB, as in this example: </p> <pre class="literallayout">INCLUDE=-I/usr/local/include/db-4.1 DBMLIB=/usr/local/lib/db-4.1/libdb.a </pre><p> There is further detailed discussion about the various DBM libraries in the file <em class="filename">doc/dbm.discuss.txt</em> in the Exim distribution. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0035" id="SECID25">4.4 Pre-building configuration</a></h3></div> </div> </div> <p> <a id="id475148" class="indexterm"></a> <a id="id475162" class="indexterm"></a> <a id="id475173" class="indexterm"></a> <a id="id475187" class="indexterm"></a> Before building Exim, a local configuration file that specifies options independent of any operating system has to be created with the name <em class="filename">Local/Makefile</em>. A template for this file is supplied as the file <em class="filename">src/EDITME</em>, and it contains full descriptions of all the option settings therein. These descriptions are therefore not repeated here. If you are building Exim for the first time, the simplest thing to do is to copy <em class="filename">src/EDITME</em> to <em class="filename">Local/Makefile</em>, then read it and edit it appropriately. </p> <p> There are three settings that you must supply, because Exim will not build without them. They are the location of the run time configuration file (CONFIGURE_FILE), the directory in which Exim binaries will be installed (BIN_DIRECTORY), and the identity of the Exim user (EXIM_USER and maybe EXIM_GROUP as well). The value of CONFIGURE_FILE can in fact be a colon-separated list of file names; Exim uses the first of them that exists. </p> <p> There are a few other parameters that can be specified either at build time or at run time, to enable the same binary to be used on a number of different machines. However, if the locations of Exim’s spool directory and log file directory (if not within the spool directory) are fixed, it is recommended that you specify them in <em class="filename">Local/Makefile</em> instead of at run time, so that errors detected early in Exim’s execution (such as a malformed configuration file) can be logged. </p> <p> <a id="id475248" class="indexterm"></a> Exim’s interfaces for calling virus and spam scanning software directly from access control lists are not compiled by default. If you want to include these facilities, you need to set </p> <pre class="literallayout">WITH_CONTENT_SCAN=yes </pre><p> in your <em class="filename">Local/Makefile</em>. For details of the facilities themselves, see chapter <a href="ch41.html" title="41. Content scanning at ACL time">41</a>. </p> <p> <a id="id475317" class="indexterm"></a> <a id="id475331" class="indexterm"></a> If you are going to build the Exim monitor, a similar configuration process is required. The file <em class="filename">exim_monitor/EDITME</em> must be edited appropriately for your installation and saved under the name <em class="filename">Local/eximon.conf</em>. If you are happy with the default settings described in <em class="filename">exim_monitor/EDITME</em>, <em class="filename">Local/eximon.conf</em> can be empty, but it must exist. </p> <p> This is all the configuration that is needed in straightforward cases for known operating systems. However, the building process is set up so that it is easy to override options that are set by default or by operating-system-specific configuration files, for example to change the name of the C compiler, which defaults to <span><strong class="option">gcc</strong></span>. See section <a href="ch04.html#SECToverride" title="4.11 Overriding build-time options for Exim">4.11</a> below for details of how to do this. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0036" id="SECID26">4.5 Support for iconv()</a></h3></div> </div> </div> <p> <a id="id475407" class="indexterm"></a> <a id="id475422" class="indexterm"></a> The contents of header lines in messages may be encoded according to the rules described RFC 2047. This makes it possible to transmit characters that are not in the ASCII character set, and to label them as being in a particular character set. When Exim is inspecting header lines by means of the <span><strong class="option">$h_</strong></span> mechanism, it decodes them, and translates them into a specified character set (default ISO-8859-1). The translation is possible only if the operating system supports the <em class="function">iconv()</em> function. </p> <p> However, some of the operating systems that supply <em class="function">iconv()</em> do not support very many conversions. The GNU <span><strong class="option">libiconv</strong></span> library (available from <span class="bold"><strong><a href="http://www.gnu.org/software/libiconv/" target="_top">http://www.gnu.org/software/libiconv/</a></strong></span>) can be installed on such systems to remedy this deficiency, as well as on systems that do not supply <em class="function">iconv()</em> at all. After installing <span><strong class="option">libiconv</strong></span>, you should add </p> <pre class="literallayout">HAVE_ICONV=yes </pre><p> to your <em class="filename">Local/Makefile</em> and rebuild Exim. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0037" id="SECTinctlsssl">4.6 Including TLS/SSL encryption support</a></h3></div> </div> </div> <p> <a id="id475518" class="indexterm"></a> <a id="id475532" class="indexterm"></a> <a id="id475546" class="indexterm"></a> <a id="id475557" class="indexterm"></a> <a id="id475572" class="indexterm"></a> Exim can be built to support encrypted SMTP connections, using the STARTTLS command as per RFC 2487. It can also support legacy clients that expect to start a TLS session immediately on connection to a non-standard port (see the <span><strong class="option">tls_on_connect_ports</strong></span> runtime option and the <span><strong class="option">-tls-on-connect</strong></span> command line option). </p> <p> If you want to build Exim with TLS support, you must first install either the OpenSSL or GnuTLS library. There is no cryptographic code in Exim itself for implementing SSL. </p> <p> If OpenSSL is installed, you should set </p> <pre class="literallayout">SUPPORT_TLS=yes TLS_LIBS=-lssl -lcrypto </pre><p> in <em class="filename">Local/Makefile</em>. You may also need to specify the locations of the OpenSSL library and include files. For example: </p> <pre class="literallayout">SUPPORT_TLS=yes TLS_LIBS=-L/usr/local/openssl/lib -lssl -lcrypto TLS_INCLUDE=-I/usr/local/openssl/include/ </pre><p> <a id="id475641" class="indexterm"></a> If GnuTLS is installed, you should set </p> <pre class="literallayout">SUPPORT_TLS=yes USE_GNUTLS=yes TLS_LIBS=-lgnutls -ltasn1 -lgcrypt </pre><p> in <em class="filename">Local/Makefile</em>, and again you may need to specify the locations of the library and include files. For example: </p> <pre class="literallayout">SUPPORT_TLS=yes USE_GNUTLS=yes TLS_LIBS=-L/usr/gnu/lib -lgnutls -ltasn1 -lgcrypt TLS_INCLUDE=-I/usr/gnu/include </pre><p> You do not need to set TLS_INCLUDE if the relevant directory is already specified in INCLUDE. Details of how to configure Exim to make use of TLS are given in chapter <a href="ch39.html" title="39. Encrypted SMTP connections using TLS/SSL">39</a>. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0038" id="SECID27">4.7 Use of tcpwrappers</a></h3></div> </div> </div> <p> <a id="id475708" class="indexterm"></a> <a id="id475719" class="indexterm"></a> Exim can be linked with the <span class="emphasis"><em>tcpwrappers</em></span> library in order to check incoming SMTP calls using the <span class="emphasis"><em>tcpwrappers</em></span> control files. This may be a convenient alternative to Exim’s own checking facilities for installations that are already making use of <span class="emphasis"><em>tcpwrappers</em></span> for other purposes. To do this, you should set USE_TCP_WRAPPERS in <em class="filename">Local/Makefile</em>, arrange for the file <em class="filename">tcpd.h</em> to be available at compile time, and also ensure that the library <em class="filename">libwrap.a</em> is available at link time, typically by including <span><strong class="option">-lwrap</strong></span> in EXTRALIBS_EXIM. For example, if <span class="emphasis"><em>tcpwrappers</em></span> is installed in <em class="filename">/usr/local</em>, you might have </p> <pre class="literallayout">USE_TCP_WRAPPERS=yes CFLAGS=-O -I/usr/local/include EXTRALIBS_EXIM=-L/usr/local/lib -lwrap </pre><p> in <em class="filename">Local/Makefile</em>. The name to use in the <span class="emphasis"><em>tcpwrappers</em></span> control files is “<span class="quote">exim</span>”. For example, the line </p> <pre class="literallayout">exim : LOCAL 192.168.1. .friendly.domain.example </pre><p> in your <em class="filename">/etc/hosts.allow</em> file allows connections from the local host, from the subnet 192.168.1.0/24, and from all hosts in <span class="emphasis"><em>friendly.domain.example</em></span>. All other connections are denied. Consult the <span class="emphasis"><em>tcpwrappers</em></span> documentation for further details. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0039" id="SECID28">4.8 Including support for IPv6</a></h3></div> </div> </div> <p> <a id="id475853" class="indexterm"></a> Exim contains code for use on systems that have IPv6 support. Setting <code class="literal">HAVE_IPV6=YES</code> in <em class="filename">Local/Makefile</em> causes the IPv6 code to be included; it may also be necessary to set IPV6_INCLUDE and IPV6_LIBS on systems where the IPv6 support is not fully integrated into the normal include and library files. </p> <p> Two different types of DNS record for handling IPv6 addresses have been defined. AAAA records (analogous to A records for IPv4) are in use, and are currently seen as the mainstream. Another record type called A6 was proposed as better than AAAA because it had more flexibility. However, it was felt to be over-complex, and its status was reduced to “<span class="quote">experimental</span>”. It is not known if anyone is actually using A6 records. Exim has support for A6 records, but this is included only if you set <code class="literal">SUPPORT_A6=YES</code> in <em class="filename">Local/Makefile</em>. The support has not been tested for some time. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0040" id="SECID29">4.9 The building process</a></h3></div> </div> </div> <p> <a id="id475925" class="indexterm"></a> Once <em class="filename">Local/Makefile</em> (and <em class="filename">Local/eximon.conf</em>, if required) have been created, run <span class="emphasis"><em>make</em></span> at the top level. It determines the architecture and operating system types, and creates a build directory if one does not exist. For example, on a Sun system running Solaris 8, the directory <em class="filename">build-SunOS5-5.8-sparc</em> is created. <a id="id475962" class="indexterm"></a> Symbolic links to relevant source files are installed in the build directory. </p> <p> <span class="bold"><strong>Warning</strong></span>: The <span><strong class="option">-j</strong></span> (parallel) flag must not be used with <span class="emphasis"><em>make</em></span>; the building process fails if it is set. </p> <p> If this is the first time <span class="emphasis"><em>make</em></span> has been run, it calls a script that builds a make file inside the build directory, using the configuration files from the <em class="filename">Local</em> directory. The new make file is then passed to another instance of <span class="emphasis"><em>make</em></span>. This does the real work, building a number of utility scripts, and then compiling and linking the binaries for the Exim monitor (if configured), a number of utility programs, and finally Exim itself. The command <code class="literal">make makefile</code> can be used to force a rebuild of the make file in the build directory, should this ever be necessary. </p> <p> If you have problems building Exim, check for any comments there may be in the <em class="filename">README</em> file concerning your operating system, and also take a look at the FAQ, where some common problems are covered. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0041" id="SECID283">4.10 Output from “<span xmlns="http://www.w3.org/1999/xhtml" class="quote">make</span>”</a></h3></div> </div> </div> <p> The output produced by the <span class="emphasis"><em>make</em></span> process for compile lines is often very unreadable, because these lines can be very long. For this reason, the normal output is suppressed by default, and instead output similar to that which appears when compiling the 2.6 Linux kernel is generated: just a short line for each module that is being compiled or linked. However, it is still possible to get the full output, by calling <span class="emphasis"><em>make</em></span> like this: </p> <pre class="literallayout">FULLECHO='' make -e </pre><p> The value of FULLECHO defaults to “<span class="quote">@</span>”, the flag character that suppresses command reflection in <span class="emphasis"><em>make</em></span>. When you ask for the full output, it is given in addition to the short output. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0042" id="SECToverride">4.11 Overriding build-time options for Exim</a></h3></div> </div> </div> <p> <a id="id476103" class="indexterm"></a> The main make file that is created at the beginning of the building process consists of the concatenation of a number of files which set configuration values, followed by a fixed set of <span class="emphasis"><em>make</em></span> instructions. If a value is set more than once, the last setting overrides any previous ones. This provides a convenient way of overriding defaults. The files that are concatenated are, in order: </p> <div class="literallayout"> <em class="filename">OS/Makefile-Default</em><br /> <em class="filename">OS/Makefile-</em><<span class="emphasis"><em>ostype</em></span>><br /> <em class="filename">Local/Makefile</em><br /> <em class="filename">Local/Makefile-</em><<span class="emphasis"><em>ostype</em></span>><br /> <em class="filename">Local/Makefile-</em><<span class="emphasis"><em>archtype</em></span>><br /> <em class="filename">Local/Makefile-</em><<span class="emphasis"><em>ostype</em></span>>-<<span class="emphasis"><em>archtype</em></span>><br /> <em class="filename">OS/Makefile-Base</em><br /> </div> <p> <a id="id476193" class="indexterm"></a> <a id="id476207" class="indexterm"></a> <a id="id476222" class="indexterm"></a> where <<span class="emphasis"><em>ostype</em></span>> is the operating system type and <<span class="emphasis"><em>archtype</em></span>> is the architecture type. <em class="filename">Local/Makefile</em> is required to exist, and the building process fails if it is absent. The other three <em class="filename">Local</em> files are optional, and are often not needed. </p> <p> The values used for <<span class="emphasis"><em>ostype</em></span>> and <<span class="emphasis"><em>archtype</em></span>> are obtained from scripts called <em class="filename">scripts/os-type</em> and <em class="filename">scripts/arch-type</em> respectively. If either of the environment variables EXIM_OSTYPE or EXIM_ARCHTYPE is set, their values are used, thereby providing a means of forcing particular settings. Otherwise, the scripts try to get values from the <span><strong class="option">uname</strong></span> command. If this fails, the shell variables OSTYPE and ARCHTYPE are inspected. A number of <span class="emphasis"><em>ad hoc</em></span> transformations are then applied, to produce the standard names that Exim expects. You can run these scripts directly from the shell in order to find out what values are being used on your system. </p> <p> <em class="filename">OS/Makefile-Default</em> contains comments about the variables that are set therein. Some (but not all) are mentioned below. If there is something that needs changing, review the contents of this file and the contents of the make file for your operating system (<em class="filename">OS/Makefile-<ostype></em>) to see what the default values are. </p> <p> <a id="id476323" class="indexterm"></a> If you need to change any of the values that are set in <em class="filename">OS/Makefile-Default</em> or in <em class="filename">OS/Makefile-<ostype></em>, or to add any new definitions, you do not need to change the original files. Instead, you should make the changes by putting the new values in an appropriate <em class="filename">Local</em> file. For example, <a id="id476360" class="indexterm"></a> when building Exim in many releases of the Tru64-Unix (formerly Digital UNIX, formerly DEC-OSF1) operating system, it is necessary to specify that the C compiler is called <span class="emphasis"><em>cc</em></span> rather than <span class="emphasis"><em>gcc</em></span>. Also, the compiler must be called with the option <span><strong class="option">-std1</strong></span>, to make it recognize some of the features of Standard C that Exim uses. (Most other compilers recognize Standard C by default.) To do this, you should create a file called <em class="filename">Local/Makefile-OSF1</em> containing the lines </p> <pre class="literallayout">CC=cc CFLAGS=-std1 </pre><p> If you are compiling for just one operating system, it may be easier to put these lines directly into <em class="filename">Local/Makefile</em>. </p> <p> Keeping all your local configuration settings separate from the distributed files makes it easy to transfer them to new versions of Exim simply by copying the contents of the <em class="filename">Local</em> directory. </p> <p> <a id="id476429" class="indexterm"></a> <a id="id476443" class="indexterm"></a> <a id="id476458" class="indexterm"></a> <a id="id476473" class="indexterm"></a> Exim contains support for doing LDAP, NIS, NIS+, and other kinds of file lookup, but not all systems have these components installed, so the default is not to include the relevant code in the binary. All the different kinds of file and database lookup that Exim supports are implemented as separate code modules which are included only if the relevant compile-time options are set. In the case of LDAP, NIS, and NIS+, the settings for <em class="filename">Local/Makefile</em> are: </p> <pre class="literallayout">LOOKUP_LDAP=yes LOOKUP_NIS=yes LOOKUP_NISPLUS=yes </pre><p> and similar settings apply to the other lookup types. They are all listed in <em class="filename">src/EDITME</em>. In many cases the relevant include files and interface libraries need to be installed before compiling Exim. <a id="id476521" class="indexterm"></a> However, there are some optional lookup types (such as cdb) for which the code is entirely contained within Exim, and no external include files or libraries are required. When a lookup type is not included in the binary, attempts to configure Exim to use it cause run time configuration errors. </p> <p> <a id="id476544" class="indexterm"></a> Exim can be linked with an embedded Perl interpreter, allowing Perl subroutines to be called during string expansion. To enable this facility, </p> <pre class="literallayout">EXIM_PERL=perl.o </pre><p> must be defined in <em class="filename">Local/Makefile</em>. Details of this facility are given in chapter <a href="ch12.html" title="12. Embedded Perl">12</a>. </p> <p> <a id="id476589" class="indexterm"></a> The location of the X11 libraries is something that varies a lot between operating systems, and there may be different versions of X11 to cope with. Exim itself makes no use of X11, but if you are compiling the Exim monitor, the X11 libraries must be available. The following three variables are set in <em class="filename">OS/Makefile-Default</em>: </p> <pre class="literallayout">X11=/usr/X11R6 XINCLUDE=-I$(X11)/include XLFLAGS=-L$(X11)/lib </pre><p> These are overridden in some of the operating-system configuration files. For example, in <em class="filename">OS/Makefile-SunOS5</em> there is </p> <pre class="literallayout">X11=/usr/openwin XINCLUDE=-I$(X11)/include XLFLAGS=-L$(X11)/lib -R$(X11)/lib </pre><p> If you need to override the default setting for your operating system, place a definition of all three of these variables into your <em class="filename">Local/Makefile-<ostype></em> file. </p> <p> <a id="id476655" class="indexterm"></a> If you need to add any extra libraries to the link steps, these can be put in a variable called EXTRALIBS, which appears in all the link commands, but by default is not defined. In contrast, EXTRALIBS_EXIM is used only on the command for linking the main Exim binary, and not for any associated utilities. </p> <p> <a id="id476674" class="indexterm"></a> There is also DBMLIB, which appears in the link commands for binaries that use DBM functions (see also section <a href="ch04.html#SECTdb" title="4.3 DBM libraries">4.3</a>). Finally, there is EXTRALIBS_EXIMON, which appears only in the link step for the Exim monitor binary, and which can be used, for example, to include additional X11 libraries. </p> <p> <a id="id476704" class="indexterm"></a> The make file copes with rebuilding Exim correctly if any of the configuration files are edited. However, if an optional configuration file is deleted, it is necessary to touch the associated non-optional file (that is, <em class="filename">Local/Makefile</em> or <em class="filename">Local/eximon.conf</em>) before rebuilding. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0043" id="SECID30">4.12 OS-specific header files</a></h3></div> </div> </div> <p> <a id="id476748" class="indexterm"></a> <a id="id476761" class="indexterm"></a> The <em class="filename">OS</em> directory contains a number of files with names of the form <em class="filename">os.h-<ostype></em>. These are system-specific C header files that should not normally need to be changed. There is a list of macro settings that are recognized in the file <em class="filename">OS/os.configuring</em>, which should be consulted if you are porting Exim to a new operating system. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0044" id="SECID31">4.13 Overriding build-time options for the monitor</a></h3></div> </div> </div> <p> <a id="id476812" class="indexterm"></a> A similar process is used for overriding things when building the Exim monitor, where the files that are involved are </p> <div class="literallayout"> <em class="filename">OS/eximon.conf-Default</em><br /> <em class="filename">OS/eximon.conf-</em><<span class="emphasis"><em>ostype</em></span>><br /> <em class="filename">Local/eximon.conf</em><br /> <em class="filename">Local/eximon.conf-</em><<span class="emphasis"><em>ostype</em></span>><br /> <em class="filename">Local/eximon.conf-</em><<span class="emphasis"><em>archtype</em></span>><br /> <em class="filename">Local/eximon.conf-</em><<span class="emphasis"><em>ostype</em></span>>-<<span class="emphasis"><em>archtype</em></span>><br /> </div> <p> <a id="id476889" class="indexterm"></a> As with Exim itself, the final three files need not exist, and in this case the <em class="filename">OS/eximon.conf-<ostype></em> file is also optional. The default values in <em class="filename">OS/eximon.conf-Default</em> can be overridden dynamically by setting environment variables of the same name, preceded by EXIMON_. For example, setting EXIMON_LOG_DEPTH in the environment overrides the value of LOG_DEPTH at run time. <a id="id476921" class="indexterm"></a> </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0045" id="SECID32">4.14 Installing Exim binaries and scripts</a></h3></div> </div> </div> <p> <a id="id476948" class="indexterm"></a> <a id="id476958" class="indexterm"></a> The command <code class="literal">make install</code> runs the <span><strong class="command">exim_install</strong></span> script with no arguments. The script copies binaries and utility scripts into the directory whose name is specified by the BIN_DIRECTORY setting in <em class="filename">Local/Makefile</em>. <a id="id476989" class="indexterm"></a> The install script copies files only if they are newer than the files they are going to replace. The Exim binary is required to be owned by root and have the <span class="emphasis"><em>setuid</em></span> bit set, for normal configurations. Therefore, you must run <code class="literal">make install</code> as root so that it can set up the Exim binary in this way. However, in some special situations (for example, if a host is doing no local deliveries) it may be possible to run Exim without making the binary setuid root (see chapter <a href="ch52.html" title="52. Security considerations">52</a> for details). </p> <p> <a id="id477030" class="indexterm"></a> Exim’s run time configuration file is named by the CONFIGURE_FILE setting in <em class="filename">Local/Makefile</em>. If this names a single file, and the file does not exist, the default configuration file <em class="filename">src/configure.default</em> is copied there by the installation script. If a run time configuration file already exists, it is left alone. If CONFIGURE_FILE is a colon-separated list, naming several alternative files, no default is installed. </p> <p> <a id="id477064" class="indexterm"></a> <a id="id477076" class="indexterm"></a> One change is made to the default configuration file when it is installed: the default configuration contains a router that references a system aliases file. The path to this file is set to the value specified by SYSTEM_ALIASES_FILE in <em class="filename">Local/Makefile</em> (<em class="filename">/etc/aliases</em> by default). If the system aliases file does not exist, the installation script creates it, and outputs a comment to the user. </p> <p> The created file contains no aliases, but it does contain comments about the aliases a site should normally have. Mail aliases have traditionally been kept in <em class="filename">/etc/aliases</em>. However, some operating systems are now using <em class="filename">/etc/mail/aliases</em>. You should check if yours is one of these, and change Exim’s configuration if necessary. </p> <p> The default configuration uses the local host’s name as the only local domain, and is set up to do local deliveries into the shared directory <em class="filename">/var/mail</em>, running as the local user. System aliases and <em class="filename">.forward</em> files in users’ home directories are supported, but no NIS or NIS+ support is configured. Domains other than the name of the local host are routed using the DNS, with delivery over SMTP. </p> <p> It is possible to install Exim for special purposes (such as building a binary distribution) in a private part of the file system. You can do this by a command such as </p> <pre class="literallayout">make DESTDIR=/some/directory/ install </pre><p> This has the effect of pre-pending the specified directory to all the file paths, except the name of the system aliases file that appears in the default configuration. (If a default alias file is created, its name <span class="emphasis"><em>is</em></span> modified.) For backwards compatibility, ROOT is used if DESTDIR is not set, but this usage is deprecated. </p> <p> <a id="id477187" class="indexterm"></a> Running <span class="emphasis"><em>make install</em></span> does not copy the Exim 4 conversion script <span class="emphasis"><em>convert4r4</em></span>, or the <span class="emphasis"><em>pcretest</em></span> test program. You will probably run the first of these only once (if you are upgrading from Exim 3), and the second isn’t really part of Exim. None of the documentation files in the <em class="filename">doc</em> directory are copied, except for the info files when you have set INFO_DIRECTORY, as described in section <a href="ch04.html#SECTinsinfdoc" title="4.15 Installing info documentation">4.15</a> below. </p> <p> For the utility programs, old versions are renamed by adding the suffix <em class="filename">.O</em> to their names. The Exim binary itself, however, is handled differently. It is installed under a name that includes the version number and the compile number, for example <em class="filename">exim-4.69-1</em>. The script then arranges for a symbolic link called <em class="filename">exim</em> to point to the binary. If you are updating a previous version of Exim, the script takes care to ensure that the name <em class="filename">exim</em> is never absent from the directory (as seen by other processes). </p> <p> <a id="id477269" class="indexterm"></a> If you want to see what the <span class="emphasis"><em>make install</em></span> will do before running it for real, you can pass the <span><strong class="option">-n</strong></span> option to the installation script by this command: </p> <pre class="literallayout">make INSTALL_ARG=-n install </pre><p> The contents of the variable INSTALL_ARG are passed to the installation script. You do not need to be root to run this test. Alternatively, you can run the installation script directly, but this must be from within the build directory. For example, from the top-level Exim directory you could use this command: </p> <pre class="literallayout">(cd build-SunOS5-5.5.1-sparc; ../scripts/exim_install -n) </pre><p> <a id="id477321" class="indexterm"></a> There are two other options that can be supplied to the installation script. </p> <div class="itemizedlist"> <ul type="disc"><li><p> <span><strong class="option">-no_chown</strong></span> bypasses the call to change the owner of the installed binary to root, and the call to make it a setuid binary. </p> </li><li><p> <span><strong class="option">-no_symlink</strong></span> bypasses the setting up of the symbolic link <em class="filename">exim</em> to the installed binary. </p> </li></ul></div> <p> INSTALL_ARG can be used to pass these options to the script. For example: </p> <pre class="literallayout">make INSTALL_ARG=-no_symlink install </pre><p> The installation script can also be given arguments specifying which files are to be copied. For example, to install just the Exim binary, and nothing else, without creating the symbolic link, you could use: </p> <pre class="literallayout">make INSTALL_ARG='-no_symlink exim' install </pre></div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0046" id="SECTinsinfdoc">4.15 Installing info documentation</a></h3></div> </div> </div> <p> <a id="id477410" class="indexterm"></a> Not all systems use the GNU <span class="emphasis"><em>info</em></span> system for documentation, and for this reason, the Texinfo source of Exim’s documentation is not included in the main distribution. Instead it is available separately from the ftp site (see section <a href="ch01.html#SECTavail" title="1.6 Where to find the Exim distribution">1.6</a>). </p> <p> If you have defined INFO_DIRECTORY in <em class="filename">Local/Makefile</em> and the Texinfo source of the documentation is found in the source tree, running <code class="literal">make install</code> automatically builds the info files and installs them. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0047" id="SECID33">4.16 Setting up the spool directory</a></h3></div> </div> </div> <p> <a id="id477468" class="indexterm"></a> When it starts up, Exim tries to create its spool directory if it does not exist. The Exim uid and gid are used for the owner and group of the spool directory. Sub-directories are automatically created in the spool directory as necessary. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0048" id="SECID34">4.17 Testing</a></h3></div> </div> </div> <p> <a id="id477499" class="indexterm"></a> Having installed Exim, you can check that the run time configuration file is syntactically valid by running the following command, which assumes that the Exim binary directory is within your PATH environment variable: </p> <pre class="literallayout">exim -bV </pre><p> If there are any errors in the configuration file, Exim outputs error messages. Otherwise it outputs the version number and build date, the DBM library that is being used, and information about which drivers and other optional code modules are included in the binary. Some simple routing tests can be done by using the address testing option. For example, </p> <div class="literallayout"> <code class="literal">exim -bt</code> <<span class="emphasis"><em>local username</em></span>><br /> </div> <p> should verify that it recognizes a local mailbox, and </p> <div class="literallayout"> <code class="literal">exim -bt</code> <<span class="emphasis"><em>remote address</em></span>><br /> </div> <p> a remote one. Then try getting it to deliver mail, both locally and remotely. This can be done by passing messages directly to Exim, without going through a user agent. For example: </p> <pre class="literallayout">exim -v postmaster@your.domain.example From: user@your.domain.example To: postmaster@your.domain.example Subject: Testing Exim This is a test message. ^D </pre><p> The <span><strong class="option">-v</strong></span> option causes Exim to output some verification of what it is doing. In this case you should see copies of three log lines, one for the message’s arrival, one for its delivery, and one containing “<span class="quote">Completed</span>”. </p> <p> <a id="id477608" class="indexterm"></a> If you encounter problems, look at Exim’s log files (<span class="emphasis"><em>mainlog</em></span> and <span class="emphasis"><em>paniclog</em></span>) to see if there is any relevant information there. Another source of information is running Exim with debugging turned on, by specifying the <span><strong class="option">-d</strong></span> option. If a message is stuck on Exim’s spool, you can force a delivery with debugging turned on by a command of the form </p> <div class="literallayout"> <code class="literal">exim -d -M</code> <<span class="emphasis"><em>exim-message-id</em></span>><br /> </div> <p> You must be root or an “<span class="quote">admin user</span>” in order to do this. The <span><strong class="option">-d</strong></span> option produces rather a lot of output, but you can cut this down to specific areas. For example, if you use <span><strong class="option">-d-all+route</strong></span> only the debugging information relevant to routing is included. (See the <span><strong class="option">-d</strong></span> option in chapter <a href="ch05.html" title="5. The Exim command line">5</a> for more details.) </p> <p> <a id="id477687" class="indexterm"></a> <a id="id477700" class="indexterm"></a> One specific problem that has shown up on some sites is the inability to do local deliveries into a shared mailbox directory, because it does not have the “<span class="quote">sticky bit</span>” set on it. By default, Exim tries to create a lock file before writing to a mailbox file, and if it cannot create the lock file, the delivery is deferred. You can get round this either by setting the “<span class="quote">sticky bit</span>” on the directory, or by setting a specific group for local deliveries and allowing that group to create files in the directory (see the comments above the <span><strong class="command">local_delivery</strong></span> transport in the default configuration file). Another approach is to configure Exim not to use lock files, but just to rely on <em class="function">fcntl()</em> locking instead. However, you should do this only if all user agents also use <em class="function">fcntl()</em> locking. For further discussion of locking issues, see chapter <a href="ch26.html" title="26. The appendfile transport">26</a>. </p> <p> One thing that cannot be tested on a system that is already running an MTA is the receipt of incoming SMTP mail on the standard SMTP port. However, the <span><strong class="option">-oX</strong></span> option can be used to run an Exim daemon that listens on some other port, or <span class="emphasis"><em>inetd</em></span> can be used to do this. The <span><strong class="option">-bh</strong></span> option and the <span class="emphasis"><em>exim_checkaccess</em></span> utility can be used to check out policy controls on incoming SMTP mail. </p> <p> Testing a new version on a system that is already running Exim can most easily be done by building a binary with a different CONFIGURE_FILE setting. From within the run time configuration, all other file and directory names that Exim uses can be altered, in order to keep it entirely clear of the production version. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0049" id="SECID35">4.18 Replacing another MTA with Exim</a></h3></div> </div> </div> <p> <a id="id477800" class="indexterm"></a> Building and installing Exim for the first time does not of itself put it in general use. The name by which the system’s MTA is called by mail user agents is either <em class="filename">/usr/sbin/sendmail</em>, or <em class="filename">/usr/lib/sendmail</em> (depending on the operating system), and it is necessary to make this name point to the <span class="emphasis"><em>exim</em></span> binary in order to get the user agents to pass messages to Exim. This is normally done by renaming any existing file and making <em class="filename">/usr/sbin/sendmail</em> or <em class="filename">/usr/lib/sendmail</em> <a id="id477848" class="indexterm"></a> a symbolic link to the <span class="emphasis"><em>exim</em></span> binary. It is a good idea to remove any setuid privilege and executable status from the old MTA. It is then necessary to stop and restart the mailer daemon, if one is running. </p> <p> <a id="id477877" class="indexterm"></a> <a id="id477888" class="indexterm"></a> Some operating systems have introduced alternative ways of switching MTAs. For example, if you are running FreeBSD, you need to edit the file <em class="filename">/etc/mail/mailer.conf</em> instead of setting up a symbolic link as just described. A typical example of the contents of this file for running Exim is as follows: </p> <pre class="literallayout">sendmail /usr/exim/bin/exim send-mail /usr/exim/bin/exim mailq /usr/exim/bin/exim -bp newaliases /usr/bin/true </pre><p> Once you have set up the symbolic link, or edited <em class="filename">/etc/mail/mailer.conf</em>, your Exim installation is “<span class="quote">live</span>”. Check it by sending a message from your favourite user agent. </p> <p> You should consider what to tell your users about the change of MTA. Exim may have different capabilities to what was previously running, and there are various operational differences such as the text of messages produced by command line options and in bounce messages. If you allow your users to make use of Exim’s filtering capabilities, you should make the document entitled <span class="emphasis"><em>Exim’s interface to mail filtering</em></span> available to them. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0050" id="SECID36">4.19 Upgrading Exim</a></h3></div> </div> </div> <p> <a id="id477958" class="indexterm"></a> If you are already running Exim on your host, building and installing a new version automatically makes it available to MUAs, or any other programs that call the MTA directly. However, if you are running an Exim daemon, you do need to send it a HUP signal, to make it re-execute itself, and thereby pick up the new binary. You do not need to stop processing mail in order to install a new version of Exim. The install script does not modify an existing runtime configuration file. </p> </div> <div class="section" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0051" id="SECID37">4.20 Stopping the Exim daemon on Solaris</a></h3></div> </div> </div> <p> <a id="id477991" class="indexterm"></a> The standard command for stopping the mailer daemon on Solaris is </p> <pre class="literallayout">/etc/init.d/sendmail stop </pre><p> If <em class="filename">/usr/lib/sendmail</em> has been turned into a symbolic link, this script fails to stop Exim because it uses the command <span class="emphasis"><em>ps -e</em></span> and greps the output for the text “<span class="quote">sendmail</span>”; this is not present because the actual program name (that is, “<span class="quote">exim</span>”) is given by the <span class="emphasis"><em>ps</em></span> command with these options. A solution is to replace the line that finds the process id with something like </p> <pre class="literallayout">pid=`cat /var/spool/exim/exim-daemon.pid` </pre><p> to obtain the daemon’s pid directly from the file that Exim saves it in. </p> <p> Note, however, that stopping the daemon does not “<span class="quote">stop Exim</span>”. Messages can still be received from local processes, and if automatic delivery is configured (the normal case), deliveries will still occur. </p> </div> </div> <div class="navfooter"> <table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div> </body></html>