ietf-mta-filters
[Top] [All Lists]

Re: SIEVE mime loops

2007-03-19 04:42:05

On Sun, 2007-03-18 at 20:27 -0400, Tony Hansen wrote:
4.1.  Test "header"

   The "header" test is extended with the addition of a new ":mime"
   tagged argument, which takes a number of other arguments.

   Usage:  header [:mime] [:anychild] [MIMEOPTS]
      [COMPARATOR] [MATCH-TYPE]
      <header-names: string-list> <key-list: string-list>

   Usage:  The definition of [MIMEOPTS] is:

      Syntax: ":type" / ":subtype" / ":contenttype" /
      ":param" <param-list: string-list>

this extension would be useful for "string" in variables, too, in
particular the :param bit which allows us to (ab)use a variable as a
hash.

myvar["key"] = "value" could be written:

    set "myvar" "${myvar}; key=value";

to extract it, use

    if string :mime :param "key" :matches "myvar" "*" ...

not sure how to specify this extension conveniently, though.

   When the ":mime" tagged argument is present in the "header" test, it
   will parse the MIME header lines in a message so that tests can be
   performed on specific elements.

   If the ":anychild" tagged argument is NOT specified:

   o  If used within the context of a "for_every_part" iterator, the
      "header" test will examine the headers associated with the current
      MIME part context from the loop.

   o  If used outside the context of a "for_every_part" iterator, the
      "header" test will examine only the outer, top-level, headers of
      the message.

I feel it is unnecessary to change the semantics of "header" when there
is no :mime.  if you don't have access to variables, it can be
inconvenient to write rules which both rely on top-level headers and
MIME properties.  my suggestion is that you need to write :mime to
inspect the inner parts.

   Example:

   require ["mime", "for_every_part", "fileinto"];

   for_every_part
   {
       if header :mime :param "filename" :comparator
          "Content-Disposition" "important"
       {
           fileinto "INBOX.important";
           break;
       }
   }

the comparator is missing in the above example.

7.  SIEVE Capability Strings

perhaps you could add the list of capability strings to the
introduction?  I also think it would be useful if each section
describing an extension named the capability string needed to enable it.

looks good to me!

-- 
Kjetil T.

<Prev in Thread] Current Thread [Next in Thread>