mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
brevo fixes
This commit is contained in:
parent
c02a4fb08d
commit
4ac3289819
@ -121,6 +121,8 @@ class ProcessBrevoInboundWebhook implements ShouldQueue
|
|||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$foundOneRecipient = false; // used for spam documentation below
|
||||||
|
|
||||||
// brevo defines recipients as array, we check all of them, to be sure
|
// brevo defines recipients as array, we check all of them, to be sure
|
||||||
foreach ($this->input["Recipients"] as $recipient) {
|
foreach ($this->input["Recipients"] as $recipient) {
|
||||||
|
|
||||||
@ -134,10 +136,11 @@ class ProcessBrevoInboundWebhook implements ShouldQueue
|
|||||||
$company = MultiDB::findAndSetDbByExpenseMailbox($recipient);
|
$company = MultiDB::findAndSetDbByExpenseMailbox($recipient);
|
||||||
if (!$company) {
|
if (!$company) {
|
||||||
Log::info('[ProcessBrevoInboundWebhook] unknown Expense Mailbox occured while handling an inbound email from brevo: ' . $recipient);
|
Log::info('[ProcessBrevoInboundWebhook] unknown Expense Mailbox occured while handling an inbound email from brevo: ' . $recipient);
|
||||||
// $this->engine->saveMeta($this->input["From"]["Address"], $recipient, true); // @turbo124 disabled, because recipents contains all recipients, and will likly result in false bans?! => normally important to save this, to protect from spam
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$foundOneRecipient = true;
|
||||||
|
|
||||||
try { // important to save meta if something fails here to prevent spam
|
try { // important to save meta if something fails here to prevent spam
|
||||||
|
|
||||||
$company_brevo_secret = $company->settings?->email_sending_method === 'client_brevo' && $company->settings?->brevo_secret ? $company->settings?->brevo_secret : null;
|
$company_brevo_secret = $company->settings?->email_sending_method === 'client_brevo' && $company->settings?->brevo_secret ? $company->settings?->brevo_secret : null;
|
||||||
@ -195,5 +198,11 @@ class ProcessBrevoInboundWebhook implements ShouldQueue
|
|||||||
$this->engine->handleExpenseMailbox($inboundMail);
|
$this->engine->handleExpenseMailbox($inboundMail);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// document for spam => mark all recipients as handled emails with unmatched mailbox => otherwise dont do any
|
||||||
|
if (!$foundOneRecipient)
|
||||||
|
foreach ($this->input["Recipients"] as $recipient) {
|
||||||
|
$this->engine->saveMeta($this->input["From"]["Address"], $recipient, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user