added capability to detect if imap server supports searching on specific
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 1 Feb 2001 00:56:53 +0000 (00:56 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 1 Feb 2001 00:56:53 +0000 (00:56 +0000)
charset.  If not, try with us-ascii rather than throw an error.  (according
to rfc2060, all imap servers MUST support us-ascii charset at bare minimum)

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1025 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_search.php
functions/mailbox_display.php

index a9cda06..993a23a 100644 (file)
@@ -30,7 +30,12 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
    fputs($imapConnection,$ss);
 
    # Read Data Back From IMAP
-   $readin = sqimap_read_data ($imapConnection, "a001", true, $result, $message);
+   $readin = sqimap_read_data ($imapConnection, "a001", false, $result, $message);
+   if (isset($languages[$squirrelmail_language]["CHARSET"]) && strtolower($result) == "no") { 
+      $ss = "a001 SEARCH CHARSET \"US-ASCII\" ALL $search_where \"$search_what\"\r\n";
+      fputs ($imapConnection, $ss);
+      $readin = sqimap_read_data ($imapConnection, "a001", true, $result, $message);
+   }
    unset($messagelist); $msgs=""; $c = 0;
 
    #Keep going till we find the SEARCH responce
index 41db001..62ad718 100644 (file)
@@ -38,7 +38,7 @@
          $flag = '';
          $flag_end = '';
       }
-      if (!isset($msg['FLAG_SEEN']) && $msg['FLAG_SEEN'] == false) 
+      if (!isset($msg['FLAG_SEEN']) || $msg['FLAG_SEEN'] == false) 
       { 
          $bold = '<b>'; 
          $bold_end = '</b>';