I had issues with imap_status not working correctly, while other imap functions seemed okay. I always got the ['flags']=0 response. No notes here and Google searching suggests it doesn't working properly with Exchange, so I wrote a little workaround, to at least get some information.
<?php
function my_imap_status($stream, $mailbox='', $info=SA_ALL)
{
$curr_obj=imap_check($stream);
if(!$curr_obj) return false;
if( (empty($mailbox)) || ($mailbox==$curr_obj->Mailbox) ) return $curr_obj;
$current_mailbox=$curr_obj->Mailbox;
if(!imap_reopen($stream, $mailbox)) return false;
$obj=imap_check($stream);
imap_reopen($stream, $current_mailbox);
return $obj;
}
?>