/functions/imap_messages.php

Description

imap_messages.php

This implements functions that manipulate messages NOTE: Quite a few functions in this file are obsolete

Functions
elapsedTime (line 452)
void elapsedTime ( $start)
  • $start
get_parent_level (line 278)

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

  • return: message ID to indent level mappings
array get_parent_level (resource $imap_stream)
  • resource $imap_stream
get_reference_header (line 119)

Returns the references header lines

void get_reference_header ( $imap_stream,  $message)
  • $imap_stream
  • $message
get_thread_sort (line 380)

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

void get_thread_sort ( $imap_stream)
  • $imap_stream
parseArray (line 517)

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

array parseArray (string $read,  &$i, integer $i)
  • string $read: imap response
  • integer $i: (reference) offset in string
  • &$i
parseFetch (line 539)

Parses a fetch response

  • return: Associative array with messages.
array parseFetch ( &$aResponse, [array $aMessageList = array()], array $aResponse)
  • array $aResponse: IMAP Response
  • array $aMessageList: Placeholder array for results. The keys of the placeholder array should be the UID so we can reconstruct the order.
  • &$aResponse
parsePriority (line 708)

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.

void parsePriority ( $sValue)
  • $sValue
parseString (line 467)

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

  • return: parsed string without the double quotes or literal count
string parseString (string $read,  &$i, integer $i)
  • string $read: imap response
  • integer $i: (reference) offset in string
  • &$i
parse_message_entities (line 1104)

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

  • since: 1.4.11
void parse_message_entities ( &$msg, int $id, resource $imap_stream, object $msg)
  • object $msg: The 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 $id: The top-level message UID on the IMAP server, even if the $msg being passed in is only an attached entity thereof.
  • resource $imap_stream: A live connection to the IMAP server.
  • &$msg
sqimap_get_headerfield (line 997)

Obsolete?

void sqimap_get_headerfield ( $imap_stream,  $field)
  • $imap_stream
  • $field
sqimap_get_message (line 1052)

Returns a message array with all the information about a message.

See the documentation folder for more information about this array.

void sqimap_get_message ( $imap_stream,  $id,  $mailbox)
  • $imap_stream
  • $id
  • $mailbox
sqimap_get_php_sort_order (line 232)

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

array sqimap_get_php_sort_order (resource $imap_stream, array $mbxresponse)
  • resource $imap_stream
  • array $mbxresponse: response from a sqimap_mailbox_select
sqimap_get_small_header (line 1186)

Obsolete?

void sqimap_get_small_header ( $imap_stream,  $id,  $sent)
  • $imap_stream
  • $id
  • $sent
sqimap_get_small_header_list (line 726)

Retrieves a list with headers, flags, size or internaldate from the imap server

void sqimap_get_small_header_list ( $imap_stream,  $msg_list, [ $show_num = false])
  • $imap_stream
  • $msg_list
  • $show_num
sqimap_get_sort_order (line 135)

Get sort order from server and return it as the $id array for mailbox_display

void sqimap_get_sort_order ( $imap_stream,  $sort,  $mbxresponse)
  • $imap_stream
  • $sort
  • $mbxresponse
sqimap_messages_copy (line 1134)

Copies specified messages to specified folder

This function is removed from SquirrelMail 1.5.1 and later versions.

  • return: (since 1.4.8) true, if message copy command was successful. false on error.
  • deprecated: Use sqimap_msgs_list_copy() instead.
  • since: 0.4
boolean sqimap_messages_copy (stream $imap_stream, string $start, string $end, string $mailbox, [boolean $handle_errors = true])
  • stream $imap_stream: IMAP connection resource
  • string $start: starting message id or uid.
  • string $end: end message id or uid
  • string $mailbox: target mailbox
  • boolean $handle_errors: (since 1.4.8) handle errors
sqimap_messages_delete (line 1145)

Deletes specified messages and moves them to trash if possible

Obsolete

void sqimap_messages_delete ( $imap_stream,  $start,  $end,  $mailbox)
  • $imap_stream
  • $start
  • $end
  • $mailbox
sqimap_messages_flag (line 1162)

Sets the specified messages with specified flag

void sqimap_messages_flag ( $imap_stream,  $start,  $end,  $flag,  $handle_errors)
  • $imap_stream
  • $start
  • $end
  • $flag
  • $handle_errors
sqimap_messages_remove_flag (line 1169)
void sqimap_messages_remove_flag ( $imap_stream,  $start,  $end,  $flag,  $handle_errors)
  • $imap_stream
  • $start
  • $end
  • $flag
  • $handle_errors
sqimap_message_list_squisher (line 91)

Sort the message list and crunch to be as small as possible

(overflow could happen, so make it small if possible)

void sqimap_message_list_squisher ( $messages_array)
  • $messages_array
sqimap_msgs_list_copy (line 30)

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

  • return: Returns true on successful copy, false on failure
bool sqimap_msgs_list_copy (int $imap_stream, mixed $id, string $mailbox)
  • int $imap_stream: The resource ID for the IMAP socket
  • mixed $id: A string or array of messages to copy
  • string $mailbox: The mailbox to copy messages to
sqimap_msgs_list_delete (line 73)

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

void sqimap_msgs_list_delete (int $imap_stream, string $mailbox, mixed $id)
  • int $imap_stream: The resource ID for the IMAP socket
  • string $mailbox: The mailbox to delete messages from
  • mixed $id: A string or array of messages to delete
sqimap_msgs_list_move (line 56)

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

  • return: If move completed without error.
  • since: 1.4.18
bool sqimap_msgs_list_move (int $imap_stream, mixed $id, string $mailbox, [bool $handle_errors = true])
  • int $imap_stream: The resource ID for the IMAP socket
  • mixed $id: A string or array of messages to copy
  • string $mailbox: The destination mailbox
  • bool $handle_errors: Show error messages in case of a NO, BAD, or BYE response
sqimap_toggle_flag (line 1175)
void sqimap_toggle_flag ( $imap_stream,  $id,  $flag,  $set,  $handle_errors)
  • $imap_stream
  • $id
  • $flag
  • $set
  • $handle_errors

Documentation generated on Fri, 18 Apr 2014 04:20:58 +0200 by phpDocumentor 1.4.3