Merge pull request #324 from azonti/master

fix `override-smtp-credentials`
This commit is contained in:
the-djmaze 2022-04-13 11:21:29 +02:00 committed by GitHub
commit 41e794f684
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,22 +4,24 @@ class OverrideSmtpCredentialsPlugin extends \RainLoop\Plugins\AbstractPlugin
{
const
NAME = 'Override SMTP Credentials',
VERSION = '2.1',
RELEASE = '2021-04-21',
VERSION = '2.2',
RELEASE = '2022-04-13',
REQUIRED = '2.5.0',
CATEGORY = 'Filters',
DESCRIPTION = 'Override SMTP credentials for specific users.';
public function Init() : void
{
$this->addHook('smtp.credentials', 'FilterSmtpCredentials');
$this->addHook('smtp.before-connect', 'FilterSmtpCredentials');
$this->addHook('smtp.before-login', 'FilterSmtpCredentials');
}
/**
* @param \RainLoop\Model\Account $oAccount
* @param \MailSo\Smtp\SmtpClient $oSmtpClient
* @param array $aSmtpCredentials
*/
public function FilterSmtpCredentials($oAccount, &$aSmtpCredentials)
public function FilterSmtpCredentials($oAccount, $oSmtpClient, &$aSmtpCredentials)
{
if ($oAccount instanceof \RainLoop\Model\Account && \is_array($aSmtpCredentials))
{