| 1 |
THE EXIM MAIL TRANSFER AGENT VERSION 4 |
| 2 |
-------------------------------------- |
| 3 |
|
| 4 |
Copyright (c) The Exim Maintainers 2025 |
| 5 |
Copyright (c) 1995 - 2018 University of Cambridge. |
| 6 |
SPDX-License-Identifier: GPL-2.0-or-later |
| 7 |
See the file NOTICE for conditions of use and distribution. |
| 8 |
|
| 9 |
There is a book about Exim by Philip Hazel called "The Exim SMTP Mail Server", |
| 10 |
published by UIT Cambridge in May 2003. This is the official guide for Exim 4. |
| 11 |
The current edition covers release 4.10 and a few later extensions. |
| 12 |
|
| 13 |
The O'Reilly book about Exim ("Exim The Mail Transfer Agent" by Philip Hazel) |
| 14 |
covers Exim 3, which is now obsolete. Exim 4 has a large number of changes |
| 15 |
from Exim 3, though the basic structure and philosophy remains the same. The |
| 16 |
older book may be helpful for the background, but a lot of the detail has |
| 17 |
changed, so it is likely to be confusing to newcomers. |
| •18 |
|
| 19 |
Information about the way Debian has built the binary packages is |
| 20 |
obtainable in /usr/share/doc/exim4-base/README.Debian.gz, and there |
| 21 |
is a Debian-centered mailing list, |
| 22 |
[email protected]. Please ask Debian-specific |
| 23 |
questions there, and only write to the upstream exim-users mailing |
| 24 |
list if you are sure that your question is not Debian-specific. You |
| 25 |
can find the subscription web page on |
| 26 |
http://lists.alioth.debian.org/mailman/listinfo/pkg-exim4-users |
| 27 |
|
| 28 |
There is a website at https://www.exim.org/. |
| 29 |
|
| 30 |
A copy of the Exim FAQ should be available from the same source that you used |
| 31 |
to obtain the Exim distribution. Additional formats for the documentation |
| 32 |
(PostScript, PDF, Texinfo, and HTML) should also be available there. |
| 33 |
|
| 34 |
|
| 35 |
EXIM DISTRIBUTION |
| 36 |
----------------- |
| 37 |
|
| 38 |
Unpacking the tar file should produce a single directory called exim-<version>, |
| 39 |
containing the following files and directories: |
| 40 |
|
| 41 |
ACKNOWLEDGMENTS some acknowledgments |
| 42 |
CHANGES a conventional file name; it indirects to some files in doc/ |
| 43 |
LICENCE the GNU General Public Licence |
| 44 |
Local/ an empty directory for local configuration files |
| 45 |
Makefile top level Makefile |
| 46 |
NOTICE notice about conditions of use |
| 47 |
OS/ directory containing OS-specific files |
| 48 |
README this file |
| 49 |
README.UPDATING special notes about updating from previous versions |
| 50 |
doc/ directory of documentation files |
| 51 |
exim_monitor/ directory of source files for the Exim monitor |
| 52 |
scripts/ directory of scripts used in the build process |
| 53 |
src/ directory of source files |
| 54 |
util/ directory of independent utilities |
| 55 |
|
| 56 |
Please see the documentation files for full instructions on how to build, |
| 57 |
install, and run Exim. For straightforward installations on operating systems |
| 58 |
to which Exim has already been ported, the building process is as follows: |
| 59 |
|
| 60 |
. Ensure that the top-level Exim directory (e.g. exim-4.80) is the current |
| 61 |
directory (containing the files and directories listed above). |
| 62 |
|
| 63 |
. Edit the file called src/EDITME and put the result in a new file called |
| 64 |
Local/Makefile. There are comments in src/EDITME telling you what the various |
| 65 |
parameters are. You must at least provide values for BIN_DIRECTORY, |
| 66 |
CONFIGURE_FILE, EXIM_USER and EXIM_GROUP (if EXIM_USER is numeric), and it is |
| 67 |
recommended that SPOOL_DIRECTORY also be defined here if it is a fixed path. |
| 68 |
|
| 69 |
. There are a number of additional parameters whose defaults can also be |
| 70 |
overridden by additions to Local/Makefile. The basic defaults are in |
| 71 |
OS/Makefile-Default, but these settings are overridden for some operating |
| 72 |
systems by values on OS/Makefile-<osname>. The most commonly-required change |
| 73 |
is probably the setting of CC, which defines the command to run the C |
| 74 |
compiler, and which defaults to gcc. To change it to cc, add the following |
| 75 |
line to Local/Makefile: |
| 76 |
|
| 77 |
CC=cc |
| 78 |
|
| 79 |
If you are running the Berkeley DB package as your dbm library, then it is |
| 80 |
worth putting USE_DB=yes in Local/Makefile, to get Exim to use the native |
| 81 |
interface. This is the default for some operating systems. See |
| 82 |
doc/dbm.discuss.txt for discussion on dbm libraries. |
| 83 |
|
| 84 |
. If you want to compile the Exim monitor, edit the file called |
| 85 |
exim_monitor/EDITME and put the result in a file called Local/eximon.conf. |
| 86 |
If you are not going to compile the Exim monitor, you should have commented |
| 87 |
out the line starting EXIM_MONITOR= when creating Local/Makefile. There are |
| 88 |
comments in exim_monitor/EDITME about the values set therein, but in this |
| 89 |
case everything can be defaulted if you wish. |
| 90 |
|
| 91 |
. If your system is not POSIX compliant by default, then you might experience |
| 92 |
fewer problems if you help point the build tools to the POSIX variants. For |
| 93 |
instance, on Solaris: |
| 94 |
|
| 95 |
PATH=/usr/xpg4/bin:$PATH make SHELL=/usr/xpg4/bin/sh |
| 96 |
|
| 97 |
. Type "make". This will determine what your machine's architecture and |
| 98 |
operating system are, and create a build directory from those names (e.g. |
| 99 |
"build-SunOS5-sparc"). Symbolic links are created from the build directory |
| 100 |
to the source directory. A configured make file called <build-dir>/makefile |
| 101 |
is then created, and "make" then goes on to use this to build various |
| 102 |
binaries and scripts inside the build directory. |
| 103 |
|
| 104 |
. Type "make install", while running as root, to install the binaries, |
| 105 |
scripts, and a default configuration file. To see what this command is |
| 106 |
going to do before risking it, run "../scripts/exim_install -n" (not as |
| 107 |
root) from within the build directory. |
| 108 |
|
| 109 |
. When you are ready to try running Exim, see the section entitled "Testing" |
| 110 |
in the chapter called "Building and Installing Exim" in doc/spec.txt, or in |
| 111 |
one of the other forms of the documentation. |
| 112 |
|
| 113 |
. Running the install script does NOT replace /usr/sbin/sendmail or |
| 114 |
/usr/lib/sendmail with a link to Exim. That step you must perform by hand |
| 115 |
when you are satisfied that Exim is running correctly. |
| 116 |
|
| 117 |
. Note that the default configuration refers to an alias file called |
| 118 |
/etc/aliases. It used to be the case that every Unix had that file, because |
| 119 |
it was the Sendmail default. These days, there are systems that don't have |
| 120 |
/etc/aliases, so you might need to set it up. Your aliases should at least |
| 121 |
include an alias for "postmaster". |
| 122 |
|
| 123 |
. Consider notifying users of the change of MTA. Exim has different |
| 124 |
capabilities, and there are various operational differences, such as stricter |
| 125 |
adherence to the RFCs than some MTAs, and differences in the text of |
| 126 |
messages produced by various command-line options. |
| 127 |
|
| 128 |
. The default configuration file will use your host's fully qualified name (as |
| 129 |
obtained from the uname() function) as the only local mail domain and as the |
| 130 |
domain which is used to qualify unqualified local mail addresses. See the |
| 131 |
comments in the default configuration file if you want to change these. |
| 132 |
|
| 133 |
The operating systems currently supported are: AIX, BSD/OS (aka BSDI), Darwin |
| 134 |
(Mac OS X), DGUX, FreeBSD, GNU/Hurd, GNU/Linux, HI-OSF (Hitachi), HP-UX, IRIX, |
| 135 |
MIPS RISCOS, NetBSD, OpenBSD, QNX, SCO, SCO SVR4.2 (aka UNIX-SV), Solaris (aka |
| 136 |
SunOS5), SunOS4, Tru64-Unix (formerly Digital Unix, formerly DEC-OSF1), Ultrix, |
| 137 |
and Unixware. However, code is not available for determining system load |
| 138 |
averages on Ultrix. There are also configuration files for compiling Exim in |
| 139 |
the Cygwin environment that can be installed on systems running Windows. |
| 140 |
However, the documentation supplied with the distribution does not contain any |
| 141 |
information about running Exim in the Cygwin environment. |
| 142 |
|
| 143 |
|
| 144 |
******* Modifying the building process ****** |
| 145 |
|
| 146 |
Instructions for overriding the build-time options for Exim are given in the |
| 147 |
manual. You should never have to modify any of the supplied files; it should be |
| 148 |
possible to override everything that is necessary by creating suitable files in |
| 149 |
the Local directory. This means that you won't need to redo your modifications |
| 150 |
for the next release of Exim. If you find you can't avoid changing some other |
| 151 |
file, let me know and I'll see if I can find a way of making that unnecessary. |
| 152 |
|
| 153 |
Briefly, the building process concatenates a number of files in order to |
| 154 |
construct its working makefile. If <ostype> and <archtype> are the operating |
| 155 |
system and architecture types respectively, the files used are: |
| 156 |
|
| 157 |
OS/Makefile-Default |
| 158 |
OS/Makefile-<ostype> |
| 159 |
Local/Makefile |
| 160 |
Local/Makefile-<ostype> |
| 161 |
Local/Makefile-<archtype> |
| 162 |
Local/Makefile-<ostype>-<archtype> |
| 163 |
Local/Makefile-<buildname> |
| 164 |
OS/Makefile-Base |
| 165 |
|
| 166 |
Of the Local/* files, only Local/Makefile is required to exist; the rest are |
| 167 |
optional. Because of the way "make" works, values set in later files override |
| 168 |
values set in earlier ones. Thus you can set up general options that are |
| 169 |
overridden for specify operating systems and/or architectures if you wish. |
| 170 |
|
| 171 |
|
| 172 |
******* IMPORTANT FOR GNU/LINUX USERS ******* |
| 173 |
|
| 174 |
Exim 4 won't work with some versions of Linux if you put its spool directory on |
| 175 |
an NFS partition. You get an error about "directory sync failed". This is |
| 176 |
because of a bug in Linux NFS. A fix has been promised in due course. It is in |
| 177 |
any case much better to put Exim's spool directory on local disc. |
| 178 |
|
| 179 |
If you get an error complaining about the lack of functions such as dbm_open() |
| 180 |
when building Exim, the problem is that it hasn't been able to find a DBM |
| 181 |
library. See the file doc/dbm.discuss.txt for a discussion about the various |
| 182 |
DBM libraries. |
| 183 |
|
| 184 |
Different versions of Linux come with different DBM libraries, stored in |
| 185 |
different places. As well as setting USE_DB=yes in Local/Makefile if Berkeley |
| 186 |
DB is in use, it may also be necessary to set a value in DBMLIB to specify the |
| 187 |
inclusion of the DBM library, for example: DBMLIB=-ldb or DBMLIB=-lgdbm. |
| 188 |
|
| 189 |
If you are using RedHat 7.0, which has DB3 as its DBM library, you need to |
| 190 |
install the db-devel package before building Exim. This will have a name like |
| 191 |
db3-devel-3.1.14-16.i386.rpm (but check which release of DB3 you have). |
| 192 |
|
| 193 |
The building scripts now distinguish between versions of Linux with the older |
| 194 |
libc5 and the more recent ones that use libc6. In the latter case, USE_DB and |
| 195 |
-ldb are the default settings, because DB is standard with libc6. |
| 196 |
|
| 197 |
It appears that with glibc-2.1.x (a minor libc upgrade), they have standardised |
| 198 |
on Berkeley DB2 (instead of DB1 in glibc-2.0.x). If you want to get DB1 back, |
| 199 |
you need to set |
| 200 |
|
| 201 |
INCLUDE=-I/usr/include/db1 |
| 202 |
DBMLIB=-ldb1 |
| 203 |
|
| 204 |
in your Local/Makefile. If you omit DBMLIB=-ldb1 Exim will link successfully |
| 205 |
using the DB1 compatibility interface to DB2, but it will expect the file |
| 206 |
format to be that of DB2, and so will not be able to read existing DB1 files. |
| 207 |
|
| 208 |
|
| 209 |
******* IMPORTANT FOR FREEBSD USERS ******* |
| 210 |
|
| 211 |
On FreeBSD there is a file called /etc/mail/mailer.conf which selects what to |
| 212 |
run for various MTA calls. Instead of changing /usr/sbin/sendmail, you should |
| 213 |
edit this file instead, to read something like this: |
| 214 |
|
| 215 |
sendmail /usr/exim/bin/exim |
| 216 |
send-mail /usr/exim/bin/exim |
| 217 |
mailq /usr/exim/bin/exim -bp |
| 218 |
newaliases /usr/bin/true |
| 219 |
|
| 220 |
You will most probably need to add the line: |
| 221 |
|
| 222 |
daily_status_include_submit_mailq="NO" # No separate 'submit' queue |
| 223 |
|
| 224 |
to /etc/periodic.conf. This stops FreeBSD running the command "mailq -Ac" |
| 225 |
(which Exim doesn't understand) to list a separate submit queue (which Exim |
| 226 |
doesn't have). |
| 227 |
|
| 228 |
If you are using FreeBSD prior to 3.0-RELEASE, and you are not using the ports |
| 229 |
mechanism to install Exim, then you should install the perl5 package |
| 230 |
(/usr/local/bin/perl) and use that instead of perl in the base system, which is |
| 231 |
perl4 up until 3.0-RELEASE. If you are using the ports mechanism, this is |
| 232 |
handled for you. |
| 233 |
|
| 234 |
If you are upgrading from version 2.11 of Exim or earlier, and you are using |
| 235 |
DBM files, and you did not previously have USE_DB=yes in your Local/Makefile, |
| 236 |
then you will either have to put USE_DB=no in your Local/Makefile or (better) |
| 237 |
rebuild your DBM data files. The default for FreeBSD has been changed to |
| 238 |
USE_DB=yes, since FreeBSD comes with Berkeley DB. However, using the native DB |
| 239 |
interface means that the data files no longer have the ".db" extension. |
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
******* IMPORTANT FOR Tru64 (aka Digital Unix aka DEC-OSF1) USERS ******* |
| 244 |
|
| 245 |
The default compiler may not recognize ANSI C by default. You may have to set |
| 246 |
|
| 247 |
CC=cc |
| 248 |
CFLAGS=-std1 |
| 249 |
|
| 250 |
in Local/Makefile in order to compile Exim. A user reported another small |
| 251 |
problem with this operating system: In the file /usr/include/net/if.h a |
| 252 |
semicolon was missing at the end of line 143. |
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
******* IMPORTANT FOR SCO USERS ******* |
| 257 |
|
| 258 |
The building scripts assume the existence of the "ar" command, which is part of |
| 259 |
the Development System. However, it is also possible to use the "gar" command |
| 260 |
that is part of the GNU utilities that are distributed with the 5.0.7 release. |
| 261 |
If you have "gar" and not "ar" you should include |
| 262 |
|
| 263 |
AR=gar |
| 264 |
|
| 265 |
in your Local/Makefile. |
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
******* IMPORTANT FOR Unixware 2.x USERS ******* |
| 270 |
|
| 271 |
Unixware does not include db/dbm/ndbm with its standard compiler (it is |
| 272 |
available with /usr/ucb/cc, but that has bugs of its own). You should install |
| 273 |
gcc and Berkeley DB (or another dbm library if you really insist). If you use a |
| 274 |
different dbm library you will need to override the default setting of DBMLIB. |
| 275 |
|
| 276 |
DB 1.85 and 2.x can be found at http://www.sleepycat.com/. They have different |
| 277 |
characteristics. See the discussion of dbm libraries in doc/dbm.discuss.txt. DB |
| 278 |
needs to be compiled with gcc and you need a 'cc' in your path before the |
| 279 |
Unixware CC to compile it. |
| 280 |
|
| 281 |
Don't bother even starting to install exim on Unixware unless you have |
| 282 |
installed gcc and use it for everything. |
| 283 |
|
| 284 |
|
| 285 |
******* IMPORTANT FOR SOLARIS 2.3 (SUNOS 5.3) USERS ******* |
| 286 |
|
| 287 |
The file /usr/include/sysexits.h does not exist on Solaris 2.3 (and presumably |
| 288 |
earlier versions), though it is present in 2.4 and later versions. To compile |
| 289 |
Exim on Solaris 2.3 it is necessary to include the line |
| 290 |
|
| 291 |
CFLAGS=-O -DNO_SYSEXITS -DEX_TEMPFAIL=75 |
| 292 |
|
| 293 |
in your Local/Makefile. |
| 294 |
|
| 295 |
|
| 296 |
******* IMPORTANT FOR IRIX USERS ******* |
| 297 |
|
| 298 |
There are problems with some versions of gcc on IRIX, as a result of which all |
| 299 |
DNS lookups yield either 0.0.0.0 or 255.255.255.255. Releases of gcc after |
| 300 |
2.7.2.3 (which works ok) are affected. Specifically, 2.8.* is affected, as are |
| 301 |
the 2.95 series. From release 3.21 of Exim, a workaround for this problem |
| 302 |
should automatically be enabled when Exim is compiled on IRIX using gcc. |
| 303 |
|
| 304 |
As from version 2.03 there is IRIX-specific code in Exim to obtain a list of |
| 305 |
all the IP addresses on local interfaces, including alias addresses, because |
| 306 |
the standard code gives only non-alias addresses in IRIX. The code came from |
| 307 |
SGI, with the comment: |
| 308 |
|
| 309 |
"On 6.2 you need the libc patch to get the sysctl() stub and the networking |
| 310 |
kernel patch to get the support." |
| 311 |
|
| 312 |
It seems that this code doesn't work on at least some earlier versions of IRIX |
| 313 |
(e.g. IRIX 5.3). If you can't compile under IRIX and the problem appears to |
| 314 |
relate to sysctl(), try commenting or #ifdef-ing out all the code in the |
| 315 |
file OS/os.c-IRIX. |
| 316 |
|
| 317 |
|
| 318 |
******* IMPORTANT FOR HP-UX USERS ******* |
| 319 |
|
| 320 |
There are two different sets of configuration files for HP-UX. Those ending in |
| 321 |
HP-UX-9 are used for HP-UX version 9, and have been tested on HP-UX version |
| 322 |
9.05. Those ending in HP-UX are for later releases, and have been tested on |
| 323 |
HP-UX version 11.00. If you are using a version of HP-UX between 9.05 and |
| 324 |
11.00, you may need to edit the file OS/os.h-HP-UX if you encounter problems |
| 325 |
building Exim. |
| 326 |
|
| 327 |
If you want to use the Sieve facility in Exim, the alias iso-8859-1 should be |
| 328 |
added to the alias definition for iso81 in /usr/lib/nls/iconv/config.iconv. You |
| 329 |
also need to add a new alias definition: "alias utf8 utf-8". |
| 330 |
|
| 331 |
|
| 332 |
******* IMPORTANT FOR QNX USERS ******* |
| 333 |
|
| 334 |
1. Exim makes some assumptions about the shell in the makefiles. The "normal" |
| 335 |
QNX shell (ksh) will not work. You need to install "bash", which can be |
| 336 |
obtained from the QNX freeware on QUICS. Install it to /usr/local/bin/bash |
| 337 |
Then you need to change the SHELL definition at the top of the main Makefile |
| 338 |
to SHELL=/usr/local/bin/bash. The file OS/Makefile-QNX sets the variable |
| 339 |
MAKE_SHELL to /usr/local/bin/bash. If you install bash in a different place, |
| 340 |
you will need to set MAKE_SHELL in your Local/Makefile in order to override |
| 341 |
this. |
| 342 |
|
| 343 |
2. For some strange reason make will fail at building "exim_dbmbuild" when |
| 344 |
called the first time. However simply calling make a second time will solve |
| 345 |
the problem. Alternatively, run "make makefile" and then "make". |
| 346 |
|
| 347 |
|
| 348 |
******* IMPORTANT FOR ULTRIX USERS ******* |
| 349 |
|
| 350 |
You need to set SHELL explicitly in the make call when building on ULTRIX, |
| 351 |
that is, type "make SHELL=sh5". |
| 352 |
|
| 353 |
|
| 354 |
******* IMPORTANT FOR GNU/HURD USERS ******* |
| 355 |
|
| 356 |
GNU/Hurd doesn't (at the time of writing, June 1999) have the ioctls for |
| 357 |
finding out the IP addresses of the local interfaces. You therefore have to set |
| 358 |
local_interfaces yourself. Otherwise it will treat only 127.0.0.1 as local. |
| 359 |
|
| 360 |
Philip Hazel |