- Модуль: mail
- Путь к файлу: ~/bitrix/modules/mail/lib/imap.php
- Класс: BitrixMailImap
- Вызов: Imap::examine
public function examine($mailbox, &$error)
{
$error = null;
if (!$this->authenticate($error))
return false;
$response = $this->executeCommand(sprintf(
'EXAMINE "%s"', static::escapeQuoted($this->encodeUtf7Imap($mailbox))
), $error);
if ($error)
{
$error = $error == Imap::ERR_COMMAND_REJECTED ? null : $error;
$error = $this->errorMessage(array(Imap::ERR_SELECT, $error), $response);
return false;
}
$result = array();
$regex = '/^ * x20 ( d+ ) x20 EXISTS /ix';
foreach ($this->getUntagged($regex, true) as $item)
$result['exists'] = $item[1][1];
$regex = '/^ * x20 OK x20 [ UIDVALIDITY x20 ( d+ ) ] /ix';
foreach ($this->getUntagged($regex, true) as $item)
$result['uidvalidity'] = $item[1][1];
$regex = sprintf(
'/^ * x20 OK x20 [ PERMANENTFLAGS x20 ( ( ( x5c? %1$s | x5c * ) ( x20 (?2) )* )? ) ] /ix',
self::$atomRegex
);
foreach ($this->getUntagged($regex, true) as $item)
{
$result['permanentflags'] = explode("x20", $item[1][1]);
}
return $result;
}