Class: Net_IMAPProtocol
Source Location: /modules/Apps/MailClient/PEAR/Net/IMAPProtocol.php
Class Net_IMAPProtocol
Descendants
| Net_IMAP |
Provides an implementation of the IMAP protocol using PEAR's Net_Socket:: class.
|
Property Summary
| boolean |
$_connected |
_connected: checks if there is a connection made to a imap server or not |
| boolean |
$_debug |
To allow class debuging |
| resource |
$_socket |
The socket resource being used to connect to the IMAP server. |
Method Summary
| array |
cmdCheck() |
Send the CHECK command. |
| mixed |
cmdClose() |
Send the CLOSE command. |
| mixed |
cmdConnect() |
Attempt to connect to the IMAP server. |
| mixed |
cmdCopy() |
Send the COPY command. |
| array |
cmdCreate() |
Send the CREATE Mailbox Command |
| array |
cmdDelete() |
Send the DELETE Mailbox Command |
| array |
cmdExamine() |
Send the EXAMINE Mailbox Command |
| mixed |
cmdList() |
Send the LIST Command |
| array |
cmdLogin() |
Attempt to login to the iMAP server. |
| array |
cmdLogout() |
Attempt to disconnect from the iMAP server. |
| mixed |
cmdLsub() |
Send the LSUB Command |
| array |
cmdNoop() |
Send the NOOP command. |
| array |
cmdRename() |
Send the RENAME Mailbox Command |
| array |
cmdSelect() |
Send the Select Mailbox Command |
| void |
cmdSetACL() |
****************************************************************** |
| void |
cmdSetAnnotation() |
***************************************************************************** |
| mixed |
cmdStartTLS() |
Return true if the TLS negotiation was successful |
| array |
cmdStatus() |
Send the STATUS Mailbox Command |
| mixed |
cmdStore() |
Send the STORE command. |
| mixed |
cmdX() |
Send the X command. |
| true |
hasCapability() |
tell if the server has capability $capability |
| nothing |
setDebug() |
Sets the debuging information on or off |
Properties
The auth methods this class support
The auth methods this class support
_connected: checks if there is a connection made to a imap server or not
Command Number for IMAP commands
The socket resource being used to connect to the IMAP server.
Methods
Net_IMAPProtocol Net_IMAPProtocol(
)
|
|
Constructor
Instantiates a new Net_IMAP object.
Information Tags:
mixed cmdAppend(
$mailbox,
$msg, [
$flags_list = ''], [
$time = '']
)
|
|
Send the APPEND Command
Parameters:
|
|
$mailbox: |
|
|
|
$msg: |
|
|
|
$flags_list: |
|
|
|
$time: |
|
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
array cmdAuthenticate(
string
$uid, string
$pwd, [string
$userMethod = null]
)
|
|
Attempt to authenticate to the iMAP server.
Parameters:
|
string |
$uid: |
The userid to authenticate as. |
|
string |
$pwd: |
The password to authenticate with. |
|
string |
$userMethod: |
The cmdID. |
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
Send the CAPABILITY Command
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
Send the CHECK command.
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
Send the CLOSE command.
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
mixed cmdConnect(
[
$host = "localhost"], [
$port = 143]
)
|
|
Attempt to connect to the IMAP server.
Parameters:
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
mixed cmdCopy(
$message_set,
$mailbox
)
|
|
Send the COPY command.
Parameters:
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
array cmdCreate(
string
$mailbox, [array
$options = null]
)
|
|
Send the CREATE Mailbox Command
Parameters:
|
string |
$mailbox: |
The mailbox to create. |
|
array |
$options: |
options to pass to create |
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
array cmdDelete(
string
$mailbox
)
|
|
Send the DELETE Mailbox Command
Parameters:
|
string |
$mailbox: |
The mailbox name to delete. |
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
void cmdDeleteACL(
$mailbox_name,
$user
)
|
|
Parameters:
void cmdDeleteAnnotation(
$mailbox_name,
$entry,
$values
)
|
|
Parameters:
|
|
$mailbox_name: |
|
|
|
$entry: |
|
|
|
$values: |
|
array cmdExamine(
string
$mailbox
)
|
|
Send the EXAMINE Mailbox Command
Parameters:
|
string |
$mailbox: |
The mailbox to examine. |
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
Send the EXPUNGE command.
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
mixed cmdFetch(
$msgset,
$fetchparam
)
|
|
Send the FETCH Command
Parameters:
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
void cmdGetACL(
$mailbox_name
)
|
|
Parameters:
void cmdGetAnnotation(
$mailbox_name,
$entries,
$values
)
|
|
Parameters:
|
|
$mailbox_name: |
|
|
|
$entries: |
|
|
|
$values: |
|
mixed cmdGetQuota(
string
$mailbox_name
)
|
|
Send the GETQUOTA command.
Parameters:
|
string |
$mailbox_name: |
the mailbox name to query for quota data |
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or quota data on success |
| Access: | public |
Information Tags:
mixed cmdGetQuotaRoot(
string
$mailbox_name
)
|
|
Send the GETQUOTAROOT command.
Parameters:
|
string |
$mailbox_name: |
the mailbox name to query for quota data |
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or quota data on success |
| Access: | public |
Information Tags:
mixed cmdList(
$mailbox_base,
$mailbox
)
|
|
Send the LIST Command
Parameters:
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
void cmdListRights(
$mailbox_name,
$user
)
|
|
Parameters:
array cmdLogin(
string
$uid, string
$pwd
)
|
|
Attempt to login to the iMAP server.
Parameters:
|
string |
$uid: |
The userid to authenticate as. |
|
string |
$pwd: |
The password to authenticate with. |
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
Attempt to disconnect from the iMAP server.
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
mixed cmdLsub(
$mailbox_base,
$mailbox
)
|
|
Send the LSUB Command
Parameters:
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
void cmdMyRights(
$mailbox_name
)
|
|
Parameters:
Send the CAPABILITY Command
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
Send the NOOP command.
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
array cmdRename(
string
$mailbox, string
$new_mailbox, [array
$options = null]
)
|
|
Send the RENAME Mailbox Command
Parameters:
|
string |
$mailbox: |
The old mailbox name. |
|
string |
$new_mailbox: |
The new (renamed) mailbox name. |
|
array |
$options: |
options to pass to create |
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
mixed cmdSearch(
$search_cmd
)
|
|
Send the SEARCH command.
Parameters:
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
array cmdSelect(
string
$mailbox
)
|
|
Send the Select Mailbox Command
Parameters:
|
string |
$mailbox: |
The mailbox to select. |
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
void cmdSetACL(
$mailbox_name,
$user,
$acl
)
|
|
******************************************************************
** RFC2086 IMAP4 ACL extension BEGINS HERE ******************************************************************
Parameters:
|
|
$mailbox_name: |
|
|
|
$user: |
|
|
|
$acl: |
|
void cmdSetAnnotation(
$mailbox_name,
$entry,
$values
)
|
|
*****************************************************************************
** draft-daboo-imap-annotatemore-05 IMAP4 ANNOTATEMORE extension BEGINS HERE ******************************************************************************
Parameters:
|
|
$mailbox_name: |
|
|
|
$entry: |
|
|
|
$values: |
|
mixed cmdSetQuota(
string
$mailbox_name, [string
$storageQuota = null], [string
$messagesQuota = null]
)
|
|
Send the SETQUOTA command.
Parameters:
|
string |
$mailbox_name: |
the mailbox name to query for quota data |
|
string |
$storageQuota: |
sets the max number of bytes this mailbox can handle |
|
string |
$messagesQuota: |
sets the max number of messages this mailbox can handle |
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or quota data on success |
| Access: | public |
Information Tags:
mixed cmdSetQuotaRoot(
string
$mailbox_name, [string
$storageQuota = null], [string
$messagesQuota = null]
)
|
|
Send the SETQUOTAROOT command.
Parameters:
|
string |
$mailbox_name: |
the mailbox name to query for quota data |
|
string |
$storageQuota: |
sets the max number of bytes this mailbox can handle |
|
string |
$messagesQuota: |
sets the max number of messages this mailbox can handle |
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or quota data on success |
| Access: | public |
Information Tags:
Return true if the TLS negotiation was successful
API Tags:
| Return: | true on success, PEAR_Error on failure |
| Access: | public |
array cmdStatus(
string
$mailbox, mixed
$request
)
|
|
Send the STATUS Mailbox Command
Parameters:
|
string |
$mailbox: |
the mailbox name |
|
mixed |
$request: |
the request status it could be an array or space separated string of MESSAGES | RECENT | UIDNEXT UIDVALIDITY | UNSEEN |
API Tags:
| Return: | Returns a Parsed Response |
| Access: | public |
Information Tags:
mixed cmdStore(
string
$message_set,
$dataitem, string
$value, string
$dataitem:
)
|
|
Send the STORE command.
Parameters:
|
string |
$message_set: |
the sessage_set |
|
string |
$dataitem:: |
the way we store the flags FLAGS: replace the flags whith $value FLAGS.SILENT: replace the flags whith $value but don't return untagged responses +FLAGS: Add the flags whith $value +FLAGS.SILENT: Add the flags whith $value but don't return untagged responses -FLAGS: Remove the flags whith $value -FLAGS.SILENT: Remove the flags whith $value but don't return untagged responses |
|
string |
$value: |
|
|
|
$dataitem: |
|
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
array cmdSubscribe(
string
$mailbox
)
|
|
Send the SUSCRIBE Mailbox Command
Parameters:
|
string |
$mailbox: |
The mailbox name to suscribe. |
API Tags:
| Return: | Returns an array containing the response |
| Access: | public |
Information Tags:
void cmdUidCopy(
$message_set,
$mailbox
)
|
|
Parameters:
void cmdUidFetch(
$msgset,
$fetchparam
)
|
|
Parameters:
mixed cmdUidSearch(
$search_cmd
)
|
|
Send the SEARCH command.
Parameters:
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
mixed cmdUidStore(
string
$message_set,
$dataitem, string
$value, string
$dataitem:
)
|
|
Send the UID STORE command.
Parameters:
|
string |
$message_set: |
the sessage_set |
|
string |
$dataitem:: |
the way we store the flags FLAGS: replace the flags whith $value FLAGS.SILENT: replace the flags whith $value but don't return untagged responses +FLAGS: Add the flags whith $value +FLAGS.SILENT: Add the flags whith $value but don't return untagged responses -FLAGS: Remove the flags whith $value -FLAGS.SILENT: Remove the flags whith $value but don't return untagged responses |
|
string |
$value: |
|
|
|
$dataitem: |
|
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
mixed cmdUnsubscribe(
$mailbox
)
|
|
Send the UNSUSCRIBE Mailbox Command
Parameters:
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
mixed cmdX(
$atom,
$parameters
)
|
|
Send the X command.
Parameters:
API Tags:
| Return: | Returns a PEAR_Error with an error message on any kind of failure, or true on success. |
| Access: | public |
Information Tags:
string getCurrentMailbox(
)
|
|
get current mailbox name
API Tags:
| Return: | Returns the current mailbox |
| Access: | public |
Information Tags:
get the last cmd ID
API Tags:
| Return: | Returns the last cmdId |
| Access: | public |
Information Tags:
true getServerAuthMethods(
)
|
|
tell if the server has capability $capability
API Tags:
| Return: | or false |
| Access: | public |
Information Tags:
boolean getUnparsedResponse(
)
|
|
get the "returning of the unparsed response" feature status
API Tags:
| Return: | return if the unparsed response is returned or not |
| Access: | public |
Information Tags:
tell if the server has Quota support
API Tags:
| Return: | or false |
| Access: | public |
Information Tags:
true hasAnnotateMoreSupport(
)
|
|
tell if the server has support for the ANNOTATEMORE extension
API Tags:
| Return: | or false |
| Access: | public |
Information Tags:
true hasCapability(
$capability
)
|
|
tell if the server has capability $capability
Parameters:
API Tags:
| Return: | or false |
| Access: | public |
Information Tags:
tell if the server has Quota support
API Tags:
| Return: | or false |
| Access: | public |
Information Tags:
nothing setDebug(
[boolean
$debug = true]
)
|
|
Sets the debuging information on or off
Parameters:
|
boolean |
$debug: |
True or false |
API Tags:
Information Tags:
nothing setUnparsedResponse(
$status, boolean
$status:
)
|
|
set the "returning of the unparsed response" feature on or off
Parameters:
|
boolean |
$status:: |
true: feature is on |
|
|
$status: |
|
API Tags:
Information Tags:
void utf_7_decode(
$str
)
|
|
Parameters:
void utf_7_encode(
$str
)
|
|
Parameters:
void _authCRAM_MD5(
$uid,
$pwd,
$cmdid
)
|
|
Parameters:
void _authDigest_MD5(
$uid,
$pwd,
$cmdid
)
|
|
Parameters:
void _authLOGIN(
$uid,
$pwd,
$cmdid
)
|
|
Parameters:
void _createQuotedString(
$mailbox
)
|
|
Parameters:
void _genericCommand(
$command, [
$params = '']
)
|
|
Parameters:
void _genericImapResponseParser(
&$str, [
$cmdid = null]
)
|
|
Parameters:
void _getEXTarray(
&$str, [
$startDelim = '('], [
$stopDelim = ')']
)
|
|
Parameters:
|
|
&$str: |
|
|
|
$startDelim: |
|
|
|
$stopDelim: |
|
void _getLineLength(
$string
)
|
|
Parameters:
void _getSubstr(
$string,
$start, [
$length = false]
)
|
|
Parameters:
|
|
$string: |
|
|
|
$start: |
|
|
|
$length: |
|
void _parseSpace(
&$str,
$line,
$file, [
$printError = true]
)
|
|
Parameters:
|
|
&$str: |
|
|
|
$line: |
|
|
|
$file: |
|
|
|
$printError: |
|
void _parseString(
&$str,
$char,
$line,
$file
)
|
|
Parameters:
|
|
&$str: |
|
|
|
$char: |
|
|
|
$line: |
|
|
|
$file: |
|
void _retrParsedResponse(
&$str,
$token, [
$previousToken = null]
)
|
|
Parameters:
|
|
&$str: |
|
|
|
$token: |
|
|
|
$previousToken: |
|
|
|