check_is_noselect (line
40)
Detects a Noselect mailbox from LSUB|LIST response
boolean
check_is_noselect
(string $lsub_line)
find_mailbox_name (line
24)
Finds mailbox name in LSUB|LIST response
string
find_mailbox_name
(string $mailbox)
isBoxBelow (line
74)
Checks if $subbox is below the specified $parentbox
boolean
isBoxBelow
(string $subbox, string $parentbox)
-
string
$subbox: subbox Child mailbox name
-
string
$parentbox: parentbox Parent mailbox name
isDraftMailbox (line
159)
Detects if mailbox is a Drafts folder or subfolder of Drafts
bool
isDraftMailbox
(string $box, [boolean $include_subs = true])
-
string
$box: box mailbox name
-
boolean
$include_subs: include_subs if true, subfolders of system folders are special. if false, subfolders are not special mailboxes.
isSentMailbox (line
140)
Detects if mailbox is a Sent folder or subfolder of Sent
bool
isSentMailbox
(string $box, [boolean $include_subs = true])
-
string
$box: box mailbox name
-
boolean
$include_subs: include_subs if true, subfolders of system folders are special. if false, subfolders are not special mailboxes.
isSpecialMailbox (line
101)
Defines special mailboxes: given a mailbox name, it checks if this is a "special" one: INBOX, Trash, Sent or Draft.
Function includes special_mailbox hook.
boolean
isSpecialMailbox
(string $box, [boolean $include_subs = true])
-
string
$box: box mailbox name
-
boolean
$include_subs: include_subs if true, subfolders of system folders are special. if false, subfolders are not special mailboxes unless they are tagged as special in 'special_mailbox' hook.
isTrashMailbox (line
120)
Detects if mailbox is a Trash folder or subfolder of Trash
bool
isTrashMailbox
(string $box, [boolean $include_subs = true])
-
string
$box: box mailbox name
-
boolean
$include_subs: include_subs if true, subfolders of system folders are special. if false, subfolders are not special mailboxes.
mailtree_sort (line
658)
Sorts mailboxes in array values
Mailboxes with some chars (like -) can mess up the order, this fixes it test test.a test.b test-again
void
mailtree_sort
(array &$lsub)
-
array
&$lsub: lsub array with full imap folder names in array values
nsm_imap_mailbox_expunge (line
216)
Expunges messages in selected mailbox.
Mailbox must be selected with sqimap_mailbox_select() before issuing the command.
If message UIDs are set and IMAP UIDPLUS extension is supported, function tries to expunge only selected messages.
integer
nsm_imap_mailbox_expunge
(stream $imap_stream, [boolean $handle_errors = true], [array $msgs = array()], [boolean $force_expunge = false])
-
stream
$imap_stream: IMAP connection resource
-
boolean
$handle_errors: Controls internal error handling. Allows to ignore expunge errors, if option is set to false
-
array
$msgs: List of message UIDs. Function accepts string values due to sqimap_message_list_squisher() function specifics, but use of strings is deprecated and unsupported.
-
boolean
$force_expunge: Force mailbox expunge, if UIDPLUS extension is not supported and code can't expunge only selected message UIDs.
nsm_imap_mailbox_name (line
1035)
Returns human readable mailbox name
Function does utf7-imap decoding and applies all rewrites done in scripts.
string
nsm_imap_mailbox_name
(string $mailbox, [boolean $html_safe = true])
-
string
$mailbox: Full IMAP mailbox name
-
boolean
$html_safe: Controls html sanitizing of returned data
readMailboxParent (line
53)
If $haystack is a full mailbox name, and $needle is the mailbox separator character, returns the second last part of the full mailbox name (i.e. the mailbox's parent mailbox)
string
readMailboxParent
(string $haystack, string $needle)
-
string
$haystack: haystack mailbox name
-
string
$needle: needle IMAP delimiter
sqimap_compact_mailboxes_response (line
1007)
Converts multiline imap resposes to one line.
Function is not part of SquirrelMail 1.4 API. It was introduced in SquirrelMail 1.5.0 and used name without sqimap_ prefix. NaSMail uses function with sqimap_ prefix.
array
sqimap_compact_mailboxes_response
(array $ary)
-
array
$ary: ary Array with IMAP responses
sqimap_mailbox_create (line
346)
Creates a folder.
void
sqimap_mailbox_create
(stream $imap_stream, string $mailbox, string $type)
-
stream
$imap_stream: imap_stream IMAP connection resource
-
string
$mailbox: mailbox Mailbox name
-
string
$type: type 'noselect' for Noselect mailbox
sqimap_mailbox_delete (line
387)
Deletes the given folder
void
sqimap_mailbox_delete
(stream $imap_stream, string $mailbox)
-
stream
$imap_stream: imap_stream IMAP connection resource
-
string
$mailbox: mailbox Mailbox name
sqimap_mailbox_exists (line
263)
Checks whether or not the specified mailbox exists
boolean
sqimap_mailbox_exists
(stream $imap_stream, string $mailbox)
-
stream
$imap_stream: imap_stream IMAP connection resource
-
string
$mailbox: mailbox Mailbox name
sqimap_mailbox_expunge (line
183)
Expunges a mailbox
In NaSMail 1.0-1.1 function had fourth argument. Argument was removed because it violated IMAP standards.
int
sqimap_mailbox_expunge
(stream $imap_stream, string $mailbox, [boolean $handle_errors = true])
-
stream
$imap_stream: imap_stream IMAP connection resource
-
string
$mailbox: mailbox Mailbox (argument is unused)
-
boolean
$handle_errors: handle_errors Error handling
sqimap_mailbox_is_subscribed (line
411)
Determines if the user is subscribed to the folder or not
boolean
sqimap_mailbox_is_subscribed
(stream $imap_stream, string $folder)
-
stream
$imap_stream: imap_stream IMAP connection resource
-
string
$folder: folder Mailbox name
sqimap_mailbox_ksort (line
979)
Sorts mailboxes stored in array keys
Mailboxes with some chars (like -) can mess up the order, this fixes it See sample listing in mailtree_sort() function
void
sqimap_mailbox_ksort
(array &$lsub)
-
array
&$lsub: lsub array with full imap folder names in array keys
sqimap_mailbox_list (line
680)
Returns sorted mailbox lists in several different ways.
See comment on sqimap_mailbox_parse() for info about the returned array.
array
sqimap_mailbox_list
(stream $imap_stream, [boolean $force = false])
-
stream
$imap_stream: imap_stream
-
boolean
$force: force Overrides session caching
sqimap_mailbox_list_all (line
850)
Returns a list of all folders, subscribed or not
array
sqimap_mailbox_list_all
(stream $imap_stream)
-
stream
$imap_stream: imap_stream
sqimap_mailbox_option_list (line
592)
Returns list of options (to be echoed into select statement based on available mailboxes and separators Caller should surround options with <select ...> </select> and any formatting.
unknown
sqimap_mailbox_option_list
(stream $imap_stream, [array $show_selected = 0], [array $folder_skip = 0], [array $boxes = 0], [string $flag = 'noselect'], [boolean $use_long_format = false])
-
stream
$imap_stream: imap_stream IMAP connection resource
-
array
$show_selected: show_selected array containing list of mailboxes to pre-select (0 if none)
-
array
$folder_skip: folder_skip array of folders to keep out of option list. Case sensitivity depends on interface configuration.
-
array
$boxes: boxes list of already fetched boxes (for places like folder panel, where you know these options will be shown 3 times in a row.. (most often unset)
-
string
$flag: flag flag to check for in mailbox flags, used to filter out mailboxes. 'noselect' by default to remove unselectable mailboxes. 'noinferiors' used to filter out folders that can not contain subfolders. NULL to avoid flag check entirely.
-
boolean
$use_long_format: use_long_format override folder display preference and always show full folder name.
sqimap_mailbox_parse (line
498)
Formats a mailbox into parts for the $boxesall array
The parts are:
raw - Raw LIST/LSUB response from the IMAP server formatted - nicely formatted folder name unformatted - unformatted, but with delimiter at end removed unformatted-dm - folder name as it appears in raw response unformatted-disp - unformatted without $folder_prefix
array
sqimap_mailbox_parse
(string $line, string $line_lsub)
-
string
$line
-
string
$line_lsub
sqimap_mailbox_rename (line
428)
Renames a mailbox.
void
sqimap_mailbox_rename
(stream $imap_stream, string $old_name, string $new_name)
-
stream
$imap_stream: imap_stream IMAP connection resource
-
string
$old_name: old_name Old mailbox name
-
string
$new_name: new_name New mailbox name
sqimap_mailbox_select (line
286)
Selects a mailbox
Command blocks mailboxes that start with '/' or contain '../' string. All linefeeds and cariage returns are removed for mailbox name.
Returned array keys depend on IMAP SELECT command response. See RFC 3501 and 2060. Please note that SELECT response requirements are changed in rfc 3501.
array
sqimap_mailbox_select
(stream $imap_stream, string $mailbox)
-
stream
$imap_stream: imap_stream IMAP connection resource
-
string
$mailbox: mailbox IMAP mailbox name
sqimap_subscribe (line
365)
Subscribes to an existing folder.
void
sqimap_subscribe
(stream $imap_stream, string $mailbox)
-
stream
$imap_stream: imap_stream IMAP connection resource
-
string
$mailbox: mailbox Mailbox name
sqimap_unsubscribe (line
376)
Unsubscribes from an existing folder
void
sqimap_unsubscribe
(stream $imap_stream, string $mailbox)
-
stream
$imap_stream: imap_stream IMAP connection resource
-
string
$mailbox: mailbox Mailbox name
user_strcasecmp (line
569)
Callback function used to sort mailboxes
Function was rewritten in SquirrelMail 1.3.x. Older code was dropped. After modifications standard PHP function can be used in callbacks.
void
user_strcasecmp
(string $a, string $b)
-
string
$a: first mailbox name
-
string
$b: second mailbox name