Abstract class for accessing mail messages storage server
package |
Framework |
---|---|
subpackage |
Storage |
author |
Thomas Bruederli |
author |
Aleksander Machniak |
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()
is_connected() : boolean
boolean
TRUE on success, FALSE on failure
check_connection() : bool
bool
Connection state.
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_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
set_folder(string $folder)
All operations will be perfomed on this folder.
string
Folder name
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_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
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
check_permflag(string $flag) : boolean
string
Permanentflag name
boolean
True if this flag is supported
get_hierarchy_delimiter() : string
string
Delimiter string
get_namespace(string $name = null) : array
string
Namespace array index: personal, other, shared, prefix
array
Namespace data
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
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)
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)
refresh_search() : array
array
Current search set
get_body(int $uid, $part = 1) : string
see | \rcube_imap::get_message_part() |
---|---|
int
Message UID
string
$part Message/part body
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
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
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(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
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
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
folder_exists(string $folder, boolean $subscription = false) : boolean
string
Folder name
boolean
Enable subscription checking
boolean
True if folder exists, False otherwise
folder_size(string $folder) : int
string
Folder name
int
Folder size in bytes, False on error
folder_namespace(string $folder) : string
string
Folder name
string
One of 'personal', 'other' or 'shared'
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_status(string $folder = null, array &$diff = array()) : int
string
Folder name
array
Difference data
int
Folder status
folder_sync(string $folder)
string
Folder name
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
create_default_folders()
get_quota() : mixed
mixed
Quota info or False if not supported
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
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_cache(string $key) : mixed
string
Cache key
mixed
Cached value
cache_gc()
UNKNOWN
NOPERM
READONLY
TRYCREATE
INUSE
OVERQUOTA
ALREADYEXISTS
NONEXISTENT
CONTACTADMIN
conn : mixed
var | |
---|---|
mixed
folder :
default_charset :
default_folders :
search_set :
page_size :
threading :
all_headers : array
var | |
---|---|
array