[Top] [All Lists]

Re: Comments on draft-daboo-sieve-mime-00.txt

2004-03-17 14:47:58

This all mostly sounds very good.  Some random reflections:

Thanks Mark :o)

I too think that ":value" is not the best choice, for various reasons,
some of which have been already stated.  

To be honest I'm not a fan of :value either, so am more than happy for an 

":type" probably works for
the mime headers but might not be as meaningful if this is later used
to apply to other headers of similar form.  What there really are are
fixed parts and variable keyword=value parts.  This doesn't really
inspire any other good names, though.

I don't mind :type but I'm wondering if :noparameters is best, as this pairs 
neatly with :parameters <string-list>?  

    if header :bodyparts :contains "Content-Type" "text/html"

Do you intend :bodyparts to select the mime parts in the message body,
or in the entire message (i.e., does it include or exclude the message
header?)  My preference would be the body only, so that one can have
the most flexibility.

I had intended it to be the entire message, but not out of strong desire.  I 
guess if I was writing a test, I would care less about where in the email 
message the entity of interest was and more about it's prescense.  With our 
header test we aren't told about where in the headers the header is, and if you 
have a multipart/alternative structure or multipart/mixed then I'm not sure 
there is a logical distinction in the order.  So I think to neatly be able to 
say "is there any text/html body part in this email" is more useful than saying 
"is there a text/html body part in one of the child body parts?"

Were we to really need to know if the text/html body part was not the "root" 
body part, then we could use an allof test:

if allof (header :bodyparts :noparameters :contains "Content" "text/html",
          not header :noparameters :contains "Content" "text/html")

Then if we combine this with allof(), we could further define that
multiple tests within an allof() must apply to the same body part.  So
if we say:

    if allof :bodyparts (header :value :contains "Content-Type" 
                                  size :over 100K)

Syntactically this is interesting, although as I've said before I think
a full-fledged notion of "views" would be more so (but obviously that's a
whole nother track).  I wonder how various implementors feel about
connecting "allof" with its contained tests in this way -- especially
if they are allowed to nest.

Originally I thought we should have a concept of "selection" of a body part and 
then be able to perform tests on it.  Couldn't get anywhere with the idea 
though, as I just thought it would end up in a hell of indexes into arrays of 
body parts, and also how would you "select" a body part?

6) Test for text in any parameter values only in a specific MIME header

    if (mimeheader :name "Content-Disposition" :parameter-value :contains 

if header :bodyparts :anyparameter :contains "Content-Disposition" ".exe"

Rather than introduce another keyword, I'd suggest using a special
parameter value string to match any actual parameter.  e.g.:

    if header :bodyparts :parameter "" :contains "Content-Disposition" ".exe"
    if header :bodyparts :parameter "*" :contains "Content-Disposition" ".exe"

Good ideas :o)  As I said, I'm not sure a concept of "anyparameter" or 
"anyheader" is particularly core to this extension so would think we'd have to 
justify it's usefulness before deciding to add it to the extension.  Certainly 
anyheader probably shouldn't be in a mime extension, but anyparameter might be.
Perhaps even say that the ":parameter" value is tested using a wildcard
match (a la :matches).

We haven't seen the facility for using wildcards on header names, so I'm not 
sure we need it for parameter names either as I think the two concepts are very