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



On Tue, 2003-07-29 at 14:28, Not Zed wrote:

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

So you mean storing the information about the filters locally using XML
and write those filters to the server each time one gets changed/added ?

IMHO all information about the filters; for remote servertypes like
Exchange, OpenGroupware.Org, IMAP, ...; should be stored on the server.

That's the only way you can be sure that if you run multiple copies of
Evolution, the filters will be recognised on all clients.

Regretfully it is not possible to make Exchange recognise the Sieve
filterscript and parse it to it's GUI but if I am going to create a GUI
for such Sieve-scripts .. I want it to work on multiple
Evolution-instances simultaneously.

I do agree with you that this meta-data should be the same as what
evolution wants to read for the other filter-types.

So I would store all meta-data on the server using comments the way the
language wants it.

Examples :

For .procmailrc

# <rule grouping="any" source="incoming">
#  <title>Apple news</title>
#  <partset>
#    <part name="sender">
#      <value name="sender-type" type="option" value="contains"/>
#      <value name="sender" type="string">
#        <string>noreply adc apple com</string>
#      </value>
#    </part>
#  </partset>
#  <actionset>
#    <part name="move-to-folder">
#      <value name="folder" type="folder">
#        <folder uri="INBOX.Newslists"/>
#      </value>
#    </part>
#    <part name="stop"/>
#  </actionset>

# <scriptsource type="procmail"><![CDATA[

:0
* ^From: *noreply\ adc\ apple\ com
.INBOX.Newslists/

# ]]></scriptsource>
# </rule>

for Sieve :

# <rule grouping="any" source="incoming">
#  <title>Apple news</title>
#  <partset>
#    <part name="sender">
#      <value name="sender-type" type="option" value="contains"/>
#      <value name="sender" type="string">
#        <string>noreply adc apple com</string>
#      </value>
#    </part>
#  </partset>
#  <actionset>
#    <part name="move-to-folder">
#      <value name="folder" type="folder">
#        <folder uri="INBOX.Newslists"/>
#      </value>
#    </part>
#    <part name="stop"/>
#  </actionset>

# <scriptsource type="procmail"><![CDATA[

if address :contains "From" "noreply adc apple com" {
        fileinto "INBOX.Newsletters";
        stop;
}

# ]]></scriptsource>
# </rule>

When evolution reads the filter from the source it will then first have
to go through a text-filter which is abstract (so must be implemented in
a filter-implementation). The procmail and Sieve implementations will
remove the "# " and "#" characters from such lines. The implementation
should then ignore the <scriptsource/> tag and rewrite the rule using
the XML meta-data.

But thats just my idea .. 


-- 
Philip Van Hoof, Software Developer @ Cronos
home: me at freax dot org
work: Philip dot VanHoof at cronos dot be
http://www.freax.be, http://www.freax.eu.org




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