Explorar el Código

added capability to detect if imap server supports searching on specific
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)

Luke Ehresman hace 24 años
padre
commit
f0a1030d3e
Se han modificado 2 ficheros con 7 adiciones y 2 borrados
  1. 6 1
      functions/imap_search.php
  2. 1 1
      functions/mailbox_display.php

+ 6 - 1
functions/imap_search.php

@@ -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

+ 1 - 1
functions/mailbox_display.php

@@ -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>';