2014-04-18 23:47:15 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class ChangeSmtpEhloMessagePlugin extends \RainLoop\Plugins\AbstractPlugin
|
|
|
|
{
|
2021-02-10 16:50:20 +08:00
|
|
|
const
|
2021-08-28 05:49:03 +08:00
|
|
|
NAME = 'Change SMTP EHLO Message',
|
2021-02-10 16:50:20 +08:00
|
|
|
CATEGORY = 'General',
|
2021-08-28 05:49:03 +08:00
|
|
|
DESCRIPTION = 'Extension to enable custom SMTP EHLO messages';
|
2021-02-10 16:50:20 +08:00
|
|
|
|
2020-08-31 00:04:54 +08:00
|
|
|
public function Init() : void
|
2014-04-18 23:47:15 +08:00
|
|
|
{
|
2022-05-31 16:47:14 +08:00
|
|
|
$this->addHook('smtp.before-connect', 'FilterSmtpCredentials');
|
2014-04-18 23:47:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-11-15 04:23:46 +08:00
|
|
|
* @param \RainLoop\Model\Account $oAccount
|
2014-04-18 23:47:15 +08:00
|
|
|
* @param array $aSmtpCredentials
|
|
|
|
*/
|
2022-05-31 16:47:14 +08:00
|
|
|
public function FilterSmtpCredentials(\RainLoop\Model\Account $oAccount,
|
|
|
|
\MailSo\Smtp\SmtpClient $oSmtpClient,
|
|
|
|
array &$aSmtpCredentials)
|
2014-04-18 23:47:15 +08:00
|
|
|
{
|
2022-05-31 16:47:14 +08:00
|
|
|
// Default:
|
|
|
|
// $aSmtpCredentials['Ehlo'] = \MailSo\Smtp\SmtpClient::EhloHelper();
|
|
|
|
//
|
|
|
|
// or write your custom php
|
|
|
|
$aSmtpCredentials['Ehlo'] = 'localhost';
|
2014-04-18 23:47:15 +08:00
|
|
|
}
|
|
|
|
}
|