mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
Set timeout defaults
This commit is contained in:
parent
d756558303
commit
5394599a9d
4 changed files with 13 additions and 8 deletions
|
|
@ -18,7 +18,8 @@ namespace MailSo\Imap;
|
|||
class Settings extends \MailSo\Net\ConnectSettings
|
||||
{
|
||||
public int
|
||||
$port = 143;
|
||||
$port = 143,
|
||||
$timeout = 300;
|
||||
|
||||
public bool
|
||||
$disable_list_status = false,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ class ConnectSettings implements \JsonSerializable
|
|||
$object->host = $aSettings['host'];
|
||||
$object->port = $aSettings['port'];
|
||||
$object->type = isset($aSettings['type']) ? $aSettings['type'] : $aSettings['secure'];
|
||||
$object->timeout = isset($aSettings['timeout']) ? $aSettings['timeout'] : 300;
|
||||
if (isset($aSettings['timeout'])) {
|
||||
$object->timeout = $aSettings['timeout'];
|
||||
}
|
||||
$object->shortLogin = !empty($aSettings['shortLogin']);
|
||||
$object->ssl = SSLContext::fromArray($aSettings['ssl'] ?? []);
|
||||
return $object;
|
||||
|
|
|
|||
|
|
@ -17,11 +17,13 @@ namespace MailSo\Smtp;
|
|||
*/
|
||||
class Settings extends \MailSo\Net\ConnectSettings
|
||||
{
|
||||
public int $port = 25;
|
||||
public int
|
||||
$port = 25,
|
||||
$timeout = 60;
|
||||
|
||||
public bool $usePhpMail = false;
|
||||
|
||||
public bool $setSender = false;
|
||||
public bool
|
||||
$usePhpMail = false,
|
||||
$setSender = false;
|
||||
|
||||
public string $Ehlo;
|
||||
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ abstract class Account implements \JsonSerializable
|
|||
public function SmtpConnectAndLoginHelper(\RainLoop\Plugins\Manager $oPlugins, \MailSo\Smtp\SmtpClient $oSmtpClient, \RainLoop\Config\Application $oConfig, bool &$bUsePhpMail = false) : bool
|
||||
{
|
||||
$oSettings = $this->Domain()->SmtpSettings();
|
||||
$oSettings->timeout = \max($oSettings->timeout, (int) $oConfig->Get('labs', 'smtp_timeout', 60));
|
||||
$oSettings->timeout = \max($oSettings->timeout, (int) $oConfig->Get('labs', 'smtp_timeout', $oSettings->timeout));
|
||||
$oSettings->Login = $this->OutLogin();
|
||||
$oSettings->usePhpMail = $bUsePhpMail;
|
||||
$oSettings->Ehlo = \MailSo\Smtp\SmtpClient::EhloHelper();
|
||||
|
|
@ -263,7 +263,7 @@ abstract class Account implements \JsonSerializable
|
|||
public function SieveConnectAndLoginHelper(\RainLoop\Plugins\Manager $oPlugins, \MailSo\Sieve\SieveClient $oSieveClient, \RainLoop\Config\Application $oConfig)
|
||||
{
|
||||
$oSettings = $this->Domain()->SieveSettings();
|
||||
$oSettings->timeout = \max($oSettings->timeout, (int) $oConfig->Get('labs', 'sieve_timeout', 10));
|
||||
$oSettings->timeout = \max($oSettings->timeout, (int) $oConfig->Get('labs', 'sieve_timeout', $oSettings->timeout));
|
||||
$oSettings->Login = $this->IncLogin();
|
||||
|
||||
$oPlugins->RunHook('sieve.before-connect', array($this, $oSieveClient, $oSettings));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue