mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
Added tests
Small fixes
This commit is contained in:
parent
c6a9563d81
commit
5236810d6b
16 changed files with 73608 additions and 45 deletions
|
|
@ -38,11 +38,11 @@ class FetchType
|
|||
*/
|
||||
private static function addHelper(&$aReturn, $mType)
|
||||
{
|
||||
if (is_string($mType))
|
||||
if (\is_string($mType))
|
||||
{
|
||||
$aReturn[$mType] = '';
|
||||
}
|
||||
else if (is_array($mType) && 2 === count($mType) && is_string($mType[0]) &&
|
||||
else if (\is_array($mType) && 2 === count($mType) && \is_string($mType[0]) &&
|
||||
is_callable($mType[1]))
|
||||
{
|
||||
$aReturn[$mType[0]] = $mType[1];
|
||||
|
|
@ -58,13 +58,13 @@ class FetchType
|
|||
public static function BuildBodyCustomHeaderRequest(array $aHeaders, $bPeek = true)
|
||||
{
|
||||
$sResult = '';
|
||||
if (0 < count($aHeaders))
|
||||
if (0 < \count($aHeaders))
|
||||
{
|
||||
$aHeaders = array_map('trim', $aHeaders);
|
||||
$aHeaders = array_map('strtoupper', $aHeaders);
|
||||
$aHeaders = \array_map('trim', $aHeaders);
|
||||
$aHeaders = \array_map('strtoupper', $aHeaders);
|
||||
|
||||
$sResult = $bPeek ? self::BODY_PEEK : self::BODY;
|
||||
$sResult .= '[HEADER.FIELDS ('.implode(' ', $aHeaders).')]';
|
||||
$sResult .= '[HEADER.FIELDS ('.\implode(' ', $aHeaders).')]';
|
||||
}
|
||||
|
||||
return $sResult;
|
||||
|
|
|
|||
|
|
@ -1697,7 +1697,6 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
|
||||
if ($bFindCapa)
|
||||
{
|
||||
// $this->oLogger->WriteDump($oImapResponse);
|
||||
$this->initCapabilityImapResponse($oImapResponse);
|
||||
}
|
||||
|
||||
|
|
@ -2022,6 +2021,21 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
break;
|
||||
}
|
||||
|
||||
// TODO
|
||||
$iClosingPosNext = $iClosingPos + 1;
|
||||
if (
|
||||
isset($this->sResponseBuffer[$iClosingPosNext]) &&
|
||||
' ' !== $this->sResponseBuffer[$iClosingPosNext] &&
|
||||
"\r" !== $this->sResponseBuffer[$iClosingPosNext] &&
|
||||
"\n" !== $this->sResponseBuffer[$iClosingPosNext] &&
|
||||
']' !== $this->sResponseBuffer[$iClosingPosNext] &&
|
||||
')' !== $this->sResponseBuffer[$iClosingPosNext]
|
||||
)
|
||||
{
|
||||
$iClosingPos++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$iSlashCount = 0;
|
||||
while ('\\' === $this->sResponseBuffer[$iClosingPos - $iSlashCount - 1])
|
||||
{
|
||||
|
|
|
|||
|
|
@ -152,28 +152,28 @@ class MailClient
|
|||
return \MailSo\Imap\Enumerations\FetchType::BODY_HEADER_PEEK;
|
||||
|
||||
// return \MailSo\Imap\Enumerations\FetchType::ENVELOPE;
|
||||
|
||||
return \MailSo\Imap\Enumerations\FetchType::BuildBodyCustomHeaderRequest(array(
|
||||
\MailSo\Mime\Enumerations\Header::RETURN_PATH,
|
||||
\MailSo\Mime\Enumerations\Header::RECEIVED,
|
||||
\MailSo\Mime\Enumerations\Header::MIME_VERSION,
|
||||
\MailSo\Mime\Enumerations\Header::MESSAGE_ID,
|
||||
\MailSo\Mime\Enumerations\Header::FROM_,
|
||||
\MailSo\Mime\Enumerations\Header::TO_,
|
||||
\MailSo\Mime\Enumerations\Header::CC,
|
||||
\MailSo\Mime\Enumerations\Header::BCC,
|
||||
\MailSo\Mime\Enumerations\Header::SENDER,
|
||||
\MailSo\Mime\Enumerations\Header::REPLY_TO,
|
||||
\MailSo\Mime\Enumerations\Header::IN_REPLY_TO,
|
||||
\MailSo\Mime\Enumerations\Header::DATE,
|
||||
\MailSo\Mime\Enumerations\Header::SUBJECT,
|
||||
\MailSo\Mime\Enumerations\Header::X_MSMAIL_PRIORITY,
|
||||
\MailSo\Mime\Enumerations\Header::IMPORTANCE,
|
||||
\MailSo\Mime\Enumerations\Header::X_PRIORITY,
|
||||
\MailSo\Mime\Enumerations\Header::CONTENT_TYPE,
|
||||
\MailSo\Mime\Enumerations\Header::REFERENCES,
|
||||
\MailSo\Mime\Enumerations\Header::X_DRAFT_INFO,
|
||||
), true);
|
||||
//
|
||||
// return \MailSo\Imap\Enumerations\FetchType::BuildBodyCustomHeaderRequest(array(
|
||||
// \MailSo\Mime\Enumerations\Header::RETURN_PATH,
|
||||
// \MailSo\Mime\Enumerations\Header::RECEIVED,
|
||||
// \MailSo\Mime\Enumerations\Header::MIME_VERSION,
|
||||
// \MailSo\Mime\Enumerations\Header::MESSAGE_ID,
|
||||
// \MailSo\Mime\Enumerations\Header::FROM_,
|
||||
// \MailSo\Mime\Enumerations\Header::TO_,
|
||||
// \MailSo\Mime\Enumerations\Header::CC,
|
||||
// \MailSo\Mime\Enumerations\Header::BCC,
|
||||
// \MailSo\Mime\Enumerations\Header::SENDER,
|
||||
// \MailSo\Mime\Enumerations\Header::REPLY_TO,
|
||||
// \MailSo\Mime\Enumerations\Header::IN_REPLY_TO,
|
||||
// \MailSo\Mime\Enumerations\Header::DATE,
|
||||
// \MailSo\Mime\Enumerations\Header::SUBJECT,
|
||||
// \MailSo\Mime\Enumerations\Header::X_MSMAIL_PRIORITY,
|
||||
// \MailSo\Mime\Enumerations\Header::IMPORTANCE,
|
||||
// \MailSo\Mime\Enumerations\Header::X_PRIORITY,
|
||||
// \MailSo\Mime\Enumerations\Header::CONTENT_TYPE,
|
||||
// \MailSo\Mime\Enumerations\Header::REFERENCES,
|
||||
// \MailSo\Mime\Enumerations\Header::X_DRAFT_INFO,
|
||||
// ), true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1946,7 +1946,6 @@ class Actions
|
|||
|
||||
$bMainCache = false;
|
||||
$bFilesCache = false;
|
||||
$bPing = false;
|
||||
|
||||
$iOneDay1 = 60 * 60 * 23;
|
||||
$iOneDay2 = 60 * 60 * 25;
|
||||
|
|
@ -1958,7 +1957,6 @@ class Actions
|
|||
|
||||
$iMainCacheTime = !empty($aTimers[0]) && \is_numeric($aTimers[0]) ? (int) $aTimers[0] : 0;
|
||||
$iFilesCacheTime = !empty($aTimers[1]) && \is_numeric($aTimers[1]) ? (int) $aTimers[1] : 0;
|
||||
$iPingTime = !empty($aTimers[2]) && \is_numeric($aTimers[2]) ? (int) $aTimers[2] : 0;
|
||||
|
||||
if (0 === $iMainCacheTime || $iMainCacheTime + $iOneDay1 < \time())
|
||||
{
|
||||
|
|
@ -1972,19 +1970,13 @@ class Actions
|
|||
$iFilesCacheTime = \time();
|
||||
}
|
||||
|
||||
if (0 === $iPingTime || $iPingTime + $iOneDay1 < \time())
|
||||
{
|
||||
$bPing = true;
|
||||
$iPingTime = \time();
|
||||
}
|
||||
|
||||
if ($bMainCache || $bFilesCache || $bPing)
|
||||
if ($bMainCache || $bFilesCache)
|
||||
{
|
||||
if (!$this->StorageProvider()->Put(null,
|
||||
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, 'Cache/Timers',
|
||||
\implode(',', array($iMainCacheTime, $iFilesCacheTime, $iPingTime))))
|
||||
\implode(',', array($iMainCacheTime, $iFilesCacheTime))))
|
||||
{
|
||||
$bMainCache = $bFilesCache = $bPing = false;
|
||||
$bMainCache = $bFilesCache = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2002,11 +1994,6 @@ class Actions
|
|||
$this->Logger()->Write('Files GC: End');
|
||||
}
|
||||
|
||||
if ($bPing)
|
||||
{
|
||||
$this->KeenIO('Ping');
|
||||
}
|
||||
|
||||
$this->Plugins()->RunHook('service.app-delay-start-end');
|
||||
|
||||
return $this->TrueResponse(__FUNCTION__);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue