Subject: "Any header" test - possible?

From: Alexandros Vellis <[email-masked]>
Date: Mon, 16 Jan 2006 13:24:28 +0200

I am wondering how I could check for e.g. the existence of some text in
*any* header.  [With the text not being an email address so
that :address test is not what I really want].

RFC3028 (+bis) would imply that this is not possible. string-list that
is used in header-list has to have at least one string:

string-list = "[" string *("," string) "]" / string
                   ; if there is only a single string, the brackets
                   ; are optional

So saying

  header :contains [] "some text"

or 

  header :contains "some text"

,implying to match any header, is not valid.

So, is it possible to do what I want in Sieve?

-- 
Alexandros Vellis
[email-masked]

---

From: Alexey Melnikov <[email-masked]>
Date: Mon, 16 Jan 2006 13:47:00 +0000

>So, is it possible to do what I want in Sieve?
I don't think so.
Can you describe a use-case for this feature in more details?

---

From: Alexandros Vellis <[email-masked]>
Date: Mon, 16 Jan 2006 15:57:12 +0200

> Can you describe a use-case for this feature in more details?

I don't have a specific scenario.

I am only doing a simple mapping of IMAP SEARCH commands to Sieve
filtering rules, for the purpose of some GUI convenience: In your MUA,
do a search in your folders, and with just two clicks add the same
criteria in your Sieve script.

Among other things, IMAP SEARCH has the argument:

   TEXT <string>
        Messages that contain the specified string in the header or
        body of the message.

So it seems that this cannot really be specified as Sieve?

I was thinking along the line

    anyof( :body :contains 'foo' , :header _:all?_ :contains 'foo')

-- 
Alexandros Vellis
[email-masked]