From b4ac5b962ca93a4c8dcccfe3fe3b1dce1d8a1ba7 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 23 Sep 2002 08:32:29 +0000 Subject: [PATCH] Fix for IMAP servers that don't always return a UIDNEXT value git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3712 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 4c113dc9..3b52743e 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -118,7 +118,11 @@ function sqimap_get_sort_order ($imap_stream, $sort, $mbxresponse) { if ($sort == 6) { if ($uid_support) { - $uidnext = $mbxresponse['UIDNEXT']-1; + if (isset($mbxresponse['UIDNEXT']) && $mbxresponse['UIDNEXT']) { + $uidnext = $mbxresponse['UIDNEXT']-1; + } else { + $uidnext = '*'; + } $uid_query = "$sid SEARCH UID 1:$uidnext\r\n"; fputs($imap_stream, $uid_query); $uids = sqimap_read_data($imap_stream, $sid, true ,$response, $message); -- 2.25.1