Interface class for accessing an IMAP server
package |
Framework |
---|---|
subpackage |
Storage |
author |
Thomas Bruederli |
author |
Aleksander Machniak |
__construct()
__get($name)
deprecated |
. |
---|---|
connect(string $host, string $user, string $pass, integer $port = 143, string $use_ssl = null) : boolean
string
Host to connect
string
Username for IMAP account
string
Password for IMAP account
integer
Port to connect to
string
SSL schema (either ssl or tls) or null if plain connection
boolean
TRUE on success, FALSE on failure
close()
check_connection() : bool
bool
Connection state.
is_connected() : boolean
boolean
TRUE on success, FALSE on failure
get_error_code() : int
int
Error code
get_error_str() : string
string
Error message
get_response_code() : int
int
Response code (class constant)
set_debug(boolean $dbg = true)
boolean
True if conversation with the server should be logged
set_folder(string $folder)
All operations will be perfomed on this folder.
string
Folder name
set_search_set(mixed $set)
mixed
Search set in driver specific format
get_search_set() : array
array
Search set in driver specific format, NULL if search wasn't initialized
get_capability(string $cap) : mixed
string
Capability name
mixed
Capability value or TRUE if supported, FALSE if not
check_permflag(string $flag) : boolean
string
Permanentflag name
boolean
True if this flag is supported
get_permflags(string $folder) : array
string
Folder name
array
Flags
get_hierarchy_delimiter() : string
string
Delimiter string
get_namespace(string $name = null) : array
string
Namespace array index: personal, other, shared, prefix
array
Namespace data
set_env()
count(string $folder = null, string $mode = 'ALL', boolean $force = false, boolean $status = true) : int
string
Folder name
string
Mode for count [ALL|THREADS|UNSEEN|RECENT|EXISTS]
boolean
Force reading from server and update cache
boolean
Enables storing folder status info (max UID/count),
required for folder_status()
int
Number of messages
list_flags(string $folder, array $uids, int $mod_seq = null) : array
string
Folder name
array
Message UIDs
int
Optional MODSEQ value
array
Indexed array with message flags
threads(string $folder) : \rcube_imap_thread
string
Folder name
\rcube_imap_thread
Thread data object
threads_direct(string $folder) : \rcube_imap_thread
string
Folder name
\rcube_imap_thread
Thread data object
fetch_thread_headers(string $folder, \rcube_result_thread $threads, int $page, int $slice) : array
string
Folder name
int
List page number
int
Number of threads to slice
array
Messages headers
set_thread_flags(array &$headers, \rcube_result_thread $threads) : array
array
Reference to headers array indexed by message UID
array
Message headers array indexed by message UID
fetch_headers(string $folder, array $msgs, bool $sort = true, bool $force = false) : array
string
Folder name
array
Message UIDs
bool
Enables result sorting by $msgs
bool
Disables cache use
array
Messages headers indexed by UID
folder_status(string $folder = null, array &$diff = array()) : int
string
Folder name
array
Difference data
int
Folder status
set_folder_stats(string $folder, string $name, mixed $data)
TODO |
: move to separate DB table (cache?) |
---|---|
string
Folder name
string
Data name
mixed
Data value
get_folder_stats(string $folder) : array
string
Folder name
array
Stats data
index(string $folder = null, string $sort_field = null, string $sort_order = null) : \rcube_result_index|\rcube_result_thread
string
Folder to get index from
string
Sort column
string
Sort order [ASC, DESC]
\rcube_result_index|\rcube_result_thread
List of messages (UIDs)
index_direct(string $folder, string $sort_field = null, string $sort_order = null, \rcube_result_* $search = null) : \rcube_result_index
Doesn't uses cache by default.
string
Folder to get index from
string
Sort column
string
Sort order [ASC, DESC]
\rcube_result_*
Optional messages set to limit the result
\rcube_result_index
Sorted list of message UIDs
thread_index(string $folder = '', string $sort_field = NULL, string $sort_order = NULL) : \rcube_result_thread
string
Folder to get index from
string
Sort column
string
Sort order [ASC, DESC]
\rcube_result_thread
Message UIDs
sort_threads(\rcube_result_thread $threads)
If not, use any method and re-sort the result in THREAD=REFS way.
search(string $folder = null, string $str = 'ALL', string $charset = null, string $sort_field = null)
todo |
: Search criteria should be provided in non-IMAP format, eg. array |
---|
string
Folder name to search in
string
Search criteria
string
Search charset
string
Header field to sort by
search_once(string $folder = null, string $str = 'ALL') : \rcube_result_index
string
Folder name to search in
string
Search string
\rcube_result_index
Search result (UIDs)
search_index(string $folder, string $criteria = 'ALL', string $charset = NULL, string $sort_field = NULL) : \rcube_result_index|\rcube_result_thread
see | \rcube_imap::search() |
---|---|
string
Folder name
string
Search criteria
string
Charset
string
Sorting field
\rcube_result_index|\rcube_result_thread
Search results (UIDs)
convert_criteria(string $str, string $charset, string $dest_charset = 'US-ASCII') : string
string
Search string
string
Original charset
string
Destination charset (default US-ASCII)
string
Search string
refresh_search() : array
array
Current search set
structure_part(array $part, int $count, string $parent = '', $mime_headers = null)
array
int
string
set_part_filename(\rcube_message_part &$part, string $headers = null)
structure_charset(array $structure) : string
array
Message structure
string
Charset name
get_raw_body(int $uid, resource $fp = null) : string
int
Message UID
resource
File pointer to save the message
string
Message source string
get_raw_headers(int $uid) : string
int
Message UID
string
Message headers string
print_raw_body(int $uid, bool $formatted = true)
int
Message UID
bool
Enables line-ending formatting
set_flag(mixed $uids, string $flag, string $folder = null, boolean $skip_cache = false) : bool
mixed
Message UIDs as array or comma-separated string, or '*'
string
Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT, MDNSENT
string
Folder name
boolean
True to skip message cache clean up
bool
Operation status
list_folders_subscribed(string $root = '', string $name = '*', string $filter = null, string $rights = null, bool $skip_sort = false) : array
string
Optional root folder
string
Optional name pattern
string
Optional filter
string
Optional ACL requirements
bool
Enable to return unsorted list (for better performance)
array
List of folders
list_folders_subscribed_direct(string $root = '', string $name = '*') : array
see | \rcube_imap::list_folders_subscribed() |
---|---|
string
Optional root folder
string
Optional name pattern
array
List of subscribed folders
list_folders(string $root = '', string $name = '*', mixed $filter = null, string $rights = null, bool $skip_sort = false) : array
string
IMAP root dir
string
Optional name pattern
mixed
Optional filter
string
Optional ACL requirements
bool
Enable to return unsorted list (for better performance)
array
Indexed array with folder names
list_folders_direct(string $root = '', string $name = '*') : array
see | \rcube_imap::list_folders() |
---|---|
string
Optional root folder
string
Optional name pattern
array
List of folders
list_folders_update(array &$result, string $type = null)
Needed on some servers eg. Courier IMAP
array
Reference to folders list
string
Listing type (ext-subscribed, subscribed or all)
filter_rights($a_folders, $rights)
For performance reasons we assume user has full rights on all personal folders.
get_quota() : mixed
mixed
Quota info or False if not supported
folder_size(string $folder) : int
string
Folder name
int
Folder size in bytes, False on error
subscribe(array $folders) : boolean
array
Folder name(s)
boolean
True on success
unsubscribe(array $folders) : boolean
array
Folder name(s)
boolean
True on success
create_folder(string $folder, boolean $subscribe = false) : boolean
string
New folder name
boolean
True if the newvfolder should be subscribed
boolean
True on success, False on error
rename_folder(string $folder, string $new_name) : boolean
string
Folder to rename
string
New folder name
boolean
True on success, False on error
delete_folder(string $folder) : boolean
string
Folder name
boolean
True on success, False on error
create_default_folders()
folder_exists(string $folder, boolean $subscription = false) : boolean
string
Folder name
boolean
Enable subscription checking
boolean
True if folder exists, False otherwise
folder_namespace(string $folder) : string
string
Folder name
string
One of 'personal', 'other' or 'shared'
mod_folder(string $folder, string $mode = 'out') : string
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.
string
Folder name
string
Mode name (out/in)
string
Folder name
folder_attributes(string $folder, bool $force = false) : array
string
Folder name
bool
Set to True if attributes should be refreshed
array
Options list
folder_data(string $folder) : array
string
Folder name
array
Data
folder_info(string $folder) : array
string
Folder name
array
Data
folder_sync(string $folder)
string
Folder name
get_fetch_headers() : string
string
Space-separated list of header names
set_acl(string $folder, string $user, string $acl) : boolean
string
Folder name
string
User name
string
ACL string
boolean
True on success, False on failure
delete_acl(string $folder, string $user) : boolean
string
Folder name
string
User name
boolean
True on success, False on failure
get_acl(string $folder) : array
string
Folder name
array
User-rights array on success, NULL on error
list_rights(string $folder, string $user) : array
string
Folder name
string
User name
array
List of user rights
my_rights(string $folder) : array
string
Folder name
array
MYRIGHTS response on success, NULL on error
md2annotate(string $entry) : array
string
Entry name
array
Entry-attribute list, NULL if not supported (?)
set_caching(string $type)
string
Cache type (@see rcube::get_cache)
get_cache_engine()
get_cache(string $key) : mixed
string
Cache key
mixed
Cached value
update_cache(string $key, mixed $data)
string
Cache key
mixed
Data
clear_cache(string $key = null, boolean $prefix_mode = false)
string
Cache key name or pattern
boolean
Enable it to clear all keys starting
with prefix specified in $key
get_mcache_engine()
cache_gc()
set_sort_order(string $sort_field, string $sort_order)
string
Sort column
string
Sort order
sort_folder_list(array $a_folders, bool $skip_default = false) : array
array
Folders list
bool
Skip default folders handling
array
Sorted list
rsort($folder, $delimiter, &$list, &$out)
id2uid(int $id, string $folder = null) : int
int
Message (sequence) ID
string
Folder name
int
Message UID
change_subscription($folders, $mode)
date_format($date)
debug_handler(&$imap, $message)
access |
public |
---|---|
decode_address_list($input, $max = null, $decode = true, $fallback = null)
decode_header($input, $fallback = null)
decode_mime_string($input, $fallback = null)
mime_decode($input, $encoding = '7bit')
explode_header_string($separator, $str, $remove_comments = false)
select_mailbox($mailbox)
set_mailbox($folder)
get_mailbox_name()
list_headers($folder = '', $page = NULL, $sort_field = NULL, $sort_order = NULL, $slice)
get_headers($uid, $folder = null, $force = false)
mailbox_status($folder = null)
list_mailboxes($root = '', $name = '*', $filter = null, $rights = null, $skip_sort = false)
list_unsubscribed($root = '', $name = '*', $filter = null, $rights = null, $skip_sort = false)
get_mailbox_size($folder)
create_mailbox($folder, $subscribe = false)
rename_mailbox($folder, $new_name)
delete_mailbox($folder)
clear_mailbox($folder = null)
mailbox_exists($folder, $subscription = false)
mailbox_namespace($folder)
mod_mailbox($folder, $mode = 'out')
mailbox_attributes($folder, $force = false)
mailbox_data($folder)
mailbox_info($folder)
mailbox_sync($folder)
expunge($folder = '', $clear_cache = true)
set_charset(string $cs)
This will be used for message decoding if a charset specification is not available
string
Charset string
set_default_folders(array $arr)
array
Indexed list of folder names
get_folder() : string
string
Name of the folder
set_page(int $page)
int
Page number to list
get_page() : int
int
Page number
set_pagesize(int $size)
int
Number of messages to display on one page
get_pagesize() : int
int
Number of messages to display on one page
set_threading(boolean $enable = false) : mixed
Enable/Disable threaded mode.
boolean
TRUE to enable and FALSE
mixed
Threading algorithm or False if THREAD is not supported
get_threading() : mixed
mixed
Threading algorithm or False if THREAD is not supported or disabled
get_body(int $uid, $part = 1) : string
see | \rcube_imap::get_message_part() |
---|---|
int
Message UID
string
$part Message/part body
unset_flag(mixed $uids, string $flag, string $folder = null) : bool
see | \set_flag |
---|---|
mixed
Message UIDs as array or comma-separated string, or '*'
string
Flag to unset: SEEN, DELETED, RECENT, ANSWERED, DRAFT, MDNSENT
string
Folder name
bool
Operation status
parse_uids(mixed $uids) : array
mixed
UIDs array or comma-separated list or '' or '1:'
array
Two elements array with UIDs converted to list and ALL flag
expunge_folder(string $folder = null, boolean $clear_cache = true) : boolean
string
Folder name
boolean
False if cache should not be cleared
boolean
True on success, False on error
clear_folder(string $folder = null) : boolean
.
string
Folder name
boolean
True on success, False on error
UNKNOWN
NOPERM
READONLY
TRYCREATE
INUSE
OVERQUOTA
ALREADYEXISTS
NONEXISTENT
CONTACTADMIN
conn : mixed
var | |
---|---|
mixed
icache : array
var | |
---|---|
array
list_page :
delimiter :
namespace :
sort_field :
sort_order :
struct_charset :
uid_id_map :
msg_headers :
search_set :
search_string :
search_charset :
search_sort_field :
search_threads :
search_sorted :
caching :
threading :
folder :
default_charset :
default_folders :
page_size :
all_headers : array
var | |
---|---|
array