Class rcube_imap

Description

Interface class for accessing an IMAP server

Located in /rcube_imap.php (line 33)


	
			
Class Constant Summary
Variable Summary
Method Summary
 static string decode_mime_string (string $input, [string $fallback = null])
 static array explode_header_string (string $separator, string $str, [bool $remove_comments = false])
 rcube_imap __construct ()
 string charset_decode (string $body, string $ctype_param)
 boolean check_permflag (string $flag)
 void clear_cache ([string $key = null], [boolean $prefix_mode = false])
 int clear_mailbox ([string $mailbox = null])
 void clear_message_cache ([string $mailbox = null], [array $uids = null])
 void close ()
 boolean connect (string $host, string $user, string $pass, [integer $port = 143], [string $use_ssl = null])
 boolean copy_message (mixed $uids, string $to_mbox, [string $from_mbox = ''])
 boolean create_mailbox (string $mailbox, [boolean $subscribe = false])
 void debug_handler ( &$imap,  $message)
 array decode_address_list (string $input, [int $max = null], [boolean $decode = true])
 string decode_header (string $input, [ $remove_quotes = false], boolean $remove_quotas)
 boolean delete_acl (string $mailbox, string $user)
 boolean delete_mailbox (string $mailbox)
 boolean delete_message (mixed $uids, [string $mailbox = ''])
 boolean delete_metadata (string $mailbox, array $entries)
 boolean expunge ([string $mailbox = ''], [boolean $clear_cache = true])
 array fetch_threads (string $mailbox, [bool $force = false])
 array get_acl (string $mailbox)
 string &get_body (int $uid, [ $part = 1])
 mixed get_cache (string $key)
 mixed get_capability (string $cap)
 string get_error_str ()
 rcube_mail_header get_headers ( $uid, [string $mailbox = null], [bool $force = false], int $id)
 int get_id (int $uid, [string $mailbox = null])
 string get_mailbox_name ()
 int get_mailbox_size (string $mailbox)
 object rcube_mail_header get_message (int $uid, [string $mailbox = null])
 string &get_message_part (int $uid, [string $part = 1], [rcube_message_part $o_part = NULL], [mixed $print = NULL], [resource $fp = NULL], [boolean $skip_charset_conv = false])
 array get_metadata (string $mailbox, array $entries, [array $options = array()])
 array get_namespace ([string $name = null])
 mixed get_quota ()
 string &get_raw_body (int $uid, [resource $fp = null])
 string &get_raw_headers (int $uid)
 string get_response_str ()
 array get_search_set ()
 int get_uid (int $id, [string $mailbox = null])
 int id2uid (int $id, [string $mailbox = null], [bool $force = false])
 boolean in_searchset (string $msgid)
 array list_headers ([string $mailbox = ''], [int $page = NULL], [string $sort_field = NULL], [string $sort_order = NULL], [int $slice = 0])
 array list_mailboxes ([string $root = ''], [string $name = '*'], [string $filter = null], [string $rights = null])
 array list_rights (string $mailbox, string $user)
 array list_unsubscribed ([string $root = ''], [string $name = '*'], [mixed $filter = null], [string $rights = null])
 array mailbox_data (string $mailbox)
 boolean mailbox_exists (string $mailbox, [boolean $subscription = false])
 array mailbox_info (string $mailbox)
 string mailbox_namespace (string $mailbox)
 array mailbox_options (string $mailbox, [bool $force = false])
 int mailbox_status ([string $mailbox = null])
 void mailbox_sync (string $mailbox)
 int messagecount ([string $mailbox = ''], [string $mode = 'ALL'], [boolean $force = false], [boolean $status = true])
 array message_index ([string $mailbox = ''], [string $sort_field = NULL], [string $sort_order = NULL])
 array message_index_direct (string $mailbox, [string $sort_field = null], [string $sort_order = null])
 string mime_decode (string $input, [string $encoding = '7bit'])
 string mod_mailbox (string $mailbox, [string $mode = 'out'])
 boolean move_message (mixed $uids, string $to_mbox, [string $from_mbox = ''])
 array my_rights (string $mailbox)
 void print_raw_body (int $uid)
 void reconnect ()
 array refresh_search ()
 boolean rename_mailbox (string $mailbox, string $new_name)
 int|bool save_message (string $mailbox,  &$message, [string $headers = ''], [boolean $is_file = false], string $message)
 array search ([string $mailbox = ''], [string $str = NULL], [string $charset = NULL], [string $sort_field = NULL])
 array search_once ([string $mailbox = ''], [string $str = NULL], [boolean $ret_uid = false])
 void select_mailbox ([string $mailbox = null])
 boolean set_acl (string $mailbox, string $user, string $acl)
 void set_caching (string $type)
 void set_charset (string $cs)
 void set_default_mailboxes (array $arr)
 boolean set_flag (mixed $uids, string $flag, [string $mailbox = null], [boolean $skip_cache = false])
 void set_mailbox (string $mailbox)
 void set_messages_caching (boolean $set)
 boolean set_metadata (string $mailbox, array $entries)
 void set_options (array $opt)
 void set_page (number $page)
 void set_pagesize (number $size)
 void set_search_set ([string $str = null], [array $msgs = null], [string $charset = null], [string $sort_field = null], [string $threads = false], [ $sorted = false])
 string set_threading ([boolean $enable = false])
 array sort_threads (string $mailbox, array $thread_tree, [array $ids = null])
 boolean subscribe (array $a_mboxes)
 array thread_index ([string $mailbox = ''], [string $sort_field = NULL], [string $sort_order = NULL])
 int uid2id (int $uid, [string $mailbox = null], [bool $force = false])
 int unset_flag (mixed $uids, string $flag, [string $mailbox = null])
 boolean unsubscribe (array $a_mboxes)
 void update_cache (string $key, mixed $data)
Variables
rcube_imap_generic $conn (line 48)

Instance of rcube_imap_generic

  • access: public
mixed $debug_level = 1 (line 35)
  • access: public
mixed $fetch_add_headers = '' (line 40)
  • access: public
mixed $get_all_headers = false (line 41)
  • access: public
mixed $list_page = 1 (line 38)
  • access: public
mixed $page_size = 10 (line 37)
  • access: public
mixed $search_set = NULL (line 81)
  • access: public
mixed $search_string = '' (line 82)
  • access: public
mixed $skip_deleted = false (line 36)
  • access: public
mixed $threading = false (line 39)
  • access: public
Methods
static decode_mime_string (line 4020)

Decode a mime-encoded string to internal charset

string decode_mime_string (string $input, [string $fallback = null])
  • string $input: Header value
  • string $fallback: Fallback charset if none specified
static explode_header_string (line 4463)

Explodes header (e.g. address-list) string into array of strings using specified separator characters with proper handling of quoted-strings and comments (RFC2822)

  • return: Header items
array explode_header_string (string $separator, string $str, [bool $remove_comments = false])
  • string $separator: String containing separator characters
  • string $str: Header string
  • bool $remove_comments: Enable to remove comments
Constructor __construct (line 126)

Object constructor.

rcube_imap __construct ()
charset_decode (line 4147)

Convert body charset to RCMAIL_CHARSET according to the ctype_parameters

  • return: Content converted to internal charset
string charset_decode (string $body, string $ctype_param)
  • string $body: Part body to decode
  • string $ctype_param: Charset to convert from
check_permflag (line 518)

Checks the PERMANENTFLAGS capability of the current mailbox and returns true if the given flag is supported by the IMAP server

  • return: True if this flag is supported
  • access: public
boolean check_permflag (string $flag)
  • string $flag: Permanentflag name
clear_cache (line 3882)

Clears the cache.

  • access: public
void clear_cache ([string $key = null], [boolean $prefix_mode = false])
  • string $key: Cache key name or pattern
  • boolean $prefix_mode: Enable it to clear all keys starting with prefix specified in $key
clear_mailbox (line 2745)

Clear all messages in a specific mailbox

  • return: Above 0 on success
int clear_mailbox ([string $mailbox = null])
  • string $mailbox: Mailbox name
clear_message_cache (line 3934)

Clears the messages cache.

void clear_message_cache ([string $mailbox = null], [array $uids = null])
  • string $mailbox: Folder name
  • array $uids: Optional message UIDs to remove from cache
close (line 221)

Close IMAP connection Usually done on script shutdown

  • access: public
void close ()
connect (line 150)

Connect to an IMAP server

  • return: TRUE on success, FALSE on failure
  • access: public
boolean connect (string $host, string $user, string $pass, [integer $port = 143], [string $use_ssl = null])
  • string $host: Host to connect
  • string $user: Username for IMAP account
  • string $pass: Password for IMAP account
  • integer $port: Port to connect to
  • string $use_ssl: SSL schema (either ssl or tls) or null if plain connection
copy_message (line 2651)

Copy a message from one mailbox to another

  • return: True on success, False on error
boolean copy_message (mixed $uids, string $to_mbox, [string $from_mbox = ''])
  • mixed $uids: Message UIDs as array or comma-separated string, or '*'
  • string $to_mbox: Target mailbox
  • string $from_mbox: Source mailbox
create_default_folders (line 3293)

Create all folders specified as default

void create_default_folders ()
create_mailbox (line 3175)

Create a new mailbox on the server and register it in local cache

  • return: True on success
boolean create_mailbox (string $mailbox, [boolean $subscribe = false])
  • string $mailbox: New mailbox name
  • boolean $subscribe: True if the new mailbox should be subscribed
debug_handler (line 4531)

This is our own debug handler for the IMAP connection

  • access: public
void debug_handler ( &$imap,  $message)
  • &$imap
  • $message
decode_address_list (line 3955)

Split an address list into a structured array list

  • return: Indexed list of addresses
array decode_address_list (string $input, [int $max = null], [boolean $decode = true])
  • string $input: Input string
  • int $max: List only this number of addresses
  • boolean $decode: Decode address strings
decode_header (line 4001)

Decode a message header value

  • return: Decoded string
string decode_header (string $input, [ $remove_quotes = false], boolean $remove_quotas)
  • string $input: Header value
  • boolean $remove_quotas: Remove quotes if necessary
  • $remove_quotes
delete_acl (line 3622)

Removes any <identifier,rights> pair for the specified user from the ACL for the specified mailbox (DELETEACL)

  • return: True on success, False on failure
  • since: 0.5-beta
  • access: public
boolean delete_acl (string $mailbox, string $user)
  • string $mailbox: Mailbox name
  • string $user: User name
delete_mailbox (line 3255)

Remove mailbox from server

  • return: True on success
boolean delete_mailbox (string $mailbox)
  • string $mailbox: Mailbox name
delete_message (line 2691)

Mark messages as deleted and expunge mailbox

  • return: True on success, False on error
boolean delete_message (mixed $uids, [string $mailbox = ''])
  • mixed $uids: Message UIDs as array or comma-separated string, or '*'
  • string $mailbox: Source mailbox
delete_metadata (line 3728)

Unsets IMAP metadata/annotations (SETMETADATA/SETANNOTATION)

  • return: True on success, False on failure
  • since: 0.5-beta
  • access: public
boolean delete_metadata (string $mailbox, array $entries)
  • string $mailbox: Mailbox name (empty for server metadata)
  • array $entries: Entry names array
expunge (line 2776)

Send IMAP expunge command and clear cache

  • return: True on success
boolean expunge ([string $mailbox = ''], [boolean $clear_cache = true])
  • string $mailbox: Mailbox name
  • boolean $clear_cache: False if cache should not be cleared
fetch_threads (line 987)

Method for fetching threads data

  • return: Array with thread data
array fetch_threads (string $mailbox, [bool $force = false])
  • string $mailbox: Folder name
  • bool $force: Use IMAP server, no cache
get_acl (line 3640)

Returns the access control list for mailbox (GETACL)

  • return: User-rights array on success, NULL on error
  • since: 0.5-beta
  • access: public
array get_acl (string $mailbox)
  • string $mailbox: Mailbox name
get_body (line 2416)

Fetch message body of a specific message from the server

string &get_body (int $uid, [ $part = 1])
  • int $uid: Message UID
  • $part
get_cache (line 3853)

Returns cached value

  • access: public
mixed get_cache (string $key)
  • string $key: Cache key
get_capability (line 480)

Returns the IMAP server's capability

  • return: Capability value or TRUE if supported, FALSE if not
  • access: public
mixed get_capability (string $cap)
  • string $cap: Capability name
get_error_code (line 251)

Returns code of last error

  • return: Error code
int get_error_code ()
get_error_str (line 262)

Returns message of last error

  • return: Error message
string get_error_str ()
get_headers (line 1922)

Return message headers object of a specific message

  • return: Message headers
rcube_mail_header get_headers ( $uid, [string $mailbox = null], [bool $force = false], int $id)
  • int $id: Message sequence ID or UID
  • string $mailbox: Mailbox to read from
  • bool $force: True to skip cache
  • $uid
get_hierarchy_delimiter (line 532)

Returns the delimiter that is used by the IMAP server for folder separation

  • return: Delimiter string
  • access: public
string get_hierarchy_delimiter ()
get_id (line 2881)

Translate UID to message ID

  • return: Message ID
int get_id (int $uid, [string $mailbox = null])
  • int $uid: Message UID
  • string $mailbox: Mailbox name
get_mailbox_name (line 467)

Returns the currently used mailbox name

  • return: Name of the mailbox/folder
  • access: public
string get_mailbox_name ()
get_mailbox_size (line 3123)

Get mailbox size (size of all messages in a mailbox)

  • return: Mailbox size in bytes, False on error
int get_mailbox_size (string $mailbox)
  • string $mailbox: Mailbox name
get_message (line 1950)

Fetch message headers and body structure from the IMAP server and build an object structure similar to the one generated by PEAR::Mail_mimeDecode

  • return: Message data
object rcube_mail_header get_message (int $uid, [string $mailbox = null])
  • int $uid: Message UID to fetch
  • string $mailbox: Mailbox to read from
get_message_part (line 2367)

Fetch message body of a specific message from the server

  • return: Message/part body if not printed
string &get_message_part (int $uid, [string $part = 1], [rcube_message_part $o_part = NULL], [mixed $print = NULL], [resource $fp = NULL], [boolean $skip_charset_conv = false])
  • int $uid: Message UID
  • string $part: Part number
  • rcube_message_part $o_part: Part object created by get_structure()
  • mixed $print: True to print part, ressource to write part contents in
  • resource $fp: File pointer to save the message part
  • boolean $skip_charset_conv: Disables charset conversion
get_metadata (line 3759)

Returns IMAP metadata/annotations (GETMETADATA/GETANNOTATION)

  • return: Metadata entry-value hash array on success, NULL on error
  • since: 0.5-beta
  • access: public
array get_metadata (string $mailbox, array $entries, [array $options = array()])
  • string $mailbox: Mailbox name (empty for server metadata)
  • array $entries: Entries
  • array $options: Command options (with MAXSIZE and DEPTH keys)
get_namespace (line 546)

Get namespace

  • return: Namespace data
  • access: public
array get_namespace ([string $name = null])
  • string $name: Namespace array index: personal, other, shared, prefix
get_quota (line 3107)

Get mailbox quota information added by Nuny

  • return: Quota info or False if not supported
mixed get_quota ()
get_raw_body (line 2432)

Returns the whole message source as string (or saves to a file)

  • return: Message source string
string &get_raw_body (int $uid, [resource $fp = null])
  • int $uid: Message UID
  • resource $fp: File pointer to save the message
get_raw_headers (line 2445)

Returns the message headers as string

  • return: Message headers string
string &get_raw_headers (int $uid)
  • int $uid: Message UID
get_response_code (line 273)

Returns code of last command response

  • return: Response code
int get_response_code ()
get_response_str (line 303)

Returns last command response

  • return: Response
string get_response_str ()
get_search_set (line 449)

Return the saved search set as hash array

  • return: Search set
array get_search_set ()
get_uid (line 2899)

Translate message number to UID

  • return: Message UID
int get_uid (int $id, [string $mailbox = null])
  • int $id: Message ID
  • string $mailbox: Mailbox name
id2uid (line 4277)

Find UID of the specified message sequence ID

  • return: Message UID
int id2uid (int $id, [string $mailbox = null], [bool $force = false])
  • int $id: Message (sequence) ID
  • string $mailbox: Mailbox name
  • bool $force: True to skip cache
in_searchset (line 1900)

Check if the given message ID is part of the current search set

  • return: True on match or if no search request is stored
boolean in_searchset (string $msgid)
  • string $msgid: Message id
list_headers (line 811)

Public method for listing headers convert mailbox name with root dir first

  • return: Indexed array with message header objects
  • access: public
array list_headers ([string $mailbox = ''], [int $page = NULL], [string $sort_field = NULL], [string $sort_order = NULL], [int $slice = 0])
  • string $mailbox: Mailbox/folder name
  • int $page: Current page to list
  • string $sort_field: Header field to sort by
  • string $sort_order: Sort order [ASC|DESC]
  • int $slice: Number of slice items to extract from result array
list_mailboxes (line 2925)

Public method for listing subscribed folders

  • return: List of mailboxes/folders
  • access: public
array list_mailboxes ([string $root = ''], [string $name = '*'], [string $filter = null], [string $rights = null])
  • string $root: Optional root folder
  • string $name: Optional name pattern
  • string $filter: Optional filter
  • string $rights: Optional ACL requirements
list_rights (line 3660)

Returns information about what rights can be granted to the user (identifier) in the ACL for the mailbox (LISTRIGHTS)

  • return: List of user rights
  • since: 0.5-beta
  • access: public
array list_rights (string $mailbox, string $user)
  • string $mailbox: Mailbox name
  • string $user: User name
list_unsubscribed (line 3049)

Get a list of all folders available on the IMAP server

  • return: Indexed array with folder names
array list_unsubscribed ([string $root = ''], [string $name = '*'], [mixed $filter = null], [string $rights = null])
  • string $root: IMAP root dir
  • string $name: Optional name pattern
  • mixed $filter: Optional filter
  • string $rights: Optional ACL requirements
mailbox_data (line 3449)

Gets connection (and current mailbox) data: UIDVALIDITY, EXISTS, RECENT, PERMANENTFLAGS, UIDNEXT, UNSEEN

  • return: Data
array mailbox_data (string $mailbox)
  • string $mailbox: Folder name
mailbox_exists (line 3313)

Checks if folder exists and is subscribed

  • return: TRUE or FALSE
boolean mailbox_exists (string $mailbox, [boolean $subscription = false])
  • string $mailbox: Folder name
  • boolean $subscription: Enable subscription checking
mailbox_info (line 3480)

Returns extended information about the folder

  • return: Data
array mailbox_info (string $mailbox)
  • string $mailbox: Folder name
mailbox_namespace (line 3348)

Returns the namespace where the folder is in

  • return: One of 'personal', 'other' or 'shared'
  • access: public
string mailbox_namespace (string $mailbox)
  • string $mailbox: Folder name
mailbox_options (line 3420)

Gets folder options from LIST response, e.g. \Noselect, \Noinferiors

  • return: Options list
array mailbox_options (string $mailbox, [bool $force = false])
  • string $mailbox: Folder name
  • bool $force: Set to True if options should be refreshed Options are available after LIST command only
mailbox_status (line 1353)

Returns current status of mailbox

We compare the maximum UID to determine the number of new messages because the RECENT flag is not reliable.

  • return: Folder status
int mailbox_status ([string $mailbox = null])
  • string $mailbox: Mailbox/folder name
mailbox_sync (line 3559)

Synchronizes messages cache.

  • access: public
void mailbox_sync (string $mailbox)
  • string $mailbox: Folder name
messagecount (line 652)

Get message count for a specific mailbox

  • return: Number of messages
  • access: public
int messagecount ([string $mailbox = ''], [string $mode = 'ALL'], [boolean $force = false], [boolean $status = true])
  • string $mailbox: Mailbox/folder name
  • string $mode: Mode for count [ALL|THREADS|UNSEEN|RECENT]
  • boolean $force: Force reading from server and update cache
  • boolean $status: Enables storing folder status info (max UID/count), required for mailbox_status()
message_index (line 1418)

Return sorted array of message IDs (not UIDs)

  • return: Indexed array with message IDs
array message_index ([string $mailbox = ''], [string $sort_field = NULL], [string $sort_order = NULL])
  • string $mailbox: Mailbox to get index from
  • string $sort_field: Sort column
  • string $sort_order: Sort order [ASC, DESC]
message_index_direct (line 1502)

Return sorted array of message IDs (not UIDs) directly from IMAP server.

Doesn't use cache and ignores current search settings.

  • return: Indexed array with message IDs
array message_index_direct (string $mailbox, [string $sort_field = null], [string $sort_order = null])
  • string $mailbox: Mailbox to get index from
  • string $sort_field: Sort column
  • string $sort_order: Sort order [ASC, DESC]
mime_decode (line 4121)

Decode a mime part

  • return: Decoded string
string mime_decode (string $input, [string $encoding = '7bit'])
  • string $input: Input string
  • string $encoding: Part encoding
mod_mailbox (line 3383)

Modify folder name according to namespace.

For output it removes prefix of the personal namespace if it's possible. For input it adds the prefix. Use it before creating a folder in root of the folders tree.

  • return: Folder name
string mod_mailbox (string $mailbox, [string $mode = 'out'])
  • string $mailbox: Folder name
  • string $mode: Mode name (out/in)
move_message (line 2567)

Move a message from one mailbox to another

  • return: True on success, False on error
boolean move_message (mixed $uids, string $to_mbox, [string $from_mbox = ''])
  • mixed $uids: Message UIDs as array or comma-separated string, or '*'
  • string $to_mbox: Target mailbox
  • string $from_mbox: Source mailbox
my_rights (line 3679)

Returns the set of rights that the current user has to mailbox (MYRIGHTS)

  • return: MYRIGHTS response on success, NULL on error
  • since: 0.5-beta
  • access: public
array my_rights (string $mailbox)
  • string $mailbox: Mailbox name
print_raw_body (line 2456)

Sends the whole message source to stdout

void print_raw_body (int $uid)
  • int $uid: Message UID
reconnect (line 235)

Close IMAP connection and re-connect This is used to avoid some strange socket errors when talking to Courier IMAP

  • access: public
void reconnect ()
refresh_search (line 1884)

Refresh saved search set

  • return: Current search set
array refresh_search ()
rename_mailbox (line 3200)

Set a new name to an existing mailbox

  • return: True on success
boolean rename_mailbox (string $mailbox, string $new_name)
  • string $mailbox: Mailbox to rename
  • string $new_name: New mailbox name
save_message (line 2536)

Append a mail message (source) to a specific mailbox

  • return: Appended message UID or True on success, False on error
int|bool save_message (string $mailbox,  &$message, [string $headers = ''], [boolean $is_file = false], string $message)
  • string $mailbox: Target mailbox
  • string $message: The message source string or filename
  • string $headers: Headers string if $message contains only the body
  • boolean $is_file: True if $message is a filename
  • &$message
search (line 1623)

Invoke search request to IMAP server

  • return: search results as list of message IDs
  • access: public
array search ([string $mailbox = ''], [string $str = NULL], [string $charset = NULL], [string $sort_field = NULL])
  • string $mailbox: Mailbox name to search in
  • string $str: Search criteria
  • string $charset: Search charset
  • string $sort_field: Header field to sort by
search_once (line 1730)

Direct (real and simple) SEARCH request to IMAP server, without result sorting and caching

  • return: Search results as list of message IDs or UIDs
array search_once ([string $mailbox = ''], [string $str = NULL], [boolean $ret_uid = false])
  • string $mailbox: Mailbox name to search in
  • string $str: Search string
  • boolean $ret_uid: True if UIDs should be returned
select_mailbox (line 378)

Forces selection of a mailbox

  • access: public
void select_mailbox ([string $mailbox = null])
  • string $mailbox: Mailbox/Folder name
set_acl (line 3600)

Changes the ACL on the specified mailbox (SETACL)

  • return: True on success, False on failure
  • since: 0.5-beta
  • access: public
boolean set_acl (string $mailbox, string $user, string $acl)
  • string $mailbox: Mailbox name
  • string $user: User name
  • string $acl: ACL string
set_caching (line 3820)

Enable or disable indexes caching

  • access: public
void set_caching (string $type)
  • string $type: Cache type (@see rcmail::get_cache)
set_charset (line 328)

Set default message charset

This will be used for message decoding if a charset specification is not available

  • access: public
void set_charset (string $cs)
  • string $cs: Charset string
set_default_mailboxes (line 340)

This list of folders will be listed above all other folders

  • access: public
void set_default_mailboxes (array $arr)
  • array $arr: Indexed list of folder names
set_flag (line 2472)

Set message flag to one or several messages

  • return: Operation status
boolean set_flag (mixed $uids, string $flag, [string $mailbox = null], [boolean $skip_cache = false])
  • mixed $uids: Message UIDs as array or comma-separated string, or '*'
  • string $flag: Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT, MDNSENT
  • string $mailbox: Folder name
  • boolean $skip_cache: True to skip message cache clean up
set_mailbox (line 360)

Set internal mailbox reference.

All operations will be perfomed on this mailbox/folder

  • access: public
void set_mailbox (string $mailbox)
  • string $mailbox: Mailbox/Folder name
set_messages_caching (line 3899)

Enable or disable messages caching

void set_messages_caching (boolean $set)
  • boolean $set: Flag
set_metadata (line 3698)

Sets IMAP metadata/annotations (SETMETADATA/SETANNOTATION)

  • return: True on success, False on failure
  • since: 0.5-beta
  • access: public
boolean set_metadata (string $mailbox, array $entries)
  • string $mailbox: Mailbox name (empty for server metadata)
  • array $entries: Entry-value array (use NULL value as NIL)
set_options (line 314)

Set options to be used in rcube_imap_generic::connect()

void set_options (array $opt)
  • array $opt: Options array
set_page (line 400)

Set internal list page

  • access: public
void set_page (number $page)
  • number $page: Page number to list
set_pagesize (line 412)

Set internal page size

  • access: public
void set_pagesize (number $size)
  • number $size: Number of messages to display on one page
set_search_set (line 427)

Save a set of message ids for future message listing methods

void set_search_set ([string $str = null], [array $msgs = null], [string $charset = null], [string $sort_field = null], [string $threads = false], [ $sorted = false])
  • string $str: IMAP Search query
  • array $msgs: List of message ids or NULL if empty
  • string $charset: Charset of search string
  • string $sort_field: Sorting field
  • string $threads: True if set is sorted (SORT was used for searching)
  • $sorted
set_threading (line 493)

Sets threading flag to the best supported THREAD algorithm

  • return: Algorithm or false if THREAD is not supported
  • access: public
string set_threading ([boolean $enable = false])
  • boolean $enable: TRUE to enable and FALSE
sort_threads (line 1785)

Sort thread

  • return: Sorted roots IDs
array sort_threads (string $mailbox, array $thread_tree, [array $ids = null])
  • string $mailbox: Mailbox name
  • array $thread_tree: Unsorted thread tree (rcube_imap_generic::thread() result)
  • array $ids: Message IDs if we know what we need (e.g. search result)
subscribe (line 3141)

Subscribe to a specific mailbox(es)

  • return: True on success
boolean subscribe (array $a_mboxes)
  • array $a_mboxes: Mailbox name(s)
thread_index (line 1548)

Return sorted array of threaded message IDs (not UIDs)

  • return: Indexed array with message IDs
array thread_index ([string $mailbox = ''], [string $sort_field = NULL], [string $sort_order = NULL])
  • string $mailbox: Mailbox to get index from
  • string $sort_field: Sort column
  • string $sort_order: Sort order [ASC, DESC]
uid2id (line 4246)

Finds message sequence ID for specified UID

  • return: Message (sequence) ID
int uid2id (int $uid, [string $mailbox = null], [bool $force = false])
  • int $uid: Message UID
  • string $mailbox: Mailbox name
  • bool $force: True to skip cache
unset_flag (line 2520)

Remove message flag for one or several messages

int unset_flag (mixed $uids, string $flag, [string $mailbox = null])
  • mixed $uids: Message UIDs as array or comma-separated string, or '*'
  • string $flag: Flag to unset: SEEN, DELETED, RECENT, ANSWERED, DRAFT, MDNSENT
  • string $mailbox: Folder name
unsubscribe (line 3157)

Unsubscribe mailboxes

  • return: True on success
boolean unsubscribe (array $a_mboxes)
  • array $a_mboxes: Mailbox name(s)
update_cache (line 3867)

Update cache

  • access: public
void update_cache (string $key, mixed $data)
  • string $key: Cache key
  • mixed $data: Data
Class Constants
ALREADYEXISTS = 6 (line 118)
CONTACTADMIN = 8 (line 120)
INUSE = 4 (line 116)
NONEXISTENT = 7 (line 119)
NOPERM = 1 (line 113)
OVERQUOTA = 5 (line 117)
READONLY = 2 (line 114)
TRYCREATE = 3 (line 115)
UNKNOWN = 0 (line 112)

Documentation generated on Tue, 04 Oct 2011 22:55:24 +0200 by phpDocumentor 1.4.3