From a2790a617beaef97a2d87e5bebc0e37a12c8c2ea Mon Sep 17 00:00:00 2001 From: lkehresman Date: Thu, 10 Aug 2000 14:51:36 +0000 Subject: [PATCH] added sqimap_mailbox_close() and implemented it for all sqimap_mailbox_select() git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@696 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + functions/imap_mailbox.php | 9 ++++++++- functions/mailbox_display.php | 4 ++-- functions/smtp.php | 1 + functions/tree.php | 4 ++++ src/compose.php | 1 + src/delete_message.php | 1 + src/download.php | 1 + src/move_messages.php | 1 + src/read_body.php | 1 + src/right_main.php | 1 + src/search.php | 1 + 12 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54b24e37..6d511260 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Version 0.5pre2 -- DEVELOPMENT ------------------------------ +- Improved word wrapping - Made message highlighting not case sensative - Added French translation from Ali Nedjimi diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index ee858ed5..38458263 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -12,6 +12,7 @@ sqimap_mailbox_select ($imap_stream, $mailbox); fputs ($imap_stream, "a001 EXPUNGE\r\n"); $read = sqimap_read_data($imap_stream, "a001", true, $response, $message); + sqimap_mailbox_close ($imap_stream); } @@ -30,8 +31,14 @@ } } + /****************************************************************************** + ** Closes an open mailbox + ******************************************************************************/ + function sqimap_mailbox_close ($imap_stream) { + fputs ($imap_stream, "a001 CLOSE\r\n"); + $tmp = sqimap_read_data($imap_stream, "a001", close, $response, $message); + } - /****************************************************************************** ** Selects a mailbox ******************************************************************************/ diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 488da052..8924617f 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -29,11 +29,11 @@ for ($i=0; $i < count($message_highlight_list); $i++) { if (trim($message_highlight_list[$i]["value"]) != "") { if ($message_highlight_list[$i]["match_type"] == "to_cc") { - if (strpos("^^".strtolower($msg["TO"]), $message_highlight_list[$i]["value"]) || strpos("^^".strtolower($msg["CC"]), $message_highlight_list[$i]["value"])) { + if (strpos("^^".strtolower($msg["TO"]), strtolower($message_highlight_list[$i]["value"])) || strpos("^^".strtolower($msg["CC"]), strtolower($message_highlight_list[$i]["value"]))) { $hlt_color = $message_highlight_list[$i]["color"]; continue; } - } else if (strpos("^^".strtolower($msg[strtoupper($message_highlight_list[$i]["match_type"])]),$message_highlight_list[$i]["value"])) { + } else if (strpos("^^".strtolower($msg[strtoupper($message_highlight_list[$i]["match_type"])]),strtolower($message_highlight_list[$i]["value"]))) { $hlt_color = $message_highlight_list[$i]["color"]; continue; } diff --git a/functions/smtp.php b/functions/smtp.php index 397f07fe..8402f282 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -495,6 +495,7 @@ writeBody ($imap_stream, $body); sqimap_append_done ($imap_stream); } + sqimap_mailbox_close($imap_stream); sqimap_logout($imap_stream); // Delete the files uploaded for attaching (if any). deleteAttachments(); diff --git a/functions/tree.php b/functions/tree.php index 9715385f..99a7198b 100644 --- a/functions/tree.php +++ b/functions/tree.php @@ -61,6 +61,7 @@ sqimap_mailbox_select($imap_stream, $trash_folder); sqimap_messages_flag ($imap_stream, 1, $numMessages, "Deleted"); sqimap_mailbox_expunge($imap_stream, $trash_folder); + sqimap_mailbox_close($imap_stream); } } } else { @@ -72,6 +73,7 @@ sqimap_mailbox_select($imap_stream, $trash_folder); sqimap_messages_flag ($imap_stream, 1, $numMessages, "Deleted"); sqimap_mailbox_expunge($imap_stream, $trash_folder); + sqimap_mailbox_close($imap_stream); } } } @@ -104,6 +106,7 @@ for ($j = 0;$j < count($tree[$index]["subNodes"]); $j++) walkTreeInPostOrderCreatingFoldersUnderTrash($tree[$index]["subNodes"][$j], $imap_stream, $tree, $dm, $topFolderName); + sqimap_mailbox_close($imap_stream); } else { sqimap_mailbox_create($imap_stream, $trash_folder . $dm . $subFolderName, ""); sqimap_mailbox_select($imap_stream, $tree[$index]["value"]); @@ -111,6 +114,7 @@ $messageCount = sqimap_get_num_messages($imap_stream, $tree[$index]["value"]); if ($messageCount > 0) sqimap_messages_copy($imap_stream, 1, $messageCount, $trash_folder . $dm . $subFolderName); + sqimap_mailbox_close($imap_stream); } } diff --git a/src/compose.php b/src/compose.php index f9b4219a..e77b3a87 100644 --- a/src/compose.php +++ b/src/compose.php @@ -93,6 +93,7 @@ else $body = "$body> $tmp\n"; } + sqimap_mailbox_close($imapConnection); return $body; } diff --git a/src/delete_message.php b/src/delete_message.php index f485b387..132b68c9 100644 --- a/src/delete_message.php +++ b/src/delete_message.php @@ -37,5 +37,6 @@ else header ("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=".urlencode($mailbox)); + sqimap_mailbox_close($imapConnection); sqimap_logout($imapConnection); ?> diff --git a/src/download.php b/src/download.php index a796ea55..1e094456 100644 --- a/src/download.php +++ b/src/download.php @@ -142,5 +142,6 @@ } } + sqimap_mailbox_close($imapConnection); sqimap_logout($imapConnection); ?> diff --git a/src/move_messages.php b/src/move_messages.php index 8b7b7cf8..8b6a5f54 100644 --- a/src/move_messages.php +++ b/src/move_messages.php @@ -109,6 +109,7 @@ } // Log out this session + sqimap_mailbox_close($imapConnection); sqimap_logout($imapConnection); ?> diff --git a/src/read_body.php b/src/read_body.php index 4925d876..81edc14a 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -58,6 +58,7 @@ } echo "\n"; echo ""; + sqimap_mailbox_close($imapConnection); sqimap_logout($imapConnection); exit; } diff --git a/src/right_main.php b/src/right_main.php index 1827afa1..3efad3d6 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -117,6 +117,7 @@ do_hook("right_main_bottom"); // close the connection + sqimap_mailbox_close($imapConnection); sqimap_logout ($imapConnection); ?> diff --git a/src/search.php b/src/search.php index fe169f83..1db642f1 100644 --- a/src/search.php +++ b/src/search.php @@ -96,6 +96,7 @@ if ($where && $what) { sqimap_mailbox_select($imapConnection, $mailbox); sqimap_search($imapConnection, $where, $what, $mailbox, $color); + sqimap_mailbox_close($imapConnection); } do_hook("search_bottom"); sqimap_logout ($imapConnection); -- 2.25.1