Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 9adab841b2346eed28e146b23c25375c > files > 108

exim-doc-4.73-2.fc15.noarch.rpm

<!DOCTYPE html PUBLIC "XSLT-compat">
<html lang="en-GB">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../common.css">
<meta name="author" content="The Exim Project. &lt;http://www.exim.org/&gt;">
<meta name="copyright" content="Copyright ©2010 The Exim Project. All rights reserved">
<meta name="description" content="Exim is a message transfer agent (MTA) developed at the University of Cambridge for use on Unix systems connected to the Internet.">
<meta name="keywords" content="exim,smtp,mta,email">
<meta name="robots" content="noodp,noydir,index,follow">
<meta name="viewport" content="width=device-width">
<title>6. The Exim run time configuration file</title>
<link rel="stylesheet" type="text/css" href="../../../../doc/chapter.css">
<link rel="canonical" href="http://www.exim.org/exim-html-current/doc/html/spec_html/ch06.html">
</head>
<body>
<h1 id="header"><a href="../../../..">Exim Internet Mailer</a></h1>
<div id="outer">
<ul id="nav_flow" class="nav">
<li><a href="../../../../index.html">Home</a></li>
<li><a href="../../../../mirrors.html">Download</a></li>
<li><a href="../../../../docs.html">Documentation</a></li>
<li><a href="../../../../maillist.html">Mailing Lists</a></li>
<li><a href="http://wiki.exim.org/">Wiki</a></li>
<li><a href="http://www.exim.org/bugzilla/">Bugs</a></li>
<li><a href="../../../../credits.html">Credits</a></li>
<li class="search"><form action="http://www.google.com/search" method="get">
<span class="search_field_container"><input type="search" name="q" placeholder="Search Docs" class="search_field"></span><input type="hidden" name="hl" value="en"><input type="hidden" name="ie" value="UTF-8"><input type="hidden" name="as_qdr" value="all"><input type="hidden" name="q" value="site:www.exim.org"><input type="hidden" name="q" value="inurl:exim-html-current">
</form></li>
</ul>
<div id="inner"><div id="content">
<a class="previous_page" href="ch05.html">&lt;-previous</a><a class="next_page" href="ch07.html">next-&gt;</a><div id="chapter" class="chapter">
<h2 id="CHAPconf" class="">Chapter 6 - The Exim run time configuration file</h2>
<p>






Exim uses a single run time configuration file that is read whenever an Exim
binary is executed. Note that in normal operation, this happens frequently,
because Exim is designed to operate in a distributed manner, without central
control.
</p>
<p>
If a syntax error is detected while reading the configuration file, Exim
writes a message on the standard error, and exits with a non-zero return code.
The message is also written to the panic log. <span class="docbook_emphasis">Note</span>: Only simple syntax
errors can be detected at this time. The values of any expanded options are
not checked until the expansion happens, even when the expansion does not
actually alter the string.
</p>
<p>
The name of the configuration file is compiled into the binary for security
reasons, and is specified by the CONFIGURE_FILE compilation option. In
most configurations, this specifies a single file. However, it is permitted to
give a colon-separated list of file names, in which case Exim uses the first
existing file in the list.
</p>
<p>






The run time configuration file must be owned by root or by the user that is
specified at compile time by the CONFIGURE_OWNER option (if set). The
configuration file must not be world-writeable, or group-writeable unless its
group is the root group or the one specified at compile time by the
CONFIGURE_GROUP option.
</p>
<p>
<span class="docbook_emphasis">Warning</span>: In a conventional configuration, where the Exim binary is setuid
to root, anybody who is able to edit the run time configuration file has an
easy way to run commands as root. If you specify a user or group in the
CONFIGURE_OWNER or CONFIGURE_GROUP options, then that user and/or any users
who are members of that group will trivially be able to obtain root privileges.
</p>
<p>
Up to Exim version 4.72, the run time configuration file was also permitted to
be writeable by the Exim user and/or group. That has been changed in Exim 4.73
since it offered a simple privilege escalation for any attacker who managed to
compromise the Exim user account.
</p>
<p>
A default configuration file, which will work correctly in simple situations,
is provided in the file <span class="docbook_filename">src/configure.default</span>. If CONFIGURE_FILE
defines just one file name, the installation process copies the default
configuration to a new file of that name if it did not previously exist. If
CONFIGURE_FILE is a list, no default is automatically installed. Chapter
<a href="ch07.html" title="7. The default configuration file">7</a> is a “walk-through” discussion of the default
configuration.
</p>
<div class="section">
<h3 id="SECID40" class="">1. Using a different configuration file</h3>
<p>

A one-off alternate configuration can be specified by the <span class="docbook_option">-C</span> command line
option, which may specify a single file or a list of files. However, when
<span class="docbook_option">-C</span> is used, Exim gives up its root privilege, unless called by root (or
unless the argument for <span class="docbook_option">-C</span> is identical to the built-in value from
CONFIGURE_FILE), or is listed in the TRUSTED_CONFIG_LIST file and the caller
is the Exim user or the user specified in the CONFIGURE_OWNER setting. <span class="docbook_option">-C</span>
is useful mainly for checking the syntax of configuration files before
installing them. No owner or group checks are done on a configuration file
specified by <span class="docbook_option">-C</span>, if root privilege has been dropped.
</p>
<p>
Even the Exim user is not trusted to specify an arbitrary configuration file
with the <span class="docbook_option">-C</span> option to be used with root privileges, unless that file is
listed in the TRUSTED_CONFIG_LIST file. This locks out the possibility of
testing a configuration using <span class="docbook_option">-C</span> right through message reception and
delivery, even if the caller is root. The reception works, but by that time,
Exim is running as the Exim user, so when it re-execs to regain privilege for
the delivery, the use of <span class="docbook_option">-C</span> causes privilege to be lost. However, root
can test reception and delivery using two separate commands (one to put a
message on the queue, using <span class="docbook_option">-odq</span>, and another to do the delivery, using
<span class="docbook_option">-M</span>).
</p>
<p>
If ALT_CONFIG_PREFIX is defined <span class="docbook_filename">in Local/Makefile</span>, it specifies a
prefix string with which any file named in a <span class="docbook_option">-C</span> command line option must
start. In addition, the file name must not contain the sequence “<code class="docbook_literal">/../</code>”.
There is no default setting for ALT_CONFIG_PREFIX; when it is unset, any file
name can be used with <span class="docbook_option">-C</span>.
</p>
<p>
One-off changes to a configuration can be specified by the <span class="docbook_option">-D</span> command line
option, which defines and overrides values for macros used inside the
configuration file. However, like <span class="docbook_option">-C</span>, the use of this option by a
non-privileged user causes Exim to discard its root privilege.
If DISABLE_D_OPTION is defined in <span class="docbook_filename">Local/Makefile</span>, the use of <span class="docbook_option">-D</span> is
completely disabled, and its use causes an immediate error exit.
</p>
<p class="changed">
The WHITELIST_D_MACROS option in <span class="docbook_filename">Local/Makefile</span> permits the binary builder
to declare certain macro names trusted, such that root privilege will not
necessarily be discarded.
WHITELIST_D_MACROS defines a colon-separated list of macros which are
considered safe and, if <span class="docbook_option">-D</span> only supplies macros from this list, and the
values are acceptable, then Exim will not give up root privilege if the caller
is root, the Exim run-time user, or the CONFIGURE_OWNER, if set.  This is a
transition mechanism and is expected to be removed in the future.  Acceptable
values for the macros satisfy the regexp: <code class="docbook_literal">^[A-Za-z0-9_/.-]*$</code>
</p>
<p>
Some sites may wish to use the same Exim binary on different machines that
share a file system, but to use different configuration files on each machine.
If CONFIGURE_FILE_USE_NODE is defined in <span class="docbook_filename">Local/Makefile</span>, Exim first
looks for a file whose name is the configuration file name followed by a dot
and the machine’s node name, as obtained from the <span class="docbook_function">uname()</span> function. If this
file does not exist, the standard name is tried. This processing occurs for
each file name in the list given by CONFIGURE_FILE or <span class="docbook_option">-C</span>.
</p>
<p>
In some esoteric situations different versions of Exim may be run under
different effective uids and the CONFIGURE_FILE_USE_EUID is defined to
help with this. See the comments in <span class="docbook_filename">src/EDITME</span> for details.
</p>
</div>
<div class="section">
<h3 id="SECTconffilfor" class="">2. Configuration file format</h3>
<p>


Exim’s configuration file is divided into a number of different parts. General
option settings must always appear at the start of the file. The other parts
are all optional, and may appear in any order. Each part other than the first
is introduced by the word “begin” followed by the name of the part. The
optional parts are:
</p>
<ul>
<li>
<p>
<span class="docbook_emphasis">ACL</span>: Access control lists for controlling incoming SMTP mail (see chapter
<a href="ch40.html" title="40. Access control lists">40</a>).
</p>
</li>
<li>
<p>

<span class="docbook_emphasis">authenticators</span>: Configuration settings for the authenticator drivers. These
are concerned with the SMTP AUTH command (see chapter <a href="ch33.html" title="33. SMTP authentication">33</a>).
</p>
</li>
<li>
<p>
<span class="docbook_emphasis">routers</span>: Configuration settings for the router drivers. Routers process
addresses and determine how the message is to be delivered (see chapters
<a href="ch15.html" title="15. Generic options for routers">15</a>–<a href="ch22.html" title="22. The redirect router">22</a>).
</p>
</li>
<li>
<p>
<span class="docbook_emphasis">transports</span>: Configuration settings for the transport drivers. Transports
define mechanisms for copying messages to destinations (see chapters
<a href="ch24.html" title="24. Generic options for transports">24</a>–<a href="ch30.html" title="30. The smtp transport">30</a>).
</p>
</li>
<li>
<p>
<span class="docbook_emphasis">retry</span>: Retry rules, for use when a message cannot be delivered immediately.
If there is no retry section, or if it is empty (that is, no retry rules are
defined), Exim will not retry deliveries. In this situation, temporary errors
are treated the same as permanent errors. Retry rules are discussed in chapter
<a href="ch32.html" title="32. Retry configuration">32</a>.
</p>
</li>
<li>
<p>
<span class="docbook_emphasis">rewrite</span>: Global address rewriting rules, for use when a message arrives and
when new addresses are generated during delivery. Rewriting is discussed in
chapter <a href="ch31.html" title="31. Address rewriting">31</a>.
</p>
</li>
<li>
<p>
<span class="docbook_emphasis">local_scan</span>: Private options for the <span class="docbook_function">local_scan()</span> function. If you
want to use this feature, you must set
</p>
<div class="docbook_literallayout"><pre>
LOCAL_SCAN_HAS_OPTIONS=yes
</pre></div>
<p>
in <span class="docbook_filename">Local/Makefile</span> before building Exim. Details of the <span class="docbook_function">local_scan()</span>
facility are given in chapter <a href="ch42.html" title="42. Adding a local scan function to Exim">42</a>.
</p>
</li>
</ul>
<p>



Leading and trailing white space in configuration lines is always ignored.
</p>
<p>
Blank lines in the file, and lines starting with a # character (ignoring
leading white space) are treated as comments and are ignored. <span class="docbook_emphasis">Note</span>: A
# character other than at the beginning of a line is not treated specially,
and does not introduce a comment.
</p>
<p>
Any non-comment line can be continued by ending it with a backslash. Note that
the general rule for white space means that trailing white space after the
backslash and leading white space at the start of continuation
lines is ignored. Comment lines beginning with # (but not empty lines) may
appear in the middle of a sequence of continuation lines.
</p>
<p>
A convenient way to create a configuration file is to start from the
default, which is supplied in <span class="docbook_filename">src/configure.default</span>, and add, delete, or
change settings as required.
</p>
<p>
The ACLs, retry rules, and rewriting rules have their own syntax which is
described in chapters <a href="ch40.html" title="40. Access control lists">40</a>, <a href="ch32.html" title="32. Retry configuration">32</a>, and <a href="ch31.html" title="31. Address rewriting">31</a>,
respectively. The other parts of the configuration file have some syntactic
items in common, and these are described below, from section <a href="ch06.html#SECTcos" title="6. The Exim run time configuration file">6.10</a>
onwards. Before that, the inclusion, macro, and conditional facilities are
described.
</p>
</div>
<div class="section">
<h3 id="SECID41" class="">3. File inclusions in the configuration file</h3>
<p>




You can include other files inside Exim’s run time configuration file by
using this syntax:
</p>
<div class="docbook_literallayout"><pre>
<code class="docbook_literal">.include</code> &lt;<span class="docbook_emphasis">file name</span>&gt;
<code class="docbook_literal">.include_if_exists</code> &lt;<span class="docbook_emphasis">file name</span>&gt;
</pre></div>
<p>
on a line by itself. Double quotes round the file name are optional. If you use
the first form, a configuration error occurs if the file does not exist; the
second form does nothing for non-existent files. In all cases, an absolute file
name is required.
</p>
<p>
Includes may be nested to any depth, but remember that Exim reads its
configuration file often, so it is a good idea to keep them to a minimum.
If you change the contents of an included file, you must HUP the daemon,
because an included file is read only when the configuration itself is read.
</p>
<p>
The processing of inclusions happens early, at a physical line level, so, like
comment lines, an inclusion can be used in the middle of an option setting,
for example:
</p>
<div class="docbook_literallayout"><pre>
hosts_lookup = a.b.c \
               .include /some/file
</pre></div>
<p>
Include processing happens after macro processing (see below). Its effect is to
process the lines of the included file as if they occurred inline where the
inclusion appears.
</p>
</div>
<div class="section">
<h3 id="SECTmacrodefs" class="">4. Macros in the configuration file</h3>
<p>


If a line in the main part of the configuration (that is, before the first
“begin” line) begins with an upper case letter, it is taken as a macro
definition, and must be of the form
</p>
<div class="docbook_literallayout"><pre>
&lt;<span class="docbook_emphasis">name</span>&gt; = &lt;<span class="docbook_emphasis">rest of line</span>&gt;
</pre></div>
<p>
The name must consist of letters, digits, and underscores, and need not all be
in upper case, though that is recommended. The rest of the line, including any
continuations, is the replacement text, and has leading and trailing white
space removed. Quotes are not removed. The replacement text can never end with
a backslash character, but this doesn’t seem to be a serious limitation.
</p>
<p>
Macros may also be defined between router, transport, authenticator, or ACL
definitions. They may not, however, be defined within an individual driver or
ACL, or in the <span class="docbook_option">local_scan</span>, retry, or rewrite sections of the configuration.
</p>
</div>
<div class="section">
<h3 id="SECID42" class="">5. Macro substitution</h3>
<p>
Once a macro is defined, all subsequent lines in the file (and any included
files) are scanned for the macro name; if there are several macros, the line is
scanned for each in turn, in the order in which the macros are defined. The
replacement text is not re-scanned for the current macro, though it is scanned
for subsequently defined macros. For this reason, a macro name may not contain
the name of a previously defined macro as a substring. You could, for example,
define
</p>
<div class="docbook_literallayout"><pre>
<code class="docbook_literal">ABCD_XYZ = </code>&lt;<span class="docbook_emphasis">something</span>&gt;
<code class="docbook_literal">ABCD = </code>&lt;<span class="docbook_emphasis">something else</span>&gt;
</pre></div>
<p>
but putting the definitions in the opposite order would provoke a configuration
error. Macro expansion is applied to individual physical lines from the file,
before checking for line continuation or file inclusion (see above). If a line
consists solely of a macro name, and the expansion of the macro is empty, the
line is ignored. A macro at the start of a line may turn the line into a
comment line or a <code class="docbook_literal">.include</code> line.
</p>
</div>
<div class="section">
<h3 id="SECID43" class="">6. Redefining macros</h3>
<p>
Once defined, the value of a macro can be redefined later in the configuration
(or in an included file). Redefinition is specified by using <span class="docbook_emphasis">==</span> instead of
<span class="docbook_emphasis">=</span>. For example:
</p>
<div class="docbook_literallayout"><pre>
MAC =  initial value
...
MAC == updated value
</pre></div>
<p>
Redefinition does not alter the order in which the macros are applied to the
subsequent lines of the configuration file. It is still the same order in which
the macros were originally defined. All that changes is the macro’s value.
Redefinition makes it possible to accumulate values. For example:
</p>
<div class="docbook_literallayout"><pre>
MAC =  initial value
...
MAC == MAC and something added
</pre></div>
<p>
This can be helpful in situations where the configuration file is built
from a number of other files.
</p>
</div>
<div class="section">
<h3 id="SECID44" class="">7. Overriding macro values</h3>
<p>
The values set for macros in the configuration file can be overridden by the
<span class="docbook_option">-D</span> command line option, but Exim gives up its root privilege when <span class="docbook_option">-D</span> is
used, unless called by root or the Exim user. A definition on the command line
using the <span class="docbook_option">-D</span> option causes all definitions and redefinitions within the
file to be ignored.
</p>
</div>
<div class="section">
<h3 id="SECID45" class="">8. Example of macro usage</h3>
<p>
As an example of macro usage, consider a configuration where aliases are looked
up in a MySQL database. It helps to keep the file less cluttered if long
strings such as SQL statements are defined separately as macros, for example:
</p>
<div class="docbook_literallayout"><pre>
ALIAS_QUERY = select mailbox from user where \
              login='${quote_mysql:$local_part}';
</pre></div>
<p>
This can then be used in a <span class="docbook_command">redirect</span> router setting like this:
</p>
<div class="docbook_literallayout"><pre>
data = ${lookup mysql{ALIAS_QUERY}}
</pre></div>
<p>
In earlier versions of Exim macros were sometimes used for domain, host, or
address lists. In Exim 4 these are handled better by named lists – see
section <a href="ch10.html#SECTnamedlists" title="10. Domain, host, address, and local part lists">10.5</a>.
</p>
</div>
<div class="section">
<h3 id="SECID46" class="">9. Conditional skips in the configuration file</h3>
<p>


You can use the directives <code class="docbook_literal">.ifdef</code>, <code class="docbook_literal">.ifndef</code>, <code class="docbook_literal">.elifdef</code>,
<code class="docbook_literal">.elifndef</code>, <code class="docbook_literal">.else</code>, and <code class="docbook_literal">.endif</code> to dynamically include or exclude
portions of the configuration file. The processing happens whenever the file is
read (that is, when an Exim binary starts to run).
</p>
<p>
The implementation is very simple. Instances of the first four directives must
be followed by text that includes the names of one or macros. The condition
that is tested is whether or not any macro substitution has taken place in the
line. Thus:
</p>
<div class="docbook_literallayout"><pre>
.ifdef AAA
message_size_limit = 50M
.else
message_size_limit = 100M
.endif
</pre></div>
<p>
sets a message size limit of 50M if the macro <code class="docbook_literal">AAA</code> is defined, and 100M
otherwise. If there is more than one macro named on the line, the condition
is true if any of them are defined. That is, it is an “or” condition. To
obtain an “and” condition, you need to use nested <code class="docbook_literal">.ifdef</code>s.
</p>
<p>
Although you can use a macro expansion to generate one of these directives,
it is not very useful, because the condition “there was a macro substitution
in this line” will always be true.
</p>
<p>
Text following <code class="docbook_literal">.else</code> and <code class="docbook_literal">.endif</code> is ignored, and can be used as comment
to clarify complicated nestings.
</p>
</div>
<div class="section">
<h3 id="SECTcos" class="">10. Common option syntax</h3>
<p>



For the main set of options, driver options, and <span class="docbook_function">local_scan()</span> options,
each setting is on a line by itself, and starts with a name consisting of
lower-case letters and underscores. Many options require a data value, and in
these cases the name must be followed by an equals sign (with optional white
space) and then the value. For example:
</p>
<div class="docbook_literallayout"><pre>
qualify_domain = mydomain.example.com
</pre></div>
<p>



Some option settings may contain sensitive data, for example, passwords for
accessing databases. To stop non-admin users from using the <span class="docbook_option">-bP</span> command
line option to read these values, you can precede the option settings with the
word “hide”. For example:
</p>
<div class="docbook_literallayout"><pre>
hide mysql_servers = localhost/users/admin/secret-password
</pre></div>
<p>
For non-admin users, such options are displayed like this:
</p>
<div class="docbook_literallayout"><pre>
mysql_servers = &lt;value not displayable&gt;
</pre></div>
<p>
If “hide” is used on a driver option, it hides the value of that option on
all instances of the same driver.
</p>
<p>
The following sections describe the syntax used for the different data types
that are found in option settings.
</p>
</div>
<div class="section">
<h3 id="SECID47" class="">11. Boolean options</h3>
<p>




Options whose type is given as boolean are on/off switches. There are two
different ways of specifying such options: with and without a data value. If
the option name is specified on its own without data, the switch is turned on;
if it is preceded by “no_” or “not_” the switch is turned off. However,
boolean options may be followed by an equals sign and one of the words
“true”, “false”, “yes”, or “no”, as an alternative syntax. For example,
the following two settings have exactly the same effect:
</p>
<div class="docbook_literallayout"><pre>
queue_only
queue_only = true
</pre></div>
<p>
The following two lines also have the same (opposite) effect:
</p>
<div class="docbook_literallayout"><pre>
no_queue_only
queue_only = false
</pre></div>
<p>
You can use whichever syntax you prefer.
</p>
</div>
<div class="section">
<h3 id="SECID48" class="">12. Integer values</h3>
<p>


If an option’s type is given as “integer”, the value can be given in decimal,
hexadecimal, or octal. If it starts with a digit greater than zero, a decimal
number is assumed. Otherwise, it is treated as an octal number unless it starts
with the characters “0x”, in which case the remainder is interpreted as a
hexadecimal number.
</p>
<p>
If an integer value is followed by the letter K, it is multiplied by 1024; if
it is followed by the letter M, it is multiplied by 1024x1024. When the values
of integer option settings are output, values which are an exact multiple of
1024 or 1024x1024 are sometimes, but not always, printed using the letters K
and M. The printing style is independent of the actual input format that was
used.
</p>
</div>
<div class="section">
<h3 id="SECID49" class="">13. Octal integer values</h3>
<p>


