diff options
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcube_imap_generic.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php index 41240a2d1..2171e5d5d 100644 --- a/program/include/rcube_imap_generic.php +++ b/program/include/rcube_imap_generic.php @@ -944,11 +944,16 @@ class rcube_imap_generic $this->selected = ''; } - $this->select($mailbox); if ($this->selected == $mailbox) { return $this->data['EXISTS']; } + // Try STATUS, should be faster + $counts = $this->status($mailbox, array('MESSAGES')); + if (is_array($counts)) { + return (int) $counts['MESSAGES']; + } + return false; } |