From 594f86d4a01e79c46040c745e9893bd4c65cba8e Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 7 Dec 2009 14:54:34 -0700 Subject: [PATCH] Bug #8753: Fix subscription determination if LIST-EXTENDED is not available --- .../Imap_Client/lib/Horde/Imap/Client/Socket.php | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php index ee088ebb4..87c1d4b45 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php @@ -959,7 +959,8 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base // If mode is subscribed, and 'flat' option is true, we can // return now. - if (($mode == Horde_Imap_Client::MBOX_SUBSCRIBED) && !empty($options['flat'])) { + if (($mode == Horde_Imap_Client::MBOX_SUBSCRIBED) && + !empty($options['flat'])) { return $subscribed; } } else { @@ -1065,26 +1066,24 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base $mode = strtoupper($data[0]); $mbox = $data[3]; - /* If dealing with [un]subscribed mailboxes, check to make sure - * this mailbox is in the correct category. */ if ($ml['check'] && - ((($mode == 'LIST') && isset($ml['subscribed'][$mbox])) || - (($mode == 'LSUB') && !isset($ml['subscribed'][$mbox])))) { + $ml['subexist'] && + !isset($ml['subscribed'][$mbox])) { return; + } else if ((!$ml['check'] && $ml['subexist']) || + (empty($mlo['flat']) && !empty($mlo['attributes']))) { + $attr = array_map('strtolower', $data[1]); + if ($ml['subexist'] && + !$ml['check'] && + in_array('\\nonexistent', $attr)) { + return; + } } if (!empty($mlo['utf8'])) { $mbox = Horde_Imap_Client_Utf7imap::Utf7ImapToUtf8($mbox); } - if ($ml['subexist'] || - (empty($mlo['flat']) && !empty($mlo['attributes']))) { - $attr = array_map('strtolower', $data[1]); - if ($ml['subexist'] && in_array('\\nonexistent', $attr)) { - return; - } - } - if (empty($mlo['flat'])) { $tmp = array('mailbox' => $mbox); if (!empty($mlo['attributes'])) { -- 2.11.0