From: lkehresman Date: Thu, 1 Feb 2001 00:56:53 +0000 (+0000) Subject: added capability to detect if imap server supports searching on specific X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=367e4f70490865d893981c68dc3931b379d24f09;ds=inline 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) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1025 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/imap_search.php b/functions/imap_search.php index a9cda066..993a23aa 100644 --- a/functions/imap_search.php +++ b/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 diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 41db0015..62ad7181 100644 --- a/functions/mailbox_display.php +++ b/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 = ''; $bold_end = '';