Cleanup imapsync

This commit is contained in:
the-djmaze 2024-03-12 02:31:09 +01:00
parent dd662164d0
commit 521f5e0d08

View file

@ -154,8 +154,6 @@ function getImapClient(int $host)
{
global $options;
$oConfig = \RainLoop\API::Config();
$type = SecurityType::AUTO_DETECT;
if (isset($options["tls{$host}"])) {
$type = SecurityType::STARTTLS;
@ -168,6 +166,7 @@ function getImapClient(int $host)
'host' => $options["host{$host}"] ?? 'localhost',
'port' => $options["port{$host}"] ?? 143,
'type' => $type,
// 'sasl' => [],
'ssl' => []
]);
if (993 === $ImapSettings->port) {
@ -178,16 +177,7 @@ function getImapClient(int $host)
if (isset($options["timeout{$host}"])) {
$ImapSettings->timeout = (int) $options["timeout{$host}"];
}
if ($oConfig->Get('labs', 'sasl_allow_scram_sha', false)) {
\array_push($ImapSettings->SASLMechanisms, 'SCRAM-SHA3-512', 'SCRAM-SHA-512', 'SCRAM-SHA-256', 'SCRAM-SHA-1');
}
if ($oConfig->Get('labs', 'sasl_allow_cram_md5', false)) {
$ImapSettings->SASLMechanisms[] = 'CRAM-MD5';
}
if ($oConfig->Get('labs', 'sasl_allow_plain', true)) {
$ImapSettings->SASLMechanisms[] = 'PLAIN';
}
$ImapSettings->Login = $options["user{$host}"];
$ImapSettings->Login = $options["user{$host}"]; // convert to punycode?
$ImapSettings->Password = $options["password{$host}"];
// $ImapSettings1->ProxyAuthUser = '';
// $ImapSettings1->ProxyAuthPassword = '';