mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 18:44:28 -04:00
feat: global blacklist for specific emails
This commit is contained in:
parent
f43909141f
commit
a6d09a2ce5
@ -34,7 +34,8 @@ class IngresEmailEngine
|
|||||||
|
|
||||||
private ?Company $company;
|
private ?Company $company;
|
||||||
private ?bool $isUnknownRecipent = null;
|
private ?bool $isUnknownRecipent = null;
|
||||||
private array $globalBlacklist = [];
|
private array $globalBlacklistDomains = [];
|
||||||
|
private array $globalBlacklistEmails = [];
|
||||||
public function __construct(private IngresEmail $email)
|
public function __construct(private IngresEmail $email)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -72,8 +73,12 @@ class IngresEmailEngine
|
|||||||
$domain = array_pop($parts);
|
$domain = array_pop($parts);
|
||||||
|
|
||||||
// global blacklist
|
// global blacklist
|
||||||
if (in_array($domain, $this->globalBlacklist)) {
|
if (in_array($domain, $this->globalBlacklistDomains)) {
|
||||||
Log::info('[IngressMailEngine] E-Mail blocked, because the domain was found on globalBlocklist: ' . $this->email->from);
|
Log::info('[IngressMailEngine] E-Mail blocked, because the domain was found on globalBlocklistDomains: ' . $this->email->from);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (in_array($this->email->from, $this->globalBlacklistEmails)) {
|
||||||
|
Log::info('[IngressMailEngine] E-Mail blocked, because the email was found on globalBlocklistEmails: ' . $this->email->from);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user