/functions/imap_general.php

Description

imap_general.php

This implements all functions that do general IMAP functions.

Includes
require_once (SM_PATH.'functions/page_header.php') (line 16)

Includes..

require_once (SM_PATH.'functions/auth.php') (line 17)
Functions
map_yp_alias (line 1373)

This is an example that gets IMAP servers from yellowpages (NIS).

you can simple put map:map_yp_alias in your $imap_server_address in config.php use your own function instead map_yp_alias to map your LDAP whatever way to find the users IMAP server.

void map_yp_alias ( $username)
  • $username
parseAddress (line 1114)

Parses an address string.

  • return: An array with one sub-array for each address found in the given string. Each sub-array contains two (?) entries, the first containing the actual email address, the second containing any personal information that was in the address string
array parseAddress (string $address, [int $max = 0])
  • string $address: Generic email address(es) in any format, including possible personal information as well as the actual address (such as "Jose" <[email protected]> or "Jose" <[email protected]>, "Keiko" <[email protected]>)
  • int $max: The most email addresses to parse out of the given string
sqimap_append (line 1314)

Saves a message to a given folder -- used for saving sent messages

void sqimap_append ( $imap_stream,  $sent_folder,  $length)
  • $imap_stream
  • $sent_folder
  • $length
sqimap_append_checkresponse (line 1326)
void sqimap_append_checkresponse ( $response,  $folder)
  • $response
  • $folder
sqimap_append_done (line 1320)
void sqimap_append_done ( $imap_stream, [ $folder = ''])
  • $imap_stream
  • $folder
sqimap_capability (line 999)

Retreive the CAPABILITY string from the IMAP server.

If capability is set, returns only that specific capability, else returns array of all capabilities.

void sqimap_capability ( $imap_stream, [ $capability = ''], [ $use_cache = TRUE])
  • $imap_stream
  • $capability
  • $use_cache
sqimap_create_stream (line 873)

Connects to the IMAP server and returns a resource identifier for use with

the other SquirrelMail IMAP functions. Does NOT login!

  • return: with two elements: imap-stream resource identifier and IMAP server response string
  • since: 1.4.23 and 1.5.0 (usable only in 1.5.1 or later) (1.4.23 has a couple subtle differences from 1.5.x)
array sqimap_create_stream (string $server, int $port, [integer $tls = 0], [array $stream_options = array()], [boolean $hide = FALSE])
  • integer $tls: whether to use plain text(0), TLS(1) or STARTTLS(2) when connecting.
  • array $stream_options: Stream context options, see config_local.php for more details (OPTIONAL)
  • boolean $hide: Whether or not to show error output
  • string $server: server hostname of IMAP server
  • int $port: port port number to connect to
sqimap_error_box (line 1389)

Function to display an error related to an IMAP query.

  • since: 1.4.23 and 1.5.0
void sqimap_error_box (string $title, [string $query = ''], [string $message_title = ''], [string $message = ''], [string $link = ''])
  • string $link: an optional link to try again
  • string $title: title the caption of the error box
  • string $query: query the query that went wrong
  • string $message_title: message_title optional message title
  • string $message: message optional error message
sqimap_fgets (line 123)

Custom fgets function: gets a line from the IMAP server, no matter how big it may be.

  • return: a line
string sqimap_fgets (stream $imap_stream)
  • stream $imap_stream: imap_stream the stream to read from
sqimap_fread (line 143)
void sqimap_fread ( $imap_stream,  $iSize, [ $filter = false], [ $outputstream = false], [ $no_return = false])
  • $imap_stream
  • $iSize
  • $filter
  • $outputstream
  • $no_return
sqimap_get_delimiter (line 1040)

Returns the delimeter between mailboxes: INBOX/Test, or INBOX.Test

void sqimap_get_delimiter ([ $imap_stream = false])
  • $imap_stream
sqimap_get_num_messages (line 1087)

Gets the number of messages in the current mailbox.

void sqimap_get_num_messages ( $imap_stream,  $mailbox)
  • $imap_stream
  • $mailbox
sqimap_get_user_server (line 1359)
void sqimap_get_user_server ( $imap_server,  $username)
  • $imap_server
  • $username
sqimap_login (line 494)

Logs the user into the IMAP server. If $hide is set, no error messages will be displayed. This function returns the IMAP connection handle.

void sqimap_login ( $username,  $password,  $imap_server_address,  $imap_port,  $hide, [ $stream_options = array()])
  • $username
  • $password
  • $imap_server_address
  • $imap_port
  • $hide
  • $stream_options
sqimap_logout (line 850)

Simply logs out the IMAP session

void sqimap_logout (stream $imap_stream)
  • stream $imap_stream: imap_stream the IMAP connection to log out.
sqimap_read_data (line 466)
void sqimap_read_data ( $imap_stream,  $tag_uid,  $handle_errors,  &$response,  &$message, [ $query = ''], [ $filter = false], [ $outputstream = false], [ $no_return = false])
  • $imap_stream
  • $tag_uid
  • $handle_errors
  • &$response
  • &$message
  • $query
  • $filter
  • $outputstream
  • $no_return
sqimap_read_data_list (line 201)

Reads the output from the IMAP stream. If handle_errors is set to true, this will also handle all errors that are received. If it is not set, the errors will be sent back through $response and $message.

void sqimap_read_data_list ( $imap_stream,  $tag_uid,  $handle_errors,  &$response,  &$message, [ $query = ''], [ $filter = false], [ $outputstream = false], [ $no_return = false])
  • $imap_stream
  • $tag_uid
  • $handle_errors
  • &$response
  • &$message
  • $query
  • $filter
  • $outputstream
  • $no_return
sqimap_run_command (line 58)
void sqimap_run_command ( $imap_stream,  $query,  $handle_errors,  &$response,  &$message, [ $unique_id = false], [ $filter = false], [ $outputstream = false], [ $no_return = false])
  • $imap_stream
  • $query
  • $handle_errors
  • &$response
  • &$message
  • $unique_id
  • $filter
  • $outputstream
  • $no_return
sqimap_run_command_list (line 40)

Both send a command and accept the result from the command.

This is to allow proper session number handling.

void sqimap_run_command_list ( $imap_stream,  $query,  $handle_errors,  &$response,  &$message, [ $unique_id = false])
  • $imap_stream
  • $query
  • $handle_errors
  • &$response
  • &$message
  • $unique_id
sqimap_run_literal_command (line 79)
void sqimap_run_literal_command ( $imap_stream,  $query,  $handle_errors,  &$response,  &$message, [ $unique_id = false])
  • $imap_stream
  • $query
  • $handle_errors
  • &$response
  • &$message
  • $unique_id
sqimap_session_id (line 26)

Generates a new session ID by incrementing the last one used; this ensures that each command has a unique ID.

  • return: IMAP session id of the form 'A000'.
string sqimap_session_id ([bool $unique_id = FALSE])
  • bool $unique_id: unique_id
sqimap_status_messages (line 1290)

Returns the number of unseen/total messages in this folder

void sqimap_status_messages ( $imap_stream,  $mailbox)
  • $imap_stream
  • $mailbox
sqimap_unseen_messages (line 1274)

Returns the number of unseen messages in this folder.

void sqimap_unseen_messages ( $imap_stream,  $mailbox)
  • $imap_stream
  • $mailbox

Documentation generated on Mon, 13 Jan 2020 04:24:43 +0100 by phpDocumentor 1.4.3