squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

imap_messages.php File Reference

Go to the source code of this file.

Namespaces

 squirrelmail
 

Functions

 sqimap_msgs_list_copy ($imap_stream, $id, $mailbox)
 
 sqimap_msgs_list_move ($imap_stream, $id, $mailbox, $handle_errors=true)
 
 sqimap_msgs_list_delete ($imap_stream, $mailbox, $id)
 
 sqimap_message_list_squisher ($messages_array)
 
 get_reference_header ($imap_stream, $message)
 
 sqimap_get_sort_order ($imap_stream, $sort, $mbxresponse)
 
 sqimap_get_php_sort_order ($imap_stream, $mbxresponse)
 
 get_parent_level ($imap_stream)
 
 get_thread_sort ($imap_stream)
 
 elapsedTime ($start)
 
 parseString ($read, &$i)
 
 parseArray ($read, &$i)
 
 parseFetch (&$aResponse, $aMessageList=array())
 
 parsePriority ($sValue)
 
 sqimap_get_small_header_list ($imap_stream, $msg_list, $show_num=false)
 
 sqimap_get_headerfield ($imap_stream, $field)
 
 sqimap_get_message ($imap_stream, $id, $mailbox)
 
 parse_message_entities (&$msg, $id, $imap_stream)
 
 sqimap_messages_copy ($imap_stream, $start, $end, $mailbox, $handle_errors=true)
 
 sqimap_messages_delete ($imap_stream, $start, $end, $mailbox)
 
 sqimap_messages_flag ($imap_stream, $start, $end, $flag, $handle_errors)
 
 sqimap_messages_remove_flag ($imap_stream, $start, $end, $flag, $handle_errors)
 
 sqimap_toggle_flag ($imap_stream, $id, $flag, $set, $handle_errors)
 
 sqimap_get_small_header ($imap_stream, $id, $sent)
 

Function Documentation

◆ elapsedTime()

elapsedTime (   $start)

Definition at line 452 of file imap_messages.php.

◆ get_parent_level()

get_parent_level (   $imap_stream)

Returns an indent array for printMessageinfo() This represents the amount of indent needed (value), for this message number (key)

Parameters
resource$imap_stream
Returns
array message ID to indent level mappings

Definition at line 278 of file imap_messages.php.

References $parent.

Referenced by displayMessageArray().

◆ get_reference_header()

get_reference_header (   $imap_stream,
  $message 
)

Returns the references header lines

Definition at line 119 of file imap_messages.php.

References $imap_stream, $message, $uid_support, and sqimap_run_command_list().

◆ get_thread_sort()

get_thread_sort (   $imap_stream)

Returns an array with each element as a string representing one message-thread as returned by the IMAP server.

Definition at line 380 of file imap_messages.php.

References $default_charset, $imap_stream, $message, $sort_by_ref, $uid_support, elseif, sqimap_run_command(), sqsession_is_registered(), sqsession_register(), and sqsession_unregister().

Referenced by fix_sort_array(), getThreadMessages(), and showMessagesForMailbox().

◆ parse_message_entities()

parse_message_entities ( $msg,
  $id,
  $imap_stream 
)

Recursively parse embedded messages (if any) in the given message, building correct rfc822 headers for each one

Parameters
object$msgThe message object to scan for attached messages NOTE: this is passed by reference! Changes made within will affect the caller's copy of $msg!
int$idThe top-level message UID on the IMAP server, even if the $msg being passed in is only an attached entity thereof.
resource$imap_streamA live connection to the IMAP server.
Returns
void
Since
1.4.11

Definition at line 1102 of file imap_messages.php.

References $id, $imap_stream, $message, $read, $rfc822_header, $uid_support, and sqimap_run_command().

Referenced by sqimap_get_message().

◆ parseArray()

parseArray (   $read,
$i 
)

Parses a string containing an array from an imap response. String starts with ( and end with )

Parameters
string$readimap response
integer$i(reference) offset in string
Returns
array $a

Definition at line 517 of file imap_messages.php.

References $read.

Referenced by parseFetch(), and sqimap_get_small_header_list().

◆ parseFetch()

parseFetch ( $aResponse,
  $aMessageList = array() 
)

Parses a fetch response

Parameters
array$aResponseIMAP Response
array$aMessageListPlaceholder array for results. The keys of the placeholder array should be the UID so we can reconstruct the order.
Returns
array $aMessageList Associative array with messages.

Definition at line 539 of file imap_messages.php.

References $header, $id, $j, $read, elseif, NULL, parseArray(), and parseString().

Referenced by spam_filters().

◆ parsePriority()

parsePriority (   $sValue)

Normalise the different Priority headers into a uniform value, namely that of the X-Priority header (1, 3, 5). Supports: Prioirty, X-Priority, Importance. X-MS-Mail-Priority is not parsed because it always coincides with one of the other headers.

DUPLICATE CODE ALERT: NOTE: this is actually a duplicate from the function in class/mime/Rfc822Header.php.

Definition at line 708 of file imap_messages.php.

References elseif.

Referenced by sqimap_get_small_header_list().

◆ parseString()

parseString (   $read,
$i 
)

Parses a string in an imap response. String starts with " or { which means it can handle double quoted strings and literal strings

Parameters
string$readimap response
integer$i(reference) offset in string
Returns
string $s parsed string without the double quotes or literal count

Definition at line 467 of file imap_messages.php.

References $read.

Referenced by parseFetch(), and sqimap_get_small_header_list().

◆ sqimap_get_headerfield()

sqimap_get_headerfield (   $imap_stream,
  $field 
)

◆ sqimap_get_message()

sqimap_get_message (   $imap_stream,
  $id,
  $mailbox 
)

Returns a message array with all the information about a message. See the documentation folder for more information about this array.

Definition at line 1050 of file imap_messages.php.

References $color, $id, $imap_stream, $mailbox, $message, $read, $rfc822_header, $sort, $uid_support, _(), error_message(), exit, mime_structure(), parse_message_entities(), and sqimap_run_command().

Referenced by attachSelectedMessages(), Deliver\mail(), and newMail().

◆ sqimap_get_php_sort_order()

sqimap_get_php_sort_order (   $imap_stream,
  $mbxresponse 
)

Get sort order from server if server does not have the SORT extension and return it as array for mailbox_display.

Parameters
resource$imap_stream
array$mbxresponseresponse from a sqimap_mailbox_select
Returns
array $php_sort_array

Definition at line 232 of file imap_messages.php.

References $imap_stream, $message, $uid_support, sqimap_run_command(), sqsession_is_registered(), sqsession_register(), and sqsession_unregister().

Referenced by fix_sort_array(), and getSelfSortMessages().

◆ sqimap_get_small_header()

sqimap_get_small_header (   $imap_stream,
  $id,
  $sent 
)

Obsolete?

Definition at line 1184 of file imap_messages.php.

References $id, $imap_stream, and sqimap_get_small_header_list().

◆ sqimap_get_small_header_list()

sqimap_get_small_header_list (   $imap_stream,
  $msg_list,
  $show_num = false 
)

◆ sqimap_get_sort_order()

sqimap_get_sort_order (   $imap_stream,
  $sort,
  $mbxresponse 
)

◆ sqimap_message_list_squisher()

sqimap_message_list_squisher (   $messages_array)

Sort the message list and crunch to be as small as possible (overflow could happen, so make it small if possible)

Definition at line 91 of file imap_messages.php.

References $end.

Referenced by spam_filters(), sqimap_get_small_header_list(), sqimap_mailbox_expunge(), sqimap_msgs_list_copy(), sqimap_msgs_list_delete(), and sqimap_toggle_flag().

◆ sqimap_messages_copy()

sqimap_messages_copy (   $imap_stream,
  $start,
  $end,
  $mailbox,
  $handle_errors = true 
)

Copies specified messages to specified folder

This function is removed from SquirrelMail 1.5.1 and later versions.

Parameters
stream$imap_streamIMAP connection resource
string$startstarting message id or uid.
string$endend message id or uid
string$mailboxtarget mailbox
boolean$handle_errors(since 1.4.8) handle errors
Returns
boolean (since 1.4.8) true, if message copy command was successful. false on error.
Since
0.4
Deprecated:
Use sqimap_msgs_list_copy() instead.

Definition at line 1132 of file imap_messages.php.

References $imap_stream, $message, $read, $uid_support, and sqimap_run_command().

Referenced by sqimap_messages_delete().

◆ sqimap_messages_delete()

sqimap_messages_delete (   $imap_stream,
  $start,
  $end,
  $mailbox 
)

Deletes specified messages and moves them to trash if possible Obsolete

turn off internal error handling (fifth argument = false) and ignore copy to trash errors (allows to delete messages when overquota)

Definition at line 1143 of file imap_messages.php.

References $auto_expunge, $end, $imap_stream, $mailbox, $move_to_trash, $trash_folder, $uid_support, sqimap_mailbox_exists(), sqimap_messages_copy(), and sqimap_messages_flag().

◆ sqimap_messages_flag()

sqimap_messages_flag (   $imap_stream,
  $start,
  $end,
  $flag,
  $handle_errors 
)

Sets the specified messages with specified flag

Definition at line 1160 of file imap_messages.php.

References $imap_stream, $message, $read, $uid_support, and sqimap_run_command().

Referenced by deliverMessage(), sqimap_messages_delete(), and walkTreeInPreOrderEmptyTrash().

◆ sqimap_messages_remove_flag()

sqimap_messages_remove_flag (   $imap_stream,
  $start,
  $end,
  $flag,
  $handle_errors 
)

Definition at line 1167 of file imap_messages.php.

References $imap_stream, $message, $read, $uid_support, and sqimap_run_command().

◆ sqimap_msgs_list_copy()

sqimap_msgs_list_copy (   $imap_stream,
  $id,
  $mailbox 
)

Copies a set of messages ($id) to another mailbox ($mailbox)

NOTE: Verions of this function BEFORE SquirrelMail 1.4.18 actually moved messages instead of copying them

Parameters
int$imap_streamThe resource ID for the IMAP socket
mixed$idA string or array of messages to copy
string$mailboxThe mailbox to copy messages to
Returns
bool Returns true on successful copy, false on failure

Definition at line 30 of file imap_messages.php.

References $id, $imap_stream, $message, $read, $uid_support, sqimap_message_list_squisher(), and sqimap_run_command().

Referenced by sqimap_msgs_list_move(), and walkTreeInPostOrderCreatingFoldersUnderTrash().

◆ sqimap_msgs_list_delete()

sqimap_msgs_list_delete (   $imap_stream,
  $mailbox,
  $id 
)

Deletes one or more message(s) and move it/them to trash or expunge the mailbox

Parameters
int$imap_streamThe resource ID for the IMAP socket
string$mailboxThe mailbox to delete messages from
mixed$idA string or array of messages to delete

turn off internal error handling (third argument = false) and ignore copy to trash errors (allows to delete messages when overquota)

Definition at line 73 of file imap_messages.php.

References $id, $imap_stream, $mailbox, $message, $move_to_trash, $read, $trash_folder, $uid_support, sqimap_mailbox_exists(), sqimap_message_list_squisher(), and sqimap_run_command().

Referenced by delete_move_next_delete(), and spamcop_while_sending().

◆ sqimap_msgs_list_move()

sqimap_msgs_list_move (   $imap_stream,
  $id,
  $mailbox,
  $handle_errors = true 
)

Moves a set of messages ($id) to another mailbox ($mailbox)

Parameters
int$imap_streamThe resource ID for the IMAP socket
mixed$idA string or array of messages to copy
string$mailboxThe destination mailbox
bool$handle_errorsShow error messages in case of a NO, BAD, or BYE response
Returns
bool If move completed without error.
Since
1.4.18

Definition at line 56 of file imap_messages.php.

References $id, $imap_stream, $mailbox, sqimap_msgs_list_copy(), and sqimap_toggle_flag().

Referenced by delete_move_next_move(), filter_search_and_delete(), and spam_filters().

◆ sqimap_toggle_flag()

sqimap_toggle_flag (   $imap_stream,
  $id,
  $flag,
  $set,
  $handle_errors 
)