[ingo] RFC: how to support custom sieve filters
Ivan Sergio Borgonovo
mail at webthatworks.it
Thu Aug 28 01:20:37 UTC 2014
I'd like to be able to write my custom sieve filters through a web
interface and as well offer a GUI for less knowledgeable users.
I'm not sure I could find the time to actually propose a patch and even
before thinking about coding I'd like to have some feedback.
While trying to understand how ingo works I ran into something that may
be considered a bug.
Ingo just read DB status ignoring what's the current managesieve status.
So it may happen you disabled ingo filter from another program and
without explicitly enabling it from the ingo interface, but just editing
rules order you may accidentally enable again ingo filter and
consequently disable your custom filter.
And there is no way to revert this change if you just have web access to
managesieve.
That aside it would be nice to have a way to be able to write custom
filters from ingo web interface without renouncing to its GUI and to be
able to enable/disable various script available on the server.
Considering the current structure of the code and the DB it would
require a large refactoring to actually be able to store more than one
sieve filter in the DB.
A possible solution could be to surround ingo generated script with some
kind of delimiter and leave the rest of the script untouched.
So ingo would load the content of a sieve script from the sieve server,
replace or add its part of the script at the end of what it loaded,
leave to the user the chance to edit it from the web and store it back
on the server.
This require very simple parsing of the stored sieve script and it is
incompatible with just an extension I can think of: "global".
require entries can be duplicated but global and include need a defined
order.
To make the whole thing usable I think there are at least some more
details to fix:
- additional permission to let user manually edit their filters
- check response of managesieve server to see if the script contained
any error and report them
- being able to select which filter to edit/add/activate among the one
available on the sieve server
If I've some spare time I think I could be able to implement most of the
features I've described without the need to dig into ingo/horde API.
What could be problematic without a deeper knowledge of horde internals
would be to add permissions to manually edit filters.
--
Ivan Sergio Borgonovo
http://www.webthatworks.it
More information about the ingo
mailing list