Moved application.ini sieve_auth_plain_initial to per domain config

This commit is contained in:
the-djmaze 2024-03-24 16:49:00 +01:00
parent 3513669412
commit b3c10190cb
5 changed files with 15 additions and 12 deletions

View file

@ -45,6 +45,7 @@ const
sievePort: 4190, sievePort: 4190,
sieveType: 0, sieveType: 0,
sieveTimeout: 10, sieveTimeout: 10,
sieveAuthLiteral: true,
smtpHost: '', smtpHost: '',
smtpPort: 25, smtpPort: 25,
@ -108,6 +109,7 @@ const
}, },
Sieve: { Sieve: {
enabled: !!oDomain.sieveEnabled(), enabled: !!oDomain.sieveEnabled(),
authLiteral: !!oDomain.sieveAuthLiteral(),
host: oDomain.sieveHost, host: oDomain.sieveHost,
port: oDomain.sievePort, port: oDomain.sievePort,
secure: pInt(oDomain.sieveType()), secure: pInt(oDomain.sieveType()),

View file

@ -21,20 +21,13 @@ class Settings extends \MailSo\Net\ConnectSettings
public bool $enabled = false; public bool $enabled = false;
public bool $authPlainLiteral = false; public bool $authLiteral = true;
public function __construct()
{
parent::__construct();
$oConfig = \RainLoop\API::Config();
$this->authPlainLiteral = !$oConfig->Get('labs', 'sieve_auth_plain_initial', true);
}
public static function fromArray(array $aSettings) : self public static function fromArray(array $aSettings) : self
{ {
$object = parent::fromArray($aSettings); $object = parent::fromArray($aSettings);
$object->enabled = !empty($aSettings['enabled']); $object->enabled = !empty($aSettings['enabled']);
// $object->authPlainLiteral = !empty($aSettings['authPlainLiteral']); $object->authLiteral = !isset($aSettings['authLiteral']) || !empty($aSettings['authLiteral']);
return $object; return $object;
} }
@ -46,7 +39,7 @@ class Settings extends \MailSo\Net\ConnectSettings
[ [
// '@Object' => 'Object/SmtpSettings', // '@Object' => 'Object/SmtpSettings',
'enabled' => $this->enabled, 'enabled' => $this->enabled,
// 'authPlainLiteral' => $this->authPlainLiteral 'authLiteral' => $this->authLiteral
] ]
); );
} }

View file

@ -134,7 +134,7 @@ class SieveClient extends \MailSo\Net\NetClient
$sAuth = $SASL->authenticate($sLogin, $sPassword, $sLoginAuthKey); $sAuth = $SASL->authenticate($sLogin, $sPassword, $sLoginAuthKey);
$this->logMask($sAuth); $this->logMask($sAuth);
if ($oSettings->authPlainLiteral) { if ($oSettings->authLiteral) {
$this->sendRaw("AUTHENTICATE \"{$type}\" {".\strlen($sAuth).'+}'); $this->sendRaw("AUTHENTICATE \"{$type}\" {".\strlen($sAuth).'+}');
$this->sendRaw($sAuth); $this->sendRaw($sAuth);
} else { } else {

View file

@ -420,7 +420,6 @@ Enables caching in the system'),
'login_fault_delay' => array(5, 'When login fails, wait N seconds before responding'), 'login_fault_delay' => array(5, 'When login fails, wait N seconds before responding'),
'log_ajax_response_write_limit' => array(300), 'log_ajax_response_write_limit' => array(300),
'smtp_show_server_errors' => array(false), 'smtp_show_server_errors' => array(false),
'sieve_auth_plain_initial' => array(true),
'mail_func_clear_headers' => array(true, 'PHP mail() remove To and Subject headers'), 'mail_func_clear_headers' => array(true, 'PHP mail() remove To and Subject headers'),
'mail_func_additional_parameters' => array(false, 'PHP mail() set -f emailaddress'), 'mail_func_additional_parameters' => array(false, 'PHP mail() set -f emailaddress'),
'folders_spec_limit' => array(50), 'folders_spec_limit' => array(50),

View file

@ -272,6 +272,15 @@
<input name="Sieve[timeout]" type="number" min="5" step="1" style="width:6em" data-bind="textInput: sieveTimeout"> <input name="Sieve[timeout]" type="number" min="5" step="1" style="width:6em" data-bind="textInput: sieveTimeout">
</div> </div>
</div> </div>
<h4 data-i18n="LOGIN/LABEL_LOGIN"></h4>
<div data-bind="component: {
name: 'Checkbox',
params: {
value: sieveAuthLiteral,
label: 'Use LITERAL+'
}
}"></div>
</div> </div>
</div> </div>