Net_SieveThis class enables you to talk to the timsieved server that comes with Cyrus IMAP. This means you can install, list, update and set active Sieve scripts. You can download it via the PEAR web site. The PEAR info page is here. It requires the Net_Socket class which you can get here, which in turn relies on the PEAR library. If you do not have the PEAR library (try doing a require('PEAR.php');) you can get it here. Some basic documentation of the API is below. It has only been tested with Cyrus 2.0.16. Class APIConstructorArguments:
Simply sets up the object and connects to the server. If there is an error it will be set in the _error property. listScripts()No arguments. Returns a numerically indexed array of scriptnames that are currently installed on the server. getActive()No arguments. Returns the name of the currently active script. setActive()Arguments:
Sets the active script to the given script name. getScript()Arguments:
Returns the script with the given name. installScript()Arguments:
This function adds a script (second argument) to the server with the given name (first argument). It will optionally make it active (third argument). removeScript()Arguments:
Deletes the given script from the server getError()If the _error property is an error (an object of class PEAR_Error), this function will return it. It will return false otherwise. Use to determine if there was an error during the call to the constructor. Link to meIf you use any of the code on this site (and if you don't I guess) or it makes your life easier, I'd appreciate a link - http://www.phpguru.org. Thanks! |
