mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-08 22:18:28 +03:00
SmtpClient->Connect() use $oSettings->Ehlo
This commit is contained in:
parent
353fdda3e5
commit
edcb84b4ae
3 changed files with 11 additions and 9 deletions
|
|
@ -72,14 +72,14 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
* @throws \MailSo\Net\Exceptions\*
|
||||
* @throws \MailSo\Smtp\Exceptions\*
|
||||
*/
|
||||
public function Connect(\MailSo\Net\ConnectSettings $oSettings, string $sEhloHost = '[127.0.0.1]') : void
|
||||
public function Connect(\MailSo\Net\ConnectSettings $oSettings) : void
|
||||
{
|
||||
parent::Connect($oSettings);
|
||||
|
||||
$this->validateResponse(220);
|
||||
|
||||
$this->ehloOrHelo($sEhloHost);
|
||||
$this->sEhlo = $sEhloHost;
|
||||
$this->ehloOrHelo($oSettings->Ehlo);
|
||||
$this->sEhlo = $oSettings->Ehlo;
|
||||
|
||||
if (ConnectionSecurityType::STARTTLS === $this->Settings->type
|
||||
|| (ConnectionSecurityType::AUTO_DETECT === $this->Settings->type && $this->hasCapability('STARTTLS'))) {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,8 @@ trait AdminDomains
|
|||
$oSmtpClient->SetLogger($this->Logger());
|
||||
|
||||
$oSettings = $oDomain->SmtpSettings();
|
||||
$oSmtpClient->Connect($oSettings, \MailSo\Smtp\SmtpClient::EhloHelper());
|
||||
$oSettings->Ehlo = \MailSo\Smtp\SmtpClient::EhloHelper();
|
||||
$oSmtpClient->Connect($oSettings);
|
||||
|
||||
if (!empty($aAuth['user'])) {
|
||||
$oSettings->Login = $aAuth['user'];
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ abstract class Account implements \JsonSerializable
|
|||
$oPlugins->RunHook('imap.after-connect', array($this, $oImapClient, $oSettings));
|
||||
|
||||
$oSettings->Password = $this->IncPassword();
|
||||
return $this->netClientLogin($oImapClient, $oPlugins, $oSettings);
|
||||
return $this->netClientLogin($oImapClient, $oPlugins);
|
||||
}
|
||||
|
||||
public function SmtpConnectAndLogin(\RainLoop\Plugins\Manager $oPlugins, \MailSo\Smtp\SmtpClient $oSmtpClient) : bool
|
||||
|
|
@ -251,7 +251,7 @@ abstract class Account implements \JsonSerializable
|
|||
$oSettings->useAuth = false;
|
||||
return true;
|
||||
}
|
||||
$oSmtpClient->Connect($oSettings, $oSettings->Ehlo);
|
||||
$oSmtpClient->Connect($oSettings);
|
||||
$oPlugins->RunHook('smtp.after-connect', array($this, $oSmtpClient, $oSettings));
|
||||
/*
|
||||
if ($this->oDomain->OutAskCredentials() && !($this->sSmtpPassword && $this->sSmtpLogin)) {
|
||||
|
|
@ -259,7 +259,7 @@ abstract class Account implements \JsonSerializable
|
|||
}
|
||||
*/
|
||||
$oSettings->Password = $this->sSmtpPassword ?: $this->sPassword;
|
||||
return $this->netClientLogin($oSmtpClient, $oPlugins, $oSettings);
|
||||
return $this->netClientLogin($oSmtpClient, $oPlugins);
|
||||
}
|
||||
|
||||
public function SieveConnectAndLogin(\RainLoop\Plugins\Manager $oPlugins, \MailSo\Sieve\SieveClient $oSieveClient, \RainLoop\Config\Application $oConfig)
|
||||
|
|
@ -274,10 +274,10 @@ abstract class Account implements \JsonSerializable
|
|||
$oPlugins->RunHook('sieve.after-connect', array($this, $oSieveClient, $oSettings));
|
||||
|
||||
$oSettings->Password = $this->IncPassword();
|
||||
return $this->netClientLogin($oSieveClient, $oPlugins, $oSettings);
|
||||
return $this->netClientLogin($oSieveClient, $oPlugins);
|
||||
}
|
||||
|
||||
private function netClientLogin(\MailSo\Net\NetClient $oClient, \RainLoop\Plugins\Manager $oPlugins, \MailSo\Net\ConnectSettings $oSettings) : bool
|
||||
private function netClientLogin(\MailSo\Net\NetClient $oClient, \RainLoop\Plugins\Manager $oPlugins) : bool
|
||||
{
|
||||
/*
|
||||
$encrypted = !empty(\stream_get_meta_data($oClient->ConnectionResource())['crypto']);
|
||||
|
|
@ -288,6 +288,7 @@ abstract class Account implements \JsonSerializable
|
|||
[cipher_version] => TLSv1.3
|
||||
)
|
||||
*/
|
||||
$oSettings = $oClient->Settings;
|
||||
$oSettings->ProxyAuthUser = $this->sProxyAuthUser;
|
||||
$oSettings->ProxyAuthPassword = $this->sProxyAuthPassword;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue