STATE_DISCONNECTED
STATE_DISCONNECTED
Client is disconnected.
This class implements the ManageSieve protocol (RFC 5804).
__construct(array $params = array())
Constructor.
If username and password are provided connects to the server and logs in too.
array | $params | A hash of connection parameters:
|
connect(string $host = null, string $port = null, array $context = null, boolean $secure = null)
Handles connecting to the server and checks the response validity.
Defaults from the constructor are used for missing parameters.
string | $host | Hostname of server. |
string | $port | Port of server. |
array | $context | List of options to pass to stream_context_create(). |
boolean | $secure | Security layer requested. @see __construct(). |
login(string $user = null, string $password = null, string $authmethod = null, string $euser = null)
Logs into server.
Defaults from the constructor are used for missing parameters.
string | $user | Login username. |
string | $password | Login password. |
string | $authmethod | Type of login method to use. |
string | $euser | Effective UID (perform on behalf of $euser). |
installScript(string $scriptname, string $script, boolean $makeactive = false)
Adds a script to the server.
string | $scriptname | Name of the script. |
string | $script | The script content. |
boolean | $makeactive | Whether to make this the active script. |
hasSpace(string $scriptname, integer $size) : boolean
Checks if the server has space to store the script by the server.
string | $scriptname | The name of the script to mark as active. |
integer | $size | The size of the script. |
True if there is space.
_cmdAuthenticate(string $uid, string $pwd, string $authmethod = null, string $euser = '')
Handles the authentication using any known method.
string | $uid | The userid to authenticate as. |
string | $pwd | The password to authenticate with. |
string | $authmethod | The method to use. If empty, the class chooses the best (strongest) available method. |
string | $euser | The effective uid to authenticate as. |
_authPLAIN(string $user, string $pass, string $euser)
Authenticates the user using the PLAIN method.
string | $user | The userid to authenticate as. |
string | $pass | The password to authenticate with. |
string | $euser | The effective uid to authenticate as. |
_authLOGIN(string $user, string $pass, string $euser)
Authenticates the user using the LOGIN method.
string | $user | The userid to authenticate as. |
string | $pass | The password to authenticate with. |
string | $euser | The effective uid to authenticate as. Not used. |
_authCRAMMD5(string $user, string $pass, string $euser)
Authenticates the user using the CRAM-MD5 method.
string | $user | The userid to authenticate as. |
string | $pass | The password to authenticate with. |
string | $euser | The effective uid to authenticate as. Not used. |
_authDigestMD5(string $user, string $pass, string $euser)
Authenticates the user using the DIGEST-MD5 method.
string | $user | The userid to authenticate as. |
string | $pass | The password to authenticate with. |
string | $euser | The effective uid to authenticate as. |
_authEXTERNAL(string $user, string $pass, string $euser)
Authenticates the user using the EXTERNAL method.
string | $user | The userid to authenticate as. |
string | $pass | The password to authenticate with. |
string | $euser | The effective uid to authenticate as. |
_doCmd(string $cmd = '', boolean $auth = false) : string
Send a command and retrieves a response from the server.
string | $cmd | The command to send. |
boolean | $auth | Whether this is an authentication command. |
if a NO response.
Reponse string if an OK response.
_getBestAuthMethod(string $authmethod = null) : string
Returns the name of the best authentication method that the server has advertised.
string | $authmethod | Only consider this method as available. |
The name of the best supported authentication method.