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.
TIMEOUT_CONNECTION = '30'
Default timeout in seconds for initiating session
resource|null $_socket = ''
socket to imap server
int $_tagCount = '0'
counter for request tag
__construct(
string $host, int|null $port
=
null, bool $ssl
=
false
)
:
Public constructor
__destruct(
)
:
Public destructor
_assumedNextLine(
string $start
)
:
bool
get next line and assume it starts with $start. some requests give a simple feedback so we can quickly check if we can go on.
_decodeLine(
string $line
)
:
array
split a given line in tokens. a token is literal of any form or a list
_nextLine(
)
:
string
get the next line from socket with error checking, but nothing else
_nextTaggedLine(
string $tag
)
:
string
get next line and split the tag. that's the normal case for a response line
append(
string $folder, string $message, array $flags
=
null, string $date
=
null
)
:
bool
append a new message to given folder
capability(
)
:
array
Get capabilities from IMAP server
connect(
string $host, int|null $port
=
null, string|bool $ssl
=
false
)
:
string
Open connection to IMAP server
copy(
string $folder, $from, int|null $to
=
null
)
:
bool
copy message set from current folder to other folder
create(
string $folder
)
:
bool
create a new folder (and parent folders if needed)
delete(
string $folder
)
:
bool
remove a folder
escapeList(
array $list
)
:
string
escape a list with literals or lists
escapeString(
string|array $string
)
:
string|array
escape one or more literals i.e. for sendRequest
examine(
string $box
=
INBOX
)
:
bool|array
examine folder
examineOrSelect(
string $command
=
EXAMINE, string $box
=
INBOX
)
:
bool|array
Examine and select have the same response. The common code for both is in this method
expunge(
)
:
bool
permanently remove messages
fetch(
string|array $items, int $from, int|null $to
=
null
)
:
string|array
fetch one or more items of one or more messages
listMailbox(
string $reference, string $mailbox
=
*
)
:
array
get mailbox list
this method can't be named after the IMAP command 'LIST', as list is a reserved keyword
login(
string $user, string $password
)
:
bool
Login to IMAP server.
logout(
)
:
bool
logout of imap server
noop(
)
:
bool
send noop
readLine(
array|string $tokens
=
array, string $wantedTag
=
*, bool $dontParse
=
false
)
:
bool
read a response "line" (could also be more than one real line if response has {..}<NL>) and do a simple decode
readResponse(
string $tag, bool $dontParse
=
false
)
:
null|bool|array
read all lines of response until given tag is found (last line of response)
rename(
string $old, string $new
)
:
bool
rename an existing folder
requestAndResponse(
string $command, array $tokens
=
array, bool $dontParse
=
false
)
:
mixed
send a request and get response at once
search(
$params
)
:
array
do a search request
This method is currently marked as internal as the API might change and is not safe if you don't take precautions.
select(
string $box
=
INBOX
)
:
bool|array
change folder
sendRequest(
string $command, array $tokens
=
array, string $tag
=
null
)
:
null
send a request
store(
array $flags, int $from, int|null $to
=
null, string|null $mode
=
null, bool $silent
=
true
)
:
bool|array
set flags