Sophie

Sophie

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

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>15. Generic options for routers</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/ch15.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="ch14.html">&lt;-previous</a><a class="next_page" href="ch16.html">next-&gt;</a><div id="chapter" class="chapter">
<h2 id="CHAProutergeneric" class="">Chapter 15 - Generic options for routers</h2>
<p>


This chapter describes the generic options that apply to all routers.
Those that are preconditions are marked with ‡ in the “use” field.
</p>
<p>
For a general description of how a router operates, see sections
<a href="ch03.html#SECTrunindrou" title="3. How Exim receives and delivers mail">3.10</a> and <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a>. The latter specifies the order in
which the preconditions are tested. The order of expansion of the options that
provide data for a transport is: <span class="docbook_option">errors_to</span>, <span class="docbook_option">headers_add</span>,
<span class="docbook_option">headers_remove</span>, <span class="docbook_option">transport</span>.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">address_data</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>

The string is expanded just before the router is run, that is, after all the
precondition tests have succeeded. If the expansion is forced to fail, the
router declines, the value of <span class="docbook_option">address_data</span> remains unchanged, and the
<span class="docbook_option">more</span> option controls what happens next. Other expansion failures cause
delivery of the address to be deferred.
</p>
<p>

When the expansion succeeds, the value is retained with the address, and can be
accessed using the variable $address_data in the current router, subsequent
routers, and the eventual transport.
</p>
<p>
<span class="docbook_emphasis">Warning</span>: If the current or any subsequent router is a <span class="docbook_command">redirect</span> router
that runs a user’s filter file, the contents of $address_data are accessible
in the filter. This is not normally a problem, because such data is usually
either not confidential or it “belongs” to the current user, but if you do
put confidential data into $address_data you need to remember this point.
</p>
<p>
Even if the router declines or passes, the value of $address_data remains
with the address, though it can be changed by another <span class="docbook_option">address_data</span> setting
on a subsequent router. If a router generates child addresses, the value of
$address_data propagates to them. This also applies to the special kind of
“child” that is generated by a router with the <span class="docbook_option">unseen</span> option.
</p>
<p>
The idea of <span class="docbook_option">address_data</span> is that you can use it to look up a lot of data
for the address once, and then pick out parts of the data later. For example,
you could use a single LDAP lookup to return a string of the form
</p>
<div class="docbook_literallayout"><pre>
uid=1234 gid=5678 mailbox=/mail/xyz forward=/home/xyz/.forward
</pre></div>
<p>
In the transport you could pick out the mailbox by a setting such as
</p>
<div class="docbook_literallayout"><pre>
file = ${extract{mailbox}{$address_data}}
</pre></div>
<p>
This makes the configuration file less messy, and also reduces the number of
lookups (though Exim does cache lookups).
</p>
<p>


The <span class="docbook_option">address_data</span> facility is also useful as a means of passing information
from one router to another, and from a router to a transport. In addition, if
$address_data is set by a router when verifying a recipient address from an
ACL, it remains available for use in the rest of the ACL statement. After
verifying a sender, the value is transferred to $sender_address_data.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">address_test</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">true</span>
</td>
</tr>


</table>
<p>


If this option is set false, the router is skipped when routing is being tested
by means of the <span class="docbook_option">-bt</span> command line option. This can be a convenience when
your first router sends messages to an external scanner, because it saves you
having to set the “already scanned” indicator when testing real address
routing.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">cannot_route_message</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


This option specifies a text message that is used when an address cannot be
routed because Exim has run out of routers. The default message is
“Unrouteable address”. This option is useful only on routers that have
<span class="docbook_option">more</span> set false, or on the very last router in a configuration, because the
value that is used is taken from the last router that is considered. This
includes a router that is skipped because its preconditions are not met, as
well as a router that declines. For example, using the default configuration,
you could put:
</p>
<div class="docbook_literallayout"><pre>
cannot_route_message = Remote domain not found in DNS
</pre></div>
<p>
on the first router, which is a <span class="docbook_command">dnslookup</span> router with <span class="docbook_option">more</span> set false,
and
</p>
<div class="docbook_literallayout"><pre>
cannot_route_message = Unknown local user
</pre></div>
<p>
on the final router that checks for local users. If string expansion fails for
this option, the default message is used. Unless the expansion failure was
explicitly forced, a message about the failure is written to the main and panic
logs, in addition to the normal message about the routing failure.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">caseful_local_part</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>


By default, routers handle the local parts of addresses in a case-insensitive
manner, though the actual case is preserved for transmission with the message.
If you want the case of letters to be significant in a router, you must set
this option true. For individual router options that contain address or local
part lists (for example, <span class="docbook_option">local_parts</span>), case-sensitive matching can be
turned on by “+caseful” as a list item. See section <a href="ch10.html#SECTcasletadd" title="10. Domain, host, address, and local part lists">10.20</a> for
more details.
</p>
<p>



The value of the $local_part variable is forced to lower case while a
router is running unless <span class="docbook_option">caseful_local_part</span> is set. When a router assigns
an address to a transport, the value of $local_part when the transport runs
is the same as it was in the router. Similarly, when a router generates child
addresses by aliasing or forwarding, the values of $original_local_part
and $parent_local_part are those that were used by the redirecting router.
</p>
<p>
This option applies to the processing of an address by a router. When a
recipient address is being processed in an ACL, there is a separate <span class="docbook_option">control</span>
modifier that can be used to specify case-sensitive processing within the ACL
(see section <a href="ch40.html#SECTcontrols" title="40. Access control lists">40.21</a>).
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">check_local_user</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>




When this option is true, Exim checks that the local part of the recipient
address (with affixes removed if relevant) is the name of an account on the
local system. The check is done by calling the <span class="docbook_function">getpwnam()</span> function rather
than trying to read <span class="docbook_filename">/etc/passwd</span> directly. This means that other methods of
holding password data (such as NIS) are supported. If the local part is a local
user, $home is set from the password data, and can be tested in other
preconditions that are evaluated after this one (the order of evaluation is
given in section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a>). However, the value of $home can be
overridden by <span class="docbook_option">router_home_directory</span>. If the local part is not a local user,
the router is skipped.
</p>
<p>
If you want to check that the local part is either the name of a local user
or matches something else, you cannot combine <span class="docbook_option">check_local_user</span> with a
setting of <span class="docbook_option">local_parts</span>, because that specifies the logical <span class="docbook_emphasis">and</span> of the
two conditions. However, you can use a <span class="docbook_command">passwd</span> lookup in a <span class="docbook_option">local_parts</span>
setting to achieve this. For example:
</p>
<div class="docbook_literallayout"><pre>
local_parts = passwd;$local_part : lsearch;/etc/other/users
</pre></div>
<p>
Note, however, that the side effects of <span class="docbook_option">check_local_user</span> (such as setting
up a home directory) do not occur when a <span class="docbook_command">passwd</span> lookup is used in a
<span class="docbook_option">local_parts</span> (or any other) precondition.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">condition</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>

This option specifies a general precondition test that has to succeed for the
router to be called. The <span class="docbook_option">condition</span> option is the last precondition to be
evaluated (see section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a>). The string is expanded, and if the
result is a forced failure, or an empty string, or one of the strings “0” or
“no” or “false” (checked without regard to the case of the letters), the
router is skipped, and the address is offered to the next one.
</p>
<p>
If the result is any other value, the router is run (as this is the last
precondition to be evaluated, all the other preconditions must be true).
</p>
<p>
This option is unique in that multiple <span class="docbook_option">condition</span> options may be present.
All <span class="docbook_option">condition</span> options must succeed.
</p>
<p>
The <span class="docbook_option">condition</span> option provides a means of applying custom conditions to the
running of routers. Note that in the case of a simple conditional expansion,
the default expansion values are exactly what is wanted. For example:
</p>
<div class="docbook_literallayout"><pre>
condition = ${if &gt;{$message_age}{600}}
</pre></div>
<p>
Because of the default behaviour of the string expansion, this is equivalent to
</p>
<div class="docbook_literallayout"><pre>
condition = ${if &gt;{$message_age}{600}{true}{}}
</pre></div>
<p>
A multiple condition example, which succeeds:
</p>
<div class="docbook_literallayout"><pre>
condition = ${if &gt;{$message_age}{600}}
condition = ${if !eq{${lc:$local_part}}{postmaster}}
condition = foobar
</pre></div>
<p>
If the expansion fails (other than forced failure) delivery is deferred. Some
of the other precondition options are common special cases that could in fact
be specified using <span class="docbook_option">condition</span>.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">debug_print</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>

If this option is set and debugging is enabled (see the <span class="docbook_option">-d</span> command line
option), the string is expanded and included in the debugging output.
If expansion of the string fails, the error message is written to the debugging
output, and Exim carries on processing.
This option is provided to help with checking out the values of variables and
so on when debugging router configurations. For example, if a <span class="docbook_option">condition</span>
option appears not to be working, <span class="docbook_option">debug_print</span> can be used to output the
variables it references. The output happens after checks for <span class="docbook_option">domains</span>,
<span class="docbook_option">local_parts</span>, and <span class="docbook_option">check_local_user</span> but before any other preconditions
are tested. A newline is added to the text if it does not end with one.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">disable_logging</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>
If this option is set true, nothing is logged for any routing errors
or for any deliveries caused by this router. You should not set this option
unless you really, really know what you are doing. See also the generic
transport option of the same name.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">domains</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">domain list</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


If this option is set, the router is skipped unless the current domain matches
the list. If the match is achieved by means of a file lookup, the data that the
lookup returned for the domain is placed in $domain_data for use in string
expansions of the driver’s private options. See section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a> for
a list of the order in which preconditions are evaluated.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">driver</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>
This option must always be set. It specifies which of the available routers is
to be used.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">errors_to</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


If a router successfully handles an address, it may assign the address to a
transport for delivery or it may generate child addresses. In both cases, if
there is a delivery problem during later processing, the resulting bounce
message is sent to the address that results from expanding this string,
provided that the address verifies successfully. The <span class="docbook_option">errors_to</span> option is
expanded before <span class="docbook_option">headers_add</span>, <span class="docbook_option">headers_remove</span>, and <span class="docbook_option">transport</span>.
</p>
<p>
The <span class="docbook_option">errors_to</span> setting associated with an address can be overridden if it
subsequently passes through other routers that have their own <span class="docbook_option">errors_to</span>
settings, or if the message is delivered by a transport with a <span class="docbook_option">return_path</span>
setting.
</p>
<p>
If <span class="docbook_option">errors_to</span> is unset, or the expansion is forced to fail, or the result of
the expansion fails to verify, the errors address associated with the incoming
address is used. At top level, this is the envelope sender. A non-forced
expansion failure causes delivery to be deferred.
</p>
<p>
If an address for which <span class="docbook_option">errors_to</span> has been set ends up being delivered over
SMTP, the envelope sender for that delivery is the <span class="docbook_option">errors_to</span> value, so that
any bounces that are generated by other MTAs on the delivery route are also
sent there. You can set <span class="docbook_option">errors_to</span> to the empty string by either of these
settings:
</p>
<div class="docbook_literallayout"><pre>
errors_to =
errors_to = ""
</pre></div>
<p>
An expansion item that yields an empty string has the same effect. If you do
this, a locally detected delivery error for addresses processed by this router
no longer gives rise to a bounce message; the error is discarded. If the
address is delivered to a remote host, the return path is set to <code class="docbook_literal">&lt;&gt;</code>, unless
overridden by the <span class="docbook_option">return_path</span> option on the transport.
</p>
<p>

If for some reason you want to discard local errors, but use a non-empty
MAIL command for remote delivery, you can preserve the original return
path in $address_data in the router, and reinstate it in the transport by
setting <span class="docbook_option">return_path</span>.
</p>
<p>
The most common use of <span class="docbook_option">errors_to</span> is to direct mailing list bounces to the
manager of the list, as described in section <a href="ch47.html#SECTmailinglists" title="47. Some common configuration settings">47.2</a>, or to
implement VERP (Variable Envelope Return Paths) (see section <a href="ch47.html#SECTverp" title="47. Some common configuration settings">47.6</a>).
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">expn</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">true</span>
</td>
</tr>


</table>
<p>




If this option is turned off, the router is skipped when testing an address
as a result of processing an SMTP EXPN command. You might, for example,
want to turn it off on a router for users’ <span class="docbook_filename">.forward</span> files, while leaving it
on for the system alias file.
See section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a> for a list of the order in which preconditions
are evaluated.
</p>
<p>
The use of the SMTP EXPN command is controlled by an ACL (see chapter
<a href="ch40.html" title="40. Access control lists">40</a>). When Exim is running an EXPN command, it is similar to testing
an address with <span class="docbook_option">-bt</span>. Compare VRFY, whose counterpart is <span class="docbook_option">-bv</span>.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">fail_verify</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>

Setting this option has the effect of setting both <span class="docbook_option">fail_verify_sender</span> and
<span class="docbook_option">fail_verify_recipient</span> to the same value.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">fail_verify_recipient</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>
If this option is true and an address is accepted by this router when
verifying a recipient, verification fails.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">fail_verify_sender</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>
If this option is true and an address is accepted by this router when
verifying a sender, verification fails.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">fallback_hosts</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string list</span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


String expansion is not applied to this option. The argument must be a
colon-separated list of host names or IP addresses. The list separator can be
changed (see section <a href="ch06.html#SECTlistconstruct" title="6. The Exim run time configuration file">6.19</a>), and a port can be specified with
each name or address. In fact, the format of each item is exactly the same as
defined for the list of hosts in a <span class="docbook_command">manualroute</span> router (see section
<a href="ch20.html#SECTformatonehostitem" title="20. The manualroute router">20.5</a>).
</p>
<p>
If a router queues an address for a remote transport, this host list is
associated with the address, and used instead of the transport’s fallback host
list. If <span class="docbook_option">hosts_randomize</span> is set on the transport, the order of the list is
randomized for each use. See the <span class="docbook_option">fallback_hosts</span> option of the <span class="docbook_command">smtp</span>
transport for further details.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">group</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">see below</span>
</td>
</tr>


</table>
<p>




When a router queues an address for a transport, and the transport does not
specify a group, the group given here is used when running the delivery
process.
The group may be specified numerically or by name. If expansion fails, the
error is logged and delivery is deferred.
The default is unset, unless <span class="docbook_option">check_local_user</span> is set, when the default
is taken from the password information. See also <span class="docbook_option">initgroups</span> and <span class="docbook_option">user</span>
and the discussion in chapter <a href="ch23.html" title="23. Environment for running local transports">23</a>.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">headers_add</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


This option specifies a string of text that is expanded at routing time, and
associated with any addresses that are accepted by the router. However, this
option has no effect when an address is just being verified. The way in which
the text is used to add header lines at transport time is described in section
<a href="ch44.html#SECTheadersaddrem" title="44. Message processing">44.17</a>. New header lines are not actually added until the
message is in the process of being transported. This means that references to
header lines in string expansions in the transport’s configuration do not
“see” the added header lines.
</p>
<p>
The <span class="docbook_option">headers_add</span> option is expanded after <span class="docbook_option">errors_to</span>, but before
<span class="docbook_option">headers_remove</span> and <span class="docbook_option">transport</span>. If the expanded string is empty, or if
the expansion is forced to fail, the option has no effect. Other expansion
failures are treated as configuration errors.
</p>
<p>
<span class="docbook_emphasis">Warning 1</span>: The <span class="docbook_option">headers_add</span> option cannot be used for a <span class="docbook_command">redirect</span>
router that has the <span class="docbook_option">one_time</span> option set.
</p>
<p>


<span class="docbook_emphasis">Warning 2</span>: If the <span class="docbook_option">unseen</span> option is set on the router, all header
additions are deleted when the address is passed on to subsequent routers.
For a <span class="docbook_option">redirect</span> router, if a generated address is the same as the incoming
address, this can lead to duplicate addresses with different header
modifications. Exim does not do duplicate deliveries (except, in certain
circumstances, to pipes -- see section <a href="ch22.html#SECTdupaddr" title="22. The redirect router">22.7</a>), but it is undefined
which of the duplicates is discarded, so this ambiguous situation should be
avoided. The <span class="docbook_option">repeat_use</span> option of the <span class="docbook_option">redirect</span> router may be of help.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">headers_remove</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


This option specifies a string of text that is expanded at routing time, and
associated with any addresses that are accepted by the router. However, this
option has no effect when an address is just being verified. The way in which
the text is used to remove header lines at transport time is described in
section <a href="ch44.html#SECTheadersaddrem" title="44. Message processing">44.17</a>. Header lines are not actually removed until
the message is in the process of being transported. This means that references
to header lines in string expansions in the transport’s configuration still
“see” the original header lines.
</p>
<p>
The <span class="docbook_option">headers_remove</span> option is expanded after <span class="docbook_option">errors_to</span> and
<span class="docbook_option">headers_add</span>, but before <span class="docbook_option">transport</span>. If the expansion is forced to fail,
the option has no effect. Other expansion failures are treated as configuration
errors.
</p>
<p>
<span class="docbook_emphasis">Warning 1</span>: The <span class="docbook_option">headers_remove</span> option cannot be used for a <span class="docbook_command">redirect</span>
router that has the <span class="docbook_option">one_time</span> option set.
</p>
<p>
<span class="docbook_emphasis">Warning 2</span>: If the <span class="docbook_option">unseen</span> option is set on the router, all header
removal requests are deleted when the address is passed on to subsequent
routers, and this can lead to problems with duplicates -- see the similar
warning for <span class="docbook_option">headers_add</span> above.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">ignore_target_hosts</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">host list</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


Although this option is a host list, it should normally contain IP address
entries rather than names. If any host that is looked up by the router has an
IP address that matches an item in this list, Exim behaves as if that IP
address did not exist. This option allows you to cope with rogue DNS entries
like
</p>
<div class="docbook_literallayout"><pre>
remote.domain.example.  A  127.0.0.1
</pre></div>
<p>
by setting
</p>
<div class="docbook_literallayout"><pre>
ignore_target_hosts = 127.0.0.1
</pre></div>
<p>
on the relevant router. If all the hosts found by a <span class="docbook_command">dnslookup</span> router are
discarded in this way, the router declines. In a conventional configuration, an
attempt to mail to such a domain would normally provoke the “unrouteable
domain” error, and an attempt to verify an address in the domain would fail.
Similarly, if <span class="docbook_option">ignore_target_hosts</span> is set on an <span class="docbook_command">ipliteral</span> router, the
router declines if presented with one of the listed addresses.
</p>
<p>
You can use this option to disable the use of IPv4 or IPv6 for mail delivery by
means of the first or the second of the following settings, respectively:
</p>
<div class="docbook_literallayout"><pre>
ignore_target_hosts = 0.0.0.0/0
ignore_target_hosts = &lt;; 0::0/0
</pre></div>
<p>
The pattern in the first line matches all IPv4 addresses, whereas the pattern
in the second line matches all IPv6 addresses.
</p>
<p>
This option may also be useful for ignoring link-local and site-local IPv6
addresses. Because, like all host lists, the value of <span class="docbook_option">ignore_target_hosts</span>
is expanded before use as a list, it is possible to make it dependent on the
domain that is being routed.
</p>
<p>

During its expansion, $host_address is set to the IP address that is being
checked.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">initgroups</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>




If the router queues an address for a transport, and this option is true, and
the uid supplied by the router is not overridden by the transport, the
<span class="docbook_function">initgroups()</span> function is called when running the transport to ensure that
any additional groups associated with the uid are set up. See also <span class="docbook_option">group</span>
and <span class="docbook_option">user</span> and the discussion in chapter <a href="ch23.html" title="23. Environment for running local transports">23</a>.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">local_part_prefix</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">string list</span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


If this option is set, the router is skipped unless the local part starts with
one of the given strings, or <span class="docbook_option">local_part_prefix_optional</span> is true. See
section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a> for a list of the order in which preconditions are
evaluated.
</p>
<p>
The list is scanned from left to right, and the first prefix that matches is
used. A limited form of wildcard is available; if the prefix begins with an
asterisk, it matches the longest possible sequence of arbitrary characters at
the start of the local part. An asterisk should therefore always be followed by
some character that does not occur in normal local parts.


Wildcarding can be used to set up multiple user mailboxes, as described in
section <a href="ch47.html#SECTmulbox" title="47. Some common configuration settings">47.8</a>.
</p>
<p>


During the testing of the <span class="docbook_option">local_parts</span> option, and while the router is
running, the prefix is removed from the local part, and is available in the
expansion variable $local_part_prefix. When a message is being delivered, if
the router accepts the address, this remains true during subsequent delivery by
a transport. In particular, the local part that is transmitted in the RCPT
command for LMTP, SMTP, and BSMTP deliveries has the prefix removed by default.
This behaviour can be overridden by setting <span class="docbook_option">rcpt_include_affixes</span> true on
the relevant transport.
</p>
<p>
When an address is being verified, <span class="docbook_option">local_part_prefix</span> affects only the
behaviour of the router. If the callout feature of verification is in use, this
means that the full address, including the prefix, will be used during the
callout.
</p>
<p>
The prefix facility is commonly used to handle local parts of the form
<span class="docbook_option">owner-something</span>. Another common use is to support local parts of the form
<span class="docbook_option">real-username</span> to bypass a user’s <span class="docbook_filename">.forward</span> file – helpful when trying
to tell a user their forwarding is broken – by placing a router like this one
immediately before the router that handles <span class="docbook_filename">.forward</span> files:
</p>
<div class="docbook_literallayout"><pre>
real_localuser:
  driver = accept
  local_part_prefix = real-
  check_local_user
  transport = local_delivery
</pre></div>
<p>
For security, it would probably be a good idea to restrict the use of this
router to locally-generated messages, using a condition such as this:
</p>
<div class="docbook_literallayout"><pre>
  condition = ${if match {$sender_host_address}\
                         {\N^(|127\.0\.0\.1)$\N}}
</pre></div>
<p>
If both <span class="docbook_option">local_part_prefix</span> and <span class="docbook_option">local_part_suffix</span> are set for a router,
both conditions must be met if not optional. Care must be taken if wildcards
are used in both a prefix and a suffix on the same router. Different
separator characters must be used to avoid ambiguity.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">local_part_prefix_optional</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>
See <span class="docbook_option">local_part_prefix</span> above.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">local_part_suffix</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">string list</span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


This option operates in the same way as <span class="docbook_option">local_part_prefix</span>, except that the
local part must end (rather than start) with the given string, the
<span class="docbook_option">local_part_suffix_optional</span> option determines whether the suffix is
mandatory, and the wildcard * character, if present, must be the last
character of the suffix. This option facility is commonly used to handle local
parts of the form <span class="docbook_option">something-request</span> and multiple user mailboxes of the form
<span class="docbook_option">username-foo</span>.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">local_part_suffix_optional</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>
See <span class="docbook_option">local_part_suffix</span> above.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">local_parts</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">local part list</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


The router is run only if the local part of the address matches the list.
See section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a> for a list of the order in which preconditions
are evaluated, and
section <a href="ch10.html#SECTlocparlis" title="10. Domain, host, address, and local part lists">10.21</a> for a discussion of local part lists. Because the
string is expanded, it is possible to make it depend on the domain, for
example:
</p>
<div class="docbook_literallayout"><pre>
local_parts = dbm;/usr/local/specials/$domain
</pre></div>
<p>

If the match is achieved by a lookup, the data that the lookup returned
for the local part is placed in the variable $local_part_data for use in
expansions of the router’s private options. You might use this option, for
example, if you have a large number of local virtual domains, and you want to
send all postmaster mail to the same place without having to set up an alias in
each virtual domain:
</p>
<div class="docbook_literallayout"><pre>
postmaster:
  driver = redirect
  local_parts = postmaster
  data = postmaster@real.domain.example
</pre></div>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">log_as_local</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">see below</span>
</td>
</tr>


</table>
<p>


Exim has two logging styles for delivery, the idea being to make local
deliveries stand out more visibly from remote ones. In the “local” style, the
recipient address is given just as the local part, without a domain. The use of
this style is controlled by this option. It defaults to true for the <span class="docbook_command">accept</span>
router, and false for all the others. This option applies only when a
router assigns an address to a transport. It has no effect on routers that
redirect addresses.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">more</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">true</span>
</td>
</tr>


</table>
<p>
The result of string expansion for this option must be a valid boolean value,
that is, one of the strings “yes”, “no”, “true”, or “false”. Any other
result causes an error, and delivery is deferred. If the expansion is forced to
fail, the default value for the option (true) is used. Other failures cause
delivery to be deferred.
</p>
<p>
If this option is set false, and the router declines to handle the address, no
further routers are tried, routing fails, and the address is bounced.

However, if the router explicitly passes an address to the following router by
means of the setting
</p>
<div class="docbook_literallayout"><pre>
self = pass
</pre></div>
<p>
or otherwise, the setting of <span class="docbook_option">more</span> is ignored. Also, the setting of <span class="docbook_option">more</span>
does not affect the behaviour if one of the precondition tests fails. In that
case, the address is always passed to the next router.
</p>
<p>
Note that <span class="docbook_option">address_data</span> is not considered to be a precondition. If its
expansion is forced to fail, the router declines, and the value of <span class="docbook_option">more</span>
controls what happens next.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">pass_on_timeout</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>


If a router times out during a host lookup, it normally causes deferral of the
address. If <span class="docbook_option">pass_on_timeout</span> is set, the address is passed on to the next
router, overriding <span class="docbook_option">no_more</span>. This may be helpful for systems that are
intermittently connected to the Internet, or those that want to pass to a smart
host any messages that cannot immediately be delivered.
</p>
<p>
There are occasional other temporary errors that can occur while doing DNS
lookups. They are treated in the same way as a timeout, and this option
applies to all of them.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">pass_router</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>

Routers that recognize the generic <span class="docbook_option">self</span> option (<span class="docbook_command">dnslookup</span>,
<span class="docbook_command">ipliteral</span>, and <span class="docbook_command">manualroute</span>) are able to return “pass”, forcing
routing to continue, and overriding a false setting of <span class="docbook_option">more</span>. When one of
these routers returns “pass”, the address is normally handed on to the next
router in sequence. This can be changed by setting <span class="docbook_option">pass_router</span> to the name
of another router. However (unlike <span class="docbook_option">redirect_router</span>) the named router must
be below the current router, to avoid loops. Note that this option applies only
to the special case of “pass”. It does not apply when a router returns
“decline” because it cannot handle an address.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">redirect_router</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>

Sometimes an administrator knows that it is pointless to reprocess addresses
generated from alias or forward files with the same router again. For
example, if an alias file translates real names into login ids there is no
point searching the alias file a second time, especially if it is a large file.
</p>
<p>
The <span class="docbook_option">redirect_router</span> option can be set to the name of any router instance.
It causes the routing of any generated addresses to start at the named router
instead of at the first router. This option has no effect if the router in
which it is set does not generate new addresses.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">require_files</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">string list</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>


This option provides a general mechanism for predicating the running of a
router on the existence or non-existence of certain files or directories.
Before running a router, as one of its precondition tests, Exim works its way
through the <span class="docbook_option">require_files</span> list, expanding each item separately.
</p>
<p>
Because the list is split before expansion, any colons in expansion items must
be doubled, or the facility for using a different list separator must be used.
If any expansion is forced to fail, the item is ignored. Other expansion
failures cause routing of the address to be deferred.
</p>
<p>
If any expanded string is empty, it is ignored. Otherwise, except as described
below, each string must be a fully qualified file path, optionally preceded by
“!”. The paths are passed to the <span class="docbook_function">stat()</span> function to test for the
existence of the files or directories. The router is skipped if any paths not
preceded by “!” do not exist, or if any paths preceded by “!” do exist.
</p>
<p>

If <span class="docbook_function">stat()</span> cannot determine whether a file exists or not, delivery of
the message is deferred. This can happen when NFS-mounted filesystems are
unavailable.
</p>
<p>
This option is checked after the <span class="docbook_option">domains</span>, <span class="docbook_option">local_parts</span>, and <span class="docbook_option">senders</span>
options, so you cannot use it to check for the existence of a file in which to
look up a domain, local part, or sender. (See section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a> for a
full list of the order in which preconditions are evaluated.) However, as
these options are all expanded, you can use the <span class="docbook_option">exists</span> expansion condition
to make such tests. The <span class="docbook_option">require_files</span> option is intended for checking files
that the router may be going to use internally, or which are needed by a
transport (for example <span class="docbook_filename">.procmailrc</span>).
</p>
<p>
During delivery, the <span class="docbook_function">stat()</span> function is run as root, but there is a
facility for some checking of the accessibility of a file by another user.
This is not a proper permissions check, but just a “rough” check that
operates as follows:
</p>
<p>
If an item in a <span class="docbook_option">require_files</span> list does not contain any forward slash
characters, it is taken to be the user (and optional group, separated by a
comma) to be checked for subsequent files in the list. If no group is specified
but the user is specified symbolically, the gid associated with the uid is
used. For example:
</p>
<div class="docbook_literallayout"><pre>
require_files = mail:/some/file
require_files = $local_part:$home/.procmailrc
</pre></div>
<p>
If a user or group name in a <span class="docbook_option">require_files</span> list does not exist, the
<span class="docbook_option">require_files</span> condition fails.
</p>
<p>
Exim performs the check by scanning along the components of the file path, and
checking the access for the given uid and gid. It checks for “x” access on
directories, and “r” access on the final file. Note that this means that file
access control lists, if the operating system has them, are ignored.
</p>
<p>
<span class="docbook_emphasis">Warning 1</span>: When the router is being run to verify addresses for an
incoming SMTP message, Exim is not running as root, but under its own uid. This
may affect the result of a <span class="docbook_option">require_files</span> check. In particular, <span class="docbook_function">stat()</span>
may yield the error EACCES (“Permission denied”). This means that the Exim
user is not permitted to read one of the directories on the file’s path.
</p>
<p>
<span class="docbook_emphasis">Warning 2</span>: Even when Exim is running as root while delivering a message,
<span class="docbook_function">stat()</span> can yield EACCES for a file in an NFS directory that is mounted
without root access. In this case, if a check for access by a particular user
is requested, Exim creates a subprocess that runs as that user, and tries the
check again in that process.
</p>
<p>
The default action for handling an unresolved EACCES is to consider it to
be caused by a configuration error, and routing is deferred because the
existence or non-existence of the file cannot be determined. However, in some
circumstances it may be desirable to treat this condition as if the file did
not exist. If the file name (or the exclamation mark that precedes the file
name for non-existence) is preceded by a plus sign, the EACCES error is treated
as if the file did not exist. For example:
</p>
<div class="docbook_literallayout"><pre>
require_files = +/some/file
</pre></div>
<p>
If the router is not an essential part of verification (for example, it
handles users’ <span class="docbook_filename">.forward</span> files), another solution is to set the <span class="docbook_option">verify</span>
option false so that the router is skipped when verifying.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">retry_use_local_part</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">see below</span>
</td>
</tr>


</table>
<p>


When a delivery suffers a temporary routing failure, a retry record is created
in Exim’s hints database. For addresses whose routing depends only on the
domain, the key for the retry record should not involve the local part, but for
other addresses, both the domain and the local part should be included.
Usually, remote routing is of the former kind, and local routing is of the
latter kind.
</p>
<p>
This option controls whether the local part is used to form the key for retry
hints for addresses that suffer temporary errors while being handled by this
router. The default value is true for any router that has <span class="docbook_option">check_local_user</span>
set, and false otherwise. Note that this option does not apply to hints keys
for transport delays; they are controlled by a generic transport option of the
same name.
</p>
<p>
The setting of <span class="docbook_option">retry_use_local_part</span> applies only to the router on which it
appears. If the router generates child addresses, they are routed
independently; this setting does not become attached to them.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">router_home_directory</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>



This option sets a home directory for use while the router is running. (Compare
<span class="docbook_option">transport_home_directory</span>, which sets a home directory for later
transporting.) In particular, if used on a <span class="docbook_command">redirect</span> router, this option
sets a value for $home while a filter is running. The value is expanded;
forced expansion failure causes the option to be ignored – other failures
cause the router to defer.
</p>
<p>
Expansion of <span class="docbook_option">router_home_directory</span> happens immediately after the
<span class="docbook_option">check_local_user</span> test (if configured), before any further expansions take
place.
(See section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a> for a list of the order in which preconditions
are evaluated.)
While the router is running, <span class="docbook_option">router_home_directory</span> overrides the value of
$home that came from <span class="docbook_option">check_local_user</span>.
</p>
<p>
When a router accepts an address and assigns it to a local transport (including
the cases when a <span class="docbook_command">redirect</span> router generates a pipe, file, or autoreply
delivery), the home directory setting for the transport is taken from the first
of these values that is set:
</p>
<ul>
<li>
<p>
The <span class="docbook_option">home_directory</span> option on the transport;
</p>
</li>
<li>
<p>
The <span class="docbook_option">transport_home_directory</span> option on the router;
</p>
</li>
<li>
<p>
The password data if <span class="docbook_option">check_local_user</span> is set on the router;
</p>
</li>
<li>
<p>
The <span class="docbook_option">router_home_directory</span> option on the router.
</p>
</li>
</ul>
<p>
In other words, <span class="docbook_option">router_home_directory</span> overrides the password data for the
router, but not for the transport.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">self</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>
</td>
<td>Default: <span class="docbook_emphasis">freeze</span>
</td>
</tr>


</table>
<p>


This option applies to those routers that use a recipient address to find a
list of remote hosts. Currently, these are the <span class="docbook_command">dnslookup</span>, <span class="docbook_command">ipliteral</span>,
and <span class="docbook_command">manualroute</span> routers.
Certain configurations of the <span class="docbook_command">queryprogram</span> router can also specify a list
of remote hosts.
Usually such routers are configured to send the message to a remote host via an
<span class="docbook_command">smtp</span> transport. The <span class="docbook_option">self</span> option specifies what happens when the first
host on the list turns out to be the local host.
The way in which Exim checks for the local host is described in section
<a href="ch13.html#SECTreclocipadd" title="13. Starting the daemon and the use of network interfaces">13.8</a>.
</p>
<p>
Normally this situation indicates either an error in Exim’s configuration (for
example, the router should be configured not to process this domain), or an
error in the DNS (for example, the MX should not point to this host). For this
reason, the default action is to log the incident, defer the address, and
freeze the message. The following alternatives are provided for use in special
cases:
</p>
<dl>

<dt><span class="docbook_option">defer</span></dt>
<dd>
<p>
Delivery of the message is tried again later, but the message is not frozen.
</p>
</dd>

<dt>
<span class="docbook_option">reroute</span>: &lt;<span class="docbook_emphasis">domain</span>&gt;</dt>
<dd>
<p>
The domain is changed to the given domain, and the address is passed back to
be reprocessed by the routers. No rewriting of headers takes place. This
behaviour is essentially a redirection.
</p>
</dd>

<dt>
<span class="docbook_option">reroute: rewrite:</span> &lt;<span class="docbook_emphasis">domain</span>&gt;</dt>
<dd>
<p>
The domain is changed to the given domain, and the address is passed back to be
reprocessed by the routers. Any headers that contain the original domain are
rewritten.
</p>
</dd>

<dt><span class="docbook_option">pass</span></dt>
<dd>
<p>


The router passes the address to the next router, or to the router named in the
<span class="docbook_option">pass_router</span> option if it is set. This overrides <span class="docbook_option">no_more</span>. During
subsequent routing and delivery, the variable $self_hostname contains the
name of the local host that the router encountered. This can be used to
distinguish between different cases for hosts with multiple names. The
combination
</p>
<div class="docbook_literallayout"><pre>
self = pass
no_more
</pre></div>
<p>
ensures that only those addresses that routed to the local host are passed on.
Without <span class="docbook_option">no_more</span>, addresses that were declined for other reasons would also
be passed to the next router.
</p>
</dd>

<dt><span class="docbook_option">fail</span></dt>
<dd>
<p>
Delivery fails and an error report is generated.
</p>
</dd>

<dt><span class="docbook_option">send</span></dt>
<dd>
<p>

The anomaly is ignored and the address is queued for the transport. This
setting should be used with extreme caution. For an <span class="docbook_command">smtp</span> transport, it
makes sense only in cases where the program that is listening on the SMTP port
is not this version of Exim. That is, it must be some other MTA, or Exim with a
different configuration file that handles the domain in another way.
</p>
</dd>
</dl>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">senders</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">address list</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>

If this option is set, the router is skipped unless the message’s sender
address matches something on the list.
See section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a> for a list of the order in which preconditions
are evaluated.
</p>
<p>
There are issues concerning verification when the running of routers is
dependent on the sender. When Exim is verifying the address in an <span class="docbook_option">errors_to</span>
setting, it sets the sender to the null string. When using the <span class="docbook_option">-bt</span> option
to check a configuration file, it is necessary also to use the <span class="docbook_option">-f</span> option to
set an appropriate sender. For incoming mail, the sender is unset when
verifying the sender, but is available when verifying any recipients. If the
SMTP VRFY command is enabled, it must be used after MAIL if the sender address
matters.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">translate_ip_address</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>



There exist some rare networking situations (for example, packet radio) where
it is helpful to be able to translate IP addresses generated by normal routing
mechanisms into other IP addresses, thus performing a kind of manual IP
routing. This should be done only if the normal IP routing of the TCP/IP stack
is inadequate or broken. Because this is an extremely uncommon requirement, the
code to support this option is not included in the Exim binary unless
SUPPORT_TRANSLATE_IP_ADDRESS=yes is set in <span class="docbook_filename">Local/Makefile</span>.
</p>
<p>

The <span class="docbook_option">translate_ip_address</span> string is expanded for every IP address generated
by the router, with the generated address set in $host_address. If the
expansion is forced to fail, no action is taken.
For any other expansion error, delivery of the message is deferred.
If the result of the expansion is an IP address, that replaces the original
address; otherwise the result is assumed to be a host name – this is looked
up using <span class="docbook_function">gethostbyname()</span> (or <span class="docbook_function">getipnodebyname()</span> when available) to
produce one or more replacement IP addresses. For example, to subvert all IP
addresses in some specific networks, this could be added to a router:
</p>
<div class="docbook_literallayout"><pre>
translate_ip_address = \
  ${lookup{${mask:$host_address/26}}lsearch{/some/file}\
    {$value}fail}}
</pre></div>
<p>
The file would contain lines like
</p>
<div class="docbook_literallayout"><pre>
10.2.3.128/26    some.host
10.8.4.34/26     10.44.8.15
</pre></div>
<p>
You should not make use of this facility unless you really understand what you
are doing.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">transport</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>
This option specifies the transport to be used when a router accepts an address
and sets it up for delivery. A transport is never needed if a router is used
only for verification. The value of the option is expanded at routing time,
after the expansion of <span class="docbook_option">errors_to</span>, <span class="docbook_option">headers_add</span>, and <span class="docbook_option">headers_remove</span>,
and result must be the name of one of the configured transports. If it is not,
delivery is deferred.
</p>
<p>
The <span class="docbook_option">transport</span> option is not used by the <span class="docbook_command">redirect</span> router, but it does
have some private options that set up transports for pipe and file deliveries
(see chapter <a href="ch22.html" title="22. The redirect router">22</a>).
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">transport_current_directory</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">unset</span>
</td>
</tr>


</table>
<p>

This option associates a current directory with any address that is routed
to a local transport. This can happen either because a transport is
explicitly configured for the router, or because it generates a delivery to a
file or a pipe. During the delivery process (that is, at transport time), this
option string is expanded and is set as the current directory, unless
overridden by a setting on the transport.
If the expansion fails for any reason, including forced failure, an error is
logged, and delivery is deferred.
See chapter <a href="ch23.html" title="23. Environment for running local transports">23</a> for details of the local delivery
environment.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">transport_home_directory</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">see below</span>
</td>
</tr>


</table>
<p>

This option associates a home directory with any address that is routed to a
local transport. This can happen either because a transport is explicitly
configured for the router, or because it generates a delivery to a file or a
pipe. During the delivery process (that is, at transport time), the option
string is expanded and is set as the home directory, unless overridden by a
setting of <span class="docbook_option">home_directory</span> on the transport.
If the expansion fails for any reason, including forced failure, an error is
logged, and delivery is deferred.
</p>
<p>
If the transport does not specify a home directory, and
<span class="docbook_option">transport_home_directory</span> is not set for the router, the home directory for
the transport is taken from the password data if <span class="docbook_option">check_local_user</span> is set for
the router. Otherwise it is taken from <span class="docbook_option">router_home_directory</span> if that option
is set; if not, no home directory is set for the transport.
</p>
<p>
See chapter <a href="ch23.html" title="23. Environment for running local transports">23</a> for further details of the local delivery
environment.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">unseen</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>

The result of string expansion for this option must be a valid boolean value,
that is, one of the strings “yes”, “no”, “true”, or “false”. Any other
result causes an error, and delivery is deferred. If the expansion is forced to
fail, the default value for the option (false) is used. Other failures cause
delivery to be deferred.
</p>
<p>
When this option is set true, routing does not cease if the router accepts the
address. Instead, a copy of the incoming address is passed to the next router,
overriding a false setting of <span class="docbook_option">more</span>. There is little point in setting
<span class="docbook_option">more</span> false if <span class="docbook_option">unseen</span> is always true, but it may be useful in cases when
the value of <span class="docbook_option">unseen</span> contains expansion items (and therefore, presumably, is
sometimes true and sometimes false).
</p>
<p>

Setting the <span class="docbook_option">unseen</span> option has a similar effect to the <span class="docbook_option">unseen</span> command
qualifier in filter files. It can be used to cause copies of messages to be
delivered to some other destination, while also carrying out a normal delivery.
In effect, the current address is made into a “parent” that has two children
– one that is delivered as specified by this router, and a clone that goes on
to be routed further. For this reason, <span class="docbook_option">unseen</span> may not be combined with the
<span class="docbook_option">one_time</span> option in a <span class="docbook_command">redirect</span> router.
</p>
<p>
<span class="docbook_emphasis">Warning</span>: Header lines added to the address (or specified for removal) by
this router or by previous routers affect the “unseen” copy of the message
only. The clone that continues to be processed by further routers starts with
no added headers and none specified for removal. For a <span class="docbook_option">redirect</span> router, if
a generated address is the same as the incoming address, this can lead to
duplicate addresses with different header modifications. Exim does not do
duplicate deliveries (except, in certain circumstances, to pipes -- see section
<a href="ch22.html#SECTdupaddr" title="22. The redirect router">22.7</a>), but it is undefined which of the duplicates is discarded,
so this ambiguous situation should be avoided. The <span class="docbook_option">repeat_use</span> option of the
<span class="docbook_option">redirect</span> router may be of help.
</p>
<p>
Unlike the handling of header modifications, any data that was set by the
<span class="docbook_option">address_data</span> option in the current or previous routers <span class="docbook_emphasis">is</span> passed on to
subsequent routers.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">user</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>
</td>
<td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span>
</td>
<td>Default: <span class="docbook_emphasis">see below</span>
</td>
</tr>


</table>
<p>





When a router queues an address for a transport, and the transport does not
specify a user, the user given here is used when running the delivery process.
The user may be specified numerically or by name. If expansion fails, the
error is logged and delivery is deferred.
This user is also used by the <span class="docbook_command">redirect</span> router when running a filter file.
The default is unset, except when <span class="docbook_option">check_local_user</span> is set. In this case,
the default is taken from the password information. If the user is specified as
a name, and <span class="docbook_option">group</span> is not set, the group associated with the user is used.
See also <span class="docbook_option">initgroups</span> and <span class="docbook_option">group</span> and the discussion in chapter
<a href="ch23.html" title="23. Environment for running local transports">23</a>.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">verify</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">true</span>
</td>
</tr>


</table>
<p>
Setting this option has the effect of setting <span class="docbook_option">verify_sender</span> and
<span class="docbook_option">verify_recipient</span> to the same value.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">verify_only</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">false</span>
</td>
</tr>


</table>
<p>



If this option is set, the router is used only when verifying an address or
testing with the <span class="docbook_option">-bv</span> option, not when actually doing a delivery, testing
with the <span class="docbook_option">-bt</span> option, or running the SMTP EXPN command. It can be further
restricted to verifying only senders or recipients by means of
<span class="docbook_option">verify_sender</span> and <span class="docbook_option">verify_recipient</span>.
</p>
<p>
<span class="docbook_emphasis">Warning</span>: When the router is being run to verify addresses for an incoming
SMTP message, Exim is not running as root, but under its own uid. If the router
accesses any files, you need to make sure that they are accessible to the Exim
user or group.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">verify_recipient</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">true</span>
</td>
</tr>


</table>
<p>
If this option is false, the router is skipped when verifying recipient
addresses
or testing recipient verification using <span class="docbook_option">-bv</span>.
See section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a> for a list of the order in which preconditions
are evaluated.
</p>
<p>

</p>
<table>






<tr>
<td><span class="docbook_option">verify_sender</span></td>
<td>Use: <span class="docbook_emphasis">routers</span>‡<span class="docbook_emphasis"></span>
</td>
<td>Type: <span class="docbook_emphasis">boolean</span>
</td>
<td>Default: <span class="docbook_emphasis">true</span>
</td>
</tr>


</table>
<p>
If this option is false, the router is skipped when verifying sender addresses
or testing sender verification using <span class="docbook_option">-bvs</span>.
See section <a href="ch03.html#SECTrouprecon" title="3. How Exim receives and delivers mail">3.12</a> for a list of the order in which preconditions
are evaluated.


</p>
</div>
<a class="previous_page" href="ch14.html">&lt;-previous</a><a class="next_page" href="ch16.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>