프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$supportedAuthMethods | array | Can be overwritten if having problems with certain methods. | |
$supportedSASLAuthMethods | array | SASL authentication methods that require Auth_SASL. |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_logger | string | array | Logging handler. | |
$_maxReferralCount | array | Maximum number of referral loops | |
$_params | array | Parameters and connection information. | |
$_sock | The socket client. | ||
$_state | integer | One of the STATE_* constants. |
메소드 | 설명 | |
---|---|---|
__construct ( array $params = [] ) | Constructor. | |
connect ( string $host = null, string $port = null, array $context = null, boolean $secure = null ) | Handles connecting to the server and checks the response validity. | |
disconnect ( boolean $sendLogoutCMD = true ) | Disconnect from the Sieve server. | |
getActive ( ) : string | Returns the active script. | |
getAuthMechs ( ) : array | Returns the list of authentication methods the server supports. | |
getExtensions ( ) : array | Returns the list of extensions the server supports. | |
getScript ( string $scriptname ) : string | Retrieves a script. | |
hasAuthMech ( string $method ) : boolean | Returns whether the server supports an authentication method. | |
hasExtension ( string $extension ) : boolean | Returns whether the server supports an extension. | |
hasSpace ( string $scriptname, integer $size ) : boolean | Checks if the server has space to store the script by the server. | |
installScript ( string $scriptname, string $script, boolean $makeactive = false ) | Adds a script to the server. | |
listScripts ( ) : array | Returns an indexed array of scripts currently on the server. | |
login ( string $user = null, string $password = null, string $authmethod = null, string $euser = null ) | Logs into server. | |
removeScript ( string $scriptname ) | Removes a script from the server. | |
setActive ( string $scriptname ) | Sets the active script. | |
setLogger ( object $logger ) | Passes a logger for debug logging. |
메소드 | 설명 | |
---|---|---|
_authCRAMMD5 ( string $user, string $pass, string $euser ) | Authenticates the user using the CRAM-MD5 method. | |
_authDigestMD5 ( string $user, string $pass, string $euser ) | Authenticates the user using the DIGEST-MD5 method. | |
_authEXTERNAL ( string $user, string $pass, string $euser ) | Authenticates the user using the EXTERNAL method. | |
_authLOGIN ( string $user, string $pass, string $euser ) | Authenticates the user using the LOGIN method. | |
_authPLAIN ( string $user, string $pass, string $euser ) | Authenticates the user using the PLAIN method. | |
_checkAuthenticated ( ) | Asserts that the client is in authenticated state. | |
_checkConnected ( ) | Asserts that the client is in disconnected state. | |
_cmdAuthenticate ( string $uid, string $pwd, string $authmethod = null, string $euser = '' ) | Handles the authentication using any known method. | |
_cmdCapability ( ) | Sends the CAPABILITY command | |
_cmdDeleteScript ( string $scriptname ) | Removes a script from the server. | |
_cmdGetScript ( string $scriptname ) : string | Retrieves the contents of the named script. | |
_cmdListScripts ( ) : array | Returns the list of scripts on the server. | |
_cmdLogout ( boolean $sendLogoutCMD = true ) | Logs out of the server and terminates the connection. | |
_cmdPutScript ( string $scriptname, string $scriptdata ) | Adds a script to the server. | |
_cmdSetActive ( string $scriptname ) | Sets the active script, i.e. the one that gets run on new mail by the server. | |
_debug ( string $message ) | Write debug text to the current log handler. | |
_doCmd ( string $cmd = '', boolean $auth = false ) : string | Send a command and retrieves a response from the server. | |
_escape ( string $string ) : string | Converts strings into RFC's quoted-string or literal-c2s form. | |
_getBestAuthMethod ( string $authmethod = null ) : string | Returns the name of the best authentication method that the server has advertised. | |
_handleConnectAndLogin ( ) | Connects to the server and logs in. | |
_parseCapability ( string $data ) | Parses the response from the CAPABILITY command and stores the result in $_capability. | |
_recvBytes ( integer $length ) : string | Receives a number of bytes from the server. | |
_recvLn ( ) : string | Receives a single line from the server. | |
_sendCmd ( string $cmd ) | Sends a command to the server | |
_sendStringResponse ( string $str ) | Sends a string response to the server. |
public __construct ( array $params = [] ) | ||
$params | array | A hash of connection parameters: - host: Hostname of server (DEFAULT: localhost). Optionally prefixed with protocol scheme. - port: Port of server (DEFAULT: 4190). - user: Login username (optional). - password: Login password (optional). - authmethod: Type of login to perform (see $supportedAuthMethods) (DEFAULT: AUTH_AUTOMATIC). - euser: Effective user. If authenticating as an administrator, login as this user. - bypassauth: Skip the authentication phase. Useful if passing an already open socket. - secure: Security layer requested. One of: - true: (TLS if available/necessary) [DEFAULT] - false: (No encryption) - 'ssl': (Auto-detect SSL version) - 'sslv2': (Force SSL version 3) - 'sslv3': (Force SSL version 2) - 'tls': (TLS; started via protocol-level negotation over unencrypted channel) - 'tlsv1': (TLS version 1.x connection) - context: Additional options for stream_context_create(). - logger: A log handler, must implement debug(). |
protected _checkAuthenticated ( ) |
protected _checkConnected ( ) |
protected _cmdAuthenticate ( string $uid, string $pwd, string $authmethod = null, string $euser = '' ) | ||
$uid | string | The userid to authenticate as. |
$pwd | string | The password to authenticate with. |
$authmethod | string | The method to use. If empty, the class chooses the best (strongest) available method. |
$euser | string | The effective uid to authenticate as. |
protected _cmdDeleteScript ( string $scriptname ) | ||
$scriptname | string | Name of the script to delete. |
protected _cmdGetScript ( string $scriptname ) : string | ||
$scriptname | string | Name of the script to retrieve. |
리턴 | string | The script. |
protected _cmdListScripts ( ) : array | ||
리턴 | array | An array with the list of scripts in the first element and the active script in the second element. |
protected _cmdLogout ( boolean $sendLogoutCMD = true ) | ||
$sendLogoutCMD | boolean | Whether to send LOGOUT command before disconnecting. |
protected _cmdPutScript ( string $scriptname, string $scriptdata ) | ||
$scriptname | string | Name of the new script. |
$scriptdata | string | The new script. |
protected _cmdSetActive ( string $scriptname ) | ||
$scriptname | string | The name of the script to mark as active. |
protected _getBestAuthMethod ( string $authmethod = null ) : string | ||
$authmethod | string | Only consider this method as available. |
리턴 | string | The name of the best supported authentication method. |
protected _handleConnectAndLogin ( ) |
protected _parseCapability ( string $data ) | ||
$data | string | The response from the capability command. |
protected _recvBytes ( integer $length ) : string | ||
$length | integer | Number of bytes to read. |
리턴 | string | The server response. |
protected _sendStringResponse ( string $str ) | ||
$str | string | The string to send. |
public disconnect ( boolean $sendLogoutCMD = true ) | ||
$sendLogoutCMD | boolean | Whether to send LOGOUT command before disconnecting. |
public getAuthMechs ( ) : array | ||
리턴 | array | List of authentication methods. |
public getExtensions ( ) : array | ||
리턴 | array | List of extensions. |
public hasAuthMech ( string $method ) : boolean | ||
$method | string | The method to check. |
리턴 | boolean | Whether the method is supported. |
public hasExtension ( string $extension ) : boolean | ||
$extension | string | The extension to check. |
리턴 | boolean | Whether the extension is supported. |
public listScripts ( ) : array | ||
리턴 | array | Indexed array of scriptnames. |
public removeScript ( string $scriptname ) | ||
$scriptname | string | Name of the script. |
protected array $_maxReferralCount | ||
리턴 | array |
public array $supportedAuthMethods | ||
리턴 | array |
public array $supportedSASLAuthMethods | ||
리턴 | array |