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_general.php File Reference

Go to the source code of this file.

Namespaces

 squirrelmail
 

Functions

 sqimap_session_id ($unique_id=FALSE)
 
 sqimap_run_command_list ($imap_stream, $query, $handle_errors, &$response, &$message, $unique_id=false)
 
 sqimap_run_command ($imap_stream, $query, $handle_errors, &$response, &$message, $unique_id=false, $filter=false, $outputstream=false, $no_return=false)
 
 sqimap_run_literal_command ($imap_stream, $query, $handle_errors, &$response, &$message, $unique_id=false)
 
 sqimap_fgets ($imap_stream)
 
 sqimap_fread ($imap_stream, $iSize, $filter=false, $outputstream=false, $no_return=false)
 
 sqimap_read_data_list ($imap_stream, $tag_uid, $handle_errors, &$response, &$message, $query='', $filter=false, $outputstream=false, $no_return=false)
 
 sqimap_read_data ($imap_stream, $tag_uid, $handle_errors, &$response, &$message, $query='', $filter=false, $outputstream=false, $no_return=false)
 
 sqimap_login ($username, $password, $imap_server_address, $imap_port, $hide)
 
 sqimap_logout ($imap_stream)
 
 sqimap_capability ($imap_stream, $capability='')
 
 sqimap_get_delimiter ($imap_stream=false)
 
 sqimap_get_num_messages ($imap_stream, $mailbox)
 
 parseAddress ($address, $max=0)
 
 sqimap_unseen_messages ($imap_stream, $mailbox)
 
 sqimap_status_messages ($imap_stream, $mailbox)
 
 sqimap_append ($imap_stream, $sent_folder, $length)
 
 sqimap_append_done ($imap_stream, $folder='')
 
 sqimap_append_checkresponse ($response, $folder)
 
 sqimap_get_user_server ($imap_server, $username)
 
 map_yp_alias ($username)
 

Function Documentation

◆ map_yp_alias()

map_yp_alias (   $username)

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.

Definition at line 1015 of file imap_general.php.

References $username.

◆ parseAddress()

parseAddress (   $address,
  $max = 0 
)

Parses an address string. FIXME: the original author should step up and document this - the following is a guess based on a couple simple tests of using the function, not knowing the code inside

Parameters
string$addressGeneric email address(es) in any format, including possible personal information as well as the actual address (such as "Jose" jose@.nosp@m.exam.nosp@m.ple.o.nosp@m.rg or "Jose" jose@.nosp@m.exam.nosp@m.ple.o.nosp@m.rg, "Keiko" keiko.nosp@m.@exa.nosp@m.mple..nosp@m.org)
int$maxThe most email addresses to parse out of the given string
Returns
array 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

Definition at line 756 of file imap_general.php.

Referenced by printMessageInfo(), and sqimap_get_small_header_list().

◆ sqimap_append()

sqimap_append (   $imap_stream,
  $sent_folder,
  $length 
)

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

Definition at line 956 of file imap_general.php.

References $imap_stream, $sent_folder, sqimap_append_checkresponse(), and sqimap_session_id().

Referenced by Deliver_IMAP\send_mail().

◆ sqimap_append_checkresponse()

sqimap_append_checkresponse (   $response,
  $folder 
)

◆ sqimap_append_done()

sqimap_append_done (   $imap_stream,
  $folder = '' 
)

Definition at line 962 of file imap_general.php.

References $imap_stream, and sqimap_append_checkresponse().

Referenced by Deliver_IMAP\send_mail().

◆ sqimap_capability()

sqimap_capability (   $imap_stream,
  $capability = '' 
)

Retreive the CAPABILITY string from the IMAP server. If capability is set, returns only that specific capability, else returns array of all capabilities.

Definition at line 651 of file imap_general.php.

References $imap_stream, $read, $sqimap_capabilities, and sqimap_run_command().

Referenced by sqimap_get_delimiter().

◆ sqimap_fgets()

sqimap_fgets (   $imap_stream)

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

Parameters
streamimap_stream the stream to read from
Returns
string a line

Definition at line 123 of file imap_general.php.

References $imap_stream, and $read.

Referenced by sqimap_login(), and sqimap_read_data_list().

◆ sqimap_fread()

sqimap_fread (   $imap_stream,
  $iSize,
  $filter = false,
  $outputstream = false,
  $no_return = false 
)

Definition at line 143 of file imap_general.php.

References $imap_stream.

Referenced by sqimap_read_data_list().

◆ sqimap_get_delimiter()

sqimap_get_delimiter (   $imap_stream = false)

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

Definition at line 681 of file imap_general.php.

References $data, $imap_stream, $optional_delimiter, $read, sqimap_capability(), sqimap_read_data(), and sqimap_run_command().

Referenced by load_optpage_data_folder(), and newmail_plugin().

◆ sqimap_get_num_messages()

sqimap_get_num_messages (   $imap_stream,
  $mailbox 
)

Gets the number of messages in the current mailbox.

Definition at line 729 of file imap_general.php.

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

Referenced by formatMailboxName().

◆ sqimap_get_user_server()

sqimap_get_user_server (   $imap_server,
  $username 
)

Definition at line 1001 of file imap_general.php.

References $username.

Referenced by sqimap_login().

◆ sqimap_login()

◆ sqimap_logout()

sqimap_logout (   $imap_stream)

Simply logs out the IMAP session

Parameters
streamimap_stream the IMAP connection to log out.
Returns
void

Definition at line 639 of file imap_general.php.

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

Referenced by deliverMessage(), load_optpage_data_folder(), Deliver\mail(), mail_fetch_login(), newMail(), sent_subfolders_optpage_loadhook_folders(), sent_subfolders_update_sentfolder(), sqimap_login(), sqimap_mailbox_select(), and start_filters().

◆ sqimap_read_data()

sqimap_read_data (   $imap_stream,
  $tag_uid,
  $handle_errors,
$response,
$message,
  $query = '',
  $filter = false,
  $outputstream = false,
  $no_return = false 
)

◆ sqimap_read_data_list()

sqimap_read_data_list (   $imap_stream,
  $tag_uid,
  $handle_errors,
$response,
$message,
  $query = '',
  $filter = false,
  $outputstream = false,
  $no_return = false 
)

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.

Definition at line 201 of file imap_general.php.

References $color, $data, $imap_stream, $j, $message, $read, $squirrelmail_language, _(), elseif, error_box(), exit, set_up_language(), SM_PATH, sqimap_fgets(), and sqimap_fread().

Referenced by get_caps(), imap_test(), sqimap_read_data(), and sqimap_run_command_list().

◆ sqimap_run_command()

◆ sqimap_run_command_list()

sqimap_run_command_list (   $imap_stream,
  $query,
  $handle_errors,
$response,
$message,
  $unique_id = false 
)

Both send a command and accept the result from the command. This is to allow proper session number handling.

Definition at line 40 of file imap_general.php.

References $color, $imap_stream, $message, $read, $squirrelmail_language, _(), error_box(), set_up_language(), SM_PATH, sqimap_read_data_list(), and sqimap_session_id().

Referenced by filter_search_and_delete(), get_reference_header(), spam_filters(), sqimap_get_headerfield(), sqimap_get_small_header_list(), and sqimap_get_sort_order().

◆ sqimap_run_literal_command()

sqimap_run_literal_command (   $imap_stream,
  $query,
  $handle_errors,
$response,
$message,
  $unique_id = false 
)

◆ sqimap_session_id()

sqimap_session_id (   $unique_id = FALSE)

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

Parameters
boolunique_id
Returns
string IMAP session id of the form 'A000'.

Definition at line 26 of file imap_general.php.

References sprintf.

Referenced by get_caps(), imap_test(), sqimap_append(), sqimap_get_headerfield(), sqimap_login(), sqimap_mailbox_list_all(), sqimap_run_command(), sqimap_run_command_list(), and sqimap_run_literal_command().

◆ sqimap_status_messages()

sqimap_status_messages (   $imap_stream,
  $mailbox 
)

Returns the number of unseen/total messages in this folder

Definition at line 932 of file imap_general.php.

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

Referenced by CheckNewMailboxSound(), create_unseen_string(), and start_filters().

◆ sqimap_unseen_messages()

sqimap_unseen_messages (   $imap_stream,
  $mailbox 
)

Returns the number of unseen messages in this folder.

Definition at line 916 of file imap_general.php.

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