Sophie

Sophie

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

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: 47. Some common configuration settings</title>

<meta name="description" content="Specification of the Exim Mail Transfer Agent: 47. Some common configuration settings">
<meta name="keywords" content="Specification of the Exim Mail Transfer Agent: 47. Some common configuration settings">
<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="Some-common-configuration-settings"></a>
<a name="SEC420"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="spec_46.html#SEC419" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC421" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="spec_46.html#SEC417" 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_48.html#SEC434" 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"> 47. Some common configuration settings </h1>

<p>This chapter discusses some configuration settings that seem to be fairly
common. More examples and discussion can be found in the Exim book.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC421">47.1 Sending mail to a smart host</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC422">47.2 Using Exim to handle mailing lists</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC423">47.3 Syntax errors in mailing lists</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC424">47.4 Re-expansion of mailing lists</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC425">47.5 Closed mailing lists</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC426">47.6 Variable Envelope Return Paths (VERP)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC427">47.7 Virtual domains</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC428">47.8 Multiple user mailboxes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC429">47.9 Simplified vacation processing</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC430">47.10 Taking copies of mail</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC431">47.11 Intermittently connected hosts</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC432">47.12 Exim on the upstream server host</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC433">47.13 Exim on the intermittently connected client host</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Sending-mail-to-a-smart-host"></a>
<a name="SEC421"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC420" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC422" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.1 Sending mail to a smart host </h2>

<p>If you want to send all mail for non-local domains to a &quot;smart host&quot;, you
should replace the default <code>dnslookup</code> router with a router which does the
routing explicitly:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">send_to_smart_host:
  driver = manualroute
  route_list = !+local_domains smart.host.name
  transport = remote_smtp
</pre></td></tr></table>

<p>You can use the smart host's IP address instead of the name if you wish.
If you are using Exim only to submit messages to a smart host, and not for
receiving incoming messages, you can arrange for it to do the submission
synchronously by setting the <code>mua_wrapper</code> option (see chapter
<a href="spec_48.html#SEC434">Using Exim as a non-queueing client</a>).
</p>
<hr size="6">
<a name="Using-Exim-to-handle-mailing-lists"></a>
<a name="SEC422"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC421" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC423" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.2 Using Exim to handle mailing lists </h2>

<p>Exim can be used to run simple mailing lists, but for large and/or complicated
requirements, the use of additional specialized mailing list software such as
Majordomo or Mailman is recommended.
</p>
<p>The <code>redirect</code> router can be used to handle mailing lists where each list
is maintained in a separate file, which can therefore be managed by an
independent manager. The <code>domains</code> router option can be used to run these
lists in a separate domain from normal mail. For example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">lists:
  driver = redirect
  domains = lists.example
  file = /usr/lists/$local_part
  forbid_pipe
  forbid_file
  errors_to = $local_part-request@lists.example
  no_more
</pre></td></tr></table>

<p>This router is skipped for domains other than <em>lists.example</em>. For addresses
in that domain, it looks for a file that matches the local part. If there is no
such file, the router declines, but because <code>no_more</code> is set, no subsequent
routers are tried, and so the whole delivery fails.
</p>
<p>The <code>forbid_pipe</code> and <code>forbid_file</code> options prevent a local part from being
expanded into a file name or a pipe delivery, which is usually inappropriate in
a mailing list.
</p>
<a name="IDX2736"></a>
<p>The <code>errors_to</code> option specifies that any delivery errors caused by addresses
taken from a mailing list are to be sent to the given address rather than the
original sender of the message. However, before acting on this, Exim verifies
the error address, and ignores it if verification fails.
</p>
<p>For example, using the configuration above, mail sent to
<em>dicts@lists.example</em> is passed on to those addresses contained in
&lsquo;<tt>/usr/lists/dicts</tt>&rsquo;, with error reports directed to
<em>dicts-request@lists.example</em>, provided that this address can be verified.
There could be a file called &lsquo;<tt>/usr/lists/dicts-request</tt>&rsquo; containing
the address(es) of this particular list's manager(s), but other approaches,
such as setting up an earlier router (possibly using the <code>local_part_prefix</code>
or <code>local_part_suffix</code> options) to handle addresses of the form
<code>owner-</code><em>xxx</em> or <code>xxx-</code><em>request</em>, are also possible.
</p>
<hr size="6">
<a name="Syntax-errors-in-mailing-lists"></a>
<a name="SEC423"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC422" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC424" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.3 Syntax errors in mailing lists </h2>

<p>If an entry in redirection data contains a syntax error, Exim normally defers
delivery of the original address. That means that a syntax error in a mailing
list holds up all deliveries to the list. This may not be appropriate when a
list is being maintained automatically from data supplied by users, and the
addresses are not rigorously checked.
</p>
<p>If the <code>skip_syntax_errors</code> option is set, the <code>redirect</code> router just skips
entries that fail to parse, noting the incident in the log. If in addition
<code>syntax_errors_to</code> is set to a verifiable address, a message is sent to it
whenever a broken address is skipped. It is usually appropriate to set
<code>syntax_errors_to</code> to the same address as <code>errors_to</code>.
</p>
<hr size="6">
<a name="Re_002dexpansion-of-mailing-lists"></a>
<a name="SEC424"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC423" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC425" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.4 Re-expansion of mailing lists </h2>

<p>Exim remembers every individual address to which a message has been delivered,
in order to avoid duplication, but it normally stores only the original
recipient addresses with a message. If all the deliveries to a mailing list
cannot be done at the first attempt, the mailing list is re-expanded when the
delivery is next tried. This means that alterations to the list are taken into
account at each delivery attempt, so addresses that have been added to
the list since the message arrived will therefore receive a copy of the
message, even though it pre-dates their subscription.
</p>
<p>If this behaviour is felt to be undesirable, the <code>one_time</code> option can be set
on the <code>redirect</code> router. If this is done, any addresses generated by the
router that fail to deliver at the first attempt are added to the message as
&quot;top level&quot; addresses, and the parent address that generated them is marked
&quot;delivered&quot;. Thus, expansion of the mailing list does not happen again at the
subsequent delivery attempts. The disadvantage of this is that if any of the
failing addresses are incorrect, correcting them in the file has no effect on
pre-existing messages.
</p>
<p>The original top-level address is remembered with each of the generated
addresses, and is output in any log messages. However, any intermediate parent
addresses are not recorded. This makes a difference to the log only if the
<code>all_parents</code> selector is set, but for mailing lists there is normally only
one level of expansion anyway.
</p>
<hr size="6">
<a name="Closed-mailing-lists"></a>
<a name="SEC425"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC424" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC426" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.5 Closed mailing lists </h2>

<p>The examples so far have assumed open mailing lists, to which anybody may
send mail. It is also possible to set up closed lists, where mail is accepted
from specified senders only. This is done by making use of the generic
<code>senders</code> option to restrict the router that handles the list.
</p>
<p>The following example uses the same file as a list of recipients and as a list
of permitted senders. It requires three routers:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">lists_request:
  driver = redirect
  domains = lists.example
  local_part_suffix = -request
  file = /usr/lists/$local_part$local_part_suffix
  no_more

lists_post:
  driver = redirect
  domains = lists.example
  senders = ${if exists {/usr/lists/$local_part}\
             {lsearch;/usr/lists/$local_part}{*}}
  file = /usr/lists/$local_part
  forbid_pipe
  forbid_file
  errors_to = $local_part-request@lists.example
  no_more

lists_closed:
  driver = redirect
  domains = lists.example
  allow_fail
  data = :fail: $local_part@lists.example is a closed mailing list
</pre></td></tr></table>

<p>All three routers have the same <code>domains</code> setting, so for any other domains,
they are all skipped. The first router runs only if the local part ends in
<code>-request</code>. It handles messages to the list manager(s) by means of an open
mailing list.
</p>
<p>The second router runs only if the <code>senders</code> precondition is satisfied. It
checks for the existence of a list that corresponds to the local part, and then
checks that the sender is on the list by means of a linear search. It is
necessary to check for the existence of the file before trying to search it,
because otherwise Exim thinks there is a configuration error. If the file does
not exist, the expansion of <code>senders</code> is *, which matches all senders. This
means that the router runs, but because there is no list, declines, and
<code>no_more</code> ensures that no further routers are run. The address fails with an
&quot;unrouteable address&quot; error.
</p>
<p>The third router runs only if the second router is skipped, which happens when
a mailing list exists, but the sender is not on it. This router forcibly fails
the address, giving a suitable error message.
</p>
<hr size="6">
<a name="Variable-Envelope-Return-Paths-_005bVERP_005d"></a>
<a name="SEC426"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC425" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC427" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.6 Variable Envelope Return Paths (VERP) </h2>

<p>Variable Envelope Return Paths - see <strong><a href="http://cr.yp.to/proto/verp.txt">http://cr.yp.to/proto/verp.txt</a></strong> -
are a way of helping mailing list administrators discover which subscription
address is the cause of a particular delivery failure. The idea is to encode
the original recipient address in the outgoing envelope sender address, so that
if the message is forwarded by another host and then subsequently bounces, the
original recipient can be extracted from the recipient address of the bounce.
</p>
<a name="IDX2737"></a>
<a name="IDX2738"></a>
<p>Envelope sender addresses can be modified by Exim using two different
facilities: the <code>errors_to</code> option on a router (as shown in previous mailing
list examples), or the <code>return_path</code> option on a transport. The second of
these is effective only if the message is successfully delivered to another
host; it is not used for errors detected on the local host (see the description
of <code>return_path</code> in chapter <a href="spec_24.html#SEC220">Generic options for transports</a>). Here is an example
of the use of <code>return_path</code> to implement VERP on an <code>smtp</code> transport:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">verp_smtp:
  driver = smtp
  max_rcpt = 1
  return_path = \
    ${if match {$return_path}{^(.+?)-request@your.dom.example\$}\
      {$1-request+$local_part=$domain@your.dom.example}fail}
</pre></td></tr></table>

<p>This has the effect of rewriting the return path (envelope sender) on outgoing
SMTP messages, if the local part of the original return path ends in
&quot;-request&quot;, and the domain is <em>your.dom.example</em>. The rewriting inserts the
local part and domain of the recipient into the return path. Suppose, for
example, that a message whose return path has been set to
<em>somelist-request@your.dom.example</em> is sent to
<em>subscriber@other.dom.example</em>. In the transport, the return path is
rewritten as
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">somelist-request+subscriber=other.dom.example@your.dom.example
</pre></td></tr></table>

<a name="IDX2739"></a>
<p>For this to work, you must tell Exim to send multiple copies of messages that
have more than one recipient, so that each copy has just one recipient. This is
achieved by setting <code>max_rcpt</code> to 1. Without this, a single copy of a message
might be sent to several different recipients in the same domain, in which case
<code>$local_part</code> is not available in the transport, because it is not unique.
</p>
<p>Unless your host is doing nothing but mailing list deliveries, you should
probably use a separate transport for the VERP deliveries, so as not to use
extra resources in making one-per-recipient copies for other deliveries. This
can easily be done by expanding the <code>transport</code> option in the router:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">dnslookup:
  driver = dnslookup
  domains = ! +local_domains
  transport = \
    ${if match {$return_path}{^(.+?)-request@your.dom.example\$}\
      {verp_smtp}{remote_smtp}}
  no_more
</pre></td></tr></table>

<p>If you want to change the return path using <code>errors_to</code> in a router instead
of using <code>return_path</code> in the transport, you need to set <code>errors_to</code> on all
routers that handle mailing list addresses. This will ensure that all delivery
errors, including those detected on the local host, are sent to the VERP
address.
</p>
<p>On a host that does no local deliveries and has no manual routing, only the
<code>dnslookup</code> router needs to be changed. A special transport is not needed for
SMTP deliveries. Every mailing list recipient has its own return path value,
and so Exim must hand them to the transport one at a time. Here is an example
of a <code>dnslookup</code> router that implements VERP:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">verp_dnslookup:
  driver = dnslookup
  domains = ! +local_domains
  transport = remote_smtp
  errors_to = \
    ${if match {$return_path}{^(.+?)-request@your.dom.example\$}}
     {$1-request+$local_part=$domain@your.dom.example}fail}
  no_more
</pre></td></tr></table>

<p>Before you start sending out messages with VERPed return paths, you must also
configure Exim to accept the bounce messages that come back to those paths.
Typically this is done by setting a <code>local_part_suffix</code> option for a
router, and using this to route the messages to wherever you want to handle
them.
</p>
<p>The overhead incurred in using VERP depends very much on the size of the
message, the number of recipient addresses that resolve to the same remote
host, and the speed of the connection over which the message is being sent. If
a lot of addresses resolve to the same host and the connection is slow, sending
a separate copy of the message for each address may take substantially longer
than sending a single copy with many recipients (for which VERP cannot be
used).
</p>
<hr size="6">
<a name="Virtual-domains"></a>
<a name="SEC427"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC426" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC428" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.7 Virtual domains </h2>

<p>The phrase <em>virtual domain</em> is unfortunately used with two rather different
meanings:
</p>
<ul class="toc">
<li>
A domain for which there are no real mailboxes; all valid local parts are
aliases for other email addresses. Common examples are organizational
top-level domains and &quot;vanity&quot; domains.

</li><li>
One of a number of independent domains that are all handled by the same host,
with mailboxes on that host, but where the mailbox owners do not necessarily
have login accounts on that host.
</li></ul>

<p>The first usage is probably more common, and does seem more &quot;virtual&quot; than
the second. This kind of domain can be handled in Exim with a straightforward
aliasing router. One approach is to create a separate alias file for each
virtual domain. Exim can test for the existence of the alias file to determine
whether the domain exists. The <code>dsearch</code> lookup type is useful here, leading
to a router of this form:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">virtual:
  driver = redirect
  domains = dsearch;/etc/mail/virtual
  data = ${lookup{$local_part}lsearch{/etc/mail/virtual/$domain}}
  no_more
</pre></td></tr></table>

<p>The <code>domains</code> option specifies that the router is to be skipped, unless there
is a file in the &lsquo;<tt>/etc/mail/virtual</tt>&rsquo; directory whose name is the same as the
domain that is being processed. When the router runs, it looks up the local
part in the file to find a new address (or list of addresses). The <code>no_more</code>
setting ensures that if the lookup fails (leading to <code>data</code> being an empty
string), Exim gives up on the address without trying any subsequent routers.
</p>
<p>This one router can handle all the virtual domains because the alias file names
follow a fixed pattern. Permissions can be arranged so that appropriate people
can edit the different alias files. A successful aliasing operation results in
a new envelope recipient address, which is then routed from scratch.
</p>
<p>The other kind of &quot;virtual&quot; domain can also be handled in a straightforward
way. One approach is to create a file for each domain containing a list of
valid local parts, and use it in a router like this:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">my_domains:
  driver = accept
  domains = dsearch;/etc/mail/domains
  local_parts = lsearch;/etc/mail/domains/$domain
  transport = my_mailboxes
</pre></td></tr></table>

<p>The address is accepted if there is a file for the domain, and the local part
can be found in the file. The <code>domains</code> option is used to check for the
file's existence because <code>domains</code> is tested before the <code>local_parts</code>
option (see section <a href="spec_3.html#SEC25">Router preconditions</a>). You cannot use <code>require_files</code>,
because that option is tested after <code>local_parts</code>. The transport is as
follows:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">my_mailboxes:
  driver = appendfile
  file = /var/mail/$domain/$local_part
  user = mail
</pre></td></tr></table>

<p>This uses a directory of mailboxes for each domain. The <code>user</code> setting is
required, to specify which uid is to be used for writing to the mailboxes.
</p>
<p>The configuration shown here is just one example of how you might support this
requirement. There are many other ways this kind of configuration can be set
up, for example, by using a database instead of separate files to hold all the
information about the domains.
</p>
<hr size="6">
<a name="Multiple-user-mailboxes"></a>
<a name="SEC428"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC427" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC429" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.8 Multiple user mailboxes </h2>

<p>Heavy email users often want to operate with multiple mailboxes, into which
incoming mail is automatically sorted. A popular way of handling this is to
allow users to use multiple sender addresses, so that replies can easily be
identified. Users are permitted to add prefixes or suffixes to their local
parts for this purpose. The wildcard facility of the generic router options
<code>local_part_prefix</code> and <code>local_part_suffix</code> can be used for this. For
example, consider this router:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">userforward:
  driver = redirect
  check_local_user
  file = $home/.forward
  local_part_suffix = -*
  local_part_suffix_optional
  allow_filter
</pre></td></tr></table>

<a name="IDX2740"></a>
<p>It runs a user's &lsquo;<tt>.forward</tt>&rsquo; file for all local parts of the form
<em>username-*</em>. Within the filter file the user can distinguish different
cases by testing the variable <code>$local_part_suffix</code>. For example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">if $local_part_suffix contains -special then
save /home/$local_part/Mail/special
endif
</pre></td></tr></table>

<p>If the filter file does not exist, or does not deal with such addresses, they
fall through to subsequent routers, and, assuming no subsequent use of the
<code>local_part_suffix</code> option is made, they presumably fail. Thus, users have
control over which suffixes are valid.
</p>
<p>Alternatively, a suffix can be used to trigger the use of a different
&lsquo;<tt>.forward</tt>&rsquo; file - which is the way a similar facility is implemented in
another MTA:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">userforward:
  driver = redirect
  check_local_user
  file = $home/.forward$local_part_suffix
  local_part_suffix = -*
  local_part_suffix_optional
  allow_filter
</pre></td></tr></table>

<p>If there is no suffix, &lsquo;<tt>.forward</tt>&rsquo; is used; if the suffix is <em>-special</em>, for
example, &lsquo;<tt>.forward-special</tt>&rsquo; is used. Once again, if the appropriate file
does not exist, or does not deal with the address, it is passed on to
subsequent routers, which could, if required, look for an unqualified
&lsquo;<tt>.forward</tt>&rsquo; file to use as a default.
</p>
<hr size="6">
<a name="Simplified-vacation-processing"></a>
<a name="SEC429"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC428" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC430" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.9 Simplified vacation processing </h2>

<p>The traditional way of running the <em>vacation</em> program is for a user to set up
a pipe command in a &lsquo;<tt>.forward</tt>&rsquo; file
(see section <a href="spec_22.html#SEC210">Special items in redirection lists</a> for syntax details).
This is prone to error by inexperienced users. There are two features of Exim
that can be used to make this process simpler for users:
</p>
<ul class="toc">
<li>
A local part prefix such as &quot;vacation-&quot; can be specified on a router which
can cause the message to be delivered directly to the <em>vacation</em> program, or
alternatively can use Exim's <code>autoreply</code> transport. The contents of a user's
&lsquo;<tt>.forward</tt>&rsquo; file are then much simpler. For example:

<table><tr><td>&nbsp;</td><td><pre class="example">spqr, vacation-spqr
</pre></td></tr></table>

</li><li>
The <code>require_files</code> generic router option can be used to trigger a
vacation delivery by checking for the existence of a certain file in the
user's home directory. The <code>unseen</code> generic option should also be used, to
ensure that the original delivery also proceeds. In this case, all the user has
to do is to create a file called, say, &lsquo;<tt>.vacation</tt>&rsquo;, containing a vacation
message.
</li></ul>

<p>Another advantage of both these methods is that they both work even when the
use of arbitrary pipes by users is locked out.
</p>
<hr size="6">
<a name="Taking-copies-of-mail"></a>
<a name="SEC430"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC429" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC431" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.10 Taking copies of mail </h2>

<p>Some installations have policies that require archive copies of all messages to
be made. A single copy of each message can easily be taken by an appropriate
command in a system filter, which could, for example, use a different file for
each day's messages.
</p>
<p>There is also a shadow transport mechanism that can be used to take copies of
messages that are successfully delivered by local transports, one copy per
delivery. This could be used, <em>inter alia</em>, to implement automatic
notification of delivery by sites that insist on doing such things.
</p>
<hr size="6">
<a name="Intermittently-connected-hosts"></a>
<a name="SEC431"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC430" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC432" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.11 Intermittently connected hosts </h2>

<p>It has become quite common (because it is cheaper) for hosts to connect to the
Internet periodically rather than remain connected all the time. The normal
arrangement is that mail for such hosts accumulates on a system that is
permanently connected.
</p>
<p>Exim was designed for use on permanently connected hosts, and so it is not
particularly well-suited to use in an intermittently connected environment.
Nevertheless there are some features that can be used.
</p>
<hr size="6">
<a name="Exim-on-the-upstream-server-host"></a>
<a name="SEC432"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC431" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC433" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.12 Exim on the upstream server host </h2>

<p>It is tempting to arrange for incoming mail for the intermittently connected
host to remain on Exim's queue until the client connects. However, this
approach does not scale very well. Two different kinds of waiting message are
being mixed up in the same queue - those that cannot be delivered because of
some temporary problem, and those that are waiting for their destination host
to connect. This makes it hard to manage the queue, as well as wasting
resources, because each queue runner scans the entire queue.
</p>
<p>A better approach is to separate off those messages that are waiting for an
intermittently connected host. This can be done by delivering these messages
into local files in batch SMTP, &quot;mailstore&quot;, or other envelope-preserving
format, from where they are transmitted by other software when their
destination connects. This makes it easy to collect all the mail for one host
in a single directory, and to apply local timeout rules on a per-message basis
if required.
</p>
<p>On a very small scale, leaving the mail on Exim's queue can be made to work. If
you are doing this, you should configure Exim with a long retry period for the
intermittent host. For example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">cheshire.wonderland.fict.example    *   F,5d,24h
</pre></td></tr></table>

<p>This stops a lot of failed delivery attempts from occurring, but Exim remembers
which messages it has queued up for that host. Once the intermittent host comes
online, forcing delivery of one message (either by using the <code>-M</code> or <code>-R</code>
options, or by using the ETRN SMTP command (see section <a href="spec_45.html#SEC413">The ETRN command</a>)
causes all the queued up messages to be delivered, often down a single SMTP
connection. While the host remains connected, any new messages get delivered
immediately.
</p>
<p>If the connecting hosts do not have fixed IP addresses, that is, if a host is
issued with a different IP address each time it connects, Exim's retry
mechanisms on the holding host get confused, because the IP address is normally
used as part of the key string for holding retry information. This can be
avoided by unsetting <code>retry_include_ip_address</code> on the <code>smtp</code> transport.
Since this has disadvantages for permanently connected hosts, it is best to
arrange a separate transport for the intermittently connected ones.
</p>
<hr size="6">
<a name="Exim-on-the-intermittently-connected-client-host"></a>
<a name="SEC433"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC432" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC420" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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"> 47.13 Exim on the intermittently connected client host </h2>

<p>The value of <code>smtp_accept_queue_per_connection</code> should probably be
increased, or even set to zero (that is, disabled) on the intermittently
connected host, so that all incoming messages down a single connection get
delivered immediately.
</p>
<a name="IDX2741"></a>
<a name="IDX2742"></a>
<a name="IDX2743"></a>
<p>Mail waiting to be sent from an intermittently connected host will probably
not have been routed, because without a connection DNS lookups are not
possible. This means that if a normal queue run is done at connection time,
each message is likely to be sent in a separate SMTP session. This can be
avoided by starting the queue run with a command line option beginning with
<code>-qq</code> instead of <code>-q</code>. In this case, the queue is scanned twice. In the
first pass, routing is done but no deliveries take place. The second pass is a
normal queue run; since all the messages have been previously routed, those
destined for the same host are likely to get sent as multiple deliveries in a
single SMTP connection.
</p>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC420" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="spec_48.html#SEC434" 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>