mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 08:27:03 +03:00
Release fixes
Additional branding options fixes (php mail functionality)
This commit is contained in:
parent
baae7f2900
commit
8f55b5c554
14 changed files with 351 additions and 159 deletions
|
|
@ -730,6 +730,64 @@ END;
|
|||
return $sValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sIncHeaders
|
||||
* @param string $aHeadersToRemove = array()
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function RemoveHeaderFromHeaders($sIncHeaders, $aHeadersToRemove = array())
|
||||
{
|
||||
$sResultHeaders = $sIncHeaders;
|
||||
|
||||
if (\is_array($aHeadersToRemove) && 0 < \count($aHeadersToRemove))
|
||||
{
|
||||
$aHeadersToRemove = \array_map('strtolower', $aHeadersToRemove);
|
||||
|
||||
$sIncHeaders = \preg_replace('/[\r\n]+/', "\n", $sIncHeaders);
|
||||
$aHeaders = \explode("\n", $sIncHeaders);
|
||||
|
||||
$bSkip = false;
|
||||
$aResult = array();
|
||||
|
||||
foreach ($aHeaders as $sLine)
|
||||
{
|
||||
if (0 < \strlen($sLine))
|
||||
{
|
||||
$sFirst = $sLine{1};
|
||||
if (' ' === $sFirst || "\t" === $sFirst)
|
||||
{
|
||||
if (!$bSkip)
|
||||
{
|
||||
$aResult[] = $sLine;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$bSkip = false;
|
||||
$aParts = \explode(':', $sLine, 2);
|
||||
|
||||
if (!empty($aParts) && !empty($aParts[0]))
|
||||
{
|
||||
if (\in_array(\strtolower(\trim($aParts[0])), $aHeadersToRemove))
|
||||
{
|
||||
$bSkip = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$aResult[] = $sLine;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sResultHeaders = \implode("\r\n", $aResult);
|
||||
}
|
||||
|
||||
return $sResultHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sEncodeType
|
||||
* @param string $sValue
|
||||
|
|
|
|||
|
|
@ -716,7 +716,8 @@ class MailClient
|
|||
$sHighestModSeq = isset($aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::HIGHESTMODSEQ])
|
||||
? (string) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::HIGHESTMODSEQ] : '';
|
||||
|
||||
if ($this->IsGmail())
|
||||
if ($this->IsGmail() &&
|
||||
('INBOX' === $sFolderName || '[gmail]' === \strtolower(\substr($sFolderName, 0, 7))))
|
||||
{
|
||||
$oFolder = $this->oImapClient->FolderCurrentInformation();
|
||||
if ($oFolder && null !== $oFolder->Exists && $oFolder->FolderName === $sFolderName)
|
||||
|
|
@ -846,7 +847,8 @@ class MailClient
|
|||
$aFlags = array();
|
||||
|
||||
$bSelect = false;
|
||||
if ($this->IsGmail())
|
||||
if ($this->IsGmail() &&
|
||||
('INBOX' === $sFolderName || '[gmail]' === \strtolower(\substr($sFolderName, 0, 7))))
|
||||
{
|
||||
$this->oImapClient->FolderSelect($sFolderName);
|
||||
$bSelect = true;
|
||||
|
|
@ -1336,10 +1338,7 @@ class MailClient
|
|||
$aCriteriasResult[] = \gmdate('j-M-Y', $iTimeFilter > $iDateStampFrom ?
|
||||
$iTimeFilter : $iDateStampFrom);
|
||||
|
||||
if (0 < $iTimeFilter && $iTimeFilter > $iDateStampFrom)
|
||||
{
|
||||
$iTimeFilter = 0;
|
||||
}
|
||||
$iTimeFilter = 0;
|
||||
}
|
||||
|
||||
if (0 < $iDateStampTo)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue