mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Allow demo account to send messages to itself
This commit is contained in:
parent
ab5715b536
commit
e52316bb08
1 changed files with 18 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ class DemoAccountPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
const
|
const
|
||||||
NAME = 'Demo Account Extension',
|
NAME = 'Demo Account Extension',
|
||||||
CATEGORY = 'Login',
|
CATEGORY = 'Login',
|
||||||
|
REQUIRED = '2.10.1',
|
||||||
DESCRIPTION = 'Extension to enable a demo account';
|
DESCRIPTION = 'Extension to enable a demo account';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -77,7 +78,23 @@ class DemoAccountPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
public function FilterSendMessage($oMessage)
|
public function FilterSendMessage($oMessage)
|
||||||
{
|
{
|
||||||
if ($oMessage && $this->isDemoAccount()) {
|
if ($oMessage && $this->isDemoAccount()) {
|
||||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::DemoSendMessageError);
|
$sEmail = $this->Config()->Get('plugin', 'email');
|
||||||
|
foreach ($oMessage->GetTo() as $oEmail) {
|
||||||
|
if ($oEmail->GetEmail() !== $sEmail) {
|
||||||
|
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::DemoSendMessageError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($oMessage->GetCc() ?: [] as $oEmail) {
|
||||||
|
if ($oEmail->GetEmail() !== $sEmail) {
|
||||||
|
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::DemoSendMessageError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($oMessage->GetBcc() ?: [] as $oEmail) {
|
||||||
|
if ($oEmail->GetEmail() !== $sEmail) {
|
||||||
|
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::DemoSendMessageError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::DemoSendMessageError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue