15 public function connect(
$host, $port, $timeout = 1, $skip_cert =
false)
18 sprintf(
'%s:%s',
$host, $port), $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT,
19 stream_context_create(
array(
'ssl' =>
array(
'verify_peer' => !$skip_cert,
'verify_peer_name' => !$skip_cert)))
23 throw new Exception(
GetMessage(
'MAIL_IMAP_ERR_CONNECT'));
30 if ($prompt ===
false)
31 throw new Exception(
GetMessage(
'MAIL_IMAP_ERR_COMMUNICATE'));
33 if (mb_strpos($prompt,
'* OK') !== 0)
35 $this->imap_stream =
null;
37 throw new Exception(
GetMessage(
'MAIL_IMAP_ERR_CONNECT').
': '.
GetMessage(
'MAIL_IMAP_ERR_BAD_SERVER'));
52 $tag = $this->
sendCommand(
"AUTHENTICATE PLAIN\r\n");
55 if (mb_strpos($prompt,
'+') !== 0)
57 if (mb_strpos($prompt, $tag.
' NO') === 0 || mb_strpos($prompt, $tag.
' BAD') === 0)
58 throw new Exception(
GetMessage(
'MAIL_IMAP_ERR_AUTH_MECH'));
60 throw new Exception(
GetMessage(
'MAIL_IMAP_ERR_AUTH').
': '.
GetMessage(
'MAIL_IMAP_ERR_BAD_SERVER'));
63 fputs($this->imap_stream, base64_encode(
"\x00".
$login.
"\x00".
$password).
"\r\n");
67 if (mb_strpos(
$response, $tag.
' OK') ===
false)
70 throw new Exception(
GetMessage(
'MAIL_IMAP_ERR_AUTH'));
72 throw new Exception(
GetMessage(
'MAIL_IMAP_ERR_AUTH').
': '.
GetMessage(
'MAIL_IMAP_ERR_BAD_SERVER'));
83 if (mb_strpos(
$response, $tag.
' OK') ===
false)
84 throw new Exception(
GetMessage(
'MAIL_IMAP_ERR_BAD_SERVER'));
89 if (mb_strpos(
$response, $tag.
' OK') ===
false)
90 throw new Exception(
GetMessage(
'MAIL_IMAP_ERR_BAD_SERVER'));
95 $unseen =
count(preg_split(
'/\s+/',
$matches[1],
null, PREG_SPLIT_NO_EMPTY));
105 $tag = sprintf(
'A%03u', $this->counter);
107 $command = sprintf(
'%s %s', $tag, $command);
108 $bytes = fputs($this->imap_stream, $command);
110 if (
$bytes < mb_strlen($command))
111 throw new Exception(
GetMessage(
'MAIL_IMAP_ERR_COMMUNICATE'));
122 $buffer = fgets($this->imap_stream, 4096);
129 while (mb_strpos(
$buffer,
"\r\n") ===
false);
147 while (mb_strpos($line, $tag) !== 0);
authenticate($login, $password)
connect($host, $port, $timeout=1, $skip_cert=false)
if(!defined("ADMIN_AJAX_MODE") &&(($_REQUEST["mode"] ?? '') !='excel')) $buffer
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"