Class rcube_imap

Description

Interface class for accessing an IMAP server

Located in /rcube_imap.php (line 36)

rcube_storage
   |
   --rcube_imap
Variable Summary
Method Summary
 static void decode_mime_string ( $input, [ $fallback = null])
 static void explode_header_string ( $separator,  $str, [ $remove_comments = false])
 rcube_imap __construct ()
 void change_subscription ( $folders,  $mode)
 boolean check_permflag (string $flag)
 void clear_cache ([string $key = null], [boolean $prefix_mode = false])
 void clear_messagecount ( $folder, [ $mode = null])
 void clear_message_cache ([string $folder = null], [array $uids = null])
 void close ()
 boolean connect (string $host, string $user, string $pass, [integer $port = 143], [string $use_ssl = null])
 string convert_criteria (string $str, string $charset, [string $dest_charset = 'US-ASCII'])
 boolean copy_message (mixed $uids, string $to_mbox, [string $from_mbox = ''])
 int count ([string $folder = ''], [string $mode = 'ALL'], [boolean $force = false], [boolean $status = true])
 boolean create_folder (string $folder, [boolean $subscribe = false])
 void create_mailbox ( $folder, [ $subscribe = false])
 void debug_handler ( &$imap,  $message)
 void decode_address_list ( $input, [ $max = null], [ $decode = true], [ $fallback = null])
 void decode_header ( $input, [ $fallback = null])
 boolean delete_acl (string $folder, string $user)
 boolean delete_folder (string $folder)
 void delete_mailbox ( $folder)
 boolean delete_message (mixed $uids, [string $folder = ''])
 boolean delete_metadata (string $folder, array $entries)
 void expunge ([ $folder = ''], [ $clear_cache = true])
 void expunge_cache ()
 boolean expunge_message (mixed $uids, [string $folder = null], [boolean $clear_cache = true])
 array fetch_headers (string $folder, array $msgs, [bool $sort = true], [bool $force = false])
 rcube_imap_thread fetch_threads (string $folder, [bool $force = false])
 array fetch_thread_headers (string $folder, rcube_result_thread $threads, int $page, [int $slice = 0])
 void filter_rights ( $a_folders,  $rights)
 array folder_attributes (string $folder, [bool $force = false])
 array folder_data (string $folder)
 boolean folder_exists (string $folder, [boolean $subscription = false])
 array folder_info (string $folder)
 string folder_namespace (string $folder)
 int folder_size (string $folder)
 int folder_status ([string $folder = null])
 void folder_sync (string $folder)
 array get_acl (string $folder)
 mixed get_cache (string $key)
 mixed get_capability (string $cap)
 string get_error_str ()
 string get_fetch_headers ()
 array get_folder_stats (string $folder)
 void get_mailbox_size ( $folder)
 object rcube_mail_header get_message (int $uid, [string $folder = null])
 rcube_mail_header get_message_headers ( $uid, [string $folder = null], [bool $force = false], int $id)
 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 $folder, 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)
 array get_search_set ()
 int id2uid (int $id, [string $folder = null])
 rcube_result_index|rcube_result_thread index ([string $folder = ''], [string $sort_field = NULL], [string $sort_order = NULL])
 rcube_result_index index_direct (string $folder, [string $sort_field = null], [string $sort_order = null], [bool $skip_cache = true])
 boolean is_connected ()
 array list_folders ([string $root = ''], [string $name = '*'], [mixed $filter = null], [string $rights = null], [bool $skip_sort = false])
 array list_folders_direct ([string $root = ''], [string $name = '*'])
 array list_folders_subscribed ([string $root = ''], [string $name = '*'], [string $filter = null], [string $rights = null], [bool $skip_sort = false])
 array list_folders_subscribed_direct ([string $root = ''], [string $name = '*'])
 void list_headers ([ $folder = ''], [ $page = NULL], [ $sort_field = NULL], [ $sort_order = NULL], [ $slice = 0])
 void list_mailboxes ([ $root = ''], [ $name = '*'], [ $filter = null], [ $rights = null], [ $skip_sort = false])
 array list_messages ([string $folder = ''], [int $page = NULL], [string $sort_field = NULL], [string $sort_order = NULL], [int $slice = 0])
 array list_rights (string $folder, string $user)
 array list_search_messages (string $folder, int $page, [int $slice = 0])
 array list_search_thread_messages (string $folder, int $page, [int $slice = 0])
 array list_thread_messages (string $folder, int $page, [int $slice = 0])
 void list_unsubscribed ([ $root = ''], [ $name = '*'], [ $filter = null], [ $rights = null], [ $skip_sort = false])
 void mailbox_attributes ( $folder, [ $force = false])
 void mailbox_data ( $folder)
 void mailbox_exists ( $folder, [ $subscription = false])
 void mailbox_info ( $folder)
 void mailbox_namespace ( $folder)
 void mailbox_status ([ $folder = null])
 void mailbox_sync ( $folder)
 array md2annotate (string $entry)
 int messagecount (string $folder, [string $mode = 'ALL'], [boolean $force = false], [boolean $status = true])
 void message_index ([ $folder = ''], [ $sort_field = NULL], [ $sort_order = NULL])
 void message_index_direct ( $folder, [ $sort_field = null], [ $sort_order = null], [ $skip_cache = true])
 void mime_decode ( $input, [ $encoding = '7bit'])
 string mod_folder (string $folder, [string $mode = 'out'])
 void mod_mailbox ( $folder, [ $mode = 'out'])
 boolean move_message (mixed $uids, string $to_mbox, [string $from_mbox = ''])
 array my_rights (string $folder)
 void print_raw_body ( $uid)
 array refresh_search ()
 boolean rename_folder (string $folder, string $new_name)
 void rename_mailbox ( $folder,  $new_name)
 void rsort ( $folder,  $delimiter,  &$list,  &$out)
 int|bool save_message (string $folder,  &$message, [string $headers = ''], [boolean $is_file = false], string $message)
 void search ([string $folder = ''], [string $str = 'ALL'], [string $charset = NULL], [string $sort_field = NULL])
 rcube_result_index|rcube_result_thread search_index (string $folder, [string $criteria = 'ALL'], [string $charset = NULL], [string $sort_field = NULL])
 rcube_result_index search_once ([ $folder = null], [string $str = 'ALL'], string $mailbox)
 void select_mailbox ( $mailbox)
 boolean set_acl (string $folder, string $user, string $acl)
 void set_caching (string $type)
 void set_debug ([boolean $dbg = true])
 void set_env ()
 boolean set_flag (mixed $uids, string $flag, [string $folder = null], [boolean $skip_cache = false])
 void set_folder (string $folder)
 void set_folder_stats (string $folder, string $name, mixed $data)
 void set_mailbox ( $folder)
 void set_messagecount ( $folder,  $mode,  $increment)
 void set_messages_caching (boolean $set)
 boolean set_metadata (string $folder, array $entries)
 void set_part_filename ( &$part, [string $headers = null], rcube_message_part $part)
 void set_search_set (array $set)
 void set_sort_order (string $sort_field, string $sort_order)
 array set_thread_flags ( &$headers, rcube_imap_result $threads, array $headers)
 void sort_folder_list (array $a_folders)
 string structure_charset (array $structure)
 void structure_part (array $part, [int $count = 0], [string $parent = ''], [ $mime_headers = null])
 boolean subscribe (array $folders)
 rcube_result_thread thread_index ([string $folder = ''], [string $sort_field = NULL], [string $sort_order = NULL])
 boolean unsubscribe ( $folders, array $a_mboxes)
 void update_cache (string $key, mixed $data)
 array _list_messages ([string $folder = ''], [int $page = NULL], [string $sort_field = NULL], [string $sort_order = NULL], [int $slice = 0])
 void __get ( $name)
Variables
rcube_cache $cache (line 57)

Instance of rcube_cache

  • access: protected
mixed $caching = false (line 81)
  • access: protected
rcube_imap_generic $conn (line 43)

Instance of rcube_imap_generic

  • access: public

Redefinition of:
rcube_storage::$conn
Instance of connection object e.g. rcube_imap_generic
mixed $delimiter (line 67)
  • access: protected
array $icache = array() (line 64)

Internal (in-memory) cache

  • access: protected
mixed $list_page = 1 (line 66)
  • access: protected
rcube_imap_cache $mcache (line 50)

Instance of rcube_imap_cache

  • access: protected
mixed $messages_caching = false (line 82)
  • access: protected
mixed $msg_headers = array() (line 73)
  • access: protected
mixed $namespace (line 68)
  • access: protected
mixed $options = array('auth_method' => 'check') (line 80)
  • access: protected

Redefinition of:
rcube_storage::$options
mixed $search_charset = '' (line 76)
  • access: protected
mixed $search_set (line 74)
  • access: protected

Redefinition of:
rcube_storage::$search_set
mixed $search_sorted = false (line 79)
  • access: protected
mixed $search_sort_field = '' (line 77)
  • access: protected
mixed $search_string = '' (line 75)
  • access: protected
mixed $search_threads = false (line 78)
  • access: protected
mixed $sort_field = '' (line 69)
  • access: protected
mixed $sort_order = 'DESC' (line 70)
  • access: protected
mixed $struct_charset (line 71)
  • access: protected
mixed $threading = false (line 83)
  • access: protected

Redefinition of:
rcube_storage::$threading
mixed $uid_id_map = array() (line 72)
  • access: protected

Inherited Variables

Inherited from rcube_storage

rcube_storage::$all_headers
rcube_storage::$default_charset
rcube_storage::$default_folders
rcube_storage::$folder
rcube_storage::$page_size
Methods
static decode_mime_string (line 3873)
  • access: public
void decode_mime_string ( $input, [ $fallback = null])
  • $input
  • $fallback
static explode_header_string (line 3883)
  • access: public
void explode_header_string ( $separator,  $str, [ $remove_comments = false])
  • $separator
  • $str
  • $remove_comments
Constructor __construct (line 89)

Object constructor.

  • access: public
rcube_imap __construct ()
change_subscription (line 3769)

Subscribe/unsubscribe a list of folders and update local cache

  • access: protected
void change_subscription ( $folders,  $mode)
  • $folders
  • $mode
check_connection (line 218)

Check connection state, connect if not connected.

  • return: Connection state.
  • access: public
bool check_connection ()

Redefinition of:
rcube_storage::check_connection()
Check connection state, connect if not connected.
check_permflag (line 405)

Checks the PERMANENTFLAGS capability of the current folder 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

Redefinition of:
rcube_storage::check_permflag()
Checks the PERMANENTFLAGS capability of the current folder and returns true if the given flag is supported by the server.
clear_cache (line 3576)

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

Redefinition of:
rcube_storage::clear_cache()
Clears the cache.
clear_messagecount (line 3833)

Remove messagecount of a specific folder from cache

  • access: protected
void clear_messagecount ( $folder, [ $mode = null])
  • $folder
  • $mode
clear_message_cache (line 3645)

Clears the messages cache.

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

Close IMAP connection.

Usually done on script shutdown

  • access: public
void close ()

Redefinition of:
rcube_storage::close()
Close connection. Usually done on script shutdown
connect (line 128)

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

Redefinition of:
rcube_storage::connect()
Connect to the server
convert_criteria (line 1453)

Converts charset of search criteria string

  • return: Search string
  • access: protected
string convert_criteria (string $str, string $charset, [string $dest_charset = 'US-ASCII'])
  • string $str: Search string
  • string $charset: Original charset
  • string $dest_charset: Destination charset (default US-ASCII)
copy_message (line 2289)

Copy a message from one folder to another

  • return: True on success, False on error
  • access: public
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 folder
  • string $from_mbox: Source folder

Redefinition of:
rcube_storage::copy_message()
Copy message(s) from one mailbox to another.
count (line 543)

Get message count for a specific folder

  • return: Number of messages
  • access: public
int count ([string $folder = ''], [string $mode = 'ALL'], [boolean $force = false], [boolean $status = true])
  • string $folder: 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 folder_status()

Redefinition of:
rcube_storage::count()
Get messages count for a specific folder.
create_default_folders (line 2937)

Create all folders specified as default

  • access: public
void create_default_folders ()

Redefinition of:
rcube_storage::create_default_folders()
Create all folders specified as default
create_folder (line 2804)

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

  • return: True on success
  • access: public
boolean create_folder (string $folder, [boolean $subscribe = false])
  • string $folder: New folder name
  • boolean $subscribe: True if the new folder should be subscribed

Redefinition of:
rcube_storage::create_folder()
Create a new folder on the server.
create_mailbox (line 3938)
  • access: public
void create_mailbox ( $folder, [ $subscribe = false])
  • $folder
  • $subscribe
debug_handler (line 3853)

This is our own debug handler for the IMAP connection

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

Deprecated methods (to be removed)

  • access: public
void decode_address_list ( $input, [ $max = null], [ $decode = true], [ $fallback = null])
  • $input
  • $max
  • $decode
  • $fallback
decode_header (line 3868)
  • access: public
void decode_header ( $input, [ $fallback = null])
  • $input
  • $fallback
delete_acl (line 3290)

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

  • return: True on success, False on failure
  • since: 0.5-beta
  • access: public
boolean delete_acl (string $folder, string $user)
  • string $folder: Folder name
  • string $user: User name

Redefinition of:
rcube_storage::delete_acl()
Removes any <identifier,rights> pair for the specified user from the ACL for the specified folder (DELETEACL).
delete_folder (line 2893)

Remove folder from server

  • return: True on success
boolean delete_folder (string $folder)
  • string $folder: Folder name

Redefinition of:
rcube_storage::delete_folder()
Remove a folder from the server.
delete_mailbox (line 3948)
void delete_mailbox ( $folder)
  • $folder
delete_message (line 2337)

Mark messages as deleted and expunge them

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

Redefinition of:
rcube_storage::delete_message()
Mark message(s) as deleted and expunge.
delete_metadata (line 3414)

Unsets IMAP metadata/annotations (SETMETADATA/SETANNOTATION)

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

Redefinition of:
rcube_storage::delete_metadata()
Unsets metadata/annotations (SETMETADATA/SETANNOTATION)
expunge (line 3988)
  • access: public
void expunge ([ $folder = ''], [ $clear_cache = true])
  • $folder
  • $clear_cache
expunge_cache (line 3586)

Delete outdated cache entries

  • access: public
void expunge_cache ()

Redefinition of:
rcube_storage::expunge_cache()
Delete outdated cache entries
expunge_message (line 2394)

Send IMAP expunge command and clear cache

  • return: True on success, False on failure
  • access: public
boolean expunge_message (mixed $uids, [string $folder = null], [boolean $clear_cache = true])
  • mixed $uids: Message UIDs as array or comma-separated string, or '*'
  • string $folder: Folder name
  • boolean $clear_cache: False if cache should not be cleared

Redefinition of:
rcube_storage::expunge_message()
Expunge message(s) and clear the cache.
fetch_headers (line 1023)

Fetches messages headers (by UID)

  • return: Messages headers indexed by UID
array fetch_headers (string $folder, array $msgs, [bool $sort = true], [bool $force = false])
  • string $folder: Folder name
  • array $msgs: Message UIDs
  • bool $sort: Enables result sorting by $msgs
  • bool $force: Disables cache use
fetch_threads (line 770)

Method for fetching threads data

  • return: Thread data object
rcube_imap_thread fetch_threads (string $folder, [bool $force = false])
  • string $folder: Folder name
  • bool $force: Use IMAP server, no cache
fetch_thread_headers (line 804)

protected method for fetching threaded messages headers

  • return: Messages headers
  • access: protected
array fetch_thread_headers (string $folder, rcube_result_thread $threads, int $page, [int $slice = 0])
  • string $folder: Folder name
  • rcube_result_thread $threads: Threads data object
  • int $page: List page number
  • int $slice: Number of threads to slice
filter_rights (line 2714)

Filter the given list of folders according to access rights

  • access: protected
void filter_rights ( $a_folders,  $rights)
  • $a_folders
  • $rights
folder_attributes (line 3069)

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

  • return: Options list
  • access: public
array folder_attributes (string $folder, [bool $force = false])
  • string $folder: Folder name
  • bool $force: Set to True if attributes should be refreshed

Redefinition of:
rcube_storage::folder_attributes()
Gets folder attributes (from LIST response, e.g. \Noselect, \Noinferiors).
folder_data (line 3102)

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

  • return: Data
  • access: public
array folder_data (string $folder)
  • string $folder: Folder name

Redefinition of:
rcube_storage::folder_data()
Gets connection (and current folder) data: UIDVALIDITY, EXISTS, RECENT, PERMANENTFLAGS, UIDNEXT, UNSEEN
folder_exists (line 2959)

Checks if folder exists and is subscribed

  • return: TRUE or FALSE
  • access: public
boolean folder_exists (string $folder, [boolean $subscription = false])
  • string $folder: Folder name
  • boolean $subscription: Enable subscription checking

Redefinition of:
rcube_storage::folder_exists()
Checks if folder exists and is subscribed
folder_info (line 3141)

Returns extended information about the folder

  • return: Data
  • access: public
array folder_info (string $folder)
  • string $folder: Folder name

Redefinition of:
rcube_storage::folder_info()
Returns extended information about the folder.
folder_namespace (line 2998)

Returns the namespace where the folder is in

  • return: One of 'personal', 'other' or 'shared'
  • access: public
string folder_namespace (string $folder)
  • string $folder: Folder name

Redefinition of:
rcube_storage::folder_namespace()
Returns the namespace where the folder is in
folder_size (line 2751)

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

  • return: Folder size in bytes, False on error
  • access: public
int folder_size (string $folder)
  • string $folder: Folder name

Redefinition of:
rcube_storage::folder_size()
Get folder size (size of all messages in a folder)
folder_status (line 1070)

Returns current status of folder

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

  • return: Folder status
  • access: public
int folder_status ([string $folder = null])
  • string $folder: Folder name

Redefinition of:
rcube_storage::folder_status()
Returns current status of a folder
folder_sync (line 3220)

Synchronizes messages cache.

  • access: public
void folder_sync (string $folder)
  • string $folder: Folder name

Redefinition of:
rcube_storage::folder_sync()
Synchronizes messages cache.
get_acl (line 3312)

Returns the access control list for folder (GETACL)

  • return: User-rights array on success, NULL on error
  • since: 0.5-beta
  • access: public
array get_acl (string $folder)
  • string $folder: Folder name

Redefinition of:
rcube_storage::get_acl()
Returns the access control list for a folder (GETACL).
get_cache (line 3549)

Returns cached value

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

Redefinition of:
rcube_storage::get_cache()
Returns cached value
get_cache_engine (line 3530)

Getter for IMAP cache object

  • access: protected
void get_cache_engine ()
get_capability (line 380)

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

Redefinition of:
rcube_storage::get_capability()
Returns the storage server's (IMAP) capability
get_error_code (line 251)

Returns code of last error

  • return: Error code
  • access: public
int get_error_code ()

Redefinition of:
rcube_storage::get_error_code()
Returns code of last error
get_error_str (line 262)

Returns text of last error

  • return: Error string
  • access: public
string get_error_str ()

Redefinition of:
rcube_storage::get_error_str()
Returns message of last error
get_fetch_headers (line 3233)

Get message header names for rcube_imap_generic::fetchHeader(s)

  • return: Space-separated list of header names
  • access: protected
string get_fetch_headers ()
get_folder_stats (line 1125)

Gets folder statistic data

  • return: Stats data
  • access: protected
array get_folder_stats (string $folder)
  • string $folder: Folder name
get_hierarchy_delimiter (line 425)

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

  • return: Delimiter string
  • access: public
string get_hierarchy_delimiter ()

Redefinition of:
rcube_storage::get_hierarchy_delimiter()
Returns the delimiter that is used by the server for folder hierarchy separation.
get_mailbox_name (line 3898)
  • access: public
void get_mailbox_name ()
get_mailbox_size (line 3933)
  • access: public
void get_mailbox_size ( $folder)
  • $folder
get_mcache_engine (line 3625)

Getter for messages cache object

  • access: protected
void get_mcache_engine ()
get_message (line 1536)

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
  • access: public
object rcube_mail_header get_message (int $uid, [string $folder = null])
  • int $uid: Message UID to fetch
  • string $folder: Folder to read from

Redefinition of:
rcube_storage::get_message()
Fetch message headers and body structure from the server and build an object structure similar to the one generated by PEAR::Mail_mimeDecode
get_message_headers (line 1505)

Return message headers object of a specific message

  • return: Message headers
  • access: public
rcube_mail_header get_message_headers ( $uid, [string $folder = null], [bool $force = false], int $id)
  • int $id: Message UID
  • string $folder: Folder to read from
  • bool $force: True to skip cache
  • $uid

Redefinition of:
rcube_storage::get_message_headers()
Return message headers object of a specific message
get_message_part (line 2000)

Fetch message body of a specific message from the server

  • return: Message/part body if not printed
  • access: public
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

Redefinition of:
rcube_storage::get_message_part()
Fetch message body of a specific message from the server
get_metadata (line 3447)

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 $folder, array $entries, [array $options = array()])
  • string $folder: Folder name (empty for server metadata)
  • array $entries: Entries
  • array $options: Command options (with MAXSIZE and DEPTH keys)

Redefinition of:
rcube_storage::get_metadata()
Returns folder metadata/annotations (GETMETADATA/GETANNOTATION).
get_namespace (line 438)

Get namespace

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

Redefinition of:
rcube_storage::get_namespace()
Get namespace
get_quota (line 2734)

Get mailbox quota information added by Nuny

  • return: Quota info or False if not supported
  • access: public
mixed get_quota ()

Redefinition of:
rcube_storage::get_quota()
Get mailbox quota information.
get_raw_body (line 2060)

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

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

Redefinition of:
rcube_storage::get_raw_body()
Returns the whole message source as string (or saves to a file)
get_raw_headers (line 2078)

Returns the message headers as string

  • return: Message headers string
  • access: public
string get_raw_headers (int $uid)
  • int $uid: Message UID

Redefinition of:
rcube_storage::get_raw_headers()
Returns the message headers as string
get_response_code (line 273)

Returns code of last command response

  • return: Response code
  • access: public
int get_response_code ()

Redefinition of:
rcube_storage::get_response_code()
Returns code of last command response
get_search_set (line 357)

Return the saved search set as hash array

  • return: Search set
  • access: public
array get_search_set ()

Redefinition of:
rcube_storage::get_search_set()
Return the saved search set.
id2uid (line 3744)

Find UID of the specified message sequence ID

  • return: Message UID
  • access: public
int id2uid (int $id, [string $folder = null])
  • int $id: Message (sequence) ID
  • string $folder: Folder name
index (line 1144)

Return sorted list of message UIDs

  • return: List of messages (UIDs)
  • access: public
rcube_result_index|rcube_result_thread index ([string $folder = ''], [string $sort_field = NULL], [string $sort_order = NULL])
  • string $folder: Folder to get index from
  • string $sort_field: Sort column
  • string $sort_order: Sort order [ASC, DESC]

Redefinition of:
rcube_storage::index()
Return sorted list of message UIDs
index_direct (line 1209)

Return sorted list of message UIDs ignoring current search settings.

Doesn't uses cache by default.

  • return: Sorted list of message UIDs
  • access: public
rcube_result_index index_direct (string $folder, [string $sort_field = null], [string $sort_order = null], [bool $skip_cache = true])
  • string $folder: Folder to get index from
  • string $sort_field: Sort column
  • string $sort_order: Sort order [ASC, DESC]
  • bool $skip_cache: Disables cache usage
is_connected (line 240)

Checks IMAP connection.

  • return: TRUE on success, FALSE on failure
  • access: public
boolean is_connected ()

Redefinition of:
rcube_storage::is_connected()
Checks connection state.
list_folders (line 2585)

Get a list of all folders available on the server

  • return: Indexed array with folder names
  • access: public
array list_folders ([string $root = ''], [string $name = '*'], [mixed $filter = null], [string $rights = null], [bool $skip_sort = false])
  • string $root: IMAP root dir
  • string $name: Optional name pattern
  • mixed $filter: Optional filter
  • string $rights: Optional ACL requirements
  • bool $skip_sort: Enable to return unsorted list (for better performance)

Redefinition of:
rcube_storage::list_folders()
Get a list of all folders available on the server.
list_folders_direct (line 2652)

Method for direct folders listing (LIST)

array list_folders_direct ([string $root = ''], [string $name = '*'])
  • string $root: Optional root folder
  • string $name: Optional name pattern
list_folders_subscribed (line 2456)

Public method for listing subscribed folders.

  • return: List of folders
  • access: public
array list_folders_subscribed ([string $root = ''], [string $name = '*'], [string $filter = null], [string $rights = null], [bool $skip_sort = false])
  • string $root: Optional root folder
  • string $name: Optional name pattern
  • string $filter: Optional filter
  • string $rights: Optional ACL requirements
  • bool $skip_sort: Enable to return unsorted list (for better performance)

Redefinition of:
rcube_storage::list_folders_subscribed()
Get a list of subscribed folders.
list_folders_subscribed_direct (line 2517)

Method for direct folders listing (LSUB)

array list_folders_subscribed_direct ([string $root = ''], [string $name = '*'])
  • string $root: Optional root folder
  • string $name: Optional name pattern
list_headers (line 3903)
  • access: public
void list_headers ([ $folder = ''], [ $page = NULL], [ $sort_field = NULL], [ $sort_order = NULL], [ $slice = 0])
  • $folder
  • $page
  • $sort_field
  • $sort_order
  • $slice
list_mailboxes (line 3923)
  • access: public
void list_mailboxes ([ $root = ''], [ $name = '*'], [ $filter = null], [ $rights = null], [ $skip_sort = false])
  • $root
  • $name
  • $filter
  • $rights
  • $skip_sort
list_messages (line 675)

Public method for listing headers

  • return: Indexed array with message header objects
  • access: public
array list_messages ([string $folder = ''], [int $page = NULL], [string $sort_field = NULL], [string $sort_order = NULL], [int $slice = 0])
  • string $folder: 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

Redefinition of:
rcube_storage::list_messages()
Public method for listing headers.
list_rights (line 3336)

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

  • return: List of user rights
  • since: 0.5-beta
  • access: public
array list_rights (string $folder, string $user)
  • string $folder: Folder name
  • string $user: User name

Redefinition of:
rcube_storage::list_rights()
Returns information about what rights can be granted to the user (identifier) in the ACL for the folder (LISTRIGHTS).
list_search_messages (line 874)

protected method for listing a set of message headers (search results)

  • return: Indexed array with message header objects
  • access: protected
array list_search_messages (string $folder, int $page, [int $slice = 0])
  • string $folder: Folder name
  • int $page: Current page to list
  • int $slice: Number of slice items to extract from result array
list_search_thread_messages (line 999)

protected method for listing a set of threaded message headers (search results)

array list_search_thread_messages (string $folder, int $page, [int $slice = 0])
  • string $folder: Folder name
  • int $page: Current page to list
  • int $slice: Number of slice items to extract from result array
list_thread_messages (line 749)

protected method for listing message headers using threads

  • return: Indexed array with message header objects
  • see: rcube_imap::list_messages
  • access: protected
array list_thread_messages (string $folder, int $page, [int $slice = 0])
  • string $folder: Folder name
  • int $page: Current page to list
  • int $slice: Number of slice items to extract from result array
list_unsubscribed (line 3928)
  • access: public
void list_unsubscribed ([ $root = ''], [ $name = '*'], [ $filter = null], [ $rights = null], [ $skip_sort = false])
  • $root
  • $name
  • $filter
  • $rights
  • $skip_sort
mailbox_attributes (line 3968)
  • access: public
void mailbox_attributes ( $folder, [ $force = false])
  • $folder
  • $force
mailbox_data (line 3973)
  • access: public
void mailbox_data ( $folder)
  • $folder
mailbox_exists (line 3953)
  • access: public
void mailbox_exists ( $folder, [ $subscription = false])
  • $folder
  • $subscription
mailbox_info (line 3978)
  • access: public
void mailbox_info ( $folder)
  • $folder
mailbox_namespace (line 3958)
  • access: public
void mailbox_namespace ( $folder)
  • $folder
mailbox_status (line 3908)
  • access: public
void mailbox_status ([ $folder = null])
  • $folder
mailbox_sync (line 3983)
  • access: public
void mailbox_sync ( $folder)
  • $folder
md2annotate (line 3490)

Converts the METADATA extension entry name into the correct entry-attrib names for older ANNOTATEMORE version.

  • return: Entry-attribute list, NULL if not supported (?)
  • access: protected
array md2annotate (string $entry)
  • string $entry: Entry name
messagecount (line 565)

protected method for getting nr of messages

int messagecount (string $folder, [string $mode = 'ALL'], [boolean $force = false], [boolean $status = true])
  • string $folder: 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 folder_status()
message_index (line 3913)
  • access: public
void message_index ([ $folder = ''], [ $sort_field = NULL], [ $sort_order = NULL])
  • $folder
  • $sort_field
  • $sort_order
message_index_direct (line 3918)
  • access: public
void message_index_direct ( $folder, [ $sort_field = null], [ $sort_order = null], [ $skip_cache = true])
  • $folder
  • $sort_field
  • $sort_order
  • $skip_cache
mime_decode (line 3878)
  • access: public
void mime_decode ( $input, [ $encoding = '7bit'])
  • $input
  • $encoding
mod_folder (line 3033)

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
  • access: public
string mod_folder (string $folder, [string $mode = 'out'])
  • string $folder: Folder name
  • string $mode: Mode name (out/in)

Redefinition of:
rcube_storage::mod_folder()
Modify folder name according to namespace.
mod_mailbox (line 3963)
  • access: public
void mod_mailbox ( $folder, [ $mode = 'out'])
  • $folder
  • $mode
move_message (line 2199)

Move a message from one folder to another

  • return: True on success, False on error
  • access: public
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 folder
  • string $from_mbox: Source folder

Redefinition of:
rcube_storage::move_message()
Move message(s) from one folder to another.
my_rights (line 3359)

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

  • return: MYRIGHTS response on success, NULL on error
  • since: 0.5-beta
  • access: public
array my_rights (string $folder)
  • string $folder: Folder name

Redefinition of:
rcube_storage::my_rights()
Returns the set of rights that the current user has to a folder (MYRIGHTS).
print_raw_body (line 2091)

Sends the whole message source to stdout

  • access: public
void print_raw_body ( $uid)
  • $uid

Redefinition of:
rcube_storage::print_raw_body()
Sends the whole message source to stdout
refresh_search (line 1486)

Refresh saved search set

  • return: Current search set
  • access: public
array refresh_search ()

Redefinition of:
rcube_storage::refresh_search()
Refresh saved search set
rename_folder (line 2834)

Set a new name to an existing folder

  • return: True on success
  • access: public
boolean rename_folder (string $folder, string $new_name)
  • string $folder: Folder to rename
  • string $new_name: New folder name

Redefinition of:
rcube_storage::rename_folder()
Set a new name to an existing folder
rename_mailbox (line 3943)
  • access: public
void rename_mailbox ( $folder,  $new_name)
  • $folder
  • $new_name
rsort (line 3722)

Recursive method for sorting folders

  • access: protected
void rsort ( $folder,  $delimiter,  &$list,  &$out)
  • $folder
  • $delimiter
  • &$list
  • &$out
save_message (line 2165)

Append a mail message (source) to a specific folder

  • return: Appended message UID or True on success, False on error
  • access: public
int|bool save_message (string $folder,  &$message, [string $headers = ''], [boolean $is_file = false], string $message)
  • string $folder: Target folder
  • 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

Redefinition of:
rcube_storage::save_message()
Append a mail message (source) to a specific folder.
search (line 1326)

Invoke search request to IMAP server

  • access: public
void search ([string $folder = ''], [string $str = 'ALL'], [string $charset = NULL], [string $sort_field = NULL])
  • string $folder: Folder name to search in
  • string $str: Search criteria
  • string $charset: Search charset
  • string $sort_field: Header field to sort by

Redefinition of:
rcube_storage::search()
Invoke search request to the server.
search_index (line 1382)

protected search method

rcube_result_index|rcube_result_thread search_index (string $folder, [string $criteria = 'ALL'], [string $charset = NULL], [string $sort_field = NULL])
  • string $folder: Folder name
  • string $criteria: Search criteria
  • string $charset: Charset
  • string $sort_field: Sorting field
search_once (line 1351)

Direct (real and simple) SEARCH request (without result sorting and caching).

  • return: Search result (UIDs)
  • access: public
rcube_result_index search_once ([ $folder = null], [string $str = 'ALL'], string $mailbox)
  • string $mailbox: Mailbox name to search in
  • string $str: Search string
  • $folder

Redefinition of:
rcube_storage::search_once()
Direct (real and simple) search request (without result sorting and caching).
select_mailbox (line 3888)
  • access: public
void select_mailbox ( $mailbox)
  • $mailbox
set_acl (line 3265)

Changes the ACL on the specified folder (SETACL)

  • return: True on success, False on failure
  • since: 0.5-beta
  • access: public
boolean set_acl (string $folder, string $user, string $acl)
  • string $folder: Folder name
  • string $user: User name
  • string $acl: ACL string

Redefinition of:
rcube_storage::set_acl()
Changes the ACL on the specified folder (SETACL)
set_caching (line 3513)

Enable or disable indexes caching

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

Activate/deactivate debug mode

  • access: public
void set_debug ([boolean $dbg = true])
  • boolean $dbg: True if IMAP conversation should be logged

Redefinition of:
rcube_storage::set_debug()
Activate/deactivate debug mode.
set_env (line 454)

Sets delimiter and namespaces

  • access: protected
void set_env ()
set_flag (line 2111)

Set message flag to one or several messages

  • return: Operation status
  • access: public
boolean set_flag (mixed $uids, string $flag, [string $folder = 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 $folder: Folder name
  • boolean $skip_cache: True to skip message cache clean up

Redefinition of:
rcube_storage::set_flag()
Set message flag to one or several messages
set_folder (line 316)

Set internal folder reference.

All operations will be perfomed on this folder.

  • access: public
void set_folder (string $folder)
  • string $folder: Folder name

Redefinition of:
rcube_storage::set_folder()
Set internal folder reference.
set_folder_stats (line 1112)

Stores folder statistic data in session

  • access: protected
void set_folder_stats (string $folder, string $name, mixed $data)
  • string $folder: Folder name
  • string $name: Data name
  • mixed $data: Data value
set_mailbox (line 3893)
  • access: public
void set_mailbox ( $folder)
  • $folder
set_messagecount (line 3802)

Increde/decrese messagecount for a specific folder

  • access: protected
void set_messagecount ( $folder,  $mode,  $increment)
  • $folder
  • $mode
  • $increment
set_messages_caching (line 3607)

Enable or disable messages caching

  • access: public
void set_messages_caching (boolean $set)
  • boolean $set: Flag
set_metadata (line 3382)

Sets IMAP metadata/annotations (SETMETADATA/SETANNOTATION)

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

Redefinition of:
rcube_storage::set_metadata()
Sets metadata/annotations (SETMETADATA/SETANNOTATION)
set_part_filename (line 1841)

Set attachment filename from message part structure

  • access: protected
void set_part_filename ( &$part, [string $headers = null], rcube_message_part $part)
set_search_set (line 339)

Save a search result for future message listing methods

  • access: public
void set_search_set (array $set)
  • array $set: Search set, result from rcube_imap::get_search_set():
    1. - searching criteria, string
    2. - search result, rcube_result_index|rcube_result_thread
    3. - searching character set, string
    4. - sorting field, string
    5. - true if sorted, bool

Redefinition of:
rcube_storage::set_search_set()
Save a search result for future message listing methods.
set_sort_order (line 3663)

Validate the given input and save to local properties

  • access: protected
void set_sort_order (string $sort_field, string $sort_order)
  • string $sort_field: Sort column
  • string $sort_order: Sort order
set_thread_flags (line 842)

protected method for setting threaded messages flags: depth, has_children and unread_children

  • return: Message headers array indexed by message UID
  • access: protected
array set_thread_flags ( &$headers, rcube_imap_result $threads, array $headers)
  • array $headers: Reference to headers array indexed by message UID
  • rcube_imap_result $threads: Threads data object
  • &$headers
sort_folder_list (line 3679)

Sort folders first by default folders and then in alphabethical order

  • access: protected
void sort_folder_list (array $a_folders)
  • array $a_folders: Folders list
sort_threads (line 1291)

Sort threaded result, using THREAD=REFS method

  • access: protected
void sort_threads (rcube_result_thread $threads)
structure_charset (line 1977)

Get charset name from message structure (first part)

  • return: Charset name
  • access: protected
string structure_charset (array $structure)
  • array $structure: Message structure
structure_part (line 1626)

Build message part object

  • access: protected
void structure_part (array $part, [int $count = 0], [string $parent = ''], [ $mime_headers = null])
  • array $part
  • int $count
  • string $parent
  • $mime_headers
subscribe (line 2775)

Subscribe to a specific folder(s)

  • return: True on success
  • access: public
boolean subscribe (array $folders)
  • array $folders: Folder name(s)

Redefinition of:
rcube_storage::subscribe()
Subscribe to a specific folder(s)
thread_index (line 1264)

Return index of threaded message UIDs

  • return: Message UIDs
  • access: public
rcube_result_thread thread_index ([string $folder = ''], [string $sort_field = NULL], [string $sort_order = NULL])
  • string $folder: Folder to get index from
  • string $sort_field: Sort column
  • string $sort_order: Sort order [ASC, DESC]
unsubscribe (line 2789)

Unsubscribe folder(s)

  • return: True on success
  • access: public
boolean unsubscribe ( $folders, array $a_mboxes)
  • array $a_mboxes: Folder name(s)
  • $folders

Redefinition of:
rcube_storage::unsubscribe()
Unsubscribe folder(s)
update_cache (line 3562)

Update cache

  • access: public
void update_cache (string $key, mixed $data)
  • string $key: Cache key
  • mixed $data: Data
_list_messages (line 697)

protected method for listing message headers

  • return: Indexed array with message header objects
  • see: rcube_imap::list_messages
  • access: protected
array _list_messages ([string $folder = ''], [int $page = NULL], [string $sort_field = NULL], [string $sort_order = NULL], [int $slice = 0])
  • string $folder: 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
__get (line 109)

Magic getter for backward compat.

  • access: public
void __get ( $name)
  • $name

Inherited Methods

Inherited From rcube_storage

 rcube_storage::check_connection()
 rcube_storage::check_permflag()
 rcube_storage::clear_cache()
 rcube_storage::clear_folder()
 rcube_storage::close()
 rcube_storage::connect()
 rcube_storage::copy_message()
 rcube_storage::count()
 rcube_storage::create_default_folders()
 rcube_storage::create_folder()
 rcube_storage::delete_acl()
 rcube_storage::delete_folder()
 rcube_storage::delete_message()
 rcube_storage::delete_metadata()
 rcube_storage::expunge_cache()
 rcube_storage::expunge_folder()
 rcube_storage::expunge_message()
 rcube_storage::folder_attributes()
 rcube_storage::folder_data()
 rcube_storage::folder_exists()
 rcube_storage::folder_info()
 rcube_storage::folder_namespace()
 rcube_storage::folder_size()
 rcube_storage::folder_status()
 rcube_storage::folder_sync()
 rcube_storage::get_acl()
 rcube_storage::get_body()
 rcube_storage::get_cache()
 rcube_storage::get_capability()
 rcube_storage::get_error_code()
 rcube_storage::get_error_str()
 rcube_storage::get_folder()
 rcube_storage::get_hierarchy_delimiter()
 rcube_storage::get_message()
 rcube_storage::get_message_headers()
 rcube_storage::get_message_part()
 rcube_storage::get_metadata()
 rcube_storage::get_namespace()
 rcube_storage::get_page()
 rcube_storage::get_pagesize()
 rcube_storage::get_quota()
 rcube_storage::get_raw_body()
 rcube_storage::get_raw_headers()
 rcube_storage::get_response_code()
 rcube_storage::get_search_set()
 rcube_storage::get_threading()
 rcube_storage::index()
 rcube_storage::is_connected()
 rcube_storage::list_folders()
 rcube_storage::list_folders_subscribed()
 rcube_storage::list_messages()
 rcube_storage::list_rights()
 rcube_storage::mod_folder()
 rcube_storage::move_message()
 rcube_storage::my_rights()
 rcube_storage::parse_uids()
 rcube_storage::print_raw_body()
 rcube_storage::refresh_search()
 rcube_storage::rename_folder()
 rcube_storage::save_message()
 rcube_storage::search()
 rcube_storage::search_once()
 rcube_storage::set_acl()
 rcube_storage::set_charset()
 rcube_storage::set_debug()
 rcube_storage::set_default_folders()
 rcube_storage::set_flag()
 rcube_storage::set_folder()
 rcube_storage::set_metadata()
 rcube_storage::set_options()
 rcube_storage::set_page()
 rcube_storage::set_pagesize()
 rcube_storage::set_search_set()
 rcube_storage::set_threading()
 rcube_storage::subscribe()
 rcube_storage::unset_flag()
 rcube_storage::unsubscribe()
Class Constants

Documentation generated on Wed, 23 May 2012 16:40:49 +0200 by phpDocumentor 1.4.4