Mail/Protocol/Smtp/Auth/Crammd5.php
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-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Mail
- Subpackage
- Protocol
- Version
- $Id: Crammd5.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Mail_Protocol_Smtp_Auth_Crammd5
Minimum implementation according to RFC2821: EHLO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, QUIT
- Parent(s)
- \Zend_Mail_Protocol_Smtp < \Zend_Mail_Protocol_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Version
- $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $
Constants

EOL
= "\r\n"
- Inherited_from
- \Zend_Mail_Protocol_Abstract::EOL
- Inherited_from
- \Zend_Mail_Protocol_Smtp::EOL

TIMEOUT_CONNECTION
= 30
- Inherited_from
- \Zend_Mail_Protocol_Abstract::TIMEOUT_CONNECTION
- Inherited_from
- \Zend_Mail_Protocol_Smtp::TIMEOUT_CONNECTION
Properties


\unknown_type $_auth = false
false
Details- Type
- \unknown_type
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_auth


\unknown_type $_data = null
null
Details- Type
- \unknown_type
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_data


\unknown_type $_helo = false
false
Details- Type
- \unknown_type
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_helo


string $_host
- Type
- string
- Inherited_from
- \Zend_Mail_Protocol_Abstract::$$_host
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_host


array $_log = array()
array()
Details- Type
- array
- Inherited_from
- \Zend_Mail_Protocol_Abstract::$$_log
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_log


\unknown_type $_mail = false
false
Details- Type
- \unknown_type
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_mail


integer $_maximumLog = 64
64
Details- Type
- integer
- Inherited_from
- \Zend_Mail_Protocol_Abstract::$$_maximumLog
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_maximumLog


integer $_port
- Type
- integer
- Inherited_from
- \Zend_Mail_Protocol_Abstract::$$_port
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_port


\unknown_type $_rcpt = false
false
Details- Type
- \unknown_type
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_rcpt


string $_request
- Type
- string
- Inherited_from
- \Zend_Mail_Protocol_Abstract::$$_request
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_request


array $_response
- Type
- array
- Inherited_from
- \Zend_Mail_Protocol_Abstract::$$_response
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_response


string $_secure
- Type
- string
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_secure


boolean $_sess = false
false
Details- Type
- boolean
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_sess


resource $_socket
- Type
- resource
- Inherited_from
- \Zend_Mail_Protocol_Abstract::$$_socket
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_socket


resource $_template = '%d%s'
'%d%s'
Details- Type
- resource
- Inherited_from
- \Zend_Mail_Protocol_Abstract::$$_template
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_template


string $_transport = 'tcp'
'tcp'
Details- Type
- string
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_transport


\Zend_Validate $_validHost
- Type
- \Zend_Validate
- Inherited_from
- \Zend_Mail_Protocol_Abstract::$$_validHost
- Inherited_from
- \Zend_Mail_Protocol_Smtp::$$_validHost
Methods


__construct(string $host = '127.0.0.1', int $port = null, array $config = null) : void
Constructor.
Name | Type | Description |
---|---|---|
$host | string | (Default: 127.0.0.1) |
$port | int | (Default: null) |
$config | array | Auth-specific parameters |
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |


__destruct() : void
Class destructor to cleanup open resources
Inherited from: \Zend_Mail_Protocol_Abstract::__destruct()\Zend_Mail_Protocol_Smtp::__destruct()

_addLog(string $value) : void
Add the transaction log
Inherited from: \Zend_Mail_Protocol_Abstract::_addLog()\Zend_Mail_Protocol_Smtp::_addLog()Name | Type | Description |
---|---|---|
$value | string | new transaction |


_connect(string $remote) : boolean
Connect to the server using the supplied transport and target
Inherited from: \Zend_Mail_Protocol_Abstract::_connect()\Zend_Mail_Protocol_Smtp::_connect()An example $remote string may be 'tcp://mail.example.com:25' or 'ssh://hostname.com:2222'
Name | Type | Description |
---|---|---|
$remote | string | Remote |
Type | Description |
---|---|
boolean |
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |


_disconnect() : void
Disconnect from remote host and free resource
Inherited from: \Zend_Mail_Protocol_Abstract::_disconnect()\Zend_Mail_Protocol_Smtp::_disconnect()

_ehlo(string $host) : void
Send EHLO or HELO depending on capabilities of smtp host
Inherited from: \Zend_Mail_Protocol_Smtp::_ehlo()Name | Type | Description |
---|---|---|
$host | string | The client hostname or IP address (default: 127.0.0.1) |
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |


_expect(string | array $code, $timeout = null) : string
Parse server response for successful codes
Inherited from: \Zend_Mail_Protocol_Abstract::_expect()\Zend_Mail_Protocol_Smtp::_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.
Name | Type | Description |
---|---|---|
$code | string | array | One or more codes that indicate a successful response |
$timeout |
Type | Description |
---|---|
string | Last line of response string |
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |


_hmacMd5(string $key, string $data, string $block = 64) : string
Prepare CRAM-MD5 response to server's ticket
Name | Type | Description |
---|---|---|
$key | string | Challenge key (usually password) |
$data | string | Challenge data |
$block | string | Length of blocks |
Type | Description |
---|---|
string |


_receive( $timeout = null) : string
Get a line from the stream.
Inherited from: \Zend_Mail_Protocol_Abstract::_receive()\Zend_Mail_Protocol_Smtp::_receive()Name | Type | Description |
---|---|---|
$timeout |
Type | Description |
---|---|
string |
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |
- integer
Per-request timeout value if applicable


_send(string $request) : integer | boolean
Send the given request followed by a LINEEND to the server.
Inherited from: \Zend_Mail_Protocol_Abstract::_send()\Zend_Mail_Protocol_Smtp::_send()Name | Type | Description |
---|---|---|
$request | string |
Type | Description |
---|---|
integer | boolean | Number of bytes written to remote host |
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |


_setStreamTimeout(integer $timeout) : boolean
Set stream timeout
Inherited from: \Zend_Mail_Protocol_Abstract::_setStreamTimeout()\Zend_Mail_Protocol_Smtp::_setStreamTimeout()Name | Type | Description |
---|---|---|
$timeout | integer |
Type | Description |
---|---|
boolean |


auth() : void
Default authentication method
This default method is implemented by AUTH adapters to properly authenticate to a remote host.
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |
- Todo
- Perform CRAM-MD5 authentication with supplied credentials


connect() : 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.
Type | Description |
---|---|
boolean |


data(string $data) : void
Name | Type | Description |
---|---|---|
$data | string |
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |


getLog() : string
Retrieve the transaction log
Inherited from: \Zend_Mail_Protocol_Abstract::getLog()\Zend_Mail_Protocol_Smtp::getLog()Type | Description |
---|---|
string |


getMaximumLog() : int
Get the maximum log size
Inherited from: \Zend_Mail_Protocol_Abstract::getMaximumLog()\Zend_Mail_Protocol_Smtp::getMaximumLog()Type | Description |
---|---|
int | the maximum log size |


getRequest() : string
Retrieve the last client request
Inherited from: \Zend_Mail_Protocol_Abstract::getRequest()\Zend_Mail_Protocol_Smtp::getRequest()Type | Description |
---|---|
string |


getResponse() : array
Retrieve the last server response
Inherited from: \Zend_Mail_Protocol_Abstract::getResponse()\Zend_Mail_Protocol_Smtp::getResponse()Type | Description |
---|---|
array |


helo(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()Name | Type | Description |
---|---|---|
$host | string | The client hostname or IP address (default: 127.0.0.1) |
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |


mail(string $from) : void
Name | Type | Description |
---|---|---|
$from | string | Sender mailbox |
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |


noop() : 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.


quit() : void
Issues the QUIT command and clears the current session
Inherited from: \Zend_Mail_Protocol_Smtp::quit()

rcpt(string $to) : void
Name | Type | Description |
---|---|---|
$to | string | Receiver(s) mailbox |
Exception | Description |
---|---|
\Zend_Mail_Protocol_Exception |


resetLog() : void
Reset the transaction log
Inherited from: \Zend_Mail_Protocol_Abstract::resetLog()\Zend_Mail_Protocol_Smtp::resetLog()

rset() : 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.


setMaximumLog(integer $maximumLog) : void
Set the maximum log size
Inherited from: \Zend_Mail_Protocol_Abstract::setMaximumLog()\Zend_Mail_Protocol_Smtp::setMaximumLog()Name | Type | Description |
---|---|---|
$maximumLog | integer | Maximum log size |


vrfy(string $user) : void
Issues the VRFY command and validates answer
Inherited from: \Zend_Mail_Protocol_Smtp::vrfy()Not used by Zend_Mail.
Name | Type | Description |
---|---|---|
$user | string | User Name or eMail to verify |