2014-04-18 23:47:15 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class ChangeSmtpEhloMessagePlugin extends \RainLoop\Plugins\AbstractPlugin
|
|
|
|
{
|
2021-02-10 16:50:20 +08:00
|
|
|
const
|
|
|
|
NAME = '',
|
|
|
|
CATEGORY = 'General',
|
|
|
|
DESCRIPTION = '';
|
|
|
|
|
2020-08-31 00:04:54 +08:00
|
|
|
public function Init() : void
|
2014-04-18 23:47:15 +08:00
|
|
|
{
|
|
|
|
$this->addHook('filter.smtp-credentials', 'FilterSmtpCredentials');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-11-15 04:23:46 +08:00
|
|
|
* @param \RainLoop\Model\Account $oAccount
|
2014-04-18 23:47:15 +08:00
|
|
|
* @param array $aSmtpCredentials
|
|
|
|
*/
|
|
|
|
public function FilterSmtpCredentials($oAccount, &$aSmtpCredentials)
|
|
|
|
{
|
2014-11-15 04:23:46 +08:00
|
|
|
if ($oAccount instanceof \RainLoop\Model\Account && \is_array($aSmtpCredentials))
|
2014-04-18 23:47:15 +08:00
|
|
|
{
|
|
|
|
// Default:
|
|
|
|
// $aSmtpCredentials['Ehlo'] = \MailSo\Smtp\SmtpClient::EhloHelper();
|
|
|
|
//
|
|
|
|
// or write your custom php
|
|
|
|
$aSmtpCredentials['Ehlo'] = 'localhost';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|