The imap_search function often doesn't find the message, what am I doing wrong?

Code:

$this->mbox = @imap_open("{imap.yandex.EN:993/imap/ssl}INBOX", $login, $pwd);
$arr = imap_search($this->mbox,'UNSEEN FROM "' . $imap_search . '" SUBJECT "'.$th.'"',SE_FREE,'UTF-8');
 var_dump($arr); // $arr= false

Ie I want the unread messages from a specific sender with a specific subject.

And I can't understand what the problem is, because if you just specify the UNSEEN, then he finds them.
If UNSEEN FROM ""that there is a 50/50, sometimes he finds them, and sometimes false.
But if the UNSEEN FROM "" SUBJECT "" there are often sends false.

Can the Yandex server is buggy, or I requests not constitute?..
July 2nd 19 at 13:07
1 answer
July 2nd 19 at 13:09
On Yandex most likely the cache on the search that is updated not so often, so letters he begins to see immediately. Sometimes sometimes not. Therefore, all refused to function imap_search and perform the search locally.
"search locally" is how to understand? - Viva_Goldner commented on July 2nd 19 at 13:12
Connect to the server-defined folder.
Get the last N emails (you can get it all at once, it is possible portions), with basic information in addition to content. Go through the array, filtering on sender, subject, and so on.
For more information about the letter helmet request more information about email contents, attachments in the uid. - lois.Gusikowski11 commented on July 2nd 19 at 13:15
Fucked in the work of the imap extensions, not read letters. Had to leave in the direction of eden/map running on sockets - lois.Gusikowski11 commented on July 2nd 19 at 13:18

Find more questions by tags PHPE-mailIMAP