From c1e25dedb9dfe0626febe60e43c313da9fa73b1f Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 25 Mar 2024 19:36:39 +0100 Subject: [PATCH] Cleanup SMTP auth handling --- .../v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php | 1 - .../v/0.0.0/app/libraries/RainLoop/Model/Account.php | 9 +++------ .../v/0.0.0/app/templates/Views/Admin/PopupsDomain.html | 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php index 721ed989c..540d69886 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php @@ -106,7 +106,6 @@ trait UserAuth } $this->Plugins()->RunHook('login.credentials', array(&$sEmail, &$sLogin, &$sPassword)); - $this->logMask($sPassword); $oPassword->setValue($sPassword); } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Account.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Account.php index 4c1c173b1..6f55b8ba7 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Account.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Account.php @@ -70,12 +70,9 @@ abstract class Account implements \JsonSerializable $this->oPassword = $oPassword; } - public function SetSmtpPassword( - #[\SensitiveParameter] - string $sPassword - ) : void + public function SetSmtpPassword(SensitiveString $oPassword) : void { - $this->oSmtpPassword = new SensitiveString($sPassword); + $this->oSmtpPassword = $oPassword; } #[\ReturnTypeWillChange] @@ -169,7 +166,7 @@ abstract class Account implements \JsonSerializable // init smtp user/password if (isset($aAccountHash['smtp'])) { $oAccount->sSmtpLogin = $aAccountHash['smtp']['user']; - $oAccount->SetSmtpPassword($aAccountHash['smtp']['pass']); + $oAccount->SetSmtpPassword(new SensitiveString($aAccountHash['smtp']['pass'])); } } } diff --git a/snappymail/v/0.0.0/app/templates/Views/Admin/PopupsDomain.html b/snappymail/v/0.0.0/app/templates/Views/Admin/PopupsDomain.html index f30a5ebfd..fc0628295 100644 --- a/snappymail/v/0.0.0/app/templates/Views/Admin/PopupsDomain.html +++ b/snappymail/v/0.0.0/app/templates/Views/Admin/PopupsDomain.html @@ -61,7 +61,6 @@ } }"> (user@example.com → user) - (user@example.com → user)