Subject: Re: extensions and sieve

From: "Nigel Swinson" <[email-masked]>
Date: Thu, 20 Mar 2003 00:17:20 -0000

> Here's a hasty first draft:
>
> Test mimeheader
>
>    Syntax: mimeheader [:param <params:string-list>] [COMPARATOR]
[MATCH-TYPE]
>              <header-names: string-list> <key-list: string-list>
>
>    The "mimeheader" test evaluates to true if any of the values of
>    the named MIME headers match any of the keys.  The type of match
>    is specified by the optional [MATCH-TYPE] argument, which defaults
>    to ":is", as specified in section 2.6 of [SIEVE].

Given that I won't be in San Fransisco for tommorow's 11:30am meeting, I
thought I'd throw in my 2p (or should I say 2cents) and say that I like
Jutta's draft.  It solves part of the problem that my cheap and dirty
"x_body" test offers :o)

However I think I preferred my "recursive" extension that I suggested in
http://www.imc.org/ietf-mta-filters/mail-archive/msg01070.html.  Nobody
seemed to respond to that suggestion (perhaps cos you all hated it?).  Mime
structure is pretty recursive after all....

So I'd recon we should have two extensions:

:param - which allows you to split off this stuff
    *(token / <tspecial other than ;>) *(; name=value)

    [We should allow some way of matching only the "token" bit, so if the
header is:
        Content-Type: text/plain;  charset="US-ASCII"
    Then we only match the "text/plain" bit.  Maybe a blank param?  ie
:param "" ?]

:recursive - which operates recursively on main mail headers through to all
body part headers, but could also apply to the exists and size tests too.

Ideally you'd be able to have some kind of "select" test that would select a
body part, then filter on only that content.  Maybe a "with".  So rather
than the "allof" test that looks for a message that matches all criteria,
the "with" would look for a single body part that matches all the criteria.
So you could say:

    if with (header :recursive :param "charset" :is "Content-Type"
"US-ASCII",
                header :recursive :param "" :contains "Content-Type" "text",
                body :contains "sex")
        {}

It seems like we really want to get our body and our header tests all
working well together rather than in isolation.  Hope you have a productive
meeting tommorow!

Cheers

Nigel