From 26511b3e3647c4448b6d0291c968668ea2f58a49 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Thu, 4 May 2000 21:12:14 +0000 Subject: [PATCH] fixed bug in mailbox_exists for shane git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@490 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_mailbox.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 39e17d96..169633c8 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -19,13 +19,13 @@ ** Checks whether or not the specified mailbox exists ******************************************************************************/ function sqimap_mailbox_exists ($imap_stream, $mailbox) { - $boxes = sqimap_mailbox_list ($imap_stream); - $found = false; - for ($i = 0; $i < count ($boxes); $i++) { - if ($boxes[$i]["unformatted"] == $mailbox) - $found = true; + fputs ($imap_stream, "a001 LIST \"\" \"$mailbox\"\r\n"); + $mbx = sqimap_read_data($imap_stream, "a001", true, $response, $message); + if (ereg ("$mailbox", $mbx[0])) { + return true; + } else { + return false; } - return $found; } -- 2.25.1