Mark E. Mallett wrote:
Some more random comments.
1. Introduction
> This extension depends on the presence of "variables" extension
> [Variables].
Should you mention that this isn't an automatic dependency? i.e.
that the script writer still has to require variables?
I've added:
This means that a script using this extension MUST list both
"variables" and "imap4flags" in a require statement.
in order to clarify.
<<Extension name has been changed as revision 03 of this document is widely
deployed in CMU Cyrus server>>
Isn't this problematic in terms of the relationship between drafts
and implementations?
It is surely is, but I don't know a generic solution for the problem.
2.1. General requirements for flag handling
> A string
> containing a space separated list of flags ...
nit: "space-separated"
(repeat for other occurances in the document)
fixed.
> If a flag validity check fails the flag should be silently
> dropped, but a warning message should be logged by the Sieve interpreter.
nit one: I would say "ignored" since "dropped" could be read as
"removed from the message" rather than "not paid attention to in the
Sieve statement." (Even though the flag wouldn't be associated with the
message if it's invalid: but I'm talking English grammar here, not
logic.)
Ok.
nit two: I would use a word other than "logged" -- warnings may
be issued in other ways than logging.
nit three: should "should" be "SHOULD" ?
Yes.
nit four: if the error should be reported, in what way is it silently
ignored?
Maybe the better way of conveying my idea is to say that a failure to
set a certain flag doesn't stop other flags from being set and doesn't
cause a runtime error.
3. Actions
> The "set" action
> defined in [Variables] can be used to replaces an existing set of flags
> with a new set as well.
nit: "replace" (instead of "replaces")
Thanks.
3.1. Setflag Action
> if header :contains "from" "boss(_at_)frobnitzm(_dot_)edu" {
Prohibition on using real domain names in documents? (i.e.,
"example.edu") Repeat for other occurances in the document.
Fixed.
4. Test hasflag
I'm having a hard time understanding what this test does in other than
simple cases.
> The "hasflag" test evaluates to true if any of the variables matches any
> flag name.
Does this mean "contains any of the flags listed in list-of-flags" ?
or "contains all of the flags listed in list-of-flags"?
or "matches (according to match-type) the concatenation of flags
contained in all of the list-of-flags strings, subject to canonical
re-ordering"?
"any flag name" means the first choice.
Does each string in "list-of-flags" contain exactly one flag, or can
each string be a list of flags as in other usage?
The intention was to have the former. I will try to clarify.
Perhaps more examples would help.
Yes.
6. Implementation Notes
> "addflag <variable> <flag>" can be implemented as:
>
> if not string :matches :comparator "i;ascii-casemap"
> " ${<variable>} " "* <flag> *" {
> set <variable> "${<variable>} <flag>"
> }
Note that you'll get a superfluous leading space if <variable> starts
out empty. Probably doesn't need saying, though, except that the
following "removeflag" example goes to great pains to remove leading
and trailing spaces.
Ok.
> "removeflag <variable> <flag>" can be implemented as:
>
> if string :matches :comparator "i;ascii-casemap" " ${<variable>} "
> "* <flag> *" {
> set <variable> "${1}${2}";
> }
Should be "${1} ${2}", no?
Good catch, thanks.
10. Extended example
> elsif anyof (not address :all :contains
> ["To", "Cc"] "me(_at_)company(_dot_)com",
> header :matches "subject"
> ["*make*money*fast*", "*university*dipl*mas*"])
> {
> remove "MyFlags" "\\Flagged";
> # If message header does not contain my address,
> # it's from a list.
> fileinto :flags "${MyFlags}" "spam"; # move to "spam" folder
> }
> else
> {
> # Move all other (non-company) mail to "personal"
> # folder.
My eyes may be glazing over, but have we really established
"non-company" mail at this point? One of the ways we get here
is if "to" or "cc" contain "me(_at_)company(_dot_)com"
Everything which is not from the known mailing lists, non-company
related (not sent/addressed by/to people from the company) and addressed
to me goes to "personal".
Thank you for the comments!
Alexey