• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/classes/general/smtp.php
  • Класс: CSMTPConnection
  • Вызов: CSMTPConnection::__AuthPlainHandler
function __AuthPlainHandler()
{
	if(mb_strpos($this->readBuffer, "rn") === false)
		return false;
	$this->readBuffer = trim($this->readBuffer);
	if($this->readBuffer=="*")
		$this->Send('501', 'AUTH aborted');
	else
	{
		$pwd = base64_decode($this->readBuffer);
		if($pwd == '')
			$this->Send('501', 'Base64 decode error');
		else
		{
			$pwd = ltrim($pwd, chr(0));
			$this->Authorize(mb_substr($pwd, 0, mb_strpos($pwd, chr(0))), mb_substr($pwd, mb_strpos($pwd, chr(0)) + 1));
		}
	}

	$this->readBuffer = "";
	$this->__listenFunc = false;
	return true;
}