Stephan Bosch wrote:
Nice, I'll do some tests with this one as well.
Don't bother. It only succeeded in logging in once and then froze solid every other time; don't know why. Smartsieve works, though:
http://smartsieve.sourceforge.net/
but you have to change lib/sieve.lib (which stupidly hardcodes for timsieved). Once you tweak that file, it works fine (though I'm still not happy with the ability to create rules using a web-GUI, but you cannot edit them except as a script).
I tested websieve, being more inclined to work in Perl than PHP, but it hasn't been updated is several years and appears to be broken. One thing that testing showed was that the string length (e.g. {13+}) is part of the API that the draft RFC doesn't cover fully. In particular, websieve wanted to send the string length as part of the AUTHENTICATE stanza (which your code didn't like). You should probably just expect a string length for any command and just discard it when you don't care.
I know, the reported sieve capabilities are currently very much hardcoded. I didn't look at the CMU sieve library just yet, so I simply hardcoded the response given in the draft RFC. Maybe the CMU library even includes some capability macro (or whatever) I can use.
See these pages:
http://libsieve.sourceforge.net/functions.php
http://libsieve.sourceforge.net/structures.php
http://libsieve.sourceforge.net/example.php
specifically sieve2_validate() is all you should need to call in PUTSCRIPT. Looking at the actual header files, it appears that sieve2_listextensions() will show you which extensions are supported (but you have to provide a callback for each one you wish to support). Those pages don't have the most recent API listed.
HTH
John
-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748