mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Fixed domain popup saving
This commit is contained in:
parent
cb50320db4
commit
2feee6d1dd
4 changed files with 39 additions and 28 deletions
|
|
@ -81,11 +81,11 @@
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
this.domainIsComputed = ko.computed(function () {
|
this.domainIsComputed = ko.computed(function () {
|
||||||
|
var bPhpMail = this.smtpPhpMail();
|
||||||
return '' !== this.name() &&
|
return '' !== this.name() &&
|
||||||
'' !== this.imapServer() &&
|
'' !== this.imapServer() &&
|
||||||
'' !== this.imapPort() &&
|
'' !== this.imapPort() &&
|
||||||
'' !== this.smtpServer() &&
|
(('' !== this.smtpServer() && '' !== this.smtpPort()) || bPhpMail);
|
||||||
'' !== this.smtpPort();
|
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
this.canBeTested = ko.computed(function () {
|
this.canBeTested = ko.computed(function () {
|
||||||
|
|
|
||||||
|
|
@ -2989,32 +2989,44 @@ class Actions
|
||||||
$sImapErrorDesc = $oException->getMessage();
|
$sImapErrorDesc = $oException->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
if ($oDomain->OutUsePhpMail())
|
||||||
{
|
{
|
||||||
$oSmtpClient = \MailSo\Smtp\SmtpClient::NewInstance()->SetLogger($this->Logger());
|
$bSmtpResult = \MailSo\Base\Utils::FunctionExistsAndEnabled('mail');
|
||||||
$oSmtpClient->SetTimeOuts(5);
|
$bSmtpResult = false;
|
||||||
|
if (!$bSmtpResult)
|
||||||
$iTime = \microtime(true);
|
|
||||||
$oSmtpClient->Connect($oDomain->OutHost(), $oDomain->OutPort(), '127.0.0.1',
|
|
||||||
$oDomain->OutSecure(), !!$this->Config()->Get('ssl', 'verify_certificate'));
|
|
||||||
|
|
||||||
$iSmtpTime = \microtime(true) - $iTime;
|
|
||||||
$oSmtpClient->Disconnect();
|
|
||||||
$bSmtpResult = true;
|
|
||||||
}
|
|
||||||
catch (\MailSo\Net\Exceptions\SocketCanNotConnectToHostException $oException)
|
|
||||||
{
|
|
||||||
$this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR);
|
|
||||||
$sSmtpErrorDesc = $oException->getSocketMessage();
|
|
||||||
if (empty($sSmtpErrorDesc))
|
|
||||||
{
|
{
|
||||||
$sSmtpErrorDesc = $oException->getMessage();
|
$sSmtpErrorDesc = 'PHP: mail() function is undefined';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (\Exception $oException)
|
else
|
||||||
{
|
{
|
||||||
$this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR);
|
try
|
||||||
$sSmtpErrorDesc = $oException->getMessage();
|
{
|
||||||
|
$oSmtpClient = \MailSo\Smtp\SmtpClient::NewInstance()->SetLogger($this->Logger());
|
||||||
|
$oSmtpClient->SetTimeOuts(5);
|
||||||
|
|
||||||
|
$iTime = \microtime(true);
|
||||||
|
$oSmtpClient->Connect($oDomain->OutHost(), $oDomain->OutPort(), '127.0.0.1',
|
||||||
|
$oDomain->OutSecure(), !!$this->Config()->Get('ssl', 'verify_certificate'));
|
||||||
|
|
||||||
|
$iSmtpTime = \microtime(true) - $iTime;
|
||||||
|
$oSmtpClient->Disconnect();
|
||||||
|
$bSmtpResult = true;
|
||||||
|
}
|
||||||
|
catch (\MailSo\Net\Exceptions\SocketCanNotConnectToHostException $oException)
|
||||||
|
{
|
||||||
|
$this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR);
|
||||||
|
$sSmtpErrorDesc = $oException->getSocketMessage();
|
||||||
|
if (empty($sSmtpErrorDesc))
|
||||||
|
{
|
||||||
|
$sSmtpErrorDesc = $oException->getMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (\Exception $oException)
|
||||||
|
{
|
||||||
|
$this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR);
|
||||||
|
$sSmtpErrorDesc = $oException->getMessage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,16 +136,15 @@ class Domain
|
||||||
{
|
{
|
||||||
$oDomain = null;
|
$oDomain = null;
|
||||||
|
|
||||||
if (0 < \strlen($sName) && \is_array($aDomain) && 0 < \strlen($aDomain['imap_host']) && 0 < \strlen($aDomain['imap_port']) &&
|
if (0 < \strlen($sName) && \is_array($aDomain) && 0 < \strlen($aDomain['imap_host']) && 0 < \strlen($aDomain['imap_port']))
|
||||||
0 < \strlen($aDomain['smtp_host']) && 0 < \strlen($aDomain['smtp_port']))
|
|
||||||
{
|
{
|
||||||
$sIncHost = (string) $aDomain['imap_host'];
|
$sIncHost = (string) $aDomain['imap_host'];
|
||||||
$iIncPort = (int) $aDomain['imap_port'];
|
$iIncPort = (int) $aDomain['imap_port'];
|
||||||
$iIncSecure = self::StrConnectionSecurityTypeToCons(
|
$iIncSecure = self::StrConnectionSecurityTypeToCons(
|
||||||
!empty($aDomain['imap_secure']) ? $aDomain['imap_secure'] : '');
|
!empty($aDomain['imap_secure']) ? $aDomain['imap_secure'] : '');
|
||||||
|
|
||||||
$sOutHost = (string) $aDomain['smtp_host'];
|
$sOutHost = empty($aDomain['smtp_host']) ? '' : (string) $aDomain['smtp_host'];
|
||||||
$iOutPort = (int) $aDomain['smtp_port'];
|
$iOutPort = empty($aDomain['smtp_port']) ? 25 : (int) $aDomain['smtp_port'];
|
||||||
$iOutSecure = self::StrConnectionSecurityTypeToCons(
|
$iOutSecure = self::StrConnectionSecurityTypeToCons(
|
||||||
!empty($aDomain['smtp_secure']) ? $aDomain['smtp_secure'] : '');
|
!empty($aDomain['smtp_secure']) ? $aDomain['smtp_secure'] : '');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@
|
||||||
name: 'Checkbox',
|
name: 'Checkbox',
|
||||||
params: {
|
params: {
|
||||||
enable: capa,
|
enable: capa,
|
||||||
label: 'Show "Powered by RainLoop" link (White Labeling)',
|
label: 'Show "Powered by RainLoop" link',
|
||||||
value: loginPowered
|
value: loginPowered
|
||||||
}
|
}
|
||||||
}"></div>
|
}"></div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue