RE: [Evolution-hackers] Re: [Evolution] Sieve support



On Tue, 2003-07-29 at 07:18, Philip Van Hoof wrote:
> > > Example:
> > > 
> > > # <evolution:sieverule name="Apple Newslists">
> > > if address :contains "From" "noreply adc apple com" {
> > >         fileinto "INBOX.Newsletters";
> > >         stop;
> > > }
> > > # </evolution:rule>
>  
> > Yes, that's basically what I was imagining. The easiest way 
> > would be to say that the user isn't allowed to edit the sieve 
> > script by hand. Although if the server supports the sieve 
> > "include" extension, then the evo rules could be saved to one 
> > file and then the user could include that into the main 
> > ruleset himself.
> 
> It looks like it does support an Include extension :
> 
> http://www.ietf.org/internet-drafts/draft-daboo-sieve-include-00.txt
> Found on http://www.cyrusoft.com/sieve/
> 
> But then it's still not trivial to create a Sieve-parser to parse the
> scripts Into a GUI like the Filter-editor. I guess/fear that meta-data
> per rule will be necessary per rule.

What about doing it the other way around, e.g. similar to the way
filters are created now?

The code that builds complex rules doesn't really know anything
semantically about the rules it combines, other than how to and/or
them.  It uses xml to store the structure of the combinations/rule
parameters, which is then 'executed' to form the string which is the
actual filter search expression.

The code that handles filters doesn't need to parse the rules, it just
assumes the rule 'bits' taken from the definition files are in the
proper syntax for the backend, and it knows the syntax for intersection,
union, sequence (for actions), etc.

This is assuming things like and/or can be done in an easy hierarchical
way.  e.g. in evolution it just needs to output "(and ", the combining
expressions, then ")" for intersection.

The benefit of this is we can use the same ui code for all of it, and
just need to tweak the expression generating code for the different
output syntax.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]