<!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: 22. The redirect router</title> <meta name="description" content="Specification of the Exim Mail Transfer Agent: 22. The redirect router"> <meta name="keywords" content="Specification of the Exim Mail Transfer Agent: 22. The redirect router"> <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="The-redirect-router"></a> <a name="SEC204"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="spec_21.html#SEC203" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC205" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="spec_21.html#SEC203" title="Beginning of this chapter or previous chapter"> << </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_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22. The redirect router </h1> <p>The <code>redirect</code> router handles several kinds of address redirection. Its most common uses are for resolving local part aliases from a central alias file (usually called ‘<tt>/etc/aliases</tt>’) and for handling users' personal ‘<tt>.forward</tt>’ files, but it has many other potential uses. The incoming address can be redirected in several different ways: </p> <ul class="toc"> <li> It can be replaced by one or more new addresses which are themselves routed independently. </li><li> It can be routed to be delivered to a given file or directory. </li><li> It can be routed to be delivered to a specified pipe command. </li><li> It can cause an automatic reply to be generated. </li><li> It can be forced to fail, optionally with a custom error message. </li><li> It can be temporarily deferred, optionally with a custom message. </li><li> It can be discarded. </li></ul> <p>The generic <code>transport</code> option must not be set for <code>redirect</code> routers. However, there are some private options which define transports for delivery to files and pipes, and for generating autoreplies. See the <code>file_transport</code>, <code>pipe_transport</code> and <code>reply_transport</code> descriptions below. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top"><a href="#SEC205">22.1 Redirection data</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC206">22.2 Forward files and address verification</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC207">22.3 Interpreting redirection data</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC208">22.4 Items in a non-filter redirection list</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC209">22.5 Redirecting to a local mailbox</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC210">22.6 Special items in redirection lists</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC211">22.7 Duplicate addresses</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC212">22.8 Repeated redirection expansion</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC213">22.9 Errors in redirection lists</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC214">22.10 Private options for the redirect router</a></td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr size="6"> <a name="Redirection-data"></a> <a name="SEC205"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC204" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC206" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC204" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22.1 Redirection data </h2> <p>The router operates by interpreting a text string which it obtains either by expanding the contents of the <code>data</code> option, or by reading the entire contents of a file whose name is given in the <code>file</code> option. These two options are mutually exclusive. The first is commonly used for handling system aliases, in a configuration like this: </p> <table><tr><td> </td><td><pre class="example">system_aliases: driver = redirect data = ${lookup{$local_part}lsearch{/etc/aliases}} </pre></td></tr></table> <p>If the lookup fails, the expanded string in this example is empty. When the expansion of <code>data</code> results in an empty string, the router declines. A forced expansion failure also causes the router to decline; other expansion failures cause delivery to be deferred. </p> <p>A configuration using <code>file</code> is commonly used for handling users' ‘<tt>.forward</tt>’ files, like this: </p> <table><tr><td> </td><td><pre class="example">userforward: driver = redirect check_local_user file = $home/.forward no_verify </pre></td></tr></table> <p>If the file does not exist, or causes no action to be taken (for example, it is empty or consists only of comments), the router declines. <strong>Warning</strong>: This is not the case when the file contains syntactically valid items that happen to yield empty addresses, for example, items containing only RFC 2822 address comments. </p> <hr size="6"> <a name="Forward-files-and-address-verification"></a> <a name="SEC206"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC205" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC207" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC204" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22.2 Forward files and address verification </h2> <p>It is usual to set <code>no_verify</code> on <code>redirect</code> routers which handle users' ‘<tt>.forward</tt>’ files, as in the example above. There are two reasons for this: </p> <ul class="toc"> <li> When Exim is receiving an incoming SMTP message from a remote host, it is running under the Exim uid, not as root. Exim is unable to change uid to read the file as the user, and it may not be able to read it as the Exim user. So in practice the router may not be able to operate. </li><li> However, even when the router can operate, the existence of a ‘<tt>.forward</tt>’ file is unimportant when verifying an address. What should be checked is whether the local part is a valid user name or not. Cutting out the redirection processing saves some resources. </li></ul> <hr size="6"> <a name="Interpreting-redirection-data"></a> <a name="SEC207"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC206" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC208" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC204" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22.3 Interpreting redirection data </h2> <p>The contents of the data string, whether obtained from <code>data</code> or <code>file</code>, can be interpreted in two different ways: </p> <ul class="toc"> <li> If the <code>allow_filter</code> option is set true, and the data begins with the text "#Exim filter" or "#Sieve filter", it is interpreted as a list of <em>filtering</em> instructions in the form of an Exim or Sieve filter file, respectively. Details of the syntax and semantics of filter files are described in a separate document entitled <em>Exim's interfaces to mail filtering</em>; this document is intended for use by end users. </li><li> Otherwise, the data must be a comma-separated list of redirection items, as described in the next section. </li></ul> <p>When a message is redirected to a file (a "mail folder"), the file name given in a non-filter redirection list must always be an absolute path. A filter may generate a relative path - how this is handled depends on the transport's configuration. See section <a href="spec_26.html#SEC223">The file and directory options</a> for a discussion of this issue for the <code>appendfile</code> transport. </p> <hr size="6"> <a name="Items-in-a-non_002dfilter-redirection-list"></a> <a name="SEC208"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC207" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC209" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC204" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22.4 Items in a non-filter redirection list </h2> <p>When the redirection data is not an Exim or Sieve filter, for example, if it comes from a conventional alias or forward file, it consists of a list of addresses, file names, pipe commands, or certain special items (see section <a href="#SEC210">Special items in redirection lists</a> below). The special items can be individually enabled or disabled by means of options whose names begin with <code>allow_</code> or <code>forbid_</code>, depending on their default values. The items in the list are separated by commas or newlines. If a comma is required in an item, the entire item must be enclosed in double quotes. </p> <p>Lines starting with a # character are comments, and are ignored, and # may also appear following a comma, in which case everything between the # and the next newline character is ignored. </p> <p>If an item is entirely enclosed in double quotes, these are removed. Otherwise double quotes are retained because some forms of mail address require their use (but never to enclose the entire address). In the following description, "item" refers to what remains after any surrounding double quotes have been removed. </p> <a name="IDX1852"></a> <p><strong>Warning</strong>: If you use an Exim expansion to construct a redirection address, and the expansion contains a reference to <code>$local_part</code>, you should make use of the <code>quote_local_part</code> expansion operator, in case the local part contains special characters. For example, to redirect all mail for the domain <em>obsolete.example</em>, retaining the existing local part, you could use this setting: </p> <table><tr><td> </td><td><pre class="example">data = ${quote_local_part:$local_part}@newdomain.example </pre></td></tr></table> <hr size="6"> <a name="Redirecting-to-a-local-mailbox"></a> <a name="SEC209"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC208" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC210" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC204" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22.5 Redirecting to a local mailbox </h2> <p>A redirection item may safely be the same as the address currently under consideration. This does not cause a routing loop, because a router is automatically skipped if any ancestor of the address that is being processed is the same as the current address and was processed by the current router. Such an address is therefore passed to the following routers, so it is handled as if there were no redirection. When making this loop-avoidance test, the complete local part, including any prefix or suffix, is used. </p> <a name="IDX1853"></a> <p>Specifying the same local part without a domain is a common usage in personal filter files when the user wants to have messages delivered to the local mailbox and also forwarded elsewhere. For example, the user whose login is <em>cleo</em> might have a ‘<tt>.forward</tt>’ file containing this: </p> <table><tr><td> </td><td><pre class="example">cleo, cleopatra@egypt.example </pre></td></tr></table> <a name="IDX1854"></a> <a name="IDX1855"></a> <p>For compatibility with other MTAs, such unqualified local parts may be preceded by "\", but this is not a requirement for loop prevention. However, it does make a difference if more than one domain is being handled synonymously. </p> <p>If an item begins with "\" and the rest of the item parses as a valid RFC 2822 address that does not include a domain, the item is qualified using the domain of the incoming address. In the absence of a leading "\", unqualified addresses are qualified using the value in <code>qualify_recipient</code>, but you can force the incoming domain to be used by setting <code>qualify_preserve_domain</code>. </p> <p>Care must be taken if there are alias names for local users. Consider an MTA handling a single local domain where the system alias file contains: </p> <table><tr><td> </td><td><pre class="example">Sam.Reman: spqr </pre></td></tr></table> <p>Now suppose that Sam (whose login id is <em>spqr</em>) wants to save copies of messages in the local mailbox, and also forward copies elsewhere. He creates this forward file: </p> <table><tr><td> </td><td><pre class="example">Sam.Reman, spqr@reme.elsewhere.example </pre></td></tr></table> <p>With these settings, an incoming message addressed to <em>Sam.Reman</em> fails. The <code>redirect</code> router for system aliases does not process <em>Sam.Reman</em> the second time round, because it has previously routed it, and the following routers presumably cannot handle the alias. The forward file should really contain </p> <table><tr><td> </td><td><pre class="example">spqr, spqr@reme.elsewhere.example </pre></td></tr></table> <p>but because this is such a common error, the <code>check_ancestor</code> option (see below) exists to provide a way to get round it. This is normally set on a <code>redirect</code> router that is handling users' ‘<tt>.forward</tt>’ files. </p> <hr size="6"> <a name="Special-items-in-redirection-lists"></a> <a name="SEC210"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC209" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC211" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC204" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22.6 Special items in redirection lists </h2> <p>In addition to addresses, the following types of item may appear in redirection lists (that is, in non-filter redirection data): </p> <ul class="toc"> <li> <a name="IDX1856"></a> <a name="IDX1857"></a> An item is treated as a pipe command if it begins with "|" and does not parse as a valid RFC 2822 address that includes a domain. A transport for running the command must be specified by the <code>pipe_transport</code> option. Normally, either the router or the transport specifies a user and a group under which to run the delivery. The default is to use the Exim user and group. <p>Single or double quotes can be used for enclosing the individual arguments of the pipe command; no interpretation of escapes is done for single quotes. If the command contains a comma character, it is necessary to put the whole item in double quotes, for example: </p> <table><tr><td> </td><td><pre class="example">"|/some/command ready,steady,go" </pre></td></tr></table> <p>since items in redirection lists are terminated by commas. Do not, however, quote just the command. An item such as </p> <table><tr><td> </td><td><pre class="example">|"/some/command ready,steady,go" </pre></td></tr></table> <p>is interpreted as a pipe with a rather strange command name, and no arguments. </p> </li><li> <a name="IDX1858"></a> <a name="IDX1859"></a> An item is interpreted as a path name if it begins with "/" and does not parse as a valid RFC 2822 address that includes a domain. For example, <table><tr><td> </td><td><pre class="example">/home/world/minbari </pre></td></tr></table> <p>is treated as a file name, but </p> <table><tr><td> </td><td><pre class="example">/s=molari/o=babylon/@x400gate.way </pre></td></tr></table> <p>is treated as an address. For a file name, a transport must be specified using the <code>file_transport</code> option. However, if the generated path name ends with a forward slash character, it is interpreted as a directory name rather than a file name, and <code>directory_transport</code> is used instead. </p> <p>Normally, either the router or the transport specifies a user and a group under which to run the delivery. The default is to use the Exim user and group. </p> <a name="IDX1860"></a> <p>However, if a redirection item is the path ‘<tt>/dev/null</tt>’, delivery to it is bypassed at a high level, and the log entry shows "**bypassed**" instead of a transport name. In this case the user and group are not used. </p> </li><li> <a name="IDX1861"></a> <a name="IDX1862"></a> If an item is of the form <table><tr><td> </td><td><pre class="example">:include:<path name> </pre></td></tr></table> <p>a list of further items is taken from the given file and included at that point. <strong>Note</strong>: Such a file can not be a filter file; it is just an out-of-line addition to the list. The items in the included list are separated by commas or newlines and are not subject to expansion. If this is the first item in an alias list in an <code>lsearch</code> file, a colon must be used to terminate the alias name. This example is incorrect: </p> <table><tr><td> </td><td><pre class="example">list1 :include:/opt/lists/list1 </pre></td></tr></table> <p>It must be given as </p> <table><tr><td> </td><td><pre class="example">list1: :include:/opt/lists/list1 </pre></td></tr></table> </li><li> <a name="IDX1863"></a> Sometimes you want to throw away mail to a particular local part. Making the <code>data</code> option expand to an empty string does not work, because that causes the router to decline. Instead, the alias item <a name="IDX1864"></a> <a name="IDX1865"></a> <em>:blackhole:</em> can be used. It does what its name implies. No delivery is done, and no error message is generated. This has the same effect as specifing ‘<tt>/dev/null</tt>’ as a destination, but it can be independently disabled. <p><strong>Warning</strong>: If <em>:blackhole:</em> appears anywhere in a redirection list, no delivery is done for the original local part, even if other redirection items are present. If you are generating a multi-item list (for example, by reading a database) and need the ability to provide a no-op item, you must use ‘<tt>/dev/null</tt>’. </p> </li><li> <a name="IDX1866"></a> <a name="IDX1867"></a> <a name="IDX1868"></a> <a name="IDX1869"></a> <a name="IDX1870"></a> An attempt to deliver a particular address can be deferred or forced to fail by redirection items of the form <table><tr><td> </td><td><pre class="example">:defer: :fail: </pre></td></tr></table> <p>respectively. When a redirection list contains such an item, it applies to the entire redirection; any other items in the list are ignored (<em>:blackhole:</em> is different). Any text following <em>:fail:</em> or <em>:defer:</em> is placed in the error text associated with the failure. For example, an alias file might contain: </p> <table><tr><td> </td><td><pre class="example">X.Employee: :fail: Gone away, no forwarding address </pre></td></tr></table> <p>In the case of an address that is being verified from an ACL or as the subject of a <a name="IDX1871"></a> VRFY command, the text is included in the SMTP error response by default. <a name="IDX1872"></a> The text is not included in the response to an EXPN command. In non-SMTP cases the text is included in the error message that Exim generates. </p> <a name="IDX1873"></a> <p>By default, Exim sends a 451 SMTP code for a <em>:defer:</em>, and 550 for <em>:fail:</em>. However, if the message starts with three digits followed by a space, optionally followed by an extended code of the form <em>n.n.n</em>, also followed by a space, and the very first digit is the same as the default error code, the code from the message is used instead. If the very first digit is incorrect, a panic error is logged, and the default code is used. You can suppress the use of the supplied code in a redirect router by setting the <code>forbid_smtp_code</code> option true. In this case, any SMTP code is quietly ignored. </p> <a name="IDX1874"></a> <p>In an ACL, an explicitly provided message overrides the default, but the default message is available in the variable <code>$acl_verify_message</code> and can therefore be included in a custom message if this is desired. </p> <p>Normally the error text is the rest of the redirection list - a comma does not terminate it - but a newline does act as a terminator. Newlines are not normally present in alias expansions. In <code>lsearch</code> lookups they are removed as part of the continuation process, but they may exist in other kinds of lookup and in <em>:include:</em> files. </p> <p>During routing for message delivery (as opposed to verification), a redirection containing <em>:fail:</em> causes an immediate failure of the incoming address, whereas <em>:defer:</em> causes the message to remain on the queue so that a subsequent delivery attempt can happen at a later time. If an address is deferred for too long, it will ultimately fail, because the normal retry rules still apply. </p> </li><li> <a name="IDX1875"></a> Sometimes it is useful to use a single-key search type with a default (see chapter <a href="spec_9.html#SEC89">File and database lookups</a>) to look up aliases. However, there may be a need for exceptions to the default. These can be handled by aliasing them to <em>:unknown:</em>. This differs from <em>:fail:</em> in that it causes the <code>redirect</code> router to decline, whereas <em>:fail:</em> forces routing to fail. A lookup which results in an empty redirection list has the same effect. </li></ul> <hr size="6"> <a name="Duplicate-addresses-_003c1_003e"></a> <a name="SEC211"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC210" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC212" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC204" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22.7 Duplicate addresses </h2> <p>Exim removes duplicate addresses from the list to which it is delivering, so as to deliver just one copy to each address. This does not apply to deliveries routed to pipes by different immediate parent addresses, but an indirect aliasing scheme of the type </p> <table><tr><td> </td><td><pre class="example">pipe: |/some/command $local_part localpart1: pipe localpart2: pipe </pre></td></tr></table> <p>does not work with a message that is addressed to both local parts, because when the second is aliased to the intermediate local part "pipe" it gets discarded as being the same as a previously handled address. However, a scheme such as </p> <table><tr><td> </td><td><pre class="example">localpart1: |/some/command $local_part localpart2: |/some/command $local_part </pre></td></tr></table> <p>does result in two different pipe deliveries, because the immediate parents of the pipes are distinct. </p> <hr size="6"> <a name="Repeated-redirection-expansion"></a> <a name="SEC212"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC211" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC213" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC204" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22.8 Repeated redirection expansion </h2> <p>When a message cannot be delivered to all of its recipients immediately, leading to two or more delivery attempts, redirection expansion is carried out afresh each time for those addresses whose children were not all previously delivered. If redirection is being used as a mailing list, this can lead to new members of the list receiving copies of old messages. The <code>one_time</code> option can be used to avoid this. </p> <hr size="6"> <a name="Errors-in-redirection-lists"></a> <a name="SEC213"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC212" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC214" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC204" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22.9 Errors in redirection lists </h2> <p>If <code>skip_syntax_errors</code> is set, a malformed address that causes a parsing error is skipped, and an entry is written to the main log. This may be useful for mailing lists that are automatically managed. Otherwise, if an error is detected while generating the list of new addresses, the original address is deferred. See also <code>syntax_errors_to</code>. </p> <hr size="6"> <a name="Private-options-for-the-redirect-router"></a> <a name="SEC214"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC213" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC204" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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"> 22.10 Private options for the redirect router </h2> <p>The private options for the <code>redirect</code> router are as follows: </p> <a name="IDX1876"></a> <table> <tr><td> <p><code>allow_defer</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>Setting this option allows the use of <em>:defer:</em> in non-filter redirection data, or the <code>defer</code> command in an Exim filter file. </p> <a name="IDX1877"></a> <table> <tr><td> <p><code>allow_fail</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1878"></a> <p>If this option is true, the <em>:fail:</em> item can be used in a redirection list, and the <code>fail</code> command may be used in an Exim filter file. </p> <a name="IDX1879"></a> <table> <tr><td> <p><code>allow_filter</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1880"></a> <a name="IDX1881"></a> <p>Setting this option allows Exim to interpret redirection data that starts with "#Exim filter" or "#Sieve filter" as a set of filtering instructions. There are some features of Exim filter files that some administrators may wish to lock out; see the <code>forbid_filter_</code><em>xxx</em> options below. </p> <p>It is also possible to lock out Exim filters or Sieve filters while allowing the other type; see <code>forbid_exim_filter</code> and <code>forbid_sieve_filter</code>. </p> <p>The filter is run using the uid and gid set by the generic <code>user</code> and <code>group</code> options. These take their defaults from the password data if <code>check_local_user</code> is set, so in the normal case of users' personal filter files, the filter is run as the relevant user. When <code>allow_filter</code> is set true, Exim insists that either <code>check_local_user</code> or <code>user</code> is set. </p> <a name="IDX1882"></a> <table> <tr><td> <p><code>allow_freeze</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1883"></a> <p>Setting this option allows the use of the <code>freeze</code> command in an Exim filter. This command is more normally encountered in system filters, and is disabled by default for redirection filters because it isn't something you usually want to let ordinary users do. </p> <a name="IDX1884"></a> <table> <tr><td> <p><code>check_ancestor</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>This option is concerned with handling generated addresses that are the same as some address in the list of redirection ancestors of the current address. Although it is turned off by default in the code, it is set in the default configuration file for handling users' ‘<tt>.forward</tt>’ files. It is recommended for this use of the <code>redirect</code> router. </p> <p>When <code>check_ancestor</code> is set, if a generated address (including the domain) is the same as any ancestor of the current address, it is replaced by a copy of the current address. This helps in the case where local part A is aliased to B, and B has a ‘<tt>.forward</tt>’ file pointing back to A. For example, within a single domain, the local part "Joe.Bloggs" is aliased to "jb" and ‘<tt>jb/.forward</tt>’ contains: </p> <table><tr><td> </td><td><pre class="example">\Joe.Bloggs, <other item(s)> </pre></td></tr></table> <p>Without the <code>check_ancestor</code> setting, either local part ("jb" or "joe.bloggs") gets processed once by each router and so ends up as it was originally. If "jb" is the real mailbox name, mail to "jb" gets delivered (having been turned into "joe.bloggs" by the ‘<tt>.forward</tt>’ file and back to "jb" by the alias), but mail to "joe.bloggs" fails. Setting <code>check_ancestor</code> on the <code>redirect</code> router that handles the ‘<tt>.forward</tt>’ file prevents it from turning "jb" back into "joe.bloggs" when that was the original address. See also the <code>repeat_use</code> option below. </p> <a name="IDX1885"></a> <table> <tr><td> <p><code>check_group</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>see below</em> </p></td></tr> </table> <p>When the <code>file</code> option is used, the group owner of the file is checked only when this option is set. The permitted groups are those listed in the <code>owngroups</code> option, together with the user's default group if <code>check_local_user</code> is set. If the file has the wrong group, routing is deferred. The default setting for this option is true if <code>check_local_user</code> is set and the <code>modemask</code> option permits the group write bit, or if the <code>owngroups</code> option is set. Otherwise it is false, and no group check occurs. </p> <a name="IDX1886"></a> <table> <tr><td> <p><code>check_owner</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>see below</em> </p></td></tr> </table> <p>When the <code>file</code> option is used, the owner of the file is checked only when this option is set. If <code>check_local_user</code> is set, the local user is permitted; otherwise the owner must be one of those listed in the <code>owners</code> option. The default value for this option is true if <code>check_local_user</code> or <code>owners</code> is set. Otherwise the default is false, and no owner check occurs. </p> <a name="IDX1887"></a> <table> <tr><td> <p><code>data</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <p>This option is mutually exclusive with <code>file</code>. One or other of them must be set, but not both. The contents of <code>data</code> are expanded, and then used as the list of forwarding items, or as a set of filtering instructions. If the expansion is forced to fail, or the result is an empty string or a string that has no effect (consists entirely of comments), the router declines. </p> <p>When filtering instructions are used, the string must begin with "#Exim filter", and all comments in the string, including this initial one, must be terminated with newline characters. For example: </p> <table><tr><td> </td><td><pre class="example">data = #Exim filter\n\ if $h_to: contains Exim then save $home/mail/exim endif </pre></td></tr></table> <p>If you are reading the data from a database where newlines cannot be included, you can use the <code>${sg}</code> expansion item to turn the escape string of your choice into a newline. </p> <a name="IDX1888"></a> <table> <tr><td> <p><code>directory_transport</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <p>A <code>redirect</code> router sets up a direct delivery to a directory when a path name ending with a slash is specified as a new "address". The transport used is specified by this option, which, after expansion, must be the name of a configured transport. This should normally be an <code>appendfile</code> transport. </p> <a name="IDX1889"></a> <table> <tr><td> <p><code>file</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <p>This option specifies the name of a file that contains the redirection data. It is mutually exclusive with the <code>data</code> option. The string is expanded before use; if the expansion is forced to fail, the router declines. Other expansion failures cause delivery to be deferred. The result of a successful expansion must be an absolute path. The entire file is read and used as the redirection data. If the data is an empty string or a string that has no effect (consists entirely of comments), the router declines. </p> <a name="IDX1890"></a> <p>If the attempt to open the file fails with a "does not exist" error, Exim runs a check on the containing directory, unless <code>ignore_enotdir</code> is true (see below). If the directory does not appear to exist, delivery is deferred. This can happen when users' ‘<tt>.forward</tt>’ files are in NFS-mounted directories, and there is a mount problem. If the containing directory does exist, but the file does not, the router declines. </p> <a name="IDX1891"></a> <table> <tr><td> <p><code>file_transport</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <a name="IDX1892"></a> <p>A <code>redirect</code> router sets up a direct delivery to a file when a path name not ending in a slash is specified as a new "address". The transport used is specified by this option, which, after expansion, must be the name of a configured transport. This should normally be an <code>appendfile</code> transport. When it is running, the file name is in <code>$address_file</code>. </p> <a name="IDX1893"></a> <table> <tr><td> <p><code>filter_prepend_home</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>true</em> </p></td></tr> </table> <p>When this option is true, if a <code>save</code> command in an Exim filter specifies a relative path, and <code>$home</code> is defined, it is automatically prepended to the relative path. If this option is set false, this action does not happen. The relative path is then passed to the transport unmodified. </p> <a name="IDX1894"></a> <table> <tr><td> <p><code>forbid_blackhole</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is true, the <em>:blackhole:</em> item may not appear in a redirection list. </p> <a name="IDX1895"></a> <table> <tr><td> <p><code>forbid_exim_filter</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is set true, only Sieve filters are permitted when <code>allow_filter</code> is true. </p> <a name="IDX1896"></a> <table> <tr><td> <p><code>forbid_file</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1897"></a> <a name="IDX1898"></a> <a name="IDX1899"></a> <p>If this option is true, this router may not generate a new address that specifies delivery to a local file or directory, either from a filter or from a conventional forward file. This option is forced to be true if <code>one_time</code> is set. It applies to Sieve filters as well as to Exim filters, but if true, it locks out the Sieve's "keep" facility. </p> <a name="IDX1900"></a> <table> <tr><td> <p><code>forbid_filter_dlfunc</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1901"></a> <p>If this option is true, string expansions in Exim filters are not allowed to make use of the <code>dlfunc</code> expansion facility to run dynamically loaded functions. </p> <a name="IDX1902"></a> <table> <tr><td> <p><code>forbid_filter_existstest</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1903"></a> <p>If this option is true, string expansions in Exim filters are not allowed to make use of the <code>exists</code> condition or the <code>stat</code> expansion item. </p> <a name="IDX1904"></a> <table> <tr><td> <p><code>forbid_filter_logwrite</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is true, use of the logging facility in Exim filters is not permitted. Logging is in any case available only if the filter is being run under some unprivileged uid (which is normally the case for ordinary users' ‘<tt>.forward</tt>’ files). </p> <a name="IDX1905"></a> <table> <tr><td> <p><code>forbid_filter_lookup</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is true, string expansions in Exim filter files are not allowed to make use of <code>lookup</code> items. </p> <a name="IDX1906"></a> <table> <tr><td> <p><code>forbid_filter_perl</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>This option has an effect only if Exim is built with embedded Perl support. If it is true, string expansions in Exim filter files are not allowed to make use of the embedded Perl support. </p> <a name="IDX1907"></a> <table> <tr><td> <p><code>forbid_filter_readfile</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is true, string expansions in Exim filter files are not allowed to make use of <code>readfile</code> items. </p> <a name="IDX1908"></a> <table> <tr><td> <p><code>forbid_filter_readsocket</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is true, string expansions in Exim filter files are not allowed to make use of <code>readsocket</code> items. </p> <a name="IDX1909"></a> <table> <tr><td> <p><code>forbid_filter_reply</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is true, this router may not generate an automatic reply message. Automatic replies can be generated only from Exim or Sieve filter files, not from traditional forward files. This option is forced to be true if <code>one_time</code> is set. </p> <a name="IDX1910"></a> <table> <tr><td> <p><code>forbid_filter_run</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is true, string expansions in Exim filter files are not allowed to make use of <code>run</code> items. </p> <a name="IDX1911"></a> <table> <tr><td> <p><code>forbid_include</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is true, items of the form </p> <table><tr><td> </td><td><pre class="example">:include:<path name> </pre></td></tr></table> <p>are not permitted in non-filter redirection lists. </p> <a name="IDX1912"></a> <table> <tr><td> <p><code>forbid_pipe</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1913"></a> <p>If this option is true, this router may not generate a new address which specifies delivery to a pipe, either from an Exim filter or from a conventional forward file. This option is forced to be true if <code>one_time</code> is set. </p> <a name="IDX1914"></a> <table> <tr><td> <p><code>forbid_sieve_filter</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is set true, only Exim filters are permitted when <code>allow_filter</code> is true. </p> <a name="IDX1915"></a> <a name="IDX1916"></a> <table> <tr><td> <p><code>forbid_smtp_code</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <p>If this option is set true, any SMTP error codes that are present at the start of messages specified for ‘<samp>:defer:</samp>’ or ‘<samp>:fail:</samp>’ are quietly ignored, and the default codes (451 and 550, respectively) are always used. </p> <a name="IDX1917"></a> <table> <tr><td> <p><code>hide_child_in_errmsg</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1918"></a> <p>If this option is true, it prevents Exim from quoting a child address if it generates a bounce or delay message for it. Instead it says "an address generated from <<em>the top level address</em>>". Of course, this applies only to bounces generated locally. If a message is forwarded to another host, <em>its</em> bounce may well quote the generated address. </p> <a name="IDX1919"></a> <table> <tr><td> <p><code>ignore_eacces</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1920"></a> <p>If this option is set and an attempt to open a redirection file yields the EACCES error (permission denied), the <code>redirect</code> router behaves as if the file did not exist. </p> <a name="IDX1921"></a> <table> <tr><td> <p><code>ignore_enotdir</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1922"></a> <p>If this option is set and an attempt to open a redirection file yields the ENOTDIR error (something on the path is not a directory), the <code>redirect</code> router behaves as if the file did not exist. </p> <p>Setting <code>ignore_enotdir</code> has another effect as well: When a <code>redirect</code> router that has the <code>file</code> option set discovers that the file does not exist (the ENOENT error), it tries to <code>stat()</code> the parent directory, as a check against unmounted NFS directories. If the parent can not be statted, delivery is deferred. However, it seems wrong to do this check when <code>ignore_enotdir</code> is set, because that option tells Exim to ignore "something on the path is not a directory" (the ENOTDIR error). This is a confusing area, because it seems that some operating systems give ENOENT where others give ENOTDIR. </p> <a name="IDX1923"></a> <table> <tr><td> <p><code>include_directory</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <p>If this option is set, the path names of any <em>:include:</em> items in a redirection list must start with this directory. </p> <a name="IDX1924"></a> <table> <tr><td> <p><code>modemask</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>octal integer</em></p></td><td><p> Default: <em>022</em> </p></td></tr> </table> <p>This specifies mode bits which must not be set for a file specified by the <code>file</code> option. If any of the forbidden bits are set, delivery is deferred. </p> <a name="IDX1925"></a> <table> <tr><td> <p><code>one_time</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1926"></a> <a name="IDX1927"></a> <a name="IDX1928"></a> <a name="IDX1929"></a> <a name="IDX1930"></a> <p>Sometimes the fact that Exim re-evaluates aliases and reprocesses redirection files each time it tries to deliver a message causes a problem when one or more of the generated addresses fails be delivered at the first attempt. The problem is not one of duplicate delivery - Exim is clever enough to handle that - but of what happens when the redirection list changes during the time that the message is on Exim's queue. This is particularly true in the case of mailing lists, where new subscribers might receive copies of messages that were posted before they subscribed. </p> <p>If <code>one_time</code> is set and any addresses generated by the router fail to deliver at the first attempt, the failing addresses are added to the message as "top level" addresses, and the parent address that generated them is marked "delivered". Thus, redirection does not happen again at the next delivery attempt. </p> <p><strong>Warning 1</strong>: Any header line addition or removal that is specified by this router would be lost if delivery did not succeed at the first attempt. For this reason, the <code>headers_add</code> and <code>headers_remove</code> generic options are not permitted when <code>one_time</code> is set. </p> <p><strong>Warning 2</strong>: To ensure that the router generates only addresses (as opposed to pipe or file deliveries or auto-replies) <code>forbid_file</code>, <code>forbid_pipe</code>, and <code>forbid_filter_reply</code> are forced to be true when <code>one_time</code> is set. </p> <p><strong>Warning 3</strong>: The <code>unseen</code> generic router option may not be set with <code>one_time</code>. </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 <code>all_parents</code> log selector is set. It is expected that <code>one_time</code> will typically be used for mailing lists, where there is normally just one level of expansion. </p> <a name="IDX1931"></a> <table> <tr><td> <p><code>owners</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string list</em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <a name="IDX1932"></a> <a name="IDX1933"></a> <a name="IDX1934"></a> <a name="IDX1935"></a> <p>This specifies a list of permitted owners for the file specified by <code>file</code>. This list is in addition to the local user when <code>check_local_user</code> is set. See <code>check_owner</code> above. </p> <a name="IDX1936"></a> <table> <tr><td> <p><code>owngroups</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string list</em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <p>This specifies a list of permitted groups for the file specified by <code>file</code>. The list is in addition to the local user's primary group when <code>check_local_user</code> is set. See <code>check_group</code> above. </p> <a name="IDX1937"></a> <table> <tr><td> <p><code>pipe_transport</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <a name="IDX1938"></a> <p>A <code>redirect</code> router sets up a direct delivery to a pipe when a string starting with a vertical bar character is specified as a new "address". The transport used is specified by this option, which, after expansion, must be the name of a configured transport. This should normally be a <code>pipe</code> transport. When the transport is run, the pipe command is in <code>$address_pipe</code>. </p> <a name="IDX1939"></a> <table> <tr><td> <p><code>qualify_domain</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <a name="IDX1940"></a> <p>If this option is set, and an unqualified address (one without a domain) is generated, and that address would normally be qualified by the global setting in <code>qualify_recipient</code>, it is instead qualified with the domain specified by expanding this string. If the expansion fails, the router declines. If you want to revert to the default, you can have the expansion generate <code>$qualify_recipient</code>. </p> <p>This option applies to all unqualified addresses generated by Exim filters, but for traditional ‘<tt>.forward</tt>’ files, it applies only to addresses that are not preceded by a backslash. Sieve filters cannot generate unqualified addresses. </p> <a name="IDX1941"></a> <table> <tr><td> <p><code>qualify_preserve_domain</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1942"></a> <a name="IDX1943"></a> <a name="IDX1944"></a> <p>If this option is set, the router's local <code>qualify_domain</code> option must not be set (a configuration error occurs if it is). If an unqualified address (one without a domain) is generated, it is qualified with the domain of the parent address (the immediately preceding ancestor) instead of the global <code>qualify_recipient</code> value. In the case of a traditional ‘<tt>.forward</tt>’ file, this applies whether or not the address is preceded by a backslash. </p> <a name="IDX1945"></a> <table> <tr><td> <p><code>repeat_use</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>true</em> </p></td></tr> </table> <p>If this option is set false, the router is skipped for a child address that has any ancestor that was routed by this router. This test happens before any of the other preconditions are tested. Exim's default anti-looping rules skip only when the ancestor is the same as the current address. See also <code>check_ancestor</code> above and the generic <code>redirect_router</code> option. </p> <a name="IDX1946"></a> <table> <tr><td> <p><code>reply_transport</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <p>A <code>redirect</code> router sets up an automatic reply when a <code>mail</code> or <code>vacation</code> command is used in a filter file. The transport used is specified by this option, which, after expansion, must be the name of a configured transport. This should normally be an <code>autoreply</code> transport. Other transports are unlikely to do anything sensible or useful. </p> <a name="IDX1947"></a> <table> <tr><td> <p><code>rewrite</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>true</em> </p></td></tr> </table> <a name="IDX1948"></a> <p>If this option is set false, addresses generated by the router are not subject to address rewriting. Otherwise, they are treated like new addresses and are rewritten according to the global rewriting rules. </p> <a name="IDX1949"></a> <table> <tr><td> <p><code>sieve_subaddress</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <p>The value of this option is passed to a Sieve filter to specify the :subaddress part of an address. </p> <a name="IDX1950"></a> <table> <tr><td> <p><code>sieve_useraddress</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <p>The value of this option is passed to a Sieve filter to specify the :user part of an address. However, if it is unset, the entire original local part (including any prefix or suffix) is used for :user. </p> <a name="IDX1951"></a> <table> <tr><td> <p><code>sieve_vacation_directory</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <a name="IDX1952"></a> <p>To enable the "vacation" extension for Sieve filters, you must set <code>sieve_vacation_directory</code> to the directory where vacation databases are held (do not put anything else in that directory), and ensure that the <code>reply_transport</code> option refers to an <code>autoreply</code> transport. Each user needs their own directory; Exim will create it if necessary. </p> <a name="IDX1953"></a> <table> <tr><td> <p><code>skip_syntax_errors</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>boolean</em></p></td><td><p> Default: <em>false</em> </p></td></tr> </table> <a name="IDX1954"></a> <a name="IDX1955"></a> <a name="IDX1956"></a> <a name="IDX1957"></a> <a name="IDX1958"></a> <a name="IDX1959"></a> <a name="IDX1960"></a> <p>If <code>skip_syntax_errors</code> is set, syntactically malformed addresses in non-filter redirection data are skipped, and each failing address is logged. If <code>syntax_errors_to</code> is set, a message is sent to the address it defines, giving details of the failures. If <code>syntax_errors_text</code> is set, its contents are expanded and placed at the head of the error message generated by <code>syntax_errors_to</code>. Usually it is appropriate to set <code>syntax_errors_to</code> to be the same address as the generic <code>errors_to</code> option. The <code>skip_syntax_errors</code> option is often used when handling mailing lists. </p> <p>If all the addresses in a redirection list are skipped because of syntax errors, the router declines to handle the original address, and it is passed to the following routers. </p> <p>If <code>skip_syntax_errors</code> is set when an Exim filter is interpreted, any syntax error in the filter causes filtering to be abandoned without any action being taken. The incident is logged, and the router declines to handle the address, so it is passed to the following routers. </p> <a name="IDX1961"></a> <p>Syntax errors in a Sieve filter file cause the "keep" action to occur. This action is specified by RFC 3028. The values of <code>skip_syntax_errors</code>, <code>syntax_errors_to</code>, and <code>syntax_errors_text</code> are not used. </p> <p><code>skip_syntax_errors</code> can be used to specify that errors in users' forward lists or filter files should not prevent delivery. The <code>syntax_errors_to</code> option, used with an address that does not get redirected, can be used to notify users of these errors, by means of a router like this: </p> <table><tr><td> </td><td><pre class="example">userforward: driver = redirect allow_filter check_local_user file = $home/.forward file_transport = address_file pipe_transport = address_pipe reply_transport = address_reply no_verify skip_syntax_errors syntax_errors_to = real-$local_part@$domain syntax_errors_text = \ This is an automatically generated message. An error has\n\ been found in your .forward file. Details of the error are\n\ reported below. While this error persists, you will receive\n\ a copy of this message for every message that is addressed\n\ to you. If your .forward file is a filter file, or if it is\n\ a non-filter file containing no valid forwarding addresses,\n\ a copy of each incoming message will be put in your normal\n\ mailbox. If a non-filter file contains at least one valid\n\ forwarding address, forwarding to the valid addresses will\n\ happen, and those will be the only deliveries that occur. </pre></td></tr></table> <p>You also need a router to ensure that local addresses that are prefixed by ‘<samp>real-</samp>’ are recognized, but not forwarded or filtered. For example, you could put this immediately before the <code>userforward</code> router: </p> <table><tr><td> </td><td><pre class="example">real_localuser: driver = accept check_local_user local_part_prefix = real- transport = local_delivery </pre></td></tr></table> <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> <table><tr><td> </td><td><pre class="example"> condition = ${if match {$sender_host_address}\ {\N^(|127\.0\.0\.1)$\N}} </pre></td></tr></table> <a name="IDX1962"></a> <table> <tr><td> <p><code>syntax_errors_text</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em>*<em></em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <p>See <code>skip_syntax_errors</code> above. </p> <a name="IDX1963"></a> <table> <tr><td> <p><code>syntax_errors_to</code></p></td><td><p> Use: <em>redirect</em></p></td><td><p> Type: <em>string</em></p></td><td><p> Default: <em>unset</em> </p></td></tr> </table> <p>See <code>skip_syntax_errors</code> above. <a name="IDX1964"></a> <a name="IDX1965"></a> </p> <hr size="6"> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC204" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="spec_23.html#SEC215" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </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>