Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a4080654d049ad31b216b761b9173c1f > files > 114

exim-doc-4.69-4mdv2010.0.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on September, 10 2009 by texi2html 1.78 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>

-->
<head>
<title>Specification of the Exim Mail Transfer Agent: 13. Starting the daemon and the use of network interfaces</title>

<meta name="description" content="Specification of the Exim Mail Transfer Agent: 13. Starting the daemon and the use of network interfaces">
<meta name="keywords" content="Specification of the Exim Mail Transfer Agent: 13. Starting the daemon and the use of network interfaces">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.78">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="Starting-the-daemon"></a>
<a name="SEC152"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="spec_12.html#SEC151" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC153" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec_12.html#SEC147" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1 class="chapter"> 13. Starting the daemon and the use of network interfaces </h1>

<p>A host that is connected to a TCP/IP network may have one or more physical
hardware network interfaces. Each of these interfaces may be configured as one
or more &quot;logical&quot; interfaces, which are the entities that a program actually
works with. Each of these logical interfaces is associated with an IP address.
In addition, TCP/IP software supports &quot;loopback&quot; interfaces (127.0.0.1 in
IPv4 and ::1 in IPv6), which do not use any physical hardware. Exim requires
knowledge about the host's interfaces for use in three different circumstances:
</p>
<ol>
<li>
When a listening daemon is started, Exim needs to know which interfaces
and ports to listen on.

</li><li>
When Exim is routing an address, it needs to know which IP addresses
are associated with local interfaces. This is required for the correct
processing of MX lists by removing the local host and others with the
same or higher priority values. Also, Exim needs to detect cases
when an address is routed to an IP address that in fact belongs to the
local host. Unless the <code>self</code> router option or the <code>allow_localhost</code>
option of the smtp transport is set (as appropriate), this is treated
as an error situation.

</li><li>
When Exim connects to a remote host, it may need to know which interface to use
for the outgoing connection.
</li></ol>

<p>Exim's default behaviour is likely to be appropriate in the vast majority
of cases. If your host has only one interface, and you want all its IP
addresses to be treated in the same way, and you are using only the
standard SMTP port, you should not need to take any special action. The
rest of this chapter does not apply to you.
</p>
<p>In a more complicated situation you may want to listen only on certain
interfaces, or on different ports, and for this reason there are a number of
options that can be used to influence Exim's behaviour. The rest of this
chapter describes how they operate.
</p>
<p>When a message is received over TCP/IP, the interface and port that were
actually used are set in <code>$received_ip_address</code> and <code>$received_port</code>.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC153">13.1 Starting a listening daemon</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC154">13.2 Special IP listening addresses</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC155">13.3 Overriding local_interfaces and daemon_smtp_ports</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC156">13.4 Support for the obsolete SSMTP (or SMTPS) protocol</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC157">13.5 IPv6 address scopes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC158">13.6 Disabling IPv6</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC159">13.7 Examples of starting a listening daemon</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC160">13.8 Recognizing the local host</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC161">13.9 Delivering to a remote host</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Starting-a-listening-daemon"></a>
<a name="SEC153"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC152" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC154" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC152" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC152" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 13.1 Starting a listening daemon </h2>

<p>When a listening daemon is started (by means of the <code>-bd</code> command line
option), the interfaces and ports on which it listens are controlled by the
following options:
</p>
<ul class="toc">
<li>
<code>daemon_smtp_ports</code> contains a list of default ports. (For backward
compatibility, this option can also be specified in the singular.)

</li><li>
<code>local_interfaces</code> contains list of interface IP addresses on which to
listen. Each item may optionally also specify a port.
</li></ul>

<p>The default list separator in both cases is a colon, but this can be changed as
described in section <a href="spec_6.html#SEC75">List construction</a>. When IPv6 addresses are involved,
it is usually best to change the separator to avoid having to double all the
colons. For example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">local_interfaces = &lt;; 127.0.0.1 ; \
                      192.168.23.65 ; \
                      ::1 ; \
                      3ffe:ffff:836f::fe86:a061
</pre></td></tr></table>

<p>There are two different formats for specifying a port along with an IP address
in <code>local_interfaces</code>:
</p>
<ol>
<li>
The port is added onto the address with a dot separator. For example, to listen
on port 1234 on two different IP addresses:

<table><tr><td>&nbsp;</td><td><pre class="example">local_interfaces = &lt;; 192.168.23.65.1234 ; \
                      3ffe:ffff:836f::fe86:a061.1234
</pre></td></tr></table>

</li><li>
The IP address is enclosed in square brackets, and the port is added
with a colon separator, for example:

<table><tr><td>&nbsp;</td><td><pre class="example">local_interfaces = &lt;; [192.168.23.65]:1234 ; \
                      [3ffe:ffff:836f::fe86:a061]:1234
</pre></td></tr></table>
</li></ol>

<p>When a port is not specified, the value of <code>daemon_smtp_ports</code> is used. The
default setting contains just one port:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">daemon_smtp_ports = smtp
</pre></td></tr></table>

<p>If more than one port is listed, each interface that does not have its own port
specified listens on all of them. Ports that are listed in
<code>daemon_smtp_ports</code> can be identified either by name (defined in
&lsquo;<tt>/etc/services</tt>&rsquo;) or by number. However, when ports are given with individual
IP addresses in <code>local_interfaces</code>, only numbers (not names) can be used.
</p>
<hr size="6">
<a name="Special-IP-listening-addresses"></a>
<a name="SEC154"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC153" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC155" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC152" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC152" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 13.2 Special IP listening addresses </h2>

<p>The addresses 0.0.0.0 and ::0 are treated specially. They are interpreted
as &quot;all IPv4 interfaces&quot; and &quot;all IPv6 interfaces&quot;, respectively. In each
case, Exim tells the TCP/IP stack to &quot;listen on all IPv<em>x</em> interfaces&quot;
instead of setting up separate listening sockets for each interface. The
default value of <code>local_interfaces</code> is
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">local_interfaces = 0.0.0.0
</pre></td></tr></table>

<p>when Exim is built without IPv6 support; otherwise it is:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">local_interfaces = &lt;; ::0 ; 0.0.0.0
</pre></td></tr></table>

<p>Thus, by default, Exim listens on all available interfaces, on the SMTP port.
</p>
<hr size="6">
<a name="Overriding-local_005finterfaces-and-daemon_005fsmtp_005fports"></a>
<a name="SEC155"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC154" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC156" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC152" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC152" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 13.3 Overriding local_interfaces and daemon_smtp_ports </h2>

<p>The <code>-oX</code> command line option can be used to override the values of
<code>daemon_smtp_ports</code> and/or <code>local_interfaces</code> for a particular daemon
instance. Another way of doing this would be to use macros and the <code>-D</code>
option. However, <code>-oX</code> can be used by any admin user, whereas modification of
the runtime configuration by <code>-D</code> is allowed only when the caller is root or
exim.
</p>
<p>The value of <code>-oX</code> is a list of items. The default colon separator can be
changed in the usual way if required. If there are any items that do not
contain dots or colons (that is, are not IP addresses), the value of
<code>daemon_smtp_ports</code> is replaced by the list of those items. If there are any
items that do contain dots or colons, the value of <code>local_interfaces</code> is
replaced by those items. Thus, for example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">-oX 1225
</pre></td></tr></table>

<p>overrides <code>daemon_smtp_ports</code>, but leaves <code>local_interfaces</code> unchanged,
whereas
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">-oX 192.168.34.5.1125
</pre></td></tr></table>

<p>overrides <code>local_interfaces</code>, leaving <code>daemon_smtp_ports</code> unchanged.
(However, since <code>local_interfaces</code> now contains no items without ports, the
value of <code>daemon_smtp_ports</code> is no longer relevant in this example.)
</p>
<hr size="6">
<a name="Support-for-the-obsolete-SSMTP-_005bor-SMTPS_005d-protocol"></a>
<a name="SEC156"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC155" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC157" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC152" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC152" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 13.4 Support for the obsolete SSMTP (or SMTPS) protocol </h2>

<p>Exim supports the obsolete SSMTP protocol (also known as SMTPS) that was used
before the STARTTLS command was standardized for SMTP. Some legacy clients
still use this protocol. If the <code>tls_on_connect_ports</code> option is set to a
list of port numbers, connections to those ports must use SSMTP. The most
common use of this option is expected to be
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">tls_on_connect_ports = 465
</pre></td></tr></table>

<p>because 465 is the usual port number used by the legacy clients. There is also
a command line option <code>-tls-on-connect</code>, which forces all ports to behave in
this way when a daemon is started.
</p>
<p><strong>Warning</strong>: Setting <code>tls_on_connect_ports</code> does not of itself cause the
daemon to listen on those ports. You must still specify them in
<code>daemon_smtp_ports</code>, <code>local_interfaces</code>, or the <code>-oX</code> option. (This is
because <code>tls_on_connect_ports</code> applies to <code>inetd</code> connections as well as to
connections via the daemon.)
</p>
<hr size="6">
<a name="IPv6-address-scopes"></a>
<a name="SEC157"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC156" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC158" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC152" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC152" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 13.5 IPv6 address scopes </h2>

<p>IPv6 addresses have &quot;scopes&quot;, and a host with multiple hardware interfaces
can, in principle, have the same link-local IPv6 address on different
interfaces. Thus, additional information is needed, over and above the IP
address, to distinguish individual interfaces. A convention of using a
percent sign followed by something (often the interface name) has been
adopted in some cases, leading to addresses like this:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">fe80::202:b3ff:fe03:45c1%eth0
</pre></td></tr></table>

<p>To accommodate this usage, a percent sign followed by an arbitrary string is
allowed at the end of an IPv6 address. By default, Exim calls <code>getaddrinfo()</code>
to convert a textual IPv6 address for actual use. This function recognizes the
percent convention in operating systems that support it, and it processes the
address appropriately. Unfortunately, some older libraries have problems with
<code>getaddrinfo()</code>. If
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">IPV6_USE_INET_PTON=yes
</pre></td></tr></table>

<p>is set in &lsquo;<tt>Local/Makefile</tt>&rsquo; (or an OS-dependent Makefile) when Exim is built,
Exim uses <em>inet_pton()</em> to convert a textual IPv6 address for actual use,
instead of <code>getaddrinfo()</code>. (Before version 4.14, it always used this
function.) Of course, this means that the additional functionality of
<code>getaddrinfo()</code> - recognizing scoped addresses - is lost.
</p>
<hr size="6">
<a name="Disabling-IPv6"></a>
<a name="SEC158"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC157" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC159" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC152" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC152" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 13.6 Disabling IPv6 </h2>

<p>Sometimes it happens that an Exim binary that was compiled with IPv6 support is
run on a host whose kernel does not support IPv6. The binary will fall back to
using IPv4, but it may waste resources looking up AAAA records, and trying to
connect to IPv6 addresses, causing delays to mail delivery. If you set the
<a name="IDX1061"></a>
<code>disable_ipv6</code> option true, even if the Exim binary has IPv6 support, no IPv6
activities take place. AAAA records are never looked up, and any IPv6 addresses
that are listed in <code>local_interfaces</code>, data for the <code>manualroute</code> router,
etc. are ignored. If IP literals are enabled, the <code>ipliteral</code> router declines
to handle IPv6 literal addresses.
</p>
<p>On the other hand, when IPv6 is in use, there may be times when you want to
disable it for certain hosts or domains. You can use the <code>dns_ipv4_lookup</code>
option to globally suppress the lookup of AAAA records for specified domains,
and you can use the <code>ignore_target_hosts</code> generic router option to ignore
IPv6 addresses in an individual router.
</p>
<hr size="6">
<a name="Examples-of-starting-a-listening-daemon"></a>
<a name="SEC159"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC158" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC160" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC152" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC152" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 13.7 Examples of starting a listening daemon </h2>

<p>The default case in an IPv6 environment is
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">daemon_smtp_ports = smtp
local_interfaces = &lt;; ::0 ; 0.0.0.0
</pre></td></tr></table>

<p>This specifies listening on the smtp port on all IPv6 and IPv4 interfaces.
Either one or two sockets may be used, depending on the characteristics of
the TCP/IP stack. (This is complicated and messy; for more information,
read the comments in the &lsquo;<tt>daemon.c</tt>&rsquo; source file.)
</p>
<p>To specify listening on ports 25 and 26 on all interfaces:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">daemon_smtp_ports = 25 : 26
</pre></td></tr></table>

<p>(leaving <code>local_interfaces</code> at the default setting) or, more explicitly:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">local_interfaces = &lt;; ::0.25     ; ::0.26 \
                      0.0.0.0.25 ; 0.0.0.0.26
</pre></td></tr></table>

<p>To listen on the default port on all IPv4 interfaces, and on port 26 on the
IPv4 loopback address only:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">local_interfaces = 0.0.0.0 : 127.0.0.1.26
</pre></td></tr></table>

<p>To specify listening on the default port on specific interfaces only:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">local_interfaces = 192.168.34.67 : 192.168.34.67
</pre></td></tr></table>

<p><strong>Warning</strong>: Such a setting excludes listening on the loopback interfaces.
</p>
<hr size="6">
<a name="Recognizing-the-local-host"></a>
<a name="SEC160"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC159" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC161" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC152" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC152" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 13.8 Recognizing the local host </h2>

<p>The <code>local_interfaces</code> option is also used when Exim needs to determine
whether or not an IP address refers to the local host. That is, the IP
addresses of all the interfaces on which a daemon is listening are always
treated as local.
</p>
<p>For this usage, port numbers in <code>local_interfaces</code> are ignored. If either of
the items 0.0.0.0 or ::0 are encountered, Exim gets a complete list of
available interfaces from the operating system, and extracts the relevant
(that is, IPv4 or IPv6) addresses to use for checking.
</p>
<p>Some systems set up large numbers of virtual interfaces in order to provide
many virtual web servers. In this situation, you may want to listen for
email on only a few of the available interfaces, but nevertheless treat all
interfaces as local when routing. You can do this by setting
<code>extra_local_interfaces</code> to a list of IP addresses, possibly including the
&quot;all&quot; wildcard values. These addresses are recognized as local, but are not
used for listening. Consider this example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">local_interfaces = &lt;; 127.0.0.1 ; ::1 ; \
                      192.168.53.235 ; \
                      3ffe:2101:12:1:a00:20ff:fe86:a061

extra_local_interfaces = &lt;; ::0 ; 0.0.0.0
</pre></td></tr></table>

<p>The daemon listens on the loopback interfaces and just one IPv4 and one IPv6
address, but all available interface addresses are treated as local when
Exim is routing.
</p>
<p>In some environments the local host name may be in an MX list, but with an IP
address that is not assigned to any local interface. In other cases it may be
desirable to treat other host names as if they referred to the local host. Both
these cases can be handled by setting the <code>hosts_treat_as_local</code> option.
This contains host names rather than IP addresses. When a host is referenced
during routing, either via an MX record or directly, it is treated as the local
host if its name matches <code>hosts_treat_as_local</code>, or if any of its IP
addresses match <code>local_interfaces</code> or <code>extra_local_interfaces</code>.
</p>
<hr size="6">
<a name="Delivering-to-a-remote-host"></a>
<a name="SEC161"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC160" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC152" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC152" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 13.9 Delivering to a remote host </h2>

<p>Delivery to a remote host is handled by the smtp transport. By default, it
allows the system's TCP/IP functions to choose which interface to use (if
there is more than one) when connecting to a remote host. However, the
<code>interface</code> option can be set to specify which interface is used. See the
description of the smtp transport in chapter <a href="spec_30.html#SEC242">The smtp transport</a> for more
details.
</p>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC152" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="spec_14.html#SEC162" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[Contents]</td>
<td valign="middle" align="left">[<a href="spec_55.html#SEC493" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="spec_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated on <i>September, 10 2009</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 1.78</i></a>.
 </font>
 <br>

</p>
</body>
</html>