API Documentation

Mail/Protocol/Smtp/Auth/Crammd5.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Mail  
subpackage
Protocol  
version
$Id: Crammd5.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Mail_Protocol_Smtp_Auth_Crammd5

Performs CRAM-MD5 authentication

Minimum implementation according to RFC2821: EHLO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, QUIT

Extends from
\Zend_Mail_Protocol_Smtp
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Mail  
subpackage
Protocol  
version
$Id: Abstract.php 23775 2011-03-01 17:25:24Z ralph $  

Methods

methodpublic__construct( string $host = 127.0.0.1, int $port = null, array $config = null ) : void

Constructor.

Parameters
Name Type Description
$host string

(Default: 127.0.0.1)

$port int

(Default: null)

$config array

Auth-specific parameters

Throws
Exception Description
\Zend_Mail_Protocol_Exception
methodpublic__destruct( ) : void

Class destructor to cleanup open resources

Inherited from: \Zend_Mail_Protocol_Abstract::__destruct()
methodprotected_addLog( string $value ) : void

Add the transaction log

Inherited from: \Zend_Mail_Protocol_Abstract::_addLog()
Parameters
Name Type Description
$value string new transaction
methodprotected_connect( string $remote ) : boolean

Connect to the server using the supplied transport and target

Inherited from: \Zend_Mail_Protocol_Abstract::_connect()

An example $remote string may be 'tcp://mail.example.com:25' or 'ssh://hostname.com:2222'

Parameters
Name Type Description
$remote string Remote
Returns
Type Description
boolean
Throws
Exception Description
\Zend_Mail_Protocol_Exception
methodprotected_disconnect( ) : void

Disconnect from remote host and free resource

Inherited from: \Zend_Mail_Protocol_Abstract::_disconnect()
methodprotected_ehlo( string $host ) : void

Send EHLO or HELO depending on capabilities of smtp host

Inherited from: \Zend_Mail_Protocol_Smtp::_ehlo()
Parameters
Name Type Description
$host string

The client hostname or IP address (default: 127.0.0.1)

Throws
Exception Description
\Zend_Mail_Protocol_Exception
methodprotected_expect( string|array $code,  $timeout = null ) : string

Parse server response for successful codes

Inherited from: \Zend_Mail_Protocol_Abstract::_expect()

Read the response from the stream and check for expected return code. Throws a Zend_Mail_Protocol_Exception if an unexpected code is returned.

Parameters
Name Type Description
$code string|array One or more codes that indicate a successful response
$timeout
Returns
Type Description
string Last line of response string
Throws
Exception Description
\Zend_Mail_Protocol_Exception
methodprotected_hmacMd5( string $key, string $data, string $block = 64 ) : string

Prepare CRAM-MD5 response to server's ticket

Parameters
Name Type Description
$key string

Challenge key (usually password)

$data string Challenge data
$block string Length of blocks
Returns
Type Description
string
methodprotected_receive(  $timeout = null ) : string

Get a line from the stream.

Inherited from: \Zend_Mail_Protocol_Abstract::_receive()
Parameters
Name Type Description
$timeout
Returns
Type Description
string
Throws
Exception Description
\Zend_Mail_Protocol_Exception
Details
integer
Per-request timeout value if applicable
methodprotected_send( string $request ) : integer|boolean

Send the given request followed by a LINEEND to the server.

Inherited from: \Zend_Mail_Protocol_Abstract::_send()
Parameters
Name Type Description
$request string
Returns
Type Description
integerboolean Number of bytes written to remote host
Throws
Exception Description
\Zend_Mail_Protocol_Exception
methodprotected_setStreamTimeout( integer $timeout ) : boolean

Set stream timeout

Inherited from: \Zend_Mail_Protocol_Abstract::_setStreamTimeout()
Parameters
Name Type Description
$timeout integer
Returns
Type Description
boolean
methodprotected_startSession( ) : void

Start mail session

Inherited from: \Zend_Mail_Protocol_Smtp::_startSession()
methodprotected_stopSession( ) : void

Stop mail session

Inherited from: \Zend_Mail_Protocol_Smtp::_stopSession()
methodpublicauth( ) : void

Default authentication method

This default method is implemented by AUTH adapters to properly authenticate to a remote host.

Throws
Exception Description
\Zend_Mail_Protocol_Exception
Details
todo
Perform CRAM-MD5 authentication with supplied credentials  
methodpublicconnect( ) : boolean

Connect to the server with the parameters given in the constructor.

Inherited from: \Zend_Mail_Protocol_Smtp::connect()

Concrete adapters for this class will implement their own unique connect scripts, using the _connect() method to create the socket resource.

Returns
Type Description
boolean
methodpublicdata( string $data ) : void

Issues DATA command

Inherited from: \Zend_Mail_Protocol_Smtp::data()
Parameters
Name Type Description
$data string
Throws
Exception Description
\Zend_Mail_Protocol_Exception
methodpublicdisconnect( ) : void

Closes connection

Inherited from: \Zend_Mail_Protocol_Smtp::disconnect()
methodpublicgetLog( ) : string

Retrieve the transaction log

Inherited from: \Zend_Mail_Protocol_Abstract::getLog()
Returns
Type Description
string
methodpublicgetMaximumLog( ) : int

Get the maximum log size

Inherited from: \Zend_Mail_Protocol_Abstract::getMaximumLog()
Returns
Type Description
int the maximum log size
methodpublicgetRequest( ) : string

Retrieve the last client request

Inherited from: \Zend_Mail_Protocol_Abstract::getRequest()
Returns
Type Description
string
methodpublicgetResponse( ) : array

Retrieve the last server response

Inherited from: \Zend_Mail_Protocol_Abstract::getResponse()
Returns
Type Description
array
methodpublichelo( string $host = 127.0.0.1 ) : void

Initiate HELO/EHLO sequence and set flag to indicate valid smtp session

Inherited from: \Zend_Mail_Protocol_Smtp::helo()
Parameters
Name Type Description
$host string

The client hostname or IP address (default: 127.0.0.1)

Throws
Exception Description
\Zend_Mail_Protocol_Exception
methodpublicmail( string $from ) : void

Issues MAIL command

Inherited from: \Zend_Mail_Protocol_Smtp::mail()
Parameters
Name Type Description
$from string Sender mailbox
Throws
Exception Description
\Zend_Mail_Protocol_Exception
methodpublicnoop( ) : void

Issues the NOOP command and validates answer

Inherited from: \Zend_Mail_Protocol_Smtp::noop()

Not used by Zend_Mail, could be used to keep a connection alive or check if it is still open.

methodpublicquit( ) : void

Issues the QUIT command and clears the current session

Inherited from: \Zend_Mail_Protocol_Smtp::quit()
methodpublicrcpt( string $to ) : void

Issues RCPT command

Inherited from: \Zend_Mail_Protocol_Smtp::rcpt()
Parameters
Name Type Description
$to string

Receiver(s) mailbox

Throws
Exception Description
\Zend_Mail_Protocol_Exception
methodpublicresetLog( ) : void

Reset the transaction log

Inherited from: \Zend_Mail_Protocol_Abstract::resetLog()
methodpublicrset( ) : void

Issues the RSET command and validates answer

Inherited from: \Zend_Mail_Protocol_Smtp::rset()

Can be used to restore a clean smtp communication state when a transaction has been cancelled or commencing a new transaction.

methodpublicsetMaximumLog( integer $maximumLog ) : void

Set the maximum log size

Inherited from: \Zend_Mail_Protocol_Abstract::setMaximumLog()
Parameters
Name Type Description
$maximumLog integer Maximum log size
methodpublicvrfy( string $user ) : void

Issues the VRFY command and validates answer

Inherited from: \Zend_Mail_Protocol_Smtp::vrfy()

Not used by Zend_Mail.

Parameters
Name Type Description
$user string User Name or eMail to verify
Documentation was generated by DocBlox 0.13.3.