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 a9cda0660a1fc32bf1920dac85f614a88db5a80b..993a23aa2d420d56b1a1e40569e5455cc29a145e 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 41db001506c8dc2da989a50cbef5548aad195444..62ad7181a5b3b7754034a887f89034f19d34b013 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>';