mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-08 22:18:28 +03:00
Cleanup imapsync
This commit is contained in:
parent
dd662164d0
commit
521f5e0d08
1 changed files with 2 additions and 12 deletions
|
|
@ -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 = '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue