function sqimap_read_data ($imap_stream, $pre, $handle_errors, $response, $message) {
global $color;
+ //$imap_general_debug = true;
+ $imap_general_debug = false;
+
$read = fgets ($imap_stream, 1024);
-// echo "<small><tt><font color=cc0000>$read</font></tt></small><br>";
+ if ($imap_general_debug) echo "<small><tt><font color=cc0000>$read</font></tt></small><br>";
$counter = 0;
while ((substr($read, 0, strlen("$pre OK")) != "$pre OK") &&
(substr($read, 0, strlen("$pre BAD")) != "$pre BAD") &&
(substr($read, 0, strlen("$pre NO")) != "$pre NO")) {
$data[$counter] = $read;
$read = fgets ($imap_stream, 1024);
-// echo "<small><tt><font color=cc0000>$read</font></tt></small><br>";
+ if ($imap_general_debug) echo "<small><tt><font color=cc0000>$read</font></tt></small><br>";
$counter++;
}
-// echo "--<br>";
+ if ($imap_general_debug) echo "--<br>";
if (substr($read, 0, strlen("$pre OK")) == "$pre OK") {
$response = "OK";
$message = trim(substr($read, strlen("$pre OK"), strlen($read)));
$imap_search_php = true;
function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color) {
- global $msgs, $message_highlight_list;
+ global $msgs, $message_highlight_list, $squirrelmail_language, $languages;
$urlMailbox = urlencode($mailbox);
# Construct the Search QuERY
- $ss = "a001 SEARCH ALL $search_where \"$search_what\"\r\n";
+ if ($languages[$squirrelmail_language]["CHARSET"]) {
+ $ss = "a001 SEARCH CHARSET ".$languages[$squirrelmail_language]["CHARSET"]." ALL $search_where \"$search_what\"\r\n";
+ } else {
+ $ss = "a001 SEARCH ALL $search_where \"$search_what\"\r\n";
+ }
fputs($imapConnection,$ss);
# Read Data Back From IMAP
global $msgs, $msort;
global $sent_folder;
global $message_highlight_list;
+ global $auto_expunge;
+
+ if ($auto_expunge) {
+ sqimap_mailbox_expunge($imapConnection, $mailbox);
+ sqimap_mailbox_select($imapConnection, $mailbox);
+ }
if (!$use_cache) {
if ($numMessages >= 1) {
displayHtmlHeader();
-
function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $unseen) {
global $folder_prefix, $trash_folder, $sent_folder;
global $color, $move_to_sent, $move_to_trash;
$line .= replace_spaces(readShortMailboxName($mailbox, $delimeter));
$line .= "</FONT>";
} else {
+ if ($auto_expunge) {
+ sqimap_mailbox_expunge($imapConnection, $boxes[$i]["unformatted-dm"]);
+ }
$line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
}
} else {
exit;
}
+ if (!isset($i18n_php))
+ include("../functions/i18n.php");
if (!isset($config_php))
include("../config/config.php");
if (!isset($strings_php))