mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Update index.php
This commit is contained in:
parent
a8a1efb071
commit
8c90bd9e46
1 changed files with 8 additions and 2 deletions
|
|
@ -12,6 +12,10 @@
|
||||||
|
|
||||||
class AutoDomainGrabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
class AutoDomainGrabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private $imap_prefix = "mail.";
|
||||||
|
private $smtp_prefix = "mail.";
|
||||||
|
|
||||||
public function Init()
|
public function Init()
|
||||||
{
|
{
|
||||||
$this->addHook('filter.smtp-credentials', 'FilterSmtpCredentials');
|
$this->addHook('filter.smtp-credentials', 'FilterSmtpCredentials');
|
||||||
|
|
@ -31,7 +35,8 @@ class AutoDomainGrabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
// Check for mail.$DOMAIN as entered value in RL settings
|
// Check for mail.$DOMAIN as entered value in RL settings
|
||||||
if (!empty($aImapCredentials['Host']) && 'auto' === $aImapCredentials['Host'])
|
if (!empty($aImapCredentials['Host']) && 'auto' === $aImapCredentials['Host'])
|
||||||
{
|
{
|
||||||
$aImapCredentials['Host'] = \MailSo\Base\Utils::GetDomainFromEmail($oAccount->Email());
|
$domain = substr(strrchr($oAccount->Email(), "@"), 1);
|
||||||
|
$aImapCredentials['Host'] = $this->imap_prefix.$domain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -49,7 +54,8 @@ class AutoDomainGrabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
// Check for mail.$DOMAIN as entered value in RL settings
|
// Check for mail.$DOMAIN as entered value in RL settings
|
||||||
if (!empty($aSmtpCredentials['Host']) && 'auto' === $aSmtpCredentials['Host'])
|
if (!empty($aSmtpCredentials['Host']) && 'auto' === $aSmtpCredentials['Host'])
|
||||||
{
|
{
|
||||||
$aSmtpCredentials['Host'] = \MailSo\Base\Utils::GetDomainFromEmail($oAccount->Email());
|
$domain = substr(strrchr($oAccount->Email(), "@"), 1);
|
||||||
|
$aImapCredentials['Host'] = $this->smtp_prefix.$domain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue