I
I
Ilya2020-08-11 12:59:26
PHP
Ilya, 2020-08-11 12:59:26

Why are letters not being searched in the mailbox?

I'm looking for letters by imap, it works every other time, sometimes it finds it, sometimes it's an empty array and notice.
Mail for Yandex domain, authorization via application password. Through the so-called. the portal password is the same.

subject tried both in Latin and in another windows-1251 encoding, everything is the same.

Tried different versions of php, from 7.0 to 7.4, same thing.

php:

$folder = mb_convert_encoding('Название папки в почте', "UTF7-IMAP", "utf-8");

$imapPath = '{imap.yandex.ru:993/imap/ssl}' . $folder;
$login = '[email protected]';
$password = 'password';

$connection = imap_open($imapPath, $login, $password);

$messageNumbers = imap_sort(
  $connection,
  SORTDATE,
  1,
  0,
  'SUBJECT "прайс"',
  "UTF-8"
);

var_dump($messageNumbers);


conclusion:
array(0) {
}
PHP Notice:  Unknown: [UNAVAILABLE] SEARCH Backend error. sc=6nIoVY81NOs1_110949_2-c5e3fad6bae7 (errflg=2) in Unknown on line 0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2020-09-01
@New_Horizons

The problem disappeared by itself, I suspect that Yandex fixed something there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question