mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Added: Configurable timeouts for IMAP, SMTP and SIEVE (#843)
This commit is contained in:
parent
c6f098bd2d
commit
55e3bad890
7 changed files with 17 additions and 3 deletions
|
|
@ -76,6 +76,11 @@ class Config
|
||||||
*/
|
*/
|
||||||
public static $BoundaryPrefix = '_Part_';
|
public static $BoundaryPrefix = '_Part_';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public static $ImapTimeout = 300;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \MailSo\Log\Logger|null
|
* @var \MailSo\Log\Logger|null
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class MailClient
|
||||||
$this->oLogger = null;
|
$this->oLogger = null;
|
||||||
|
|
||||||
$this->oImapClient = \MailSo\Imap\ImapClient::NewInstance();
|
$this->oImapClient = \MailSo\Imap\ImapClient::NewInstance();
|
||||||
$this->oImapClient->SetTimeOuts(10, 300); // TODO
|
$this->oImapClient->SetTimeOuts(10, \MailSo\Config::$ImapTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -165,8 +165,8 @@ abstract class NetClient
|
||||||
*/
|
*/
|
||||||
public function SetTimeOuts($iConnectTimeOut = 10, $iSocketTimeOut = 10)
|
public function SetTimeOuts($iConnectTimeOut = 10, $iSocketTimeOut = 10)
|
||||||
{
|
{
|
||||||
$this->iConnectTimeOut = $iConnectTimeOut;
|
$this->iConnectTimeOut = 5 < $iConnectTimeOut ? $iConnectTimeOut : 5;
|
||||||
$this->iSocketTimeOut = $iSocketTimeOut;
|
$this->iSocketTimeOut = 5 < $iSocketTimeOut ? $iSocketTimeOut : 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -6102,6 +6102,7 @@ class Actions
|
||||||
$bUsePhpMail = $oAccount->Domain()->OutUsePhpMail();
|
$bUsePhpMail = $oAccount->Domain()->OutUsePhpMail();
|
||||||
|
|
||||||
$oSmtpClient = \MailSo\Smtp\SmtpClient::NewInstance()->SetLogger($this->Logger());
|
$oSmtpClient = \MailSo\Smtp\SmtpClient::NewInstance()->SetLogger($this->Logger());
|
||||||
|
$oSmtpClient->SetTimeOuts(10, (int) \RainLoop\Api::Config()->Get('labs', 'smtp_timeout', 60));
|
||||||
|
|
||||||
$bLoggined = $oAccount->OutConnectAndLoginHelper($this->Plugins(), $oSmtpClient, $this->Config(), $bUsePhpMail);
|
$bLoggined = $oAccount->OutConnectAndLoginHelper($this->Plugins(), $oSmtpClient, $this->Config(), $bUsePhpMail);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,9 @@ class Api
|
||||||
\MailSo\Config::$LargeThreadLimit =
|
\MailSo\Config::$LargeThreadLimit =
|
||||||
(int) \RainLoop\Api::Config()->Get('labs', 'imap_large_thread_limit', 50);
|
(int) \RainLoop\Api::Config()->Get('labs', 'imap_large_thread_limit', 50);
|
||||||
|
|
||||||
|
\MailSo\Config::$ImapTimeout =
|
||||||
|
(int) \RainLoop\Api::Config()->Get('labs', 'imap_timeout', 300);
|
||||||
|
|
||||||
\MailSo\Config::$BoundaryPrefix = '_RainLoop_';
|
\MailSo\Config::$BoundaryPrefix = '_RainLoop_';
|
||||||
|
|
||||||
\MailSo\Config::$SystemLogger = \RainLoop\Api::Logger();
|
\MailSo\Config::$SystemLogger = \RainLoop\Api::Logger();
|
||||||
|
|
|
||||||
|
|
@ -330,6 +330,9 @@ Enables caching in the system'),
|
||||||
'smtp_show_server_errors' => array(false),
|
'smtp_show_server_errors' => array(false),
|
||||||
'sieve_allow_raw_script' => array(false),
|
'sieve_allow_raw_script' => array(false),
|
||||||
'sieve_utf8_folder_name' => array(true),
|
'sieve_utf8_folder_name' => array(true),
|
||||||
|
'imap_timeout' => array(300),
|
||||||
|
'smtp_timeout' => array(60),
|
||||||
|
'sieve_timeout' => array(10),
|
||||||
'mail_func_clear_headers' => array(true),
|
'mail_func_clear_headers' => array(true),
|
||||||
'mail_func_additional_parameters' => array(false),
|
'mail_func_additional_parameters' => array(false),
|
||||||
'favicon_status' => array(true),
|
'favicon_status' => array(true),
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface
|
||||||
$aFilters = array();
|
$aFilters = array();
|
||||||
|
|
||||||
$oSieveClient = \MailSo\Sieve\ManageSieveClient::NewInstance()->SetLogger($this->oLogger);
|
$oSieveClient = \MailSo\Sieve\ManageSieveClient::NewInstance()->SetLogger($this->oLogger);
|
||||||
|
$oSieveClient->SetTimeOuts(10, (int) \RainLoop\Api::Config()->Get('labs', 'sieve_timeout', 10));
|
||||||
|
|
||||||
if ($oAccount->SieveConnectAndLoginHelper($this->oPlugins, $oSieveClient, $this->oConfig))
|
if ($oAccount->SieveConnectAndLoginHelper($this->oPlugins, $oSieveClient, $this->oConfig))
|
||||||
{
|
{
|
||||||
|
|
@ -114,6 +115,7 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface
|
||||||
public function Save($oAccount, $aFilters, $sRaw = '', $bRawIsActive = false)
|
public function Save($oAccount, $aFilters, $sRaw = '', $bRawIsActive = false)
|
||||||
{
|
{
|
||||||
$oSieveClient = \MailSo\Sieve\ManageSieveClient::NewInstance()->SetLogger($this->oLogger);
|
$oSieveClient = \MailSo\Sieve\ManageSieveClient::NewInstance()->SetLogger($this->oLogger);
|
||||||
|
$oSieveClient->SetTimeOuts(10, (int) \RainLoop\Api::Config()->Get('labs', 'sieve_timeout', 10));
|
||||||
|
|
||||||
if ($oAccount->SieveConnectAndLoginHelper($this->oPlugins, $oSieveClient, $this->oConfig))
|
if ($oAccount->SieveConnectAndLoginHelper($this->oPlugins, $oSieveClient, $this->oConfig))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue