mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
Merge branch 'master' into master
This commit is contained in:
commit
628f8077a3
393 changed files with 74330 additions and 64616 deletions
|
|
@ -67,7 +67,10 @@ class SubStreams
|
|||
|
||||
$sHashName = \MailSo\Base\Utils::Md5Rand();
|
||||
|
||||
self::$aStreams[$sHashName] = $aSubStreams;
|
||||
self::$aStreams[$sHashName] = array_map(function($mItem) {
|
||||
return \is_resource($mItem) ? $mItem :
|
||||
\MailSo\Base\ResourceRegistry::CreateMemoryResourceFromString($mItem);
|
||||
}, $aSubStreams);
|
||||
|
||||
\MailSo\Base\Loader::IncStatistic('CreateStream/SubStreams');
|
||||
|
||||
|
|
@ -181,26 +184,6 @@ class SubStreams
|
|||
$this->iIndex++;
|
||||
}
|
||||
}
|
||||
else if (\is_string($mCurrentPart))
|
||||
{
|
||||
$sReadResult = \substr($mCurrentPart, 0, $iCount);
|
||||
|
||||
$sReturn .= $sReadResult;
|
||||
|
||||
$iLen = \strlen($sReadResult);
|
||||
if ($iCount < $iLen)
|
||||
{
|
||||
$this->sBuffer = \substr($sReturn, $iCount);
|
||||
$sReturn = \substr($sReturn, 0, $iCount);
|
||||
$iCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$iCount -= $iLen;
|
||||
}
|
||||
|
||||
$this->iIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -668,7 +668,8 @@ END;
|
|||
|
||||
$aEncodeArray = array('');
|
||||
$aMatch = array();
|
||||
\preg_match_all('/=\?[^\?]+\?[q|b|Q|B]\?[^\?]*(\?=)/', $sValue, $aMatch);
|
||||
// \preg_match_all('/=\?[^\?]+\?[q|b|Q|B]\?[^\?]*?\?=/', $sValue, $aMatch);
|
||||
\preg_match_all('/=\?[^\?]+\?[q|b|Q|B]\?.*?\?=/', $sValue, $aMatch);
|
||||
|
||||
if (isset($aMatch[0]) && \is_array($aMatch[0]))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class Header
|
|||
const DISPOSITION_NOTIFICATION_TO = 'Disposition-Notification-To';
|
||||
const X_CONFIRM_READING_TO = 'X-Confirm-Reading-To';
|
||||
|
||||
const MIME_VERSION = 'Mime-Version';
|
||||
const MIME_VERSION = 'MIME-Version';
|
||||
const X_MAILER = 'X-Mailer';
|
||||
|
||||
const X_MSMAIL_PRIORITY = 'X-MSMail-Priority';
|
||||
|
|
|
|||
|
|
@ -413,7 +413,10 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
$sCmd .= ' NOTIFY=SUCCESS,FAILURE';
|
||||
}
|
||||
|
||||
$this->sendRequestWithCheck('RCPT', array(250, 251), $sCmd);
|
||||
$this->sendRequestWithCheck(
|
||||
'RCPT', array(250, 251), $sCmd, false,
|
||||
'Failed to add recipient "'.$sTo.'"'
|
||||
);
|
||||
|
||||
$this->bRcpt = true;
|
||||
|
||||
|
|
@ -657,6 +660,7 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
* @param int|array $mExpectCode
|
||||
* @param string $sAddToCommand = ''
|
||||
* @param bool $bSecureLog = false
|
||||
* @param string $sErrorPrefix = ''
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
@ -664,10 +668,10 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
* @throws \MailSo\Net\Exceptions\Exception
|
||||
* @throws \MailSo\Smtp\Exceptions\Exception
|
||||
*/
|
||||
private function sendRequestWithCheck($sCommand, $mExpectCode, $sAddToCommand = '', $bSecureLog = false)
|
||||
private function sendRequestWithCheck($sCommand, $mExpectCode, $sAddToCommand = '', $bSecureLog = false, $sErrorPrefix = '')
|
||||
{
|
||||
$this->sendRequest($sCommand, $sAddToCommand, $bSecureLog);
|
||||
$this->validateResponse($mExpectCode);
|
||||
$this->validateResponse($mExpectCode, $sErrorPrefix);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -758,12 +762,13 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
|
||||
/**
|
||||
* @param int|array $mExpectCode
|
||||
* @param string $sErrorPrefix = ''
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \MailSo\Smtp\Exceptions\ResponseException
|
||||
*/
|
||||
private function validateResponse($mExpectCode)
|
||||
private function validateResponse($mExpectCode, $sErrorPrefix = '')
|
||||
{
|
||||
if (!\is_array($mExpectCode))
|
||||
{
|
||||
|
|
@ -786,7 +791,8 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
if ('-' !== \substr($aParts[1], 0, 1) && !\in_array((int) $aParts[0], $mExpectCode))
|
||||
{
|
||||
$this->writeLogException(
|
||||
new Exceptions\NegativeResponseException($this->aResults, \trim(
|
||||
new Exceptions\NegativeResponseException($this->aResults,
|
||||
('' === $sErrorPrefix ? '' : $sErrorPrefix.': ').\trim(
|
||||
(0 < \count($this->aResults) ? \implode("\r\n", $this->aResults)."\r\n" : '').
|
||||
$this->sResponseBuffer)), \MailSo\Log\Enumerations\Type::ERROR, true);
|
||||
}
|
||||
|
|
@ -794,7 +800,8 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
else
|
||||
{
|
||||
$this->writeLogException(
|
||||
new Exceptions\ResponseException($this->aResults, \trim(
|
||||
new Exceptions\ResponseException($this->aResults,
|
||||
('' === $sErrorPrefix ? '' : $sErrorPrefix.': ').\trim(
|
||||
(0 < \count($this->aResults) ? \implode("\r\n", $this->aResults)."\r\n" : '').
|
||||
$this->sResponseBuffer)), \MailSo\Log\Enumerations\Type::ERROR, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue