diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index 619f06ea4..6ff13d3c1 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -265,11 +265,11 @@ class Actions if ($oAccount) { $oDomain = $oAccount->Domain(); - $sLine = \str_replace('{imap:login}', $oAccount->IncLogin(), $sLine); + $sLine = \str_replace('{imap:login}', $oAccount->ImapUser(), $sLine); $sLine = \str_replace('{imap:host}', $oDomain->ImapSettings()->host, $sLine); $sLine = \str_replace('{imap:port}', $oDomain->ImapSettings()->port, $sLine); - $sLine = \str_replace('{smtp:login}', $oAccount->OutLogin(), $sLine); + $sLine = \str_replace('{smtp:login}', $oAccount->SmtpUser(), $sLine); $sLine = \str_replace('{smtp:host}', $oDomain->SmtpSettings()->host, $sLine); $sLine = \str_replace('{smtp:port}', $oDomain->SmtpSettings()->port, $sLine); } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php index 07145138e..9215c1760 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php @@ -553,7 +553,7 @@ trait Messages } if ($oMessage) { - $ETag = $oMessage->ETag($this->getAccountFromToken()->IncLogin()); + $ETag = $oMessage->ETag($this->getAccountFromToken()->ImapUser()); $this->verifyCacheByKey($ETag); $this->Plugins()->RunHook('filter.result-message', array($oMessage)); $this->cacheByKey($ETag); 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 d8d76e4a6..1648f2785 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 @@ -13,7 +13,7 @@ abstract class Account implements \JsonSerializable private string $sEmail = ''; - private string $sLogin = ''; + private string $sImapUser = ''; private ?SensitiveString $oPassword = null; @@ -35,8 +35,12 @@ abstract class Account implements \JsonSerializable public function IncLogin() : string { -// return $this->oDomain->ImapSettings()->fixUsername($this->sLogin); - return $this->sLogin; + return $this->ImapUser(); + } + public function ImapUser() : string + { +// return $this->oDomain->ImapSettings()->fixUsername($this->sImapUser); + return $this->sImapUser; } public function IncPassword() : string @@ -45,6 +49,10 @@ abstract class Account implements \JsonSerializable } public function OutLogin() : string + { + return $this->SmtpUser(); + } + public function SmtpUser() : string { // return $this->oDomain->SmtpSettings()->fixUsername($this->sSmtpUser ?: $this->sEmail); return $this->sSmtpUser ?: $this->sEmail; @@ -59,7 +67,7 @@ abstract class Account implements \JsonSerializable { return \sha1(\implode(APP_SALT, [ $this->sEmail, - $this->sLogin, + $this->sImapUser, // \json_encode($this->Domain()), // $this->oPassword ])); @@ -80,7 +88,7 @@ abstract class Account implements \JsonSerializable { $result = [ 'email' => $this->sEmail, - 'login' => $this->sLogin, + 'login' => $this->sImapUser, 'pass' => $this->IncPassword(), 'name' => $this->sName ]; @@ -106,7 +114,7 @@ abstract class Account implements \JsonSerializable $oAccount = new static; $oAccount->sEmail = \SnappyMail\IDN::emailToAscii($sEmail); - $oAccount->sLogin = \SnappyMail\IDN::emailToAscii($sLogin); + $oAccount->sImapUser = \SnappyMail\IDN::emailToAscii($sLogin); $oAccount->SetPassword($oPassword); $oAccount->oDomain = $oDomain; @@ -177,7 +185,7 @@ abstract class Account implements \JsonSerializable { $oSettings = $this->Domain()->ImapSettings(); $oSettings->timeout = \max($oSettings->timeout, (int) $oConfig->Get('imap', 'timeout', $oSettings->timeout)); - $oSettings->username = $this->IncLogin(); + $oSettings->username = $this->ImapUser(); $oSettings->expunge_all_on_delete |= !!$oConfig->Get('imap', 'use_expunge_all_on_delete', false); $oSettings->fast_simple_search = !(!$oSettings->fast_simple_search || !$oConfig->Get('imap', 'message_list_fast_simple_search', true)); @@ -201,7 +209,7 @@ abstract class Account implements \JsonSerializable public function SmtpConnectAndLogin(\RainLoop\Plugins\Manager $oPlugins, \MailSo\Smtp\SmtpClient $oSmtpClient) : bool { $oSettings = $this->Domain()->SmtpSettings(); - $oSettings->username = $this->OutLogin(); + $oSettings->username = $this->SmtpUser(); $oSettings->Ehlo = \MailSo\Smtp\SmtpClient::EhloHelper(); $oSmtpClient->Settings = $oSettings; @@ -225,7 +233,7 @@ abstract class Account implements \JsonSerializable public function SieveConnectAndLogin(\RainLoop\Plugins\Manager $oPlugins, \MailSo\Sieve\SieveClient $oSieveClient, \RainLoop\Config\Application $oConfig) { $oSettings = $this->Domain()->SieveSettings(); - $oSettings->username = $this->IncLogin(); + $oSettings->username = $this->ImapUser(); $oSieveClient->Settings = $oSettings;