Sieve is always UTF-8

This commit is contained in:
djmaze 2021-11-23 09:05:42 +01:00
parent afcd76adbf
commit 769ac33bcd
3 changed files with 2 additions and 14 deletions

View file

@ -349,7 +349,6 @@ Enables caching in the system'),
'smtp_show_server_errors' => array(false),
'smtp_use_auth_plain' => array(true),
'smtp_use_auth_cram_md5' => array(false),
'sieve_utf8_folder_name' => array(true),
'sieve_auth_plain_initial' => array(true),
'sieve_allow_fileinto_inbox' => array(false),
'imap_timeout' => array(300),

View file

@ -6,8 +6,6 @@ class Sieve
{
const NEW_LINE = "\r\n";
public static $bUtf8FolderName = true;
public static function collectionToFileString(array $aFilters) : string
{
$sNL = static::NEW_LINE;
@ -353,17 +351,9 @@ class Sieve
}
break;
case Enumerations\ActionType::MOVE_TO:
$sValue = $oFilter->ActionValue();
if (\strlen($sValue))
$sFolderName = $oFilter->ActionValue();
if (\strlen($sFolderName))
{
$sFolderName = $sValue; // utf7-imap
if (static::$bUtf8FolderName) // to utf-8
{
$sFolderName = \MailSo\Base\Utils::ConvertEncoding($sFolderName,
\MailSo\Base\Enumerations\Charset::UTF_7_IMAP,
\MailSo\Base\Enumerations\Charset::UTF_8);
}
$aCapa['fileinto'] = true;
$aResult[] = $sTab.'fileinto "'.static::quote($sFolderName).'";';
if ($oFilter->Stop())

View file

@ -84,7 +84,6 @@ class SieveStorage implements FiltersInterface
public function Save(\RainLoop\Model\Account $oAccount, string $sScriptName, array $aFilters, string $sRaw = '') : bool
{
if ($aFilters && !$sRaw) {
Sieve::$bUtf8FolderName = !!$this->oConfig->Get('labs', 'sieve_utf8_folder_name', true);
$sRaw = Sieve::collectionToFileString($aFilters);
}
$oSieveClient = $this->getConnection($oAccount);