Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3d4d9cc28af00be9852b4cb3055b122e > files > 153

exim-doc-4.69-4.fc12.noarch.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style xmlns="" type="text/css">
div.added    { background-color: #ffff99; }
div.deleted  { text-decoration: line-through;
               background-color: #FF7F7F; }
div.changed  { background-color: #99ff99; }
div.off      {  }

span.added   { background-color: #ffff99; }
span.deleted { text-decoration: line-through;
               background-color: #FF7F7F; }
span.changed { background-color: #99ff99; }
span.off     {  }



pre.literallayout {
  background-color: #E8E8D0;
  padding-left: 0.5cm;
  padding-top:  5px;
  padding-bottom: 5px;
}

div[class=changed] pre.literallayout {
  background-color: #99ff99;
  padding-left: 0.5cm;
  padding-top:  5px;
  padding-bottom: 5px;
}

div.literallayout {
  background-color: #E8E8D0;
  padding-left: 0.5cm;
  padding-top:  5px;
  padding-bottom: 5px;
}

div[class=changed] div.literallayout {
  background-color: #99ff99;
  padding-left: 0.5cm;
  padding-top:  5px;
  padding-bottom: 5px;
}

</style><title>47. Some common configuration settings</title><meta name="generator" content="DocBook XSL Stylesheets V1.72.0" /><link rel="start" href="index.html" title="Specification of the Exim Mail Transfer Agent" /><link rel="up" href="index.html" title="Specification of the Exim Mail Transfer Agent" /><link rel="prev" href="ch46.html" title="46. Customizing bounce and warning messages" /><link rel="next" href="ch48.html" title="48. Using Exim as a non-queueing client" /></head><body><div class="navheader">
<table width="100%" summary="Navigation header"><tr><td width="20%" align="left"><a accesskey="p" href="ch46.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch48.html">Next</a></td></tr></table></div>
<div class="chapter" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title"><a href="index.html#toc0420" id="CHAPcomconreq">47. Some common configuration settings</a></h2></div>
</div>
</div>
<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>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0421" id="SECID240">47.1 Sending mail to a smart host</a></h3></div>
</div>
</div>
<p>
<a id="id646976" class="indexterm"></a>
If you want to send all mail for non-local domains to a “<span class="quote">smart host</span>”, you
should replace the default <span><strong class="command">dnslookup</strong></span> router with a router which does the
routing explicitly:
</p>
<pre class="literallayout">send_to_smart_host:
  driver = manualroute
  route_list = !+local_domains smart.host.name
  transport = remote_smtp
</pre><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 <span><strong class="option">mua_wrapper</strong></span> option (see chapter
<a href="ch48.html" title="48. Using Exim as a non-queueing client">48</a>).
</p>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0422" id="SECTmailinglists">47.2 Using Exim to handle mailing lists</a></h3></div>
</div>
</div>
<p>
<a id="id647040" class="indexterm"></a>
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 <span><strong class="command">redirect</strong></span> 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 <span><strong class="option">domains</strong></span> router option can be used to run these
lists in a separate domain from normal mail. For example:
</p>
<pre class="literallayout">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><p>
This router is skipped for domains other than <span class="emphasis"><em>lists.example</em></span>. 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 <span><strong class="option">no_more</strong></span> is set, no subsequent
routers are tried, and so the whole delivery fails.
</p>
<p>
The <span><strong class="option">forbid_pipe</strong></span> and <span><strong class="option">forbid_file</strong></span> 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>
<p>
<a id="id647112" class="indexterm"></a>
The <span><strong class="option">errors_to</strong></span> 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
<span class="emphasis"><em>dicts@lists.example</em></span> is passed on to those addresses contained in
<em class="filename">/usr/lists/dicts</em>, with error reports directed to
<span class="emphasis"><em>dicts-request@lists.example</em></span>, provided that this address can be verified.
There could be a file called <em class="filename">/usr/lists/dicts-request</em> containing
the address(es) of this particular list’s manager(s), but other approaches,
such as setting up an earlier router (possibly using the <span><strong class="option">local_part_prefix</strong></span>
or <span><strong class="option">local_part_suffix</strong></span> options) to handle addresses of the form
<span><strong class="option">owner-</strong></span><span class="emphasis"><em>xxx</em></span> or <span><strong class="option">xxx-</strong></span><span class="emphasis"><em>request</em></span>, are also possible.
</p>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0423" id="SECID241">47.3 Syntax errors in mailing lists</a></h3></div>
</div>
</div>
<p>
<a id="id647201" class="indexterm"></a>
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 <span><strong class="option">skip_syntax_errors</strong></span> option is set, the <span><strong class="command">redirect</strong></span> router just skips
entries that fail to parse, noting the incident in the log. If in addition
<span><strong class="option">syntax_errors_to</strong></span> is set to a verifiable address, a message is sent to it
whenever a broken address is skipped. It is usually appropriate to set
<span><strong class="option">syntax_errors_to</strong></span> to the same address as <span><strong class="option">errors_to</strong></span>.
</p>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0424" id="SECID242">47.4 Re-expansion of mailing lists</a></h3></div>
</div>
</div>
<p>
<a id="id647264" class="indexterm"></a>
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 <span><strong class="option">one_time</strong></span> option can be set
on the <span><strong class="command">redirect</strong></span> 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
“<span class="quote">top level</span>” addresses, and the parent address that generated them is marked
“<span class="quote">delivered</span>”. 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
<span><strong class="option">all_parents</strong></span> selector is set, but for mailing lists there is normally only
one level of expansion anyway.
</p>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0425" id="SECID243">47.5 Closed mailing lists</a></h3></div>
</div>
</div>
<p>
<a id="id647333" class="indexterm"></a>
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
<span><strong class="option">senders</strong></span> 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>
<pre class="literallayout">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><p>
All three routers have the same <span><strong class="option">domains</strong></span> setting, so for any other domains,
they are all skipped. The first router runs only if the local part ends in
<span><strong class="option">-request</strong></span>. It handles messages to the list manager(s) by means of an open
mailing list.
</p>
<p>
The second router runs only if the <span><strong class="option">senders</strong></span> 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 <span><strong class="option">senders</strong></span> is *, which matches all senders. This
means that the router runs, but because there is no list, declines, and
<span><strong class="option">no_more</strong></span> ensures that no further routers are run. The address fails with an
“<span class="quote">unrouteable address</span>” 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>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0426" id="SECTverp">47.6 Variable Envelope Return Paths (VERP)</a></h3></div>
</div>
</div>
<p>
<a id="id647432" class="indexterm"></a>
<a id="id647442" class="indexterm"></a>
<a id="id647454" class="indexterm"></a>
Variable Envelope Return Paths – see <span class="bold"><strong><a href="http://cr.yp.to/proto/verp.txt" target="_top">http://cr.yp.to/proto/verp.txt</a></strong></span> –
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>
<p>
<a id="id647485" class="indexterm"></a>
<a id="id647497" class="indexterm"></a>
Envelope sender addresses can be modified by Exim using two different
facilities: the <span><strong class="option">errors_to</strong></span> option on a router (as shown in previous mailing
list examples), or the <span><strong class="option">return_path</strong></span> 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 <span><strong class="option">return_path</strong></span> in chapter <a href="ch24.html" title="24. Generic options for transports">24</a>). Here is an example
of the use of <span><strong class="option">return_path</strong></span> to implement VERP on an <span><strong class="command">smtp</strong></span> transport:
</p>
<pre class="literallayout">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><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
“<span class="quote">-request</span>”, and the domain is <span class="emphasis"><em>your.dom.example</em></span>. 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
<span class="emphasis"><em>somelist-request@your.dom.example</em></span> is sent to
<span class="emphasis"><em>subscriber@other.dom.example</em></span>. In the transport, the return path is
rewritten as
</p>
<pre class="literallayout">somelist-request+subscriber=other.dom.example@your.dom.example
</pre><p>
<a id="id647590" class="indexterm"></a>
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 <span><strong class="option">max_rcpt</strong></span> to 1. Without this, a single copy of a message
might be sent to several different recipients in the same domain, in which case
<em class="varname">$local_part</em> 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 <span><strong class="option">transport</strong></span> option in the router:
</p>
<pre class="literallayout">dnslookup:
  driver = dnslookup
  domains = ! +local_domains
  transport = \
    ${if match {$return_path}{^(.+?)-request@your.dom.example\$}\
      {verp_smtp}{remote_smtp}}
  no_more
</pre><p>
If you want to change the return path using <span><strong class="option">errors_to</strong></span> in a router instead
of using <span><strong class="option">return_path</strong></span> in the transport, you need to set <span><strong class="option">errors_to</strong></span> 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
<span><strong class="command">dnslookup</strong></span> 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 <span><strong class="command">dnslookup</strong></span> router that implements VERP:
</p>
<pre class="literallayout">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><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 <span><strong class="option">local_part_suffix</strong></span> 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>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0427" id="SECTvirtualdomains">47.7 Virtual domains</a></h3></div>
</div>
</div>
<p>
<a id="id647726" class="indexterm"></a>
<a id="id647737" class="indexterm"></a>
The phrase <span class="emphasis"><em>virtual domain</em></span> is unfortunately used with two rather different
meanings:
</p>
<div class="itemizedlist">
<ul type="disc"><li><p>
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 “<span class="quote">vanity</span>” domains.
</p>
</li><li><p>
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.
</p>
</li></ul></div>
<p>
The first usage is probably more common, and does seem more “<span class="quote">virtual</span>” 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 <span><strong class="command">dsearch</strong></span> lookup type is useful here, leading
to a router of this form:
</p>
<pre class="literallayout">virtual:
  driver = redirect
  domains = dsearch;/etc/mail/virtual
  data = ${lookup{$local_part}lsearch{/etc/mail/virtual/$domain}}
  no_more
</pre><p>
The <span><strong class="option">domains</strong></span> option specifies that the router is to be skipped, unless there
is a file in the <em class="filename">/etc/mail/virtual</em> 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 <span><strong class="option">no_more</strong></span>
setting ensures that if the lookup fails (leading to <span><strong class="option">data</strong></span> 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 “<span class="quote">virtual</span>” 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>
<pre class="literallayout">my_domains:
  driver = accept
  domains = dsearch;/etc/mail/domains
  local_parts = lsearch;/etc/mail/domains/$domain
  transport = my_mailboxes
</pre><p>
The address is accepted if there is a file for the domain, and the local part
can be found in the file. The <span><strong class="option">domains</strong></span> option is used to check for the
file’s existence because <span><strong class="option">domains</strong></span> is tested before the <span><strong class="option">local_parts</strong></span>
option (see section <a href="ch03.html#SECTrouprecon" title="3.12 Router preconditions">3.12</a>). You cannot use <span><strong class="option">require_files</strong></span>,
because that option is tested after <span><strong class="option">local_parts</strong></span>. The transport is as
follows:
</p>
<pre class="literallayout">my_mailboxes:
  driver = appendfile
  file = /var/mail/$domain/$local_part
  user = mail
</pre><p>
This uses a directory of mailboxes for each domain. The <span><strong class="option">user</strong></span> 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>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0428" id="SECTmulbox">47.8 Multiple user mailboxes</a></h3></div>
</div>
</div>
<p>
<a id="id647939" class="indexterm"></a>
<a id="id647950" class="indexterm"></a>
<a id="id647964" class="indexterm"></a>
<a id="id647978" class="indexterm"></a>
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
<span><strong class="option">local_part_prefix</strong></span> and <span><strong class="option">local_part_suffix</strong></span> can be used for this. For
example, consider this router:
</p>
<pre class="literallayout">userforward:
  driver = redirect
  check_local_user
  file = $home/.forward
  local_part_suffix = -*
  local_part_suffix_optional
  allow_filter
</pre><p>
<a id="id648021" class="indexterm"></a>
It runs a user’s <em class="filename">.forward</em> file for all local parts of the form
<span class="emphasis"><em>username-*</em></span>. Within the filter file the user can distinguish different
cases by testing the variable <em class="varname">$local_part_suffix</em>. For example:
</p>
<pre class="literallayout">if $local_part_suffix contains -special then
save /home/$local_part/Mail/special
endif
</pre><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
<span><strong class="option">local_part_suffix</strong></span> 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
<em class="filename">.forward</em> file – which is the way a similar facility is implemented in
another MTA:
</p>
<pre class="literallayout">userforward:
  driver = redirect
  check_local_user
  file = $home/.forward$local_part_suffix
  local_part_suffix = -*
  local_part_suffix_optional
  allow_filter
</pre><p>
If there is no suffix, <em class="filename">.forward</em> is used; if the suffix is <span class="emphasis"><em>-special</em></span>, for
example, <em class="filename">.forward-special</em> 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
<em class="filename">.forward</em> file to use as a default.
</p>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0429" id="SECID244">47.9 Simplified vacation processing</a></h3></div>
</div>
</div>
<p>
<a id="id648135" class="indexterm"></a>
The traditional way of running the <span class="emphasis"><em>vacation</em></span> program is for a user to set up
a pipe command in a <em class="filename">.forward</em> file
(see section <a href="ch22.html#SECTspecitredli" title="22.6 Special items in redirection lists">22.6</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>
<div class="itemizedlist">
<ul type="disc"><li><p>
A local part prefix such as “<span class="quote">vacation-</span>” can be specified on a router which
can cause the message to be delivered directly to the <span class="emphasis"><em>vacation</em></span> program, or
alternatively can use Exim’s <span><strong class="command">autoreply</strong></span> transport. The contents of a user’s
<em class="filename">.forward</em> file are then much simpler. For example:
</p>
<pre class="literallayout">spqr, vacation-spqr
</pre></li><li><p>
The <span><strong class="option">require_files</strong></span> 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 <span><strong class="option">unseen</strong></span> 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, <em class="filename">.vacation</em>, containing a vacation
message.
</p>
</li></ul></div>
<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>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0430" id="SECID245">47.10 Taking copies of mail</a></h3></div>
</div>
</div>
<p>
<a id="id648253" class="indexterm"></a>
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, <span class="emphasis"><em>inter alia</em></span>, to implement automatic
notification of delivery by sites that insist on doing such things.
</p>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0431" id="SECID246">47.11 Intermittently connected hosts</a></h3></div>
</div>
</div>
<p>
<a id="id648292" class="indexterm"></a>
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>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0432" id="SECID247">47.12 Exim on the upstream server host</a></h3></div>
</div>
</div>
<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, “<span class="quote">mailstore</span>”, 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>
<pre class="literallayout">cheshire.wonderland.fict.example    *   F,5d,24h
</pre><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 <span><strong class="option">-M</strong></span> or <span><strong class="option">-R</strong></span>
options, or by using the ETRN SMTP command (see section <a href="ch45.html#SECTETRN" title="45.8 The ETRN command">45.8</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 <span><strong class="option">retry_include_ip_address</strong></span> on the <span><strong class="command">smtp</strong></span> transport.
Since this has disadvantages for permanently connected hosts, it is best to
arrange a separate transport for the intermittently connected ones.
</p>
</div>
<div class="section" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 xmlns="" class="title"><a xmlns="http://www.w3.org/1999/xhtml" href="index.html#toc0433" id="SECID248">47.13 Exim on the intermittently connected client host</a></h3></div>
</div>
</div>
<p>
The value of <span><strong class="option">smtp_accept_queue_per_connection</strong></span> 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>
<p>
<a id="id648425" class="indexterm"></a>
<a id="id648440" class="indexterm"></a>
<a id="id648454" class="indexterm"></a>
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
<span><strong class="option">-qq</strong></span> instead of <span><strong class="option">-q</strong></span>. 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>
</div>
</div>
<div class="navfooter">
<table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch46.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch48.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div>
</body></html>