[Dovecot] MANAGESIEVE patch v2

Stephan Bosch sirius at drunksnipers.com
Fri Jul 28 01:10:35 EEST 2006


Hello Timo,

Dispite the heat out here, I managed to come up with a new version of 
the managesieve patch for dovecot-1.0rc2:

- Fixed the bug (missing CRLF) in the authenticate command
- Modified the sieve storage library making the interface much less crude.
- The scripts put on the server using the putscript command are now 
checked before they are accepted.
- The reported SIEVE capability is now directly read from the sieve 
implementation (in this case cmu), listing much more than "FILEINTO 
VACATION".
- Fixed some minor bugs in the putscript command

Considering the dovecot-sieve plugin, I noticed that you obviously do 
not want to include the cmu sieve code in the main dovecot source tree. 
Unfortunately I did not see any other way but to include this library in 
  my patch to make it support checking the uploaded scripts (for now).

There are a few alternatives to solve this issue. We could combine de 
dovecot-sieve plugin with the managesieve patch yielding a single large 
sieve plugin. However, this would require some means to let the master 
know about the new managesieve process type. This could be achieved with 
some more plugin magic.

Another way to solve this problem is by truly only excluding the cmu 
source from the main dovecot tree. If the interface of the sieve 
implementation is abstracted somehow, one could build a plugin interface 
for sieve implementations. This sieve interface would be common to 
dovecot-deliver and the managesieve daemon. This way, it does not matter 
how the sieve language is implemented (dovecot could even implement its 
own and still support cmu and others). I saw a hint to this solution in 
your original dovecot-lda plugin (i.e. sieve-mailutils.c etc), so you 
must have been playing with this idea as well.

I took the liberty to define an example interface for the sieve 
implementations in the src/lib-sieve directory. It was concieved very 
quickly and it is far from complete, but it should support the current 
features of the delivery process. It is only tested for the managesieve 
putscript verification (no script was ever run though this interface). I 
am also not quite happy with the error reporting scheme of this 
interface. This needs more work and if you don't like it you can of 
course discard it entirely and define your own.

Currently, I am also testing other sieve implementations. I am 
experimenting with libsieve2 (libsieve.sourceforge.net) and with 
building a wrapper around 'exim -bf'. This last solution is of course 
not useful for dovecot-lda, but I think the managesieve daemon is not 
only useful for dovecot itself. Support for these implementations is not 
yet included in this patch.

The patch can be downloaded at:

http://sinas.rename-it.nl/~sirius/dovecot-1.0.rc2-MANAGESIEVE-v2.diff.gz

(Simply apply it (-p0) to a clean 1.0rc2 source tree and run autogen.sh 
etc.)

For testing, I have tried other client implementations than horde-ingo, 
but somehow everyone is very focused on the timsieve daemon and they 
tend to require its protocol specifics. The only other implementation I 
got working is smartsieve. The others either crashed or produced 
protocol errors (i.e. sieveshell). I hope I can get more client 
implementations to work to ensure the incompatibilies are not my fault.

I am very eager to know what you think about the sieve implementation 
ideas and what you think of the new managesieve patch.

Regards,

--
Stephan Bosch
stephan at rename-it.nl










More information about the dovecot mailing list