diff --git a/plugins/proxyauth-login-example/LICENSE b/plugins/proxyauth-login-example/LICENSE deleted file mode 100644 index 4a4ca8d815..0000000000 --- a/plugins/proxyauth-login-example/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 RainLoop Team - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/plugins/proxyauth-login-example/index.php b/plugins/proxyauth-login-example/index.php deleted file mode 100644 index e92cde71d4..0000000000 --- a/plugins/proxyauth-login-example/index.php +++ /dev/null @@ -1,43 +0,0 @@ -addHook('login.success', 'EventLoginPostLoginProvide'); - } - - /** - * @param string $sLogin - * @param string $sPassword - */ - public function isValidAccount($sLogin, $sPassword) - { - return !empty($sLogin) && !empty($sPassword); - } - - /** - * @param \RainLoop\Model\Account $oAccount - */ - public function EventLoginPostLoginProvide(MainAccount $oAccount) - { - // Verify logic - if (!$this->isValidAccount($oAccount->IncLogin(), $oAccount->IncPassword())) { - // throw a Auth Error Exception - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError); - } - - $oAccount->SetProxyAuthUser('admin@domain.com'); - $oAccount->SetProxyAuthPassword('secret-admin-password'); - } -} diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php index 7c36a0d304..80b9332c7f 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php @@ -110,17 +110,8 @@ public function Login(Settings $oSettings) : self return $this; } - if (!empty($oSettings->ProxyAuthUser) && $oSettings->ProxyAuthPassword) { - $sLogin = $oSettings->ProxyAuthUser; - $sPassword = $oSettings->ProxyAuthPassword->getValue(); - $sProxyAuthUser = $oSettings->Login; - } else { - $sLogin = $oSettings->Login; - $sPassword = $oSettings->Password; - $sProxyAuthUser = ''; - } - - $sLogin = \MailSo\Base\Utils::IdnToAscii(\MailSo\Base\Utils::Trim($sLogin)); + $sLogin = \MailSo\Base\Utils::IdnToAscii(\MailSo\Base\Utils::Trim($oSettings->Login)); + $sPassword = $oSettings->Password; if (!\strlen($sLogin) || !\strlen($sPassword)) { $this->writeLogException(new \UnexpectedValueException, \LOG_ERR); @@ -221,9 +212,6 @@ public function Login(Settings $oSettings) : self $this->setCapabilities($oResponse); - if (\strlen($sProxyAuthUser)) { - $this->SendRequestGetResponse('PROXYAUTH', array($this->EscapeString($sProxyAuthUser))); - } /* // TODO: RFC 9051 if ($this->hasCapability('IMAP4rev2')) { diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Net/ConnectSettings.php b/snappymail/v/0.0.0/app/libraries/MailSo/Net/ConnectSettings.php index 09dfc83e3e..b1169fc417 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Net/ConnectSettings.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Net/ConnectSettings.php @@ -50,8 +50,6 @@ class ConnectSettings implements \JsonSerializable ]; public string $Login = ''; private ?SensitiveString $Password = null; - public string $ProxyAuthUser = ''; - public ?SensitiveString $ProxyAuthPassword = null; public function __construct() { 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 3d5d3a1921..fd67ed8907 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 @@ -21,10 +21,6 @@ abstract class Account implements \JsonSerializable private ?SensitiveString $sSmtpPassword = null; - private string $sProxyAuthUser = ''; - - private ?SensitiveString $sProxyAuthPassword = null; - private Domain $oDomain; public function Email() : string @@ -85,19 +81,6 @@ public function SetSmtpPassword( $this->sSmtpPassword = new SensitiveString($sPassword); } - public function SetProxyAuthUser(string $sProxyAuthUser) : void - { - $this->sProxyAuthUser = $sProxyAuthUser; - } - - public function SetProxyAuthPassword( - #[\SensitiveParameter] - string $sProxyAuthPassword - ) : void - { - $this->sProxyAuthPassword = new SensitiveString($sProxyAuthPassword); - } - #[\ReturnTypeWillChange] public function jsonSerialize() { @@ -113,12 +96,6 @@ public function jsonSerialize() 'pass' => $this->sSmtpPassword->getValue() ]; } - if ($this->sProxyAuthUser && $this->sProxyAuthPassword) { - $result['proxy'] = [ - 'user' => $this->sProxyAuthUser, - 'pass' => $this->sProxyAuthPassword->getValue() - ]; - } return $result; } @@ -204,11 +181,6 @@ public static function NewInstanceFromTokenArray( $oAccount->sSmtpLogin = $aAccountHash['smtp']['user']; $oAccount->SetSmtpPassword($aAccountHash['smtp']['pass']); } - // init proxy user/password - if (isset($aAccountHash['proxy'])) { - $oAccount->sProxyAuthUser = $aAccountHash['proxy']['user']; - $oAccount->SetProxyAuthPassword($aAccountHash['proxy']['pass']); - } } } return $oAccount; @@ -290,8 +262,6 @@ private function netClientLogin(\MailSo\Net\NetClient $oClient, \RainLoop\Plugin ) */ $oSettings = $oClient->Settings; - $oSettings->ProxyAuthUser = $this->sProxyAuthUser; - $oSettings->ProxyAuthPassword = $this->sProxyAuthPassword; $client_name = \strtolower($oClient->getLogName()); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Model/AdditionalAccount.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Model/AdditionalAccount.php index 25709c8843..764e4cca83 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Model/AdditionalAccount.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Model/AdditionalAccount.php @@ -35,9 +35,6 @@ public function asTokenArray(MainAccount $oMainAccount) : array if (!empty($aData['smtp']['pass'])) { $aData['smtp']['pass'] = \SnappyMail\Crypt::EncryptUrlSafe($aData['smtp']['pass'], $sHash); } - if (!empty($aData['proxy']['pass'])) { - $aData['proxy']['pass'] = \SnappyMail\Crypt::EncryptUrlSafe($aData['proxy']['pass'], $sHash); // sProxyAuthPassword - } $aData['hmac'] = \hash_hmac('sha1', $aData['pass'], $sHash); return $aData; } @@ -58,17 +55,11 @@ public static function NewInstanceFromTokenArray( if (!empty($aData['smtp']['pass'])) { $aAccountHash['smtp']['pass'] = \SnappyMail\Crypt::DecryptUrlSafe($aAccountHash['smtp']['pass'], $sHash); } - if (!empty($aData['proxy']['pass'])) { - $aAccountHash['proxy']['pass'] = \SnappyMail\Crypt::DecryptUrlSafe($aAccountHash['proxy']['pass'], $sHash); - } } else { $aAccountHash['pass'] = ''; if (!empty($aData['smtp']['pass'])) { $aAccountHash['smtp']['pass'] = ''; } - if (!empty($aData['proxy']['pass'])) { - $aAccountHash['proxy']['pass'] = ''; - } } } return parent::NewInstanceFromTokenArray($oActions, $aAccountHash, $bThrowExceptionOnFalse); diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/upgrade.php b/snappymail/v/0.0.0/app/libraries/snappymail/upgrade.php index a710a7dd9e..5f9051cbf7 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/upgrade.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/upgrade.php @@ -93,12 +93,6 @@ public static function ConvertInsecureAccounts(\RainLoop\Actions $oActions, \Rai 'pass' => $aAccountHash[3], 'hmac' => \hash_hmac('sha1', $aAccountHash[3], $sHash) ]; - if ($aAccountHash[8] && $aAccountHash[9]) { - $aNewAccounts[$sEmail]['proxy'] = [ - 'user' => $aAccount[5], - 'pass' => $aAccount[6] - ]; - } } catch (\Throwable $e) { \SnappyMail\Log::warning('UPGRADE', "ConvertInsecureAccount {$sEmail} failed"); } diff --git a/snappymail/v/0.0.0/imapsync.php b/snappymail/v/0.0.0/imapsync.php index 8000dabbce..e7beb11784 100755 --- a/snappymail/v/0.0.0/imapsync.php +++ b/snappymail/v/0.0.0/imapsync.php @@ -179,8 +179,6 @@ function getImapClient(int $host) } $ImapSettings->Login = $options["user{$host}"]; // convert to punycode? $ImapSettings->Password = $options["password{$host}"]; -// $ImapSettings1->ProxyAuthUser = ''; -// $ImapSettings1->ProxyAuthPassword = ''; $ImapSettings->useAuth = true; $oImapClient = new \MailSo\Imap\ImapClient;