[exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog READM…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Philip Hazel
Dátum:  
Címzett: exim-cvs
Tárgy: [exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog README.SIEVE exim/exim-src/src sieve.c exim/exim-test-orig/AutoTest/stdout 496
ph10 2005/08/30 11:55:52 BST

  Modified files:
    exim-doc/doc-txt     ChangeLog README.SIEVE 
    exim-src/src         sieve.c 
    exim-test-orig/AutoTest/stdout 496 
  Log:
  Applied latest Sieve patches from the maintainer.


  Revision  Changes    Path
  1.214     +2 -0      exim/exim-doc/doc-txt/ChangeLog
  1.7       +58 -97    exim/exim-doc/doc-txt/README.SIEVE
  1.13      +81 -206   exim/exim-src/src/sieve.c
  1.4       +73 -73    exim/exim-test-orig/AutoTest/stdout/496


  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
  retrieving revision 1.213
  retrieving revision 1.214
  diff -u -r1.213 -r1.214
  --- ChangeLog    30 Aug 2005 10:07:58 -0000    1.213
  +++ ChangeLog    30 Aug 2005 10:55:52 -0000    1.214
  @@ -1,4 +1,4 @@
  -$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.213 2005/08/30 10:07:58 ph10 Exp $
  +$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.214 2005/08/30 10:55:52 ph10 Exp $


   Change log file for Exim from version 4.21
   -------------------------------------------
  @@ -127,6 +127,8 @@
         too many continuations, the temporary file was not being removed.


PH/31 Missing "BOOL" in function definition in filtertest.c.
+
+PH/32 Applied Sieve patches from the maintainer.


Exim version 4.52

  Index: README.SIEVE
  ===================================================================
  RCS file: /home/cvs/exim/exim-doc/doc-txt/README.SIEVE,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- README.SIEVE    1 Jul 2005 10:21:45 -0000    1.6
  +++ README.SIEVE    30 Aug 2005 10:55:52 -0000    1.7
  @@ -1,4 +1,4 @@
  -$Cambridge: exim/exim-doc/doc-txt/README.SIEVE,v 1.6 2005/07/01 10:21:45 ph10 Exp $
  +$Cambridge: exim/exim-doc/doc-txt/README.SIEVE,v 1.7 2005/08/30 10:55:52 ph10 Exp $


                 Notes on the Sieve implementation for Exim


@@ -20,18 +20,48 @@

Exim Implementation

-The Exim Sieve implementation offers the core as defined by RFC 3028bis,
-the "envelope" (RFC 3028), the "fileinto" (RFC 3028), the "copy" (RFC
-3894) and the "vacation" (draft-ietf-sieve-vacation-02.txt) extension,
-the "i;ascii-numeric" comparator, but not the "reject" extension.
-Exim does not support MDMs, so adding it just to the sieve filter makes
-little sense.
+The Exim Sieve implementation offers the core as defined by draft
+3028bis-4 (next version of RFC 3028 that fixes specification mistakes),
+the "envelope" (3028bis), the "fileinto" (3028bis), the "copy" (RFC 3894)
+and the "vacation" (draft-ietf-sieve-vacation-02.txt) extension, the
+"i;ascii-numeric" comparator (RFC 2244).

The Sieve filter is integrated in Exim and works very similar to the
Exim filter: Sieve scripts are recognized by the first line containing
"# sieve filter". When using "keep" or "fileinto" to save a mail into a
folder, the resulting string is available as the variable $address_file
-in the transport that stores it. A suitable transport could be:
+in the transport that stores it. The following routers and transport
+show a typical use of Sieve:
+
+begin routers
+
+localuser_verify:
+ driver = accept
+ domains = +localdomains
+ local_part_suffix = "-*"
+ local_part_suffix_optional
+ check_local_user
+ require_files = $home/.forward
+ verify_only = true
+
+localuser_deliver:
+ driver = redirect
+ domains = +localdomains
+ local_part_suffix = "-*"
+ local_part_suffix_optional
+ sieve_subaddress = "${sg{$local_part_suffix}{^-}{}}"
+ sieve_useraddress = "$local_part"
+ check_local_user
+ require_files = $home/.forward
+ file = $home/.forward
+ check_ancestor
+ allow_filter
+ file_transport = localuser
+ reply_transport = vacation
+ sieve_vacation_directory = $home/mail/vacation
+ verify = false
+
+begin transports

   localuser:
     driver = appendfile
  @@ -39,7 +69,7 @@
                 {/var/mail/$local_part} \
                 {${if eq{${substr_0_1:$address_file}}{/} \
                       {$address_file} \
  -                    {$home/$address_file} \
  +                    {$home/mail/$address_file} \
                 }} \
            }
     delivery_date_add
  @@ -47,13 +77,16 @@
     return_path_add
     mode = 0600


-Absolute files are stored where specified, relative files are stored
-relative to $home and "inbox" goes to the standard mailbox location.
+vacation:
+ driver = autoreply

-To enable "vacation", set sieve_vacation_directory for the router to
-the directory where vacation databases are held (don't put anything
-else in that directory) and point reply_transport to an autoreply
-transport.
+Absolute files are stored where specified, relative files are stored
+relative to $home/mail and "inbox" goes to the standard mailbox location.
+To enable "vacation", sieve_vacation_directory is set to the directory
+where vacation databases are held (don't put anything else in that
+directory) and point reply_transport to an autoreply transport.
+Setting the Sieve useraddress and subaddress allows to use the subaddress
+extension.


RFC Compliance
@@ -70,41 +103,15 @@
does, too. You can change this by defining the macro RFC_EOL at compile
time to enforce CRLF being used.

-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 to UTF-8 data.
-
Sieve scripts can not 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
-evaulate the first test as true.
-
-Subject: =?iso-8859-1?q?abc=00def
-
-header :contains "Subject" ["abc"]
-header :contains "Subject" ["def"]
-header :matches "Subject" ["abc?def"]
-
-Note that by considering Sieve to be a 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. Good code should still be able to deal
-with it.
-
-RFC 3028 states that if an implementation fails to convert a character
-set to UTF-8, two strings can not be equal if one contains octects greater
-than 127. Assuming that all unknown character sets are one-byte character
-sets with the lower 128 octects 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.
+RFC 3028.

The folder specified by "fileinto" must not contain the character
-sequence ".." to avoid security problems. RFC 3028 does not specifiy the
+sequence ".." to avoid security problems. RFC 3028 does not specify the
syntax of folders apart from keep being equivalent to fileinto "INBOX".
This implementation uses "inbox" instead.

@@ -114,33 +121,6 @@
are filed into "inbox" due to an error in the filter.


-Strings Containing Header Names Or Envelope Elements
-
-RFC 3028 does not specify what happens if a string denoting a header
-field or envelope element does not contain a valid name, e.g. it
-contains a colon for a header or it is not "from" or "to" for envelopes.
-This implementation generates an error instead of ignoring the header
-field in order to ease script debugging, which fits in the common picture
-of Sieve.
-
-
-Header Test With Invalid MIME Encoding In Header
-
-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 (appearantly
-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.
-
-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 can not be converted to UTF-8.
-
-
Semantics Of Keep

The keep command is equivalent to fileinto "inbox": It saves the
@@ -158,41 +138,21 @@
the Exim specification for details.


-String Arguments
-
-There has been confusion if the string arguments to "require" are to be
-matched case-sensitive or not. The comparator default is case-insensitive
-comparison, but "require" does not allow to specify a comparator, so
-this default does not apply. Lacking a clear specification, matching
-the strings exactly makes most sense. The same is valid for comparator
-names, also specified as strings.
-
-
Sieve Syntax and Semantics

RFC 3028 confuses syntax and semantics sometimes. It uses a generic
-grammar as syntax for actions and tests and performs many checks during
-semantic analysis. Syntax is specified as grammar rule, semantics
-with natural language, despite the latter often talking about syntax.
+grammar as syntax for commands and tests and performs many checks during
+semantic analysis. Syntax is specified by grammar rules, semantics
+by natural language, despite the latter often talking about syntax.
The intention was to provide a framework for the syntax that describes
current commands as well as future extensions, and describing commands
by semantics.

-RFC 3028 does not define if semantic checks are strict (always treat
-unknown extensions as errors) or lazy (treat unknown extensions as error,
-if they are executed), and since it employs a very generic grammar,
-it is not unreasonable for an implementation using a parser for the
-generic grammar to indeed process scripts that contain unknown commands
-in dead code. It is just required to treat disabled but known extensions
-the same as unknown extensions.
-
-The following suggestion for section 8.2 gives two grammars, one for
+The following replacement for section 8.2 gives two grammars, one for
the framework, and one for specific commands, thus removing most of the
semantic analysis. Since the parser can not parse unsupported extensions,
-the result is strict error checking. As required in section 2.10.5, known
-but not enabled extensions must behave the same as unknown extensions,
-so those also result strictly in errors (though at the thin semantic
-layer), even if they can be parsed fine.
+the result is strict error checking of any executed and not executed code
+until "stop" is executed or the end of the script is reached.

8.2. Grammar

@@ -202,11 +162,12 @@
arguments that can be reordered and grammar extensions: { } denotes a
sequence of symbols that may appear in any order. Example:

- start = { a b c }
+ options = a b c
+ start = { options }

is equivalent to:

- start = ( a b c ) / ( a c b ) / ( b a c ) / ( b c a ) / ( c a b ) / ( c b a )
+ start = ( a b c ) / ( a c b ) / ( b a c ) / ( b c a ) / ( c a b ) / ( c b a )

The symbol =) is used to append to a rule:


  Index: sieve.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/sieve.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- sieve.c    17 Jun 2005 10:47:05 -0000    1.12
  +++ sieve.c    30 Aug 2005 10:55:52 -0000    1.13
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/sieve.c,v 1.12 2005/06/17 10:47:05 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/sieve.c,v 1.13 2005/08/30 10:55:52 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -311,8 +311,7 @@
     if (hc&0x80) return 0;
   #endif
     /* tolower depends on the locale and only ASCII case must be insensitive */
  -  if ((nc&0x80) || (hc&0x80)) { if (nc!=hc) return 0; }
  -  else if ((nc>='A' && nc<='Z' ? nc|0x20 : nc) != (hc>='A' && hc<='Z' ? hc|0x20 : hc)) return 0;
  +  if ((nc>='A' && nc<='Z' ? nc|0x20 : nc) != (hc>='A' && hc<='Z' ? hc|0x20 : hc)) return 0;
     ++n;
     ++h;
     --nl;
  @@ -323,7 +322,7 @@



   /*************************************************
  -*        Octet-wise glob pattern search          *
  +*              Glob pattern search               *
   *************************************************/


/*
@@ -333,231 +332,99 @@

   Returns:      0               needle not found in haystack
                 1               needle found
  +              -1              pattern error
   */


-static int eq_octetglob(const struct String *needle,
- const struct String *haystack)
+static int eq_glob(const struct String *needle,
+ const struct String *haystack, int ascii_caseless)
{
-struct String n,h;
+const uschar *n,*h,*nend,*hend;
+int may_advance=0;

  -n=*needle;
  -h=*haystack;
  -while (n.length)
  +n=needle->character;
  +h=haystack->character;
  +nend=n+needle->length;
  +hend=h+haystack->length;
  +while (n<nend)
     {
  -  switch (n.character[0])
  +  if (*n=='*')
       {
  -    case '*':
  -      {
  -      int currentLength;
  +    ++n;
  +    may_advance=1;
  +    }
  +  else
  +    {
  +    const uschar *npart,*hpart;


  -      ++n.character;
  -      --n.length;
  -      /* The greedy match is not yet well tested.  Some day we may */
  -      /* need to refer to the matched parts, so the code is already */
  -      /* prepared for that. */
  -#if 1
  -      /* greedy match */
  -      currentLength=h.length;
  -      h.character+=h.length;
  -      h.length=0;
  -      while (h.length<=currentLength)
  -        {
  -        if (eq_octetglob(&n,&h)) return 1;
  -        else /* go back one octet */
  +    /* Try to match a non-star part of the needle at the current */
  +    /* position in the haystack.                                 */
  +    match_part:
  +    npart=n;
  +    hpart=h;
  +    while (npart<nend && *npart!='*') switch (*npart)
  +      {
  +      case '?':
  +        {
  +        if (hpart==hend) return 0;
  +        /* watch out: Do not match one character, but one UTF8 encoded character */
  +        if ((*hpart&0xc0)==0xc0)
             {
  -          --h.character;
  -          ++h.length;
  +          ++hpart;
  +          while (hpart<hend && ((*hpart&0xc0)==0x80)) ++hpart;
             }
  +        else
  +         ++hpart;
  +        ++npart;
  +        break;
           }
  -      return 0;
  -#else
  -      /* minimal match */
  -      while (h.length)
  +      case '\\':
           {
  -        if (eq_octetglob(&n,&h)) return 1;
  -        else /* advance one octet */
  -          {
  -          ++h.character;
  -          --h.length;
  -          }
  +        ++npart;
  +        if (npart==nend) return -1;
  +        /* FALLTHROUGH */
           }
  -      break;
  -#endif
  -      }
  -    case '?':
  -      {
  -      if (h.length)
  +      default:
           {
  -        ++h.character;
  -        --h.length;
  -        ++n.character;
  -        --n.length;
  -        }
  -      else return 0;
  -      break;
  -      }
  -    case '\\':
  -      {
  -      ++n.character;
  -      --n.length;
  -      /* FALLTHROUGH */
  -      }
  -    default:
  -      {
  -      if
  -        (
  -        h.length==0 ||
  +        if (hpart==hend) return 0;
  +        /* tolower depends on the locale, but we need ASCII */
  +        if
  +          (
   #if !HAVE_ICONV
  -        (h.character[0]&0x80) || (n.character[0]&0x80) ||
  +          (*hpart&0x80) || (*npart&0x80) ||
   #endif
  -        h.character[0]!=n.character[0]
  -        ) return 0;
  -      else
  -        {
  -        ++h.character;
  -        --h.length;
  -        ++n.character;
  -        --n.length;
  -        };
  -      }
  -    }
  -  }
  -return (h.length==0);
  -}
  -
  -
  -/*************************************************
  -*   ASCII case-insensitive glob pattern search   *
  -*************************************************/
  -
  -/*
  -Arguments:
  -  needle      UTF-8 pattern to search ...
  -  haystack    ... inside the haystack
  -
  -Returns:      0               needle not found in haystack
  -              1               needle found
  -*/
  -
  -static int eq_asciicaseglob(const struct String *needle,
  -  const struct String *haystack)
  -{
  -struct String n,h;
  -
  -n=*needle;
  -h=*haystack;
  -while (n.length)
  -  {
  -  switch (n.character[0])
  -    {
  -    case '*':
  -      {
  -      int currentLength;
  -
  -      ++n.character;
  -      --n.length;
  -      /* The greedy match is not yet well tested.  Some day we may */
  -      /* need to refer to the matched parts, so the code is already */
  -      /* prepared for that. */
  -#if 1
  -      /* greedy match */
  -      currentLength=h.length;
  -      h.character+=h.length;
  -      h.length=0;
  -      while (h.length<=currentLength)
  -        {
  -        if (eq_asciicaseglob(&n,&h)) return 1;
  -        else /* go back one UTF-8 character */
  -          {
  -          if (h.length==currentLength) return 0;
  -          --h.character;
  -          ++h.length;
  -          if (h.character[0]&0x80)
  -            {
  -            while (h.length<currentLength && (*(h.character-1)&0x80))
  -              {
  -              --h.character;
  -              ++h.length;
  -              }
  -            }
  -          }
  -        }
  -      /* NOTREACHED */
  -#else
  -      while (h.length)
  -        {
  -        if (eq_asciicaseglob(&n,&h)) return 1;
  -        else /* advance one UTF-8 character */
  -          {
  -          if (h.character[0]&0x80)
  -            {
  -            while (h.length && (h.character[0]&0x80))
  -              {
  -              ++h.character;
  -              --h.length;
  -              }
  -            }
  -          else
  -            {
  -            ++h.character;
  -            --h.length;
  -            }
  -          }
  -        }
  -      break;
  -#endif
  -      }
  -    case '?':
  -      {
  -      if (h.length)
  -        {
  -        ++n.character;
  -        --n.length;
  -        /* advance one UTF-8 character */
  -        if (h.character[0]&0x80)
  +          ascii_caseless
  +          ? ((*npart>='A' && *npart<='Z' ? *npart|0x20 : *npart) != (*hpart>='A' && *hpart<='Z' ? *hpart|0x20 : *hpart))
  +          : *hpart!=*npart
  +          )
             {
  -          while (h.length && (h.character[0]&0x80))
  +          if (may_advance)
  +            /* string match after a star failed, advance and try again */
               {
  -            ++h.character;
  -            --h.length;
  +            ++h;
  +            goto match_part;
               }
  +          else return 0;
             }
           else
             {
  -          ++h.character;
  -          --h.length;
  -          }
  +          ++npart;
  +          ++hpart;
  +          };
           }
  -      else return 0;
  -      break;
         }
  -    case '\\':
  +    /* at this point, a part was matched successfully */
  +    if (may_advance && npart==nend && hpart<hend)
  +      /* needle ends, but haystack does not: if there was a star before, advance and try again */
         {
  -      ++n.character;
  -      --n.length;
  -      /* FALLTHROUGH */
  -      }
  -    default:
  -      {
  -      char nc,hc;
  -
  -      if (h.length==0) return 0;
  -      nc=n.character[0];
  -      hc=h.character[0];
  -#if !HAVE_ICONV
  -      if ((hc&0x80) || (nc&0x80)) return 0;
  -#endif
  -      /* tolower depends on the locale and only ASCII case must be insensitive */
  -      if ((nc&0x80) || (hc&0x80)) { if (nc!=hc) return 0; }
  -      else if ((nc>='A' && nc<='Z' ? nc|0x20 : nc) != (hc>='A' && hc<='Z' ? hc|0x20 : hc)) return 0;
  -      ++h.character;
  -      --h.length;
  -      ++n.character;
  -      --n.length;
  +      ++h;
  +      goto match_part;
         }
  +    h=hpart;
  +    n=npart;
  +    may_advance=0;
       }
     }
  -return (h.length==0);
  +return (h==hend ? 1 : may_advance);
   }



  @@ -715,12 +582,20 @@
         {
         case COMP_OCTET:
           {
  -        if (eq_octetglob(needle,haystack)) r=1;
  +        if ((r=eq_glob(needle,haystack,0))==-1)
  +          {
  +          filter->errmsg=CUS "syntactically invalid pattern";
  +          return -1;
  +          }
           break;
           }
         case COMP_EN_ASCII_CASEMAP:
           {
  -        if (eq_asciicaseglob(needle,haystack)) r=1;
  +        if ((r=eq_glob(needle,haystack,1))==-1)
  +          {
  +          filter->errmsg=CUS "syntactically invalid pattern";
  +          return -1;
  +          }
           break;
           }
         default:
  @@ -2838,12 +2713,12 @@
     if (sieve.keep)
       {
       add_addr(generated,US"inbox",1,0,0,0);
  -    msg = string_sprintf("Keep");
  +    msg = string_sprintf("Implicit keep");
       r = FF_DELIVERED;
       }
  -    else
  +  else
       {
  -    msg = string_sprintf("No keep");
  +    msg = string_sprintf("No implicit keep");
       r = FF_DELIVERED;
       }
     }


  Index: 496
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stdout/496,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- 496    17 Jun 2005 11:21:41 -0000    1.3
  +++ 496    30 Aug 2005 10:55:52 -0000    1.4
  @@ -3,299 +3,299 @@
   if address ["From","To"] "marian@???"
           { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if address :is "From" "marian@???"
           { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if address :is "To" "marian@???"
           { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if address :contains "To" "trallala"
           { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if address :matches "To" "*tra?lala*"
           { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if true { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if false { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if allof (false,false) { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if allof (true,false) { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if allof (false,true) { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if allof (true,true) { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if anyof (false,false) { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if anyof (true,false) { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if anyof (false,true) { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if anyof (true,true) { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if not anyof (false,false) { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if not anyof (true,false) { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if not anyof (false,true) { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if not anyof (true,true) { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if header "to" "MARIAN@???" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header :comparator "i;octet" "to" "MARIAN@???" { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if header :comparator "i;ascii-casemap" "to" "MARIAN@???" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   require "envelope";
   if envelope "from" "marian@???" { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   require "envelope";
   if envelope "from" "offerqn@???" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if exists [ "X-NotHere", "X-Notheretoo" ] { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if exists [ "X-NotHere", "Delivered-To" ] { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if exists [ "From", "Delivered-To" ] { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header :contains "X-NotHere" "" { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if header "Delivered-To" "" { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if header :contains "Delivered-To" "" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header :contains "Delivered-To" "rc@???" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "Delivered-To" ["irc@???"] { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if header "Delivered-To" ["irc@???","irc@???","michael.haardt"] { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if header "Mime-Version" "1.0" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if false { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if true { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if true { discard; } else { keep; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if false { keep; } else { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if false { keep; } elsif true { discard; } else { keep; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if true { discard; } elsif true { keep; } else { keep; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if false { keep; }
       else
       { if true { discard; } else { keep; } }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header :matches "to" "MA*AN@tra*al?.com" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if not header :matches "to" "MA?AN@tra*al?.com" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header :matches "to" "*marian@???" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if not header :matches "to" "?marian@???" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header :matches "to" "marian@???*" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if not header :matches "to" "marian@????" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header :matches "x-special1" "\\?*\\*" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header :matches "x-special1" "*\0*" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if not header :matches "x-special1" "*\0*q" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if not header :matches "x-special2" "\\?*\\*" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if not header :matches "x-special2" "*\0*" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if size :over 400 {
               discard;
               }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if size :over 4K {
               discard;
               }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if size :under 4K { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if size :under 400 { discard; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if false { keep; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # no filter line here
   if unknowntest { keep; }
  @@ -328,12 +328,12 @@
   require "fileinto";
   if true { fileinto "tralalla"; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header ["to"] [ "marian@???", "achnee"] { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "to" [ "egal", "achnee" { keep; }
  @@ -373,7 +373,7 @@
   # Sieve filter
   if header :matches "to" "egal" { keep; }
   ==========
  -Keep
  +Implicit keep
   ==========
   # Sieve filter
   if header :unknown "to" "egal" { keep; }
  @@ -389,64 +389,64 @@
               keep;               # keep in "In" folder
               }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "x-1" "1" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if not header "x-1" "=?ISO-8859-1?Q?=31?=" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "x-1b" "=?ISO-8859-1?Q?=31=" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "x-b64" "This is BASE64" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "x-b64-broken" "=?iso-8859-1?b?VGhpcyBpcyBCQVNFNjQ?=" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "x-q75total" "0123456789012345678901234567890123456789012345678901234567" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "x-q76total" "=?ISO-8859-1?Q?01234567890123456789012345678901234567890123456789012345678?=" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "X-Wrapped" "eins zwei drei" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "x-nomimewrap" "=?iso-8859-1?q?abc def ghi?=" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "subject" "abcdefghi" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   # Sieve filter
   if header "x-mixed" "abc def" { discard; }
   ==========
  -No keep
  +No implicit keep
   ==========
   #Sieve filter
   if true { stop; fileinto "inbox.never"; }
   ==========
  -Keep
  +Implicit keep