• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/lib/imap.php
  • Класс: BitrixMailImap
  • Вызов: Imap::getUntagged
protected function getUntagged($regex, $unset = false)
{
	$result = array();

	$length = count($this->sessUntagged);
	for ($i = 0; $i < $length; $i++)
	{
		if (!preg_match($regex, $this->sessUntagged[$i], $matches))
			continue;

		unset($matches[0]);
		$result[] = array($this->sessUntagged[$i], $matches);

		if ($unset)
			unset($this->sessUntagged[$i]);
	}

	if ($unset && !empty($result))
		$this->sessUntagged = array_values($this->sessUntagged);

	return $result;
}