added sqimap_mailbox_close() and implemented it for all sqimap_mailbox_select()
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 10 Aug 2000 14:51:36 +0000 (14:51 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 10 Aug 2000 14:51:36 +0000 (14:51 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@696 7612ce4b-ef26-0410-bec9-ea0150e637f0

12 files changed:
ChangeLog
functions/imap_mailbox.php
functions/mailbox_display.php
functions/smtp.php
functions/tree.php
src/compose.php
src/delete_message.php
src/download.php
src/move_messages.php
src/read_body.php
src/right_main.php
src/search.php

index 54b24e37d0ca3609a319e2b55c12f19e8d1a274c..6d511260e40c7ed34a73d08df269bf4cfb411807 100644 (file)
--- 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 <lrdfrx@club-internet.fr>
 
index ee858ed5d9fdf8bd11387ee4dccd9bb1beda7a56..384582632fd4a3e591acbd432561b016332e82a1 100755 (executable)
@@ -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);
    }
 
 
       }
    }
 
+   /******************************************************************************
+    **  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
     ******************************************************************************/
index 488da052c57c15bf097a01f4921b78cc0b26fcd6..8924617f2638878131c3af186b87d1ac828b262a 100644 (file)
       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;
             }   
index 397f07fe3a406d4f6cfef3fcf8b9cfe5fb389141..8402f282ff6a64080689a5968a931b8ac30e9910 100644 (file)
          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();
index 9715385fd7c3cdb42499734f7ccb23662e0fa4db..99a7198b041d19eb73eca94cf591006d39f7027b 100644 (file)
@@ -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);
             }
          }
       }
          
          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"]);
          $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);
       }
    }
 
index f9b4219a2d54b25bd6ada33034c8e2b8c81a5dc1..e77b3a87a6c7ea4ccd84477a3e932f240fddce04 100644 (file)
@@ -93,6 +93,7 @@
             else
                $body = "$body> $tmp\n";
          }
+         sqimap_mailbox_close($imapConnection);
          return $body;   
       }
 
index f485b387b581bd922c73b02073f4792e24a3cf00..132b68c975edb7f515a8e8337e1686fcbc50d113 100644 (file)
@@ -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);
 ?>
index a796ea55b032dcda9a8278777dad968944a0ddfa..1e094456004df41833d3feb337583e41b4e7df1f 100644 (file)
       }
    }
 
+   sqimap_mailbox_close($imapConnection);
    sqimap_logout($imapConnection);
 ?>
index 8b7b7cf802770ac1c1c61041ed2fdf131a90f3ac..8b6a5f543e6d829e4dc15b24480ae77f7754c8f6 100644 (file)
    }
 
    // Log out this session
+   sqimap_mailbox_close($imapConnection);
    sqimap_logout($imapConnection);
 
 ?>
index 4925d8769b4f02ab926e72ca9b769b5bb67174c2..81edc14ae3754cf1c0fb08e107721d365bd37eac 100644 (file)
@@ -58,6 +58,7 @@
       }
       echo "</pre></td></tr></table>\n";
       echo "</body></html>";
+      sqimap_mailbox_close($imapConnection);
       sqimap_logout($imapConnection);
       exit;
    }
index 1827afa1a256b6c419a84fd88eb742bab7c8862d..3efad3d61471d9b7feb37d52d8cd57447e6ea906 100644 (file)
 
    do_hook("right_main_bottom");
    // close the connection
+   sqimap_mailbox_close($imapConnection);
    sqimap_logout ($imapConnection);
 ?>
 </FONT>
index fe169f8332dd6ae9d977276535513fc8d2e4af4d..1db642f11397eed075ca90c2eec6d3a5498e8b77 100644 (file)
@@ -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);