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)
Parses an 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)
sqimap_append_done (line
1320)
void
sqimap_append_done
( $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!
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.
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
Custom fgets function: gets a line from the IMAP server, no matter how big it may be.
string
sqimap_fgets
(stream $imap_stream)
-
stream
$imap_stream: imap_stream the stream to read from
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])
sqimap_get_num_messages (line
1087)
Gets the number of messages in the current mailbox.
void
sqimap_get_num_messages
( $imap_stream, $mailbox)
sqimap_get_user_server (line
1359)
void
sqimap_get_user_server
( $imap_server, $username)
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
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.
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)
sqimap_unseen_messages (line
1274)
Returns the number of unseen messages in this folder.
void
sqimap_unseen_messages
( $imap_stream, $mailbox)