From 5757c06f77e89211cf1bca13f3372354ca536f46 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Fri, 13 May 2022 22:58:09 +0200 Subject: [PATCH] Resolve #391 poppassd error --- plugins/change-password-poppassd/driver.php | 20 +++++++++---------- plugins/change-password-poppassd/index.php | 4 ++-- .../app/libraries/MailSo/Net/NetClient.php | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/plugins/change-password-poppassd/driver.php b/plugins/change-password-poppassd/driver.php index 66218537e..4d49fb972 100644 --- a/plugins/change-password-poppassd/driver.php +++ b/plugins/change-password-poppassd/driver.php @@ -1,5 +1,7 @@ Connect( - $this->oConfig->Get('plugin', 'poppassd_host', ''), - (int) $this->oConfig->Get('plugin', 'poppassd_port', 106) - ); + $oSettings = new ConnectSettings; + $oSettings->host = $this->oConfig->Get('plugin', 'poppassd_host', ''); + $oSettings->port = (int) $this->oConfig->Get('plugin', 'poppassd_port', 106); + $this->Connect($oSettings); if ($this->bIsLoggined) { $this->writeLogException( @@ -77,8 +79,7 @@ class ChangePasswordPoppassdDriver extends \MailSo\Net\NetClient } - $this->Disconnect() - ; + $this->Disconnect(); return true; } @@ -93,13 +94,10 @@ class ChangePasswordPoppassdDriver extends \MailSo\Net\NetClient $bIsLoggined = false, $iRequestTime = 0; - public function Connect(string $sServerName, int $iPort, - int $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT, - bool $bVerifySsl = false, bool $bAllowSelfSigned = true, - string $sClientCert = '') : void + public function Connect(ConnectSettings $oSettings) : void { $this->iRequestTime = \microtime(true); - parent::Connect($sServerName, $iPort, $iSecurityType, $bVerifySsl, $bAllowSelfSigned, $sClientCert); + parent::Connect($oSettings); $this->validateResponse(); } diff --git a/plugins/change-password-poppassd/index.php b/plugins/change-password-poppassd/index.php index cc5fe7866..007b671c7 100644 --- a/plugins/change-password-poppassd/index.php +++ b/plugins/change-password-poppassd/index.php @@ -6,9 +6,9 @@ class ChangePasswordPoppassdPlugin extends \RainLoop\Plugins\AbstractPlugin { const NAME = 'Change Password Poppassd', - VERSION = '2.14', + VERSION = '2.15', RELEASE = '2022-04-28', - REQUIRED = '2.12.0', + REQUIRED = '2.15.3', CATEGORY = 'Security', DESCRIPTION = 'Extension to allow users to change their passwords through Poppassd'; diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Net/NetClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Net/NetClient.php index fe781a113..60610f56d 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Net/NetClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Net/NetClient.php @@ -120,7 +120,7 @@ abstract class NetClient * @throws \MailSo\Net\Exceptions\SocketAlreadyConnectedException * @throws \MailSo\Net\Exceptions\SocketCanNotConnectToHostException */ - public function Connect(ConnectSettings $oSettings) + public function Connect(ConnectSettings $oSettings) : void { $oSettings->host = \trim($oSettings->host); if (!\strlen($oSettings->host) || !\MailSo\Base\Validator::PortInt($oSettings->port)) {