Documentation

Horde_Smtp_Lmtp extends Horde_Smtp
in package

An interface to an LMTP server (RFC 2033).

Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2014-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

since
1.5.0

Table of Contents

CHUNK_DEFAULT  = 1048576
$data_8bit  : bool
$data_binary  : bool
$data_intl  : bool
$size  : int
$_connection  : Horde_Smtp_Connection
Connection to the SMTP server.
$_debug  : Horde_Smtp_Debug
The debug object.
$_ehlo  : string
LMTP only supports LHLO hello command (RFC 2033 [4.1]), not EHLO.
$_extensions  : array<string|int, mixed>
The list of ESMTP extensions.
$_params  : array<string|int, mixed>
Hash containing connection parameters.
$_requiredExts  : array<string|int, mixed>
These extensions are required for LMTP (RFC 2033 [5]).
__clone()  : mixed
This object can not be cloned.
__construct()  : mixed
Constructor.
__get()  : mixed
getParam()  : mixed
Returns a value from the internal params array.
isSecureConnection()  : bool
Display if connection to the server has been secured via TLS or SSL.
login()  : mixed
Connect/login to the SMTP server.
logout()  : mixed
Logout from the SMTP server.
noop()  : mixed
Send a NOOP command.
processQueue()  : mixed
Send request to process the remote queue.
queryExtension()  : mixed
Returns whether the SMTP server supports the given extension.
resetCmd()  : mixed
Send a reset command.
send()  : array<string|int, mixed>
Send a message.
serialize()  : mixed
setParam()  : mixed
Sets a configuration parameter value.
shutdown()  : mixed
Shutdown actions.
unserialize()  : mixed
_auth()  : mixed
Authenticate user to server for a given method.
_getEncryptKey()  : string
Get encryption key.
_getHostname()  : string
Return the local hostname.
_getResponse()  : array<string|int, mixed>
Gets a line from the incoming stream and parses it.
_hello()  : mixed
Send "Hello" command to the server.
_initOb()  : mixed
Do initialization tasks.
_processData()  : array<string|int, mixed>
Process the return from the DATA command.
_startTls()  : bool
Starts the TLS connection to the server, if necessary. See RFC 3207.

Constants

CHUNK_DEFAULT

public mixed CHUNK_DEFAULT = 1048576

Properties

$data_8bit read-only

public bool $data_8bit

Does server support sending 8-bit MIME data?

$data_binary read-only

public bool $data_binary

Does server support sending binary MIME data? (@since 1.7.0)

$data_intl read-only

public bool $data_intl

Does server support sending internationalized (UTF-8) header data? (@since 1.6.0)

$size read-only

public int $size

The maximum message size supported (in bytes) or null if this cannot be determined.

$_connection

Connection to the SMTP server.

protected Horde_Smtp_Connection $_connection

$_debug

The debug object.

protected Horde_Smtp_Debug $_debug

$_ehlo

LMTP only supports LHLO hello command (RFC 2033 [4.1]), not EHLO.

protected string $_ehlo = 'LHLO'

HELO isn't supported, but HELO code in _hello() should not be reached since failure of LHLO command will result in 500 error code (instead of 502 necessary to fallback to HELO).

$_extensions

The list of ESMTP extensions.

protected array<string|int, mixed> $_extensions = \null

If this value is null, we have not connected to server yet.

$_params

Hash containing connection parameters.

protected array<string|int, mixed> $_params = array()

$_requiredExts

These extensions are required for LMTP (RFC 2033 [5]).

protected array<string|int, mixed> $_requiredExts = array('ENHANCEDSTATUSCODES', 'PIPELINING')

Methods

__clone()

This object can not be cloned.

public __clone() : mixed
Return values
mixed

__construct()

Constructor.

public __construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
$params : array<string|int, mixed> = array()

Configuration parameters:

  • chunk_size: (integer) If CHUNKING is supported on the server, the chunk size (in octets) to send. 0 will disable chunking. @since 1.7.0
  • context: (array) Any context parameters passed to stream_create_context(). @since 1.9.0
  • debug: (string) If set, will output debug information to the stream provided. The value can be any PHP supported wrapper that can be opened via fopen(). DEFAULT: No debug output
  • host: (string) The SMTP server. DEFAULT: localhost
  • localhost: (string) The hostname of the localhost. (since 1.9.0) DEFAULT: Auto-determined.
  • password: (mixed) The SMTP password or a Horde_Smtp_Password object (since 1.1.0). DEFAULT: NONE
  • port: (string) The SMTP port. DEFAULT: 587 (See RFC 6409/STD 72)
  • secure: (string) Use SSL or TLS to connect. DEFAULT: true (use 'tls' option, if available)
    • false (No encryption)
    • 'ssl' (Auto-detect SSL version)
    • 'sslv2' (Force SSL version 2)
    • 'sslv3' (Force SSL version 3)
    • 'tls' (TLS; started via protocol-level negotation over unencrypted channel; RECOMMENDED way of initiating secure connection)
    • 'tlsv1' (TLS direct version 1.x connection to server) [@since 1.3.0]
    • true (Use TLS, if available) [@since 1.2.0]
  • timeout: (integer) Connection timeout, in seconds. DEFAULT: 30 seconds
  • username: (string) The SMTP username. DEFAULT: NONE
  • xoauth2_token: (string) If set, will authenticate via the XOAUTH2 mechanism (if available) with this token. Either a string or a Horde_Smtp_Password object (since 1.1.0).
Return values
mixed

__get()

public __get(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

getParam()

Returns a value from the internal params array.

public getParam(string $key) : mixed
Parameters
$key : string

The param key.

Return values
mixed

The param value, or null if not found.

isSecureConnection()

Display if connection to the server has been secured via TLS or SSL.

public isSecureConnection() : bool
Return values
bool

True if the SMTP connection is secured.

logout()

Logout from the SMTP server.

public logout() : mixed
Return values
mixed

processQueue()

Send request to process the remote queue.

public processQueue([string $host = null ]) : mixed
Parameters
$host : string = null

The specific host to request queue processing for.

Tags
throws
Horde_Smtp_Exception
Return values
mixed

queryExtension()

Returns whether the SMTP server supports the given extension.

public queryExtension(string $ext) : mixed
Parameters
$ext : string

The extension to query.

Return values
mixed

False if the server doesn't support the extension; otherwise, the extension value (returns true if the extension only supports existence).

send()

Send a message.

public send(mixed $from, mixed $to, mixed $data[, array<string|int, mixed> $opts = array() ]) : array<string|int, mixed>
Parameters
$from : mixed

The from address. Either a Horde_Mail_Rfc822_Address object or a string.

$to : mixed

The to (recipient) addresses. Either a Horde_Mail_Rfc822_List object, a string, or an array of addresses.

$data : mixed

The data to send. Either a stream or a string.

$opts : array<string|int, mixed> = array()
Tags
throws
Horde_Smtp_Exception
throws
Horde_Smtp_Exception_Recipients
throws
InvalidArgumentException
Return values
array<string|int, mixed>

If no receipients were successful, a Horde_Smtp_Exception will be thrown. If at least one recipient was successful, an array with the following format is returned: (@since 1.5.0)

  • KEYS: Recipient addresses ($to addresses).
  • VALUES: Boolean true (if message was accepted for this recpieint) or a Horde_Smtp_Exception (if messages was not accepted).

serialize()

public serialize() : mixed
Return values
mixed

setParam()

Sets a configuration parameter value.

public setParam(string $key, mixed $val) : mixed
Parameters
$key : string

The param key.

$val : mixed

The param value.

Return values
mixed

shutdown()

Shutdown actions.

public shutdown() : mixed
Return values
mixed

unserialize()

public unserialize(mixed $data) : mixed
Parameters
$data : mixed
Return values
mixed

_auth()

Authenticate user to server for a given method.

protected _auth(string $method) : mixed
Parameters
$method : string

Authentication method.

Tags
throws
Horde_Smtp_Exception
Return values
mixed

_getEncryptKey()

Get encryption key.

protected _getEncryptKey() : string
Tags
deprecated
Return values
string

The encryption key.

_getHostname()

Return the local hostname.

protected _getHostname() : string
Return values
string

Local hostname (null if it cannot be determined).

_getResponse()

Gets a line from the incoming stream and parses it.

protected _getResponse(mixed $code[, array<string|int, mixed> $opts = array() ]) : array<string|int, mixed>
Parameters
$code : mixed

Expected reply code(s) (integer or array).

$opts : array<string|int, mixed> = array()

Additional options:

  - error: (string) On error, 'logout' or 'reset'?
  - exception: (string) Throw an exception of this class on error.
Tags
throws
Horde_Smtp_Exception
Return values
array<string|int, mixed>

An array with the response text.

_hello()

Send "Hello" command to the server.

protected _hello() : mixed
Tags
throws
Horde_Smtp_Exception
Return values
mixed

_initOb()

Do initialization tasks.

protected _initOb() : mixed
Return values
mixed

_processData()

Process the return from the DATA command.

protected _processData(mixed $recipients) : array<string|int, mixed>
Parameters
$recipients : mixed

The list of message recipients.

Return values
array<string|int, mixed>

See _send().

_startTls()

Starts the TLS connection to the server, if necessary. See RFC 3207.

protected _startTls() : bool
Tags
throws
Horde_Smtp_Exception
Return values
bool

True if TLS was started.

Search results