<!DOCTYPE html PUBLIC "XSLT-compat"> <html lang="en-GB"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="../../../../common.css"> <meta name="author" content="The Exim Project. <http://www.exim.org/>"> <meta name="copyright" content="Copyright ©2010 The Exim Project. All rights reserved"> <meta name="description" content="Exim is a message transfer agent (MTA) developed at the University of Cambridge for use on Unix systems connected to the Internet."> <meta name="keywords" content="exim,smtp,mta,email"> <meta name="robots" content="noodp,noydir,index,follow"> <meta name="viewport" content="width=device-width"> <title>22. The redirect router</title> <link rel="stylesheet" type="text/css" href="../../../../doc/chapter.css"> <link rel="canonical" href="http://www.exim.org/exim-html-current/doc/html/spec_html/ch22.html"> </head> <body> <h1 id="header"><a href="../../../..">Exim Internet Mailer</a></h1> <div id="outer"> <ul id="nav_flow" class="nav"> <li><a href="../../../../index.html">Home</a></li> <li><a href="../../../../mirrors.html">Download</a></li> <li><a href="../../../../docs.html">Documentation</a></li> <li><a href="../../../../maillist.html">Mailing Lists</a></li> <li><a href="http://wiki.exim.org/">Wiki</a></li> <li><a href="http://www.exim.org/bugzilla/">Bugs</a></li> <li><a href="../../../../credits.html">Credits</a></li> <li class="search"><form action="http://www.google.com/search" method="get"> <span class="search_field_container"><input type="search" name="q" placeholder="Search Docs" class="search_field"></span><input type="hidden" name="hl" value="en"><input type="hidden" name="ie" value="UTF-8"><input type="hidden" name="as_qdr" value="all"><input type="hidden" name="q" value="site:www.exim.org"><input type="hidden" name="q" value="inurl:exim-html-current"> </form></li> </ul> <div id="inner"><div id="content"> <a class="previous_page" href="ch21.html"><-previous</a><a class="next_page" href="ch23.html">next-></a><div id="chapter" class="chapter"> <h2 id="CHAPredirect" class="">Chapter 22 - The redirect router</h2> <p> The <span class="docbook_command">redirect</span> router handles several kinds of address redirection. Its most common uses are for resolving local part aliases from a central alias file (usually called <span class="docbook_filename">/etc/aliases</span>) and for handling users’ personal <span class="docbook_filename">.forward</span> files, but it has many other potential uses. The incoming address can be redirected in several different ways: </p> <ul> <li> <p> It can be replaced by one or more new addresses which are themselves routed independently. </p> </li> <li> <p> It can be routed to be delivered to a given file or directory. </p> </li> <li> <p> It can be routed to be delivered to a specified pipe command. </p> </li> <li> <p> It can cause an automatic reply to be generated. </p> </li> <li> <p> It can be forced to fail, optionally with a custom error message. </p> </li> <li> <p> It can be temporarily deferred, optionally with a custom message. </p> </li> <li> <p> It can be discarded. </p> </li> </ul> <p> The generic <span class="docbook_option">transport</span> option must not be set for <span class="docbook_command">redirect</span> routers. However, there are some private options which define transports for delivery to files and pipes, and for generating autoreplies. See the <span class="docbook_option">file_transport</span>, <span class="docbook_option">pipe_transport</span> and <span class="docbook_option">reply_transport</span> descriptions below. </p> <div class="section"> <h3 id="SECID124" class="">1. Redirection data</h3> <p> The router operates by interpreting a text string which it obtains either by expanding the contents of the <span class="docbook_option">data</span> option, or by reading the entire contents of a file whose name is given in the <span class="docbook_option">file</span> option. These two options are mutually exclusive. The first is commonly used for handling system aliases, in a configuration like this: </p> <div class="docbook_literallayout"><pre> system_aliases: driver = redirect data = ${lookup{$local_part}lsearch{/etc/aliases}} </pre></div> <p> If the lookup fails, the expanded string in this example is empty. When the expansion of <span class="docbook_option">data</span> 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 <span class="docbook_option">file</span> is commonly used for handling users’ <span class="docbook_filename">.forward</span> files, like this: </p> <div class="docbook_literallayout"><pre> userforward: driver = redirect check_local_user file = $home/.forward no_verify </pre></div> <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. <span class="docbook_emphasis">Warning</span>: 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> </div> <div class="section"> <h3 id="SECID125" class="">2. Forward files and address verification</h3> <p> It is usual to set <span class="docbook_option">no_verify</span> on <span class="docbook_command">redirect</span> routers which handle users’ <span class="docbook_filename">.forward</span> files, as in the example above. There are two reasons for this: </p> <ul> <li> <p> 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. </p> </li> <li> <p> However, even when the router can operate, the existence of a <span class="docbook_filename">.forward</span> 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. </p> </li> </ul> </div> <div class="section"> <h3 id="SECID126" class="">3. Interpreting redirection data</h3> <p> The contents of the data string, whether obtained from <span class="docbook_option">data</span> or <span class="docbook_option">file</span>, can be interpreted in two different ways: </p> <ul> <li> <p> If the <span class="docbook_option">allow_filter</span> option is set true, and the data begins with the text “#Exim filter” or “#Sieve filter”, it is interpreted as a list of <span class="docbook_emphasis">filtering</span> 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 <span class="docbook_emphasis">Exim’s interfaces to mail filtering</span>; this document is intended for use by end users. </p> </li> <li> <p> Otherwise, the data must be a comma-separated list of redirection items, as described in the next section. </p> </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="ch26.html#SECTfildiropt" title="26. The appendfile transport">26.1</a> for a discussion of this issue for the <span class="docbook_command">appendfile</span> transport. </p> </div> <div class="section"> <h3 id="SECTitenonfilred" class="">4. Items in a non-filter redirection list</h3> <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="ch22.html#SECTspecitredli" title="22. The redirect router">22.6</a> below). The special items can be individually enabled or disabled by means of options whose names begin with <span class="docbook_option">allow_</span> or <span class="docbook_option">forbid_</span>, 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> <p> <span class="docbook_emphasis">Warning</span>: If you use an Exim expansion to construct a redirection address, and the expansion contains a reference to $local_part, you should make use of the <span class="docbook_option">quote_local_part</span> expansion operator, in case the local part contains special characters. For example, to redirect all mail for the domain <span class="docbook_emphasis">obsolete.example</span>, retaining the existing local part, you could use this setting: </p> <div class="docbook_literallayout"><pre> data = ${quote_local_part:$local_part}@newdomain.example </pre></div> </div> <div class="section"> <h3 id="SECTredlocmai" class="">5. Redirecting to a local mailbox</h3> <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> <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 <span class="docbook_emphasis">cleo</span> might have a <span class="docbook_filename">.forward</span> file containing this: </p> <div class="docbook_literallayout"><pre> cleo, cleopatra@egypt.example </pre></div> <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 <span class="docbook_option">qualify_recipient</span>, but you can force the incoming domain to be used by setting <span class="docbook_option">qualify_preserve_domain</span>. </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> <div class="docbook_literallayout"><pre> Sam.Reman: spqr </pre></div> <p> Now suppose that Sam (whose login id is <span class="docbook_emphasis">spqr</span>) wants to save copies of messages in the local mailbox, and also forward copies elsewhere. He creates this forward file: </p> <div class="docbook_literallayout"><pre> Sam.Reman, spqr@reme.elsewhere.example </pre></div> <p> With these settings, an incoming message addressed to <span class="docbook_emphasis">Sam.Reman</span> fails. The <span class="docbook_command">redirect</span> router for system aliases does not process <span class="docbook_emphasis">Sam.Reman</span> 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> <div class="docbook_literallayout"><pre> spqr, spqr@reme.elsewhere.example </pre></div> <p> but because this is such a common error, the <span class="docbook_option">check_ancestor</span> option (see below) exists to provide a way to get round it. This is normally set on a <span class="docbook_command">redirect</span> router that is handling users’ <span class="docbook_filename">.forward</span> files. </p> </div> <div class="section"> <h3 id="SECTspecitredli" class="">6. Special items in redirection lists</h3> <p> In addition to addresses, the following types of item may appear in redirection lists (that is, in non-filter redirection data): </p> <ul> <li> <p> 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 <span class="docbook_option">pipe_transport</span> 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> <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> <div class="docbook_literallayout"><pre> "|/some/command ready,steady,go" </pre></div> <p> since items in redirection lists are terminated by commas. Do not, however, quote just the command. An item such as </p> <div class="docbook_literallayout"><pre> |"/some/command ready,steady,go" </pre></div> <p> is interpreted as a pipe with a rather strange command name, and no arguments. </p> </li> <li> <p> 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, </p> <div class="docbook_literallayout"><pre> /home/world/minbari </pre></div> <p> is treated as a file name, but </p> <div class="docbook_literallayout"><pre> /s=molari/o=babylon/@x400gate.way </pre></div> <p> is treated as an address. For a file name, a transport must be specified using the <span class="docbook_option">file_transport</span> 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 <span class="docbook_option">directory_transport</span> 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> <p> However, if a redirection item is the path <span class="docbook_filename">/dev/null</span>, 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> <p> If an item is of the form </p> <div class="docbook_literallayout"><pre> :include:<path name> </pre></div> <p> a list of further items is taken from the given file and included at that point. <span class="docbook_emphasis">Note</span>: 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 <span class="docbook_command">lsearch</span> file, a colon must be used to terminate the alias name. This example is incorrect: </p> <div class="docbook_literallayout"><pre> list1 :include:/opt/lists/list1 </pre></div> <p> It must be given as </p> <div class="docbook_literallayout"><pre> list1: :include:/opt/lists/list1 </pre></div> </li> <li> <p> Sometimes you want to throw away mail to a particular local part. Making the <span class="docbook_option">data</span> option expand to an empty string does not work, because that causes the router to decline. Instead, the alias item <span class="docbook_emphasis">:blackhole:</span> 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 <span class="docbook_filename">/dev/null</span> as a destination, but it can be independently disabled. </p> <p> <span class="docbook_emphasis">Warning</span>: If <span class="docbook_emphasis">:blackhole:</span> 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 <span class="docbook_filename">/dev/null</span>. </p> </li> <li> <p> An attempt to deliver a particular address can be deferred or forced to fail by redirection items of the form </p> <div class="docbook_literallayout"><pre> :defer: :fail: </pre></div> <p> respectively. When a redirection list contains such an item, it applies to the entire redirection; any other items in the list are ignored. Any text following <span class="docbook_emphasis">:fail:</span> or <span class="docbook_emphasis">:defer:</span> is placed in the error text associated with the failure. For example, an alias file might contain: </p> <div class="docbook_literallayout"><pre> X.Employee: :fail: Gone away, no forwarding address </pre></div> <p> In the case of an address that is being verified from an ACL or as the subject of a VRFY command, the text is included in the SMTP error response by default. 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> <p> By default, Exim sends a 451 SMTP code for a <span class="docbook_emphasis">:defer:</span>, and 550 for <span class="docbook_emphasis">:fail:</span>. However, if the message starts with three digits followed by a space, optionally followed by an extended code of the form <span class="docbook_emphasis">n.n.n</span>, 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 <span class="docbook_option">forbid_smtp_code</span> option true. In this case, any SMTP code is quietly ignored. </p> <p> In an ACL, an explicitly provided message overrides the default, but the default message is available in the variable $acl_verify_message 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 <span class="docbook_command">lsearch</span> lookups they are removed as part of the continuation process, but they may exist in other kinds of lookup and in <span class="docbook_emphasis">:include:</span> files. </p> <p> During routing for message delivery (as opposed to verification), a redirection containing <span class="docbook_emphasis">:fail:</span> causes an immediate failure of the incoming address, whereas <span class="docbook_emphasis">:defer:</span> 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> <p> Sometimes it is useful to use a single-key search type with a default (see chapter <a href="ch09.html" title="9. File and database lookups">9</a>) to look up aliases. However, there may be a need for exceptions to the default. These can be handled by aliasing them to <span class="docbook_emphasis">:unknown:</span>. This differs from <span class="docbook_emphasis">:fail:</span> in that it causes the <span class="docbook_command">redirect</span> router to decline, whereas <span class="docbook_emphasis">:fail:</span> forces routing to fail. A lookup which results in an empty redirection list has the same effect. </p> </li> </ul> </div> <div class="section"> <h3 id="SECTdupaddr" class="">7. Duplicate addresses</h3> <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> <div class="docbook_literallayout"><pre> pipe: |/some/command $local_part localpart1: pipe localpart2: pipe </pre></div> <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> <div class="docbook_literallayout"><pre> localpart1: |/some/command $local_part localpart2: |/some/command $local_part </pre></div> <p> does result in two different pipe deliveries, because the immediate parents of the pipes are distinct. </p> </div> <div class="section"> <h3 id="SECID128" class="">8. Repeated redirection expansion</h3> <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 <span class="docbook_option">one_time</span> option can be used to avoid this. </p> </div> <div class="section"> <h3 id="SECID129" class="">9. Errors in redirection lists</h3> <p> If <span class="docbook_option">skip_syntax_errors</span> 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 <span class="docbook_option">syntax_errors_to</span>. </p> </div> <div class="section"> <h3 id="SECID130" class="">10. Private options for the redirect router</h3> <p> The private options for the <span class="docbook_command">redirect</span> router are as follows: </p> <p> </p> <table> <tr> <td><span class="docbook_option">allow_defer</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> Setting this option allows the use of <span class="docbook_emphasis">:defer:</span> in non-filter redirection data, or the <span class="docbook_option">defer</span> command in an Exim filter file. </p> <p> </p> <table> <tr> <td><span class="docbook_option">allow_fail</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, the <span class="docbook_emphasis">:fail:</span> item can be used in a redirection list, and the <span class="docbook_option">fail</span> command may be used in an Exim filter file. </p> <p> </p> <table> <tr> <td><span class="docbook_option">allow_filter</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> Setting this option 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 <span class="docbook_option">forbid_filter_</span><span class="docbook_emphasis">xxx</span> options below. </p> <p> It is also possible to lock out Exim filters or Sieve filters while allowing the other type; see <span class="docbook_option">forbid_exim_filter</span> and <span class="docbook_option">forbid_sieve_filter</span>. </p> <p> The filter is run using the uid and gid set by the generic <span class="docbook_option">user</span> and <span class="docbook_option">group</span> options. These take their defaults from the password data if <span class="docbook_option">check_local_user</span> is set, so in the normal case of users’ personal filter files, the filter is run as the relevant user. When <span class="docbook_option">allow_filter</span> is set true, Exim insists that either <span class="docbook_option">check_local_user</span> or <span class="docbook_option">user</span> is set. </p> <p> </p> <table> <tr> <td><span class="docbook_option">allow_freeze</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> Setting this option allows the use of the <span class="docbook_option">freeze</span> 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> <p> </p> <table> <tr> <td><span class="docbook_option">check_ancestor</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </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’ <span class="docbook_filename">.forward</span> files. It is recommended for this use of the <span class="docbook_command">redirect</span> router. </p> <p> When <span class="docbook_option">check_ancestor</span> 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 <span class="docbook_filename">.forward</span> file pointing back to A. For example, within a single domain, the local part “Joe.Bloggs” is aliased to “jb” and <span class="docbook_filename"> jb/.forward</span> contains: </p> <div class="docbook_literallayout"><pre> \Joe.Bloggs, <other item(s)> </pre></div> <p> Without the <span class="docbook_option">check_ancestor</span> 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 <span class="docbook_filename">.forward</span> file and back to “jb” by the alias), but mail to “joe.bloggs” fails. Setting <span class="docbook_option">check_ancestor</span> on the <span class="docbook_command">redirect</span> router that handles the <span class="docbook_filename">.forward</span> file prevents it from turning “jb” back into “joe.bloggs” when that was the original address. See also the <span class="docbook_option">repeat_use</span> option below. </p> <p> </p> <table> <tr> <td><span class="docbook_option">check_group</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">see below</span> </td> </tr> </table> <p> When the <span class="docbook_option">file</span> 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 <span class="docbook_option">owngroups</span> option, together with the user’s default group if <span class="docbook_option">check_local_user</span> is set. If the file has the wrong group, routing is deferred. The default setting for this option is true if <span class="docbook_option">check_local_user</span> is set and the <span class="docbook_option">modemask</span> option permits the group write bit, or if the <span class="docbook_option">owngroups</span> option is set. Otherwise it is false, and no group check occurs. </p> <p> </p> <table> <tr> <td><span class="docbook_option">check_owner</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">see below</span> </td> </tr> </table> <p> When the <span class="docbook_option">file</span> option is used, the owner of the file is checked only when this option is set. If <span class="docbook_option">check_local_user</span> is set, the local user is permitted; otherwise the owner must be one of those listed in the <span class="docbook_option">owners</span> option. The default value for this option is true if <span class="docbook_option">check_local_user</span> or <span class="docbook_option">owners</span> is set. Otherwise the default is false, and no owner check occurs. </p> <p> </p> <table> <tr> <td><span class="docbook_option">data</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> This option is mutually exclusive with <span class="docbook_option">file</span>. One or other of them must be set, but not both. The contents of <span class="docbook_option">data</span> 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> <div class="docbook_literallayout"><pre> data = #Exim filter\n\ if $h_to: contains Exim then save $home/mail/exim endif </pre></div> <p> If you are reading the data from a database where newlines cannot be included, you can use the ${sg} expansion item to turn the escape string of your choice into a newline. </p> <p> </p> <table> <tr> <td><span class="docbook_option">directory_transport</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> A <span class="docbook_command">redirect</span> 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 <span class="docbook_command">appendfile</span> transport. </p> <p> </p> <table> <tr> <td><span class="docbook_option">file</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> This option specifies the name of a file that contains the redirection data. It is mutually exclusive with the <span class="docbook_option">data</span> 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> <p> If the attempt to open the file fails with a “does not exist” error, Exim runs a check on the containing directory, unless <span class="docbook_option">ignore_enotdir</span> is true (see below). If the directory does not appear to exist, delivery is deferred. This can happen when users’ <span class="docbook_filename">.forward</span> 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> <p> </p> <table> <tr> <td><span class="docbook_option">file_transport</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> A <span class="docbook_command">redirect</span> 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 <span class="docbook_command">appendfile</span> transport. When it is running, the file name is in $address_file. </p> <p> </p> <table> <tr> <td><span class="docbook_option">filter_prepend_home</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">true</span> </td> </tr> </table> <p> When this option is true, if a <span class="docbook_command">save</span> command in an Exim filter specifies a relative path, and $home 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> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_blackhole</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, the <span class="docbook_emphasis">:blackhole:</span> item may not appear in a redirection list. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_exim_filter</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is set true, only Sieve filters are permitted when <span class="docbook_option">allow_filter</span> is true. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_file</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, 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 <span class="docbook_option">one_time</span> 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> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_filter_dlfunc</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, string expansions in Exim filters are not allowed to make use of the <span class="docbook_option">dlfunc</span> expansion facility to run dynamically loaded functions. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_filter_existstest</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, string expansions in Exim filters are not allowed to make use of the <span class="docbook_option">exists</span> condition or the <span class="docbook_option">stat</span> expansion item. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_filter_logwrite</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, 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’ <span class="docbook_filename">.forward</span> files). </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_filter_lookup</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, string expansions in Exim filter files are not allowed to make use of <span class="docbook_option">lookup</span> items. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_filter_perl</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </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> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_filter_readfile</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, string expansions in Exim filter files are not allowed to make use of <span class="docbook_option">readfile</span> items. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_filter_readsocket</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, string expansions in Exim filter files are not allowed to make use of <span class="docbook_option">readsocket</span> items. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_filter_reply</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, 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 <span class="docbook_option">one_time</span> is set. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_filter_run</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, string expansions in Exim filter files are not allowed to make use of <span class="docbook_option">run</span> items. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_include</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, items of the form </p> <div class="docbook_literallayout"><pre> :include:<path name> </pre></div> <p> are not permitted in non-filter redirection lists. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_pipe</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, 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 <span class="docbook_option">one_time</span> is set. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_sieve_filter</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is set true, only Exim filters are permitted when <span class="docbook_option">allow_filter</span> is true. </p> <p> </p> <table> <tr> <td><span class="docbook_option">forbid_smtp_code</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is set true, any SMTP error codes that are present at the start of messages specified for <code class="docbook_literal">:defer:</code> or <code class="docbook_literal">:fail:</code> are quietly ignored, and the default codes (451 and 550, respectively) are always used. </p> <p> </p> <table> <tr> <td><span class="docbook_option">hide_child_in_errmsg</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is true, 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 <<span class="docbook_emphasis">the top level address</span>>”. Of course, this applies only to bounces generated locally. If a message is forwarded to another host, <span class="docbook_emphasis">its</span> bounce may well quote the generated address. </p> <p> </p> <table> <tr> <td><span class="docbook_option">ignore_eacces</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is set and an attempt to open a redirection file yields the EACCES error (permission denied), the <span class="docbook_command">redirect</span> router behaves as if the file did not exist. </p> <p> </p> <table> <tr> <td><span class="docbook_option">ignore_enotdir</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is set and an attempt to open a redirection file yields the ENOTDIR error (something on the path is not a directory), the <span class="docbook_command">redirect</span> router behaves as if the file did not exist. </p> <p> Setting <span class="docbook_option">ignore_enotdir</span> has another effect as well: When a <span class="docbook_command">redirect</span> router that has the <span class="docbook_option">file</span> option set discovers that the file does not exist (the ENOENT error), it tries to <span class="docbook_function">stat()</span> 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 <span class="docbook_option">ignore_enotdir</span> 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> <p> </p> <table> <tr> <td><span class="docbook_option">include_directory</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> If this option is set, the path names of any <span class="docbook_emphasis">:include:</span> items in a redirection list must start with this directory. </p> <p> </p> <table> <tr> <td><span class="docbook_option">modemask</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">octal integer</span> </td> <td>Default: <span class="docbook_emphasis">022</span> </td> </tr> </table> <p> This specifies mode bits which must not be set for a file specified by the <span class="docbook_option">file</span> option. If any of the forbidden bits are set, delivery is deferred. </p> <p> </p> <table> <tr> <td><span class="docbook_option">one_time</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <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 <span class="docbook_option">one_time</span> 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> <span class="docbook_emphasis">Warning 1</span>: 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 <span class="docbook_option">headers_add</span> and <span class="docbook_option">headers_remove</span> generic options are not permitted when <span class="docbook_option">one_time</span> is set. </p> <p> <span class="docbook_emphasis">Warning 2</span>: To ensure that the router generates only addresses (as opposed to pipe or file deliveries or auto-replies) <span class="docbook_option">forbid_file</span>, <span class="docbook_option">forbid_pipe</span>, and <span class="docbook_option">forbid_filter_reply</span> are forced to be true when <span class="docbook_option">one_time</span> is set. </p> <p> <span class="docbook_emphasis">Warning 3</span>: The <span class="docbook_option">unseen</span> generic router option may not be set with <span class="docbook_option">one_time</span>. </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 <span class="docbook_option">all_parents</span> log selector is set. It is expected that <span class="docbook_option">one_time</span> will typically be used for mailing lists, where there is normally just one level of expansion. </p> <p> </p> <table> <tr> <td><span class="docbook_option">owners</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string list</span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> This specifies a list of permitted owners for the file specified by <span class="docbook_option">file</span>. This list is in addition to the local user when <span class="docbook_option">check_local_user</span> is set. See <span class="docbook_option">check_owner</span> above. </p> <p> </p> <table> <tr> <td><span class="docbook_option">owngroups</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string list</span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> This specifies a list of permitted groups for the file specified by <span class="docbook_option">file</span>. The list is in addition to the local user’s primary group when <span class="docbook_option">check_local_user</span> is set. See <span class="docbook_option">check_group</span> above. </p> <p> </p> <table> <tr> <td><span class="docbook_option">pipe_transport</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> A <span class="docbook_command">redirect</span> 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 <span class="docbook_command">pipe</span> transport. When the transport is run, the pipe command is in $address_pipe. </p> <p> </p> <table> <tr> <td><span class="docbook_option">qualify_domain</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> If this option is set, and an unqualified address (one without a domain) is generated, and that address would normally be qualified by the global setting in <span class="docbook_option">qualify_recipient</span>, 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 $qualify_recipient. </p> <p> This option applies to all unqualified addresses generated by Exim filters, but for traditional <span class="docbook_filename">.forward</span> files, it applies only to addresses that are not preceded by a backslash. Sieve filters cannot generate unqualified addresses. </p> <p> </p> <table> <tr> <td><span class="docbook_option">qualify_preserve_domain</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If this option is set, the router’s local <span class="docbook_option">qualify_domain</span> 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 <span class="docbook_option">qualify_recipient</span> value. In the case of a traditional <span class="docbook_filename">.forward</span> file, this applies whether or not the address is preceded by a backslash. </p> <p> </p> <table> <tr> <td><span class="docbook_option">repeat_use</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">true</span> </td> </tr> </table> <p> If this option is set false, the router is skipped 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 <span class="docbook_option">check_ancestor</span> above and the generic <span class="docbook_option">redirect_router</span> option. </p> <p> </p> <table> <tr> <td><span class="docbook_option">reply_transport</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> A <span class="docbook_command">redirect</span> router sets up an automatic reply when a <span class="docbook_option">mail</span> or <span class="docbook_option">vacation</span> 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 <span class="docbook_command">autoreply</span> transport. Other transports are unlikely to do anything sensible or useful. </p> <p> </p> <table> <tr> <td><span class="docbook_option">rewrite</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">true</span> </td> </tr> </table> <p> If this option is set false, 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> <p> </p> <table> <tr> <td><span class="docbook_option">sieve_subaddress</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> The value of this option is passed to a Sieve filter to specify the :subaddress part of an address. </p> <p> </p> <table> <tr> <td><span class="docbook_option">sieve_useraddress</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> The 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> <p> </p> <table> <tr> <td><span class="docbook_option">sieve_vacation_directory</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> To enable the “vacation” extension for Sieve filters, you must set <span class="docbook_option">sieve_vacation_directory</span> to the directory where vacation databases are held (do not put anything else in that directory), and ensure that the <span class="docbook_option">reply_transport</span> option refers to an <span class="docbook_command">autoreply</span> transport. Each user needs their own directory; Exim will create it if necessary. </p> <p> </p> <table> <tr> <td><span class="docbook_option">skip_syntax_errors</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">boolean</span> </td> <td>Default: <span class="docbook_emphasis">false</span> </td> </tr> </table> <p> If <span class="docbook_option">skip_syntax_errors</span> is set, syntactically malformed addresses in non-filter redirection data are skipped, and each failing address is logged. If <span class="docbook_option">syntax_errors_to</span> is set, a message is sent to the address it defines, giving details of the failures. If <span class="docbook_option">syntax_errors_text</span> is set, its contents are expanded and placed at the head of the error message generated by <span class="docbook_option">syntax_errors_to</span>. Usually it is appropriate to set <span class="docbook_option">syntax_errors_to</span> to be the same address as the generic <span class="docbook_option">errors_to</span> option. The <span class="docbook_option">skip_syntax_errors</span> 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 <span class="docbook_option">skip_syntax_errors</span> 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> <p> Syntax errors in a Sieve filter file cause the “keep” action to occur. This action is specified by RFC 3028. The values of <span class="docbook_option">skip_syntax_errors</span>, <span class="docbook_option">syntax_errors_to</span>, and <span class="docbook_option">syntax_errors_text</span> are not used. </p> <p> <span class="docbook_option">skip_syntax_errors</span> can be used to specify that errors in users’ forward lists or filter files should not prevent delivery. The <span class="docbook_option">syntax_errors_to</span> 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> <div class="docbook_literallayout"><pre> 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></div> <p> You also need a router to ensure that local addresses that are prefixed by <code class="docbook_literal">real-</code> are recognized, but not forwarded or filtered. For example, you could put this immediately before the <span class="docbook_command">userforward</span> router: </p> <div class="docbook_literallayout"><pre> real_localuser: driver = accept check_local_user local_part_prefix = real- transport = local_delivery </pre></div> <p> For security, it would probably be a good idea to restrict the use of this router to locally-generated messages, using a condition such as this: </p> <div class="docbook_literallayout"><pre> condition = ${if match {$sender_host_address}\ {\N^(|127\.0\.0\.1)$\N}} </pre></div> <p> </p> <table> <tr> <td><span class="docbook_option">syntax_errors_text</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span>†<span class="docbook_emphasis"></span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> See <span class="docbook_option">skip_syntax_errors</span> above. </p> <p> </p> <table> <tr> <td><span class="docbook_option">syntax_errors_to</span></td> <td>Use: <span class="docbook_emphasis">redirect</span> </td> <td>Type: <span class="docbook_emphasis">string</span> </td> <td>Default: <span class="docbook_emphasis">unset</span> </td> </tr> </table> <p> See <span class="docbook_option">skip_syntax_errors</span> above. </p> </div> </div> <a class="previous_page" href="ch21.html"><-previous</a><a class="next_page" href="ch23.html">next-></a> </div></div> <iframe id="branding" name="branding" src="../../../../branding/branding.html" height="0" frameborder="no" scrolling="no"></iframe><div id="footer">Website design by <a href="https://secure.grepular.com/">Mike Cardwell</a>, of <a href="http://cardwellit.com/">Cardwell IT Ltd.</a> </div> <div class="left_bar"></div> <div class="right_bar"></div> <div id="toc"> <ul class="hidden"></ul> <img src="../../../../doc/contents.png" width="16" height="155"> </div> </div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script><script type="text/javascript" src="../../../../common.js"></script><script type="text/javascript" src="../../../../doc/chapter.js"></script> </body> </html>