mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 17:07:03 +03:00
Added idea to ask SMTP credentials on AUTH failure
This commit is contained in:
parent
24dbe4f197
commit
2656d362d6
2 changed files with 97 additions and 61 deletions
|
|
@ -157,7 +157,18 @@ trait Messages
|
|||
public function DoSendMessage() : array
|
||||
{
|
||||
$oAccount = $this->initMailClientConnection();
|
||||
|
||||
/*
|
||||
$aAuth = $this->GetActionParam('auth', null);
|
||||
if ($aAuth) {
|
||||
$oAccount->setSmtpUser($aAuth['username']);
|
||||
$oAccount->setSmtpPass(new \SnappyMail\SensitiveString($aAuth['password']));
|
||||
// if ($oAccount instanceof AdditionalAccount && !empty($aAuth['remember'])) {
|
||||
// $oMainAccount = $this->getMainAccountFromToken();
|
||||
// $aAccounts = $this->GetAccounts($oMainAccount);
|
||||
// $this->SetAccounts($oMainAccount, $aAccounts);
|
||||
// }
|
||||
}
|
||||
*/
|
||||
$oConfig = $this->Config();
|
||||
|
||||
$sSaveFolder = $this->GetActionParam('saveFolder', '');
|
||||
|
|
@ -300,6 +311,10 @@ trait Messages
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (\MailSo\Smtp\Exceptions\LoginBadCredentialsException $oException)
|
||||
{
|
||||
throw new ClientException(Notifications::AuthError, $oException);
|
||||
}
|
||||
catch (ClientException $oException)
|
||||
{
|
||||
throw $oException;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue