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 54b24e3..6d51126 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 ee858ed..3845826 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 488da05..8924617 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 397f07f..8402f28 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 9715385..99a7198 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 f9b4219..e77b3a8 100644 (file)
@@ -93,6 +93,7 @@
             else
                $body = "$body> $tmp\n";
          }
+         sqimap_mailbox_close($imapConnection);
          return $body;   
       }
 
index f485b38..132b68c 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 a796ea5..1e09445 100644 (file)
       }
    }
 
+   sqimap_mailbox_close($imapConnection);
    sqimap_logout($imapConnection);
 ?>
index 8b7b7cf..8b6a5f5 100644 (file)
    }
 
    // Log out this session
+   sqimap_mailbox_close($imapConnection);
    sqimap_logout($imapConnection);
 
 ?>
index 4925d87..81edc14 100644 (file)
@@ -58,6 +58,7 @@
       }
       echo "</pre></td></tr></table>\n";
       echo "</body></html>";
+      sqimap_mailbox_close($imapConnection);
       sqimap_logout($imapConnection);
       exit;
    }
index 1827afa..3efad3d 100644 (file)
 
    do_hook("right_main_bottom");
    // close the connection
+   sqimap_mailbox_close($imapConnection);
    sqimap_logout ($imapConnection);
 ?>
 </FONT>
index fe169f8..1db642f 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);