Filter files, especially the more complicated ones, should always be tested, as
it is easy to make mistakes. Exim provides a facility for preliminary testing
of a filter file before installing it. This tests the syntax of the file and
its basic operation, and can also be used with ordinary `.forward'
Exim Overview
Exim is a mail transport agent (MTA) developed at the University of Cambridge
for use on Unix systems connected to the Internet. It is freely available under
the terms of the GNU General Public Licence. In style it is similar to Smail 3,
but its facilities are more extensive, and in particular it has some defences
against mail bombs and unsolicited junk mail, in the form of options for
refusing messages from particular hosts, networks, or senders.
Exim is in production use on a number of sites that move tens of thousands of
messages per day. This document contains an overview description of the way
Exim works, with a certain amount of omission and simplification to keep it
fairly short. Please address any enquiries about Exim to Philip Hazel:
University of Cambridge
Computer Laboratory
Pembroke Street
Cambridge CB2 3QG
United Kingdom
This document is copyright (c) University of Cambridge 1997, but copying
permission is granted to all.
-------------------------------------------------------------------------
"If I have seen further it is by standing on the shoulders of giants."
(Isaac Newton)
Exim owes a great deal to Smail 3 and its author, Ron Karr. Without the
experience of running and working on the Smail 3 code, I could never have
contemplated starting to write a new mailer. Many of the ideas and
configuration interfaces are taken from Smail 3, though the actual code of Exim
is entirely new.
My intention was to write a mailer that had more functionality than Smail 3,
but which retained the simple lightweight approach, as this seemed to me to be
all that was needed for systems directly connected to the Internet, where most
messages are delivered almost immediately.
The following operating systems are currently supported: AIX, BSDI, DGUX, FreeBSD,
HI-OSF (Hitachi), HP-UX, IRIX, Linux, MIPS RISCOS, NetBSD, OpenBSD, DEC OSF1
(aka Digital UNIX), SCO, SCO SVR4.2 (aka UNIX-SV), SunOS4, SunOS5, Ultrix, and
Unixware.
For the benefit of those reading this overview to see whether Exim is of
interest to them, its limitations are listed first.
Exim is written in ANSI C. This should not be much of a limitation these days.
However, to help with systems that lack a true ANSI C library, Exim avoids
making any use of the value returned by the `sprintf()' function, which is one
of the main incompatibilities. It has its own version of `strerror()' for use
with SunOS4 and any other system that lacks this function, and a macro can be
defined to turn `memmove()' into `bcopy()' if necessary.
Exim uses file names that are longer than 14 characters.
Exim is intended for use as an Internet mailer, and therefore handles addresses
in RFC 822 domain format only. It cannot handle `bang paths', though simple
two-component bang paths can be converted by a straightforward rewriting
configuration.
Exim insists that every address it handles has a domain attached. For incoming
local messages, domainless addresses are automatically qualified with a
configured domain value. Configuration options specify from which remote
systems unqualified addresses are acceptable.
The only external transport currently implemented is an SMTP transport over
a TCP/IP network (using sockets), suitable for machines on the Internet.
However, a pipe transport is available, and there are facilities for writing
messages to files in `batched SMTP' format; both of these can be used to send
messages to some other transport mechanism such as UUCP. Batched SMTP input is
also catered for.
Exim follows the same general approach of decentralized control that Smail 3
does. There is no central process doing overall management of mail delivery.
However, unlike Smail, the independent delivery processes share data in the
form of `hints', which makes delivery more efficient in some cases. The hints
are kept in a number of DBM files. If any of these files are lost, the only
effect is to change the pattern of delivery attempts and retries.
Here is a summary of Exim's main features. More details are given in the
sections which follow.
Many configuration options can be given as expansion strings, and as these can
include file lookups, much of Exim's operation can be made table-driven if
desired. For example, it is possible to do local delivery on a machine on which
the users do not have accounts.
Regular expressions are available i
Exim 4.00 Specification chapter 11PreviousNextContents
(Exim 4.00 Specification)
Many strings that are given in Exim's run time configuration are expanded
before use. Some of them are expanded every time they are used; others are
expanded only once.
When a string is being expanded it is copied verbatim from left to right except
when a dollar or backslash character is encountered. A dollar specifies the
start of a portion of the string which is interpreted and replaced as described
below in section 11.4 onwards.
An uninterpreted dollar can be included in an expanded string by putting a
backslash in front of it. A backslash can be used to prevent any special
character being treated specially in an expansion, including itself. If the
string appears in quotes in the configuration file, two backslashes are
required because the quotes themselves cause interpretation of backslashes when
the string is read in.
An entire portion of the string can specified as non-expandable by placing it
between two occurrences of \N. This is particularly useful for protecting
regular expressions, which often contain backslashes and dollar signs. For
example:
A backslash followed by one of the letters ``n'', ``r'', or ``t'' in an expanded
string is recognized as an escape sequence for the character newline, carriage
return, or tab, respectively. A backslash followed by up to three octal digits
is recognized as an octal encoding for a single character, and a backslash
followed by ``x'' and up to two hexadecimal digits is a hexadecimal encoding.
These escape sequences are also recognized in quoted strings when they are read
in. Their interpretation in expansions as well is useful for unquoted strings,
and for other cases such as looked-up strings that are then expanded.
Many expansions can be tested by calling Exim with the -be option. This takes
the command arguments, or lines from the standard input if there are no
arguments, runs them through the string expansion code, and writes the results
to the standard output. Variables based on configuration values are set up, but
since no message is being processed, variables such as $local_part have no
value. Nevertheless the -be option can be useful for checking out file and
database lookups, and the use of expansion operators such as substr and
hash.
Exim gives up its root privilege when it is called with the -be option, and
instead runs under the uid and gid it was called with, to prevent users from
using -be for reading files to which they normally do not have access.
The following items are recognized in expanded strings. White space may be used
between sub-items that are keywords or substrings enclosed in braces inside an
outer set of braces, to improve readability. Within braces, however, white
space is significant.
$<variable name> or ${
The Exim FAQ
The Exim FAQ
This is the FAQ for the Exim Mail Transfer Agent. Many thanks to the many
people who provided the original information. This file would be amazingly
cluttered if I tried to list them all. Suggestions for corrections,
improvements, and additions are always welcome.
This version of the FAQ applies to Exim 4.00 and later releases. It has been
extensively revised, and material that was relevant only to earlier releases
has been removed. As this caused some whole sections to disappear, I've taken
the opportunity to re-arrange the sections and renumber everything except the
configuration samples.
References of the form Cnnn, Fnnn, and Lnnn are to the sample configuration,
filter, and local_scan() files. These are hyperlinked from the HTML
version of this FAQ. They can also be found in the separately distributed
directory called config.samples. The primary location is
Q0002: Exim is not working. What is wrong? How can I check what it is doing?
Q0003: What does the error Child process of address_pipe transport returned
69 from command xxx mean?
Q0004: My virtual domain setup isn't working. How can I debug it?
Q0005: Why is Exim not rejecting incoming messages addressed to non-existent
users at SMTP time?
Q0006: I've put an entry for *.my.domain in a DBM lookup file, but it isn't
getting recognized.
Q0007: I've put the entry *@domain.com in a lookup database, but it isn't
working. The expansion I'm using is:
Q0008: If I run ./exim -d -bt user@domain all seems well, but when I send
a message from my User Agent, it does not arrive at its destination.
Q0009: What does no immediate delivery: too many messages received in one SMTP
connection mean?
Q0010: Exim puts for <address> in the Received: headers of some, but not all,
messages. Is this a bug?
Q0011: Instead of exim_dbmbuild, I'm using a homegrown program to build DBM
(or cdb) files, but Exim doesn't seem to be able to use them.
Q0012: Exim is unable to route to any remote domains. It doesn't seen to be
able to access the DNS.
Q0013: What does the error message transport system_aliases: cannot find
transport driver "redirect" in line 92 mean?
Q0014: Exim is timing out after receiving and responding to the DATA command
from one particular host, and yet the client host also claims to be
timing out. This seems to affect only certain messages.
Q0015: What does the message Socket bind() to port 25 for address (any)
failed: address already in use mean?
Q0016: I've set verify = header_syntax in my ACL, but this causes Exim to
complain about header lines like To: Work: Jim <jims@email>,
Home: Bob <bobs@email> which look all right to me. Is this a bug?
Q0017: Whenever Exim tries to deliver a specific message to a particular
server, it fails, giving the error Remote end closed connection after
data or Broken pipe or a timeout. What's going on?
Q0018: Why do messages not get delivered down the same connection when I do
something like: exim -v -R @aol.com? For other domains, I do this and
I see the appropriate waiting for passed connections to get used
messages.
Q0019: There seems to be a problem in the string expansion code: it doesn't
recognize references to headers such as ${h_to}.
Q0020: Why do connections to my machine's SMTP port take a long time to respond
with the banner, when connections to other ports respond instantly? It
sometimes takes 30 seconds to respond.
Q0021: What does failed to create child process to send failure message mean?
This is a busy mail server with smtp_accept_max set to 500, but this
problem started to occur at about 300 incoming connections.
Q0022: What does No transport set by system filter in a log line mean?
Q0023: Why is Exim refusing to relay, saying failed to find host name from IP
address when I have the sender's IP address in an ACL condition? My
configuration contains this ACL statement:
Q0024: When I run exim -bd -q10m I get PANIC LOG: exec of exim -q failed.
Q0025: I can't seem to get a pipe command to run when I include a ${if
expansion in it. This fails:
Q0026: I'm trying to get Exim to connect an alias to a pipe, but it always
gives error code 69, with the comment (could mean service or program
unavailable).
Q0027: What does the error Spool file is locked mean?
Q0028: Exim is reporting IP addresses as 0.0.0.0 or 255.255.255.255 instead of
their correct values. What's going on?
Q0029: I can't seem to figure out why PAM support doesn't work correctly.
Q0030: I'm trying to use a query-style lookup for hosts that are allowed to
relay, but it is giving really weird errors.
Q0031: Exim is rejecting connections from hosts that have more than one IP
address, for no apparent reason.
Q0032: Exim is failing to find the MySQL library, even though is it present
within LD_LIBRARY_PATH. I'm getting this error:
Q0033: What does the error lookup of host "xx.xx.xx" failed in yyy router
mean?
Q0034: Exim works fine on one host, but when I copied the binary to another
identical host, it stopped working (it could not resolve DNS names).
Q0035: I set a hosts condition in an ACL to do a lookup in a file of IP
addresses, but it doesn't work.
Q0036: Why do I get the error Permission denied: creating lock file hitching
post when Exim tries to do a local delivery?