protected function authCramMd5()
    {
        $this->sendData( 'AUTH CRAM-MD5' );
        if ( $this->getReplyCode( $response ) !== '334' )
        {
            throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH CRAM-MD5.' );
        }

        $serverDigest = trim( substr( $response, 4 ) );
        $clientDigest = hash_hmac( 'md5', base64_decode( $serverDigest ), $this->password );
        $login = base64_encode( "{$this->user} {$clientDigest}" );

        $this->sendData( $login );
        if ( $this->getReplyCode( $error ) !== '235' )
        {
            throw new ezcMailTransportSmtpException( 'SMTP server did not accept the provided username and password.' );
        }

        return true;
    }