If an option’s type is given as “octal integer”, its value is always
interpreted as an octal number, whether or not it starts with the digit zero.
Such options are always output in octal.
</p>
</div>
<div class="section">
<h3 id="SECID50" class="">14. Fixed point numbers</h3>
<p>


If an option’s type is given as “fixed-point”, its value must be a decimal
integer, optionally followed by a decimal point and up to three further digits.
</p>
</div>
<div class="section">
<h3 id="SECTtimeformat" class="">15. Time intervals</h3>
<p>


A time interval is specified as a sequence of numbers, each followed by one of
the following letters, with no intervening white space:
</p>
<table>




<tr>
<td>    <span class="docbook_option">s</span>
</td>
<td>seconds</td>
</tr>
<tr>
<td>    <span class="docbook_option">m</span>
</td>
<td>minutes</td>
</tr>
<tr>
<td>    <span class="docbook_option">h</span>
</td>
<td>hours</td>
</tr>
<tr>
<td>    <span class="docbook_option">d</span>
</td>
<td>days</td>
</tr>
<tr>
<td>    <span class="docbook_option">w</span>
</td>
<td>weeks</td>
</tr>


</table>
<p>
For example, “3h50m” specifies 3 hours and 50 minutes. The values of time
intervals are output in the same format. Exim does not restrict the values; it
is perfectly acceptable, for example, to specify “90m” instead of “1h30m”.
</p>
</div>
<div class="section">
<h3 id="SECTstrings" class="">16. String values</h3>
<p>


If an option’s type is specified as “string”, the value can be specified with
or without double-quotes. If it does not start with a double-quote, the value
consists of the remainder of the line plus any continuation lines, starting at
the first character after any leading white space, with trailing white space
removed, and with no interpretation of the characters in the string. Because
Exim removes comment lines (those beginning with #) at an early stage, they can
appear in the middle of a multi-line string. The following two settings are
therefore equivalent:
</p>
<div class="docbook_literallayout"><pre>
trusted_users = uucp:mail
trusted_users = uucp:\
                # This comment line is ignored
                mail
</pre></div>
<p>


If a string does start with a double-quote, it must end with a closing
double-quote, and any backslash characters other than those used for line
continuation are interpreted as escape characters, as follows:
</p>
<table>




<tr>
<td>    <code class="docbook_literal">\\</code>
</td>
<td>single backslash</td>
</tr>
<tr>
<td>    <code class="docbook_literal">\n</code>
</td>
<td>newline</td>
</tr>
<tr>
<td>    <code class="docbook_literal">\r</code>
</td>
<td>carriage return</td>
</tr>
<tr>
<td>    <code class="docbook_literal">\t</code>
</td>
<td>tab</td>
</tr>
<tr>
<td>    <code class="docbook_literal">\</code>&lt;<span class="docbook_emphasis">octal digits</span>&gt;</td>
<td>up to 3 octal digits specify one character</td>
</tr>
<tr>
<td>    <code class="docbook_literal">\x</code>&lt;<span class="docbook_emphasis">hex digits</span>&gt;</td>
<td>up to 2 hexadecimal digits specify one character</td>
</tr>


</table>
<p>
If a backslash is followed by some other character, including a double-quote
character, that character replaces the pair.
</p>
<p>
Quoting is necessary only if you want to make use of the backslash escapes to
insert special characters, or if you need to specify a value with leading or
trailing spaces. These cases are rare, so quoting is almost never needed in
current versions of Exim. In versions of Exim before 3.14, quoting was required
in order to continue lines, so you may come across older configuration files
and examples that apparently quote unnecessarily.
</p>
</div>
<div class="section">
<h3 id="SECID51" class="">17. Expanded strings</h3>
<p>

Some strings in the configuration file are subjected to <span class="docbook_emphasis">string expansion</span>,
by which means various parts of the string may be changed according to the
circumstances (see chapter <a href="ch11.html" title="11. String expansions">11</a>). The input syntax for such strings
is as just described; in particular, the handling of backslashes in quoted
strings is done as part of the input process, before expansion takes place.
However, backslash is also an escape character for the expander, so any
backslashes that are required for that reason must be doubled if they are
within a quoted configuration string.
</p>
</div>
<div class="section">
<h3 id="SECID52" class="">18. User and group names</h3>
<p>




User and group names are specified as strings, using the syntax described
above, but the strings are interpreted specially. A user or group name must
either consist entirely of digits, or be a name that can be looked up using the
<span class="docbook_function">getpwnam()</span> or <span class="docbook_function">getgrnam()</span> function, as appropriate.
</p>
</div>
<div class="section">
<h3 id="SECTlistconstruct" class="">19. List construction</h3>
<p>



The data for some configuration options is a list of items, with colon as the
default separator. Many of these options are shown with type “string list” in
the descriptions later in this document. Others are listed as “domain list”,
“host list”, “address list”, or “local part list”. Syntactically, they
are all the same; however, those other than “string list” are subject to
particular kinds of interpretation, as described in chapter
<a href="ch10.html" title="10. Domain, host, address, and local part lists">10</a>.
</p>
<p>
In all these cases, the entire list is treated as a single string as far as the
input syntax is concerned. The <span class="docbook_option">trusted_users</span> setting in section
<a href="ch06.html#SECTstrings" title="6. The Exim run time configuration file">6.16</a> above is an example. If a colon is actually needed in an item
in a list, it must be entered as two colons. Leading and trailing white space
on each item in a list is ignored. This makes it possible to include items that
start with a colon, and in particular, certain forms of IPv6 address. For
example, the list
</p>
<div class="docbook_literallayout"><pre>
local_interfaces = 127.0.0.1 : ::::1
</pre></div>
<p>
contains two IP addresses, the IPv4 address 127.0.0.1 and the IPv6 address ::1.
</p>
<p>
<span class="docbook_emphasis">Note</span>: Although leading and trailing white space is ignored in individual
list items, it is not ignored when parsing the list. The space after the first
colon in the example above is necessary. If it were not there, the list would
be interpreted as the two items 127.0.0.1:: and 1.
</p>
</div>
<div class="section">
<h3 id="SECID53" class="">20. Changing list separators</h3>
<p>


Doubling colons in IPv6 addresses is an unwelcome chore, so a mechanism was
introduced to allow the separator character to be changed. If a list begins
with a left angle bracket, followed by any punctuation character, that
character is used instead of colon as the list separator. For example, the list
above can be rewritten to use a semicolon separator like this:
</p>
<div class="docbook_literallayout"><pre>
local_interfaces = &lt;; 127.0.0.1 ; ::1
</pre></div>
<p>
This facility applies to all lists, with the exception of the list in
<span class="docbook_option">log_file_path</span>. It is recommended that the use of non-colon separators be
confined to circumstances where they really are needed.
</p>
<p>


It is also possible to use newline and other control characters (those with
code values less than 32, plus DEL) as separators in lists. Such separators
must be provided literally at the time the list is processed. For options that
are string-expanded, you can write the separator using a normal escape
sequence. This will be processed by the expander before the string is
interpreted as a list. For example, if a newline-separated list of domains is
generated by a lookup, you can process it directly by a line such as this:
</p>
<div class="docbook_literallayout"><pre>
domains = &lt;\n ${lookup mysql{.....}}
</pre></div>
<p>
This avoids having to change the list separator in such data. You are unlikely
to want to use a control character as a separator in an option that is not
expanded, because the value is literal text. However, it can be done by giving
the value in quotes. For example:
</p>
<div class="docbook_literallayout"><pre>
local_interfaces = "&lt;\n 127.0.0.1 \n ::1"
</pre></div>
<p>
Unlike printing character separators, which can be included in list items by
doubling, it is not possible to include a control character as data when it is
set as the separator. Two such characters in succession are interpreted as
enclosing an empty list item.
</p>
</div>
<div class="section">
<h3 id="SECTempitelis" class="">21. Empty items in lists</h3>
<p>

An empty item at the end of a list is always ignored. In other words, trailing
separator characters are ignored. Thus, the list in
</p>
<div class="docbook_literallayout"><pre>
senders = user@domain :
</pre></div>
<p>
contains only a single item. If you want to include an empty string as one item
in a list, it must not be the last item. For example, this list contains three
items, the second of which is empty:
</p>
<div class="docbook_literallayout"><pre>
senders = user1@domain : : user2@domain
</pre></div>
<p>
<span class="docbook_emphasis">Note</span>: There must be white space between the two colons, as otherwise they
are interpreted as representing a single colon data character (and the list
would then contain just one item). If you want to specify a list that contains
just one, empty item, you can do it as in this example:
</p>
<div class="docbook_literallayout"><pre>
senders = :
</pre></div>
<p>
In this case, the first item is empty, and the second is discarded because it
is at the end of the list.
</p>
</div>
<div class="section">
<h3 id="SECTfordricon" class="">22. Format of driver configurations</h3>
<p>

There are separate parts in the configuration for defining routers, transports,
and authenticators. In each part, you are defining a number of driver
instances, each with its own set of options. Each driver instance is defined by
a sequence of lines like this:
</p>
<div class="docbook_literallayout"><pre>
&lt;<span class="docbook_emphasis">instance name</span>&gt;:
  &lt;<span class="docbook_emphasis">option</span>&gt;
  ...
  &lt;<span class="docbook_emphasis">option</span>&gt;
</pre></div>
<p>
In the following example, the instance name is <span class="docbook_command">localuser</span>, and it is
followed by three options settings:
</p>
<div class="docbook_literallayout"><pre>
localuser:
  driver = accept
  check_local_user
  transport = local_delivery
</pre></div>
<p>
For each driver instance, you specify which Exim code module it uses – by the
setting of the <span class="docbook_option">driver</span> option – and (optionally) some configuration
settings. For example, in the case of transports, if you want a transport to
deliver with SMTP you would use the <span class="docbook_command">smtp</span> driver; if you want to deliver to
a local file you would use the <span class="docbook_command">appendfile</span> driver. Each of the drivers is
described in detail in its own separate chapter later in this manual.
</p>
<p>
You can have several routers, transports, or authenticators that are based on
the same underlying driver (each must have a different instance name).
</p>
<p>
The order in which routers are defined is important, because addresses are
passed to individual routers one by one, in order. The order in which
transports are defined does not matter at all. The order in which
authenticators are defined is used only when Exim, as a client, is searching
them to find one that matches an authentication mechanism offered by the
server.
</p>
<p>


Within a driver instance definition, there are two kinds of option: <span class="docbook_emphasis">generic</span>
and <span class="docbook_emphasis">private</span>. The generic options are those that apply to all drivers of the
same type (that is, all routers, all transports or all authenticators). The
<span class="docbook_option">driver</span> option is a generic option that must appear in every definition.

The private options are special for each driver, and none need appear, because
they all have default values.
</p>
<p>
The options may appear in any order, except that the <span class="docbook_option">driver</span> option must
precede any private options, since these depend on the particular driver. For
this reason, it is recommended that <span class="docbook_option">driver</span> always be the first option.
</p>
<p>
Driver instance names, which are used for reference in log entries and
elsewhere, can be any sequence of letters, digits, and underscores (starting
with a letter) and must be unique among drivers of the same type. A router and
a transport (for example) can each have the same name, but no two router
instances can have the same name. The name of a driver instance should not be
confused with the name of the underlying driver module. For example, the
configuration lines:
</p>
<div class="docbook_literallayout"><pre>
remote_smtp:
  driver = smtp
</pre></div>
<p>
create an instance of the <span class="docbook_command">smtp</span> transport driver whose name is
<span class="docbook_command">remote_smtp</span>. The same driver code can be used more than once, with
different instance names and different option settings each time. A second
instance of the <span class="docbook_command">smtp</span> transport, with different options, might be defined
thus:
</p>
<div class="docbook_literallayout"><pre>
special_smtp:
  driver = smtp
  port = 1234
  command_timeout = 10s
</pre></div>
<p>
The names <span class="docbook_command">remote_smtp</span> and <span class="docbook_command">special_smtp</span> would be used to reference
these transport instances from routers, and these names would appear in log
lines.
</p>
<p>
Comment lines may be present in the middle of driver specifications. The full
list of option settings for any particular driver instance, including all the
defaulted values, can be extracted by making use of the <span class="docbook_option">-bP</span> command line
option.
</p>
</div>
</div>
<a class="previous_page" href="ch05.html">&lt;-previous</a><a class="next_page" href="ch07.html">next-&gt;</a>
</div></div>
<iframe id="branding" name="branding" src="../../../../branding/branding.html" height="0" frameborder="no" scrolling="no"></iframe><div id="footer">Website design by <a href="https://secure.grepular.com/">Mike Cardwell</a>, of <a href="http://cardwellit.com/">Cardwell IT Ltd.</a>
</div>
<div class="left_bar"></div>
<div class="right_bar"></div>
<div id="toc">
<ul class="hidden"></ul>
<img src="../../../../doc/contents.png" width="16" height="155">
</div>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script><script type="text/javascript" src="../../../../common.js"></script><script type="text/javascript" src="../../../../doc/chapter.js"></script>
</body>
</html>