mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +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;
|
global $options;
|
||||||
|
|
||||||
$oConfig = \RainLoop\API::Config();
|
|
||||||
|
|
||||||
$type = SecurityType::AUTO_DETECT;
|
$type = SecurityType::AUTO_DETECT;
|
||||||
if (isset($options["tls{$host}"])) {
|
if (isset($options["tls{$host}"])) {
|
||||||
$type = SecurityType::STARTTLS;
|
$type = SecurityType::STARTTLS;
|
||||||
|
|
@ -168,6 +166,7 @@ function getImapClient(int $host)
|
||||||
'host' => $options["host{$host}"] ?? 'localhost',
|
'host' => $options["host{$host}"] ?? 'localhost',
|
||||||
'port' => $options["port{$host}"] ?? 143,
|
'port' => $options["port{$host}"] ?? 143,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
|
// 'sasl' => [],
|
||||||
'ssl' => []
|
'ssl' => []
|
||||||
]);
|
]);
|
||||||
if (993 === $ImapSettings->port) {
|
if (993 === $ImapSettings->port) {
|
||||||
|
|
@ -178,16 +177,7 @@ function getImapClient(int $host)
|
||||||
if (isset($options["timeout{$host}"])) {
|
if (isset($options["timeout{$host}"])) {
|
||||||
$ImapSettings->timeout = (int) $options["timeout{$host}"];
|
$ImapSettings->timeout = (int) $options["timeout{$host}"];
|
||||||
}
|
}
|
||||||
if ($oConfig->Get('labs', 'sasl_allow_scram_sha', false)) {
|
$ImapSettings->Login = $options["user{$host}"]; // convert to punycode?
|
||||||
\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->Password = $options["password{$host}"];
|
$ImapSettings->Password = $options["password{$host}"];
|
||||||
// $ImapSettings1->ProxyAuthUser = '';
|
// $ImapSettings1->ProxyAuthUser = '';
|
||||||
// $ImapSettings1->ProxyAuthPassword = '';
|
// $ImapSettings1->ProxyAuthPassword = '';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue