snappymail/plugins/change-smtp-ehlo-message/index.php

30 lines
730 B
PHP
Raw Normal View History

2014-04-18 23:47:15 +08:00
<?php
class ChangeSmtpEhloMessagePlugin extends \RainLoop\Plugins\AbstractPlugin
{
const
NAME = 'Change SMTP EHLO Message',
CATEGORY = 'General',
DESCRIPTION = 'Extension to enable custom SMTP EHLO messages';
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
}
}