<!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>Exim's interfaces to mail filtering: 2. Sieve filter files</title> <meta name="description" content="Exim's interfaces to mail filtering: 2. Sieve filter files"> <meta name="keywords" content="Exim's interfaces to mail filtering: 2. Sieve filter files"> <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="Sieve-filter-files"></a> <a name="SEC8"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="filter_1.html#SEC7" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC9" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="filter_1.html#SEC1" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="filter.html#SEC_Top" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h1 class="chapter"> 2. Sieve filter files </h1> <p>The code for Sieve filtering in Exim was contributed by Michael Haardt, and most of the content of this chapter is taken from the notes he provided. Since Sieve is an extensible language, it is important to understand "Sieve" in this context as "the specific implementation of Sieve for Exim". </p> <p>This chapter does not contain a description of Sieve, since that can be found in RFC 3028, which should be read in conjunction with these notes. </p> <p>The Exim Sieve implementation offers the core as defined by RFC 3028, comparison tests, the subaddress parameter, the <strong>copy</strong>, <strong>envelope</strong>, <strong>fileinto</strong>, <strong>notify</strong>, and <strong>vacation</strong> extensions, but not the <strong>reject</strong> extension. Exim does not support message delivery notifications (MDNs), so adding it just to the Sieve filter (as required for <strong>reject</strong>) makes little sense. </p> <p>In order for Sieve to work properly in Exim, the system administrator needs to make some adjustments to the Exim configuration. These are described in the chapter on the <code>redirect</code> router in the full Exim specification. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top"><a href="#SEC9">2.1 Recognition of Sieve filters</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC10">2.2 Saving to specified folders</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC11">2.3 Strings containing header names</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC12">2.4 Exists test with empty list of headers</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC13">2.5 Header test with invalid MIME encoding in header</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC14">2.6 Address test for multiple addresses per header</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC15">2.7 Semantics of keep</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC16">2.8 Semantics of fileinto</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC17">2.9 Semantics of redirect</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC18">2.10 String arguments</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC19">2.11 Number units</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="#SEC20">2.12 RFC compliance</a></td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr size="6"> <a name="Recognition-of-Sieve-filters"></a> <a name="SEC9"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC8" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC10" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.1 Recognition of Sieve filters </h2> <p>A filter file is interpreted as a Sieve filter if its first line is </p> <table><tr><td> </td><td><pre class="example"># Sieve filter </pre></td></tr></table> <p>This is what distinguishes it from a conventional ‘<tt>.forward</tt>’ file or an Exim filter file. </p> <hr size="6"> <a name="Saving-to-specified-folders"></a> <a name="SEC10"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC9" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC11" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.2 Saving to specified folders </h2> <p>If the system administrator has set things up as suggested in the Exim specification, and you use <code>keep</code> or <code>fileinto</code> to save a mail into a folder, absolute files are stored where specified, relative files are stored relative to <code>$home</code>, and ‘<tt>inbox</tt>’ goes to the standard mailbox location. </p> <hr size="6"> <a name="Strings-containing-header-names"></a> <a name="SEC11"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC10" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC12" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.3 Strings containing header names </h2> <p>RFC 3028 does not specify what happens if a string denoting a header field does not contain a valid header name, for example, it contains a colon. This implementation generates an error instead of ignoring the header field in order to ease script debugging, which fits in with the common picture of Sieve. </p> <hr size="6"> <a name="Exists-test-with-empty-list-of-headers"></a> <a name="SEC12"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC11" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC13" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.4 Exists test with empty list of headers </h2> <p>The <strong>exists</strong> test succeeds only if all the specified headers exist. RFC 3028 does not explicitly specify what happens on an empty list of headers. This implementation evaluates that condition as true, interpreting the RFC in a strict sense. </p> <hr size="6"> <a name="Header-test-with-invalid-MIME-encoding-in-header"></a> <a name="SEC13"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC12" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC14" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.5 Header test with invalid MIME encoding in header </h2> <p>Some MUAs process invalid base64 encoded data, generating junk. Others ignore junk after seeing an equal sign in base64 encoded data. RFC 2047 does not specify how to react in this case, other than stating that a client must not forbid to process a message for that reason. RFC 2045 specifies that invalid data should be ignored (apparently looking at end of line characters). It also specifies that invalid data may lead to rejecting messages containing them (and there it appears to talk about true encoding violations), which is a clear contradiction to ignoring them. </p> <p>RFC 3028 does not specify how to process incorrect MIME words. This implementation treats them literally, as it does if the word is correct but its character set cannot be converted to UTF-8. </p> <hr size="6"> <a name="Address-test-for-multiple-addresses-per-header"></a> <a name="SEC14"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC13" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC15" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.6 Address test for multiple addresses per header </h2> <p>A header may contain multiple addresses. RFC 3028 does not explicitly specify how to deal with them, but since the address test checks if anything matches anything else, matching one address suffices to satisfy the condition. That makes it impossible to test if a header contains a certain set of addresses and no more, but it is more logical than letting the test fail if the header contains an additional address besides the one the test checks for. </p> <hr size="6"> <a name="Semantics-of-keep"></a> <a name="SEC15"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC14" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC16" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.7 Semantics of keep </h2> <p>The <code>keep</code> command is equivalent to </p> <table><tr><td> </td><td><pre class="example">fileinto "inbox"; </pre></td></tr></table> <p>It saves the message and resets the implicit keep flag. It does not set the implicit keep flag; there is no command to set it once it has been reset. </p> <hr size="6"> <a name="Semantics-of-fileinto"></a> <a name="SEC16"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC15" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC17" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.8 Semantics of fileinto </h2> <p>RFC 3028 does not specify whether <code>fileinto</code> should try to create a mail folder if it does not exist. This implementation allows the sysadmin to configure that aspect using the <code>appendfile</code> transport options <code>create_directory</code>, <code>create_file</code>, and <code>file_must_exist</code>. See the <code>appendfile</code> transport in the Exim specification for details. </p> <hr size="6"> <a name="Semantics-of-redirect"></a> <a name="SEC17"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC16" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC18" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.9 Semantics of redirect </h2> <p>Sieve scripts are supposed to be interoperable between servers, so this implementation does not allow mail to be redirected to unqualified addresses, because the domain would depend on the system being used. On systems with virtual mail domains, the default domain is probably not what the user expects it to be. </p> <hr size="6"> <a name="String-arguments"></a> <a name="SEC18"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC17" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC19" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.10 String arguments </h2> <p>There has been confusion if the string arguments to <code>require</code> are to be matched case-sensitively or not. This implementation matches them with the match type <code>:is</code> (default, see section 2.7.1 of the RFC) and the comparator <code>i;ascii-casemap</code> (default, see section 2.7.3 of the RFC). The RFC defines the command defaults clearly, so any different implementations violate RFC 3028. The same is valid for comparator names, also specified as strings. </p> <hr size="6"> <a name="Number-units"></a> <a name="SEC19"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC18" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="#SEC20" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.11 Number units </h2> <p>There is a mistake in RFC 3028: the suffix G denotes gibi-, not tebibyte. The mistake is obvious, because RFC 3028 specifies G to denote 2^30 (which is gibi, not tebi), and that is what this implementation uses as the scaling factor for the suffix G. </p> <hr size="6"> <a name="RFC-compliance"></a> <a name="SEC20"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC19" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="#SEC8" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <h2 class="section"> 2.12 RFC compliance </h2> <p>Exim requires the first line of a Sieve filter to be </p> <table><tr><td> </td><td><pre class="example"># Sieve filter </pre></td></tr></table> <p>Of course the RFC does not specify that line. Do not expect examples to work without adding it, though. </p> <p>RFC 3028 requires the use of CRLF to terminate a line. The rationale was that CRLF is universally used in network protocols to mark the end of the line. This implementation does not embed Sieve in a network protocol, but uses Sieve scripts as part of the Exim MTA. Since all parts of Exim use LF as the newline character, this implementation does, too, by default, though the system administrator may choose (at Exim compile time) to use CRLF instead. </p> <p>Exim violates RFC 2822, section 3.6.8, by accepting 8-bit header names, so this implementation repeats this violation to stay consistent with Exim. This is in preparation for UTF-8 data. </p> <p>Sieve scripts cannot contain NUL characters in strings, but mail headers could contain MIME encoded NUL characters, which could never be matched by Sieve scripts using exact comparisons. For that reason, this implementation extends the Sieve quoted string syntax with \0 to describe a NUL character, violating \0 being the same as 0 in RFC 3028. Even without using \0, the following tests are all true in this implementation. Implementations that use C-style strings will only evaluate the first test as true. </p> <table><tr><td> </td><td><pre class="example">Subject: =?iso-8859-1?q?abc=00def header :contains "Subject" ["abc"] header :contains "Subject" ["def"] header :matches "Subject" ["abc?def"] </pre></td></tr></table> <p>Note that by considering Sieve to be an MUA, RFC 2047 can be interpreted in a way that NUL characters truncating strings is allowed for Sieve implementations, although not recommended. It is further allowed to use encoded NUL characters in headers, but that's not recommended either. The above example shows why. </p> <p>RFC 3028 states that if an implementation fails to convert a character set to UTF-8, two strings cannot be equal if one contains octets greater than 127. Assuming that all unknown character sets are one-byte character sets with the lower 128 octets being US-ASCII is not sound, so this implementation violates RFC 3028 and treats such MIME words literally. That way at least something could be matched. </p> <p>The folder specified by <code>fileinto</code> must not contain the character sequence ".." to avoid security problems. RFC 3028 does not specify the syntax of folders apart from <code>keep</code> being equivalent to </p> <table><tr><td> </td><td><pre class="example">fileinto "INBOX"; </pre></td></tr></table> <p>This implementation uses ‘<tt>inbox</tt>’ instead. </p> <p>Sieve script errors currently cause messages to be silently filed into ‘<tt>inbox</tt>’. RFC 3028 requires that the user is notified of that condition. This may be implemented in the future by adding a header line to mails that are filed into ‘<tt>inbox</tt>’ due to an error in the filter. </p> <hr size="6"> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="#SEC8" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="filter_3.html#SEC21" 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="filter.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[Contents]</td> <td valign="middle" align="left">[Index]</td> <td valign="middle" align="left">[<a href="filter_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>