diff --git a/dev/External/ko.js b/dev/External/ko.js index e1eb703d7..ddf73386e 100644 --- a/dev/External/ko.js +++ b/dev/External/ko.js @@ -114,6 +114,13 @@ else { $(oElement).data('tooltip3-data', sValue).tooltip('show'); + + _.delay(function () { + if ($(oElement).is(':visible')) + { + $(oElement).tooltip('show'); + } + }, 100); } } }; diff --git a/dev/Styles/AdminDomain.less b/dev/Styles/AdminDomain.less index 3cf6f0be6..1dd3467a7 100644 --- a/dev/Styles/AdminDomain.less +++ b/dev/Styles/AdminDomain.less @@ -30,14 +30,14 @@ } .testing-done { - .imap-header, .smtp-header { + &.imap-header, &.sieve-header, &.smtp-header { color: green; font-weight: bold; } } .testing-error { - .imap-header, .smtp-header { + &.imap-header, &.sieve-header, &.smtp-header { color: red; } } diff --git a/dev/View/Popup/Domain.js b/dev/View/Popup/Domain.js index 4bc748f6d..ff154753d 100644 --- a/dev/View/Popup/Domain.js +++ b/dev/View/Popup/Domain.js @@ -36,8 +36,10 @@ this.testing = ko.observable(false); this.testingDone = ko.observable(false); this.testingImapError = ko.observable(false); + this.testingSieveError = ko.observable(false); this.testingSmtpError = ko.observable(false); this.testingImapErrorDesc = ko.observable(''); + this.testingSieveErrorDesc = ko.observable(''); this.testingSmtpErrorDesc = ko.observable(''); this.testingImapError.subscribe(function (bValue) { @@ -47,6 +49,13 @@ } }, this); + this.testingSieveError.subscribe(function (bValue) { + if (!bValue) + { + this.testingSieveErrorDesc(''); + } + }, this); + this.testingSmtpError.subscribe(function (bValue) { if (!bValue) { @@ -54,9 +63,6 @@ } }, this); - this.testingImapErrorDesc = ko.observable(''); - this.testingSmtpErrorDesc = ko.observable(''); - this.imapServerFocus = ko.observable(false); this.sieveServerFocus = ko.observable(false); this.smtpServerFocus = ko.observable(false); @@ -147,7 +153,6 @@ this.testConnectionCommand = Utils.createCommand(this, function () { this.page('main'); - this.sieveSettings(false); this.testingDone(false); this.testingImapError(false); @@ -277,12 +282,19 @@ this.testing(false); if (Enums.StorageResultType.Success === sResult && oData.Result) { + var + bImap = false, + bSieve = false + ; + this.testingDone(true); this.testingImapError(true !== oData.Result.Imap); this.testingSmtpError(true !== oData.Result.Smtp); + this.testingSieveError(true !== oData.Result.Sieve); if (this.testingImapError() && oData.Result.Imap) { + bImap = true; this.testingImapErrorDesc(oData.Result.Imap); } @@ -290,11 +302,28 @@ { this.testingSmtpErrorDesc(oData.Result.Smtp); } + + if (this.testingSieveError() && oData.Result.Sieve) + { + bSieve = true; + this.testingSieveErrorDesc(oData.Result.Sieve); + } + + if (bImap) + { + this.sieveSettings(false); + } + else if (bSieve) + { + this.sieveSettings(true); + } } else { this.testingImapError(true); this.testingSmtpError(true); + this.testingSieveError(true); + this.sieveSettings(false); } }; @@ -325,6 +354,7 @@ this.testingDone(false); this.testingImapError(false); this.testingSmtpError(false); + this.testingSieveError(false); }; DomainPopupView.prototype.onHide = function () diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index 3de0a3ea5..204d4fadc 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -3150,9 +3150,12 @@ class Actions $sImapErrorDesc = ''; $bSmtpResult = false; $sSmtpErrorDesc = ''; + $bSieveResult = false; + $sSieveErrorDesc = ''; $iImapTime = 0; $iSmtpTime = 0; + $iSieveTime = 0; $iConnectionTimeout = 5; @@ -3230,11 +3233,42 @@ class Actions $sSmtpErrorDesc = $oException->getMessage(); } } + + try + { + $oSieveClient = \MailSo\Sieve\ManageSieveClient::NewInstance()->SetLogger($this->Logger()); + $oSieveClient->SetTimeOuts($iConnectionTimeout); + + $iTime = \microtime(true); + $oSieveClient->Connect($oDomain->SieveHost(), $oDomain->SievePort(), $oDomain->SieveSecure(), + !!$this->Config()->Get('ssl', 'verify_certificate', false), + !!$this->Config()->Get('ssl', 'allow_self_signed', true) + ); + + $iSieveTime = \microtime(true) - $iTime; + $oSieveClient->Disconnect(); + $bSieveResult = true; + } + catch (\MailSo\Net\Exceptions\SocketCanNotConnectToHostException $oException) + { + $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); + $sSieveErrorDesc = $oException->getSocketMessage(); + if (empty($sSieveErrorDesc)) + { + $sSieveErrorDesc = $oException->getMessage(); + } + } + catch (\Exception $oException) + { + $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); + $sSieveErrorDesc = $oException->getMessage(); + } } return $this->DefaultResponse(__FUNCTION__, array( 'Imap' => $bImapResult ? true : $sImapErrorDesc, - 'Smtp' => $bSmtpResult ? true : $sSmtpErrorDesc + 'Smtp' => $bSmtpResult ? true : $sSmtpErrorDesc, + 'Sieve' => $bSieveResult ? true : $sSieveErrorDesc )); } diff --git a/rainloop/v/0.0.0/app/templates/Views/Admin/PopupsDomain.html b/rainloop/v/0.0.0/app/templates/Views/Admin/PopupsDomain.html index 9f0a7c14a..b1f4ad5eb 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Admin/PopupsDomain.html +++ b/rainloop/v/0.0.0/app/templates/Views/Admin/PopupsDomain.html @@ -18,10 +18,15 @@