With PHP IMAP connection to exchange server, what flag does exchange server use for UNSEEN emails? -


i using php imap library wrapped in handy little class barbushin: https://github.com/barbushin/php-imap

i started testing against gmail account, fetch unread emails following.

$imap = new imap(); $unseen = $imap->searchmailbox('unseen'); 

the function in class following:

/*  *      - return mails matching rest of criteria  *      answered - match mails \\answered flag set  *      bcc "string" - match mails "string" in bcc: field  *      before "date" - match mails date: before "date"  *      body "string" - match mails "string" in body of mail  *      cc "string" - match mails "string" in cc: field  *      deleted - match deleted mails  *      flagged - match mails \\flagged (sometimes referred important or urgent) flag set  *      "string" - match mails "string" in from: field  *      keyword "string" - match mails "string" keyword  *      new - match new mails  *      old - match old mails  *      on "date" - match mails date: matching "date"  *      recent - match mails \\recent flag set  *      seen - match mails have been read (the \\seen flag set)  *      since "date" - match mails date: after "date"  *      subject "string" - match mails "string" in subject:  *      text "string" - match mails text "string"  *      "string" - match mails "string" in to:  *      unanswered - match mails have not been answered  *      undeleted - match mails not deleted  *      unflagged - match mails not flagged  *      unkeyword "string" - match mails not have keyword "string"  *      unseen - match mails have not been read yet  *  * @return array mails ids  */ public function searchmailbox($criteria = 'all') {     $mailsids = imap_search($this->imapstream, $criteria, se_uid, $this->serverencoding);     return $mailsids ? $mailsids : array(); } 

just handy wrapper imap_search(); http://php.net/manual/en/function.imap-search.php

connected exchange server on imap, can following:

$imap = new imap(); $unseen = $imap->searchmailbox('all'); 

this retrieve emails fine, in inbox on exchange (as per connection).

unseen (as documented) worked expected on google mail not exchange 2010. all works expected on both. wondered whether exchange 2010 used different flag? new , unread not work. , returned details can these mailid's not contain array of flags reverse engineer from.

any appreciated :)

if doesn't work, it's bug in exchange. unseen search term corresponds lack of \seen keyword (a message flag), see rfc 3501, p. 52.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -