fixes: env vars

This commit is contained in:
paulwer 2024-05-19 06:31:26 +02:00
parent 96d4a250cf
commit e08e377b34
2 changed files with 9 additions and 5 deletions

View File

@ -16,7 +16,7 @@ use App\Factory\ExpenseFactory;
use App\Jobs\Util\SystemLogger; use App\Jobs\Util\SystemLogger;
use App\Libraries\MultiDB; use App\Libraries\MultiDB;
use App\Models\ClientContact; use App\Models\ClientContact;
use App\Models\Company; use App\Models\Company;
use App\Models\SystemLog; use App\Models\SystemLog;
use App\Models\VendorContact; use App\Models\VendorContact;
use App\Services\InboundMail\InboundMail; use App\Services\InboundMail\InboundMail;
@ -99,13 +99,13 @@ class InboundMailEngine
// sender occured in more than 500 emails in the last 12 hours // sender occured in more than 500 emails in the last 12 hours
$senderMailCountTotal = Cache::get('inboundMailCountSender:' . $from, 0); $senderMailCountTotal = Cache::get('inboundMailCountSender:' . $from, 0);
if ($senderMailCountTotal >= 5000) { if ($senderMailCountTotal >= config('global_inbound_sender_permablock_mailcount')) {
nlog('E-Mail blocked permanent, because the sender sended more than ' . $senderMailCountTotal . ' emails in the last 12 hours: ' . $from); nlog('E-Mail blocked permanent, because the sender sended more than ' . $senderMailCountTotal . ' emails in the last 12 hours: ' . $from);
$this->blockSender($from); $this->blockSender($from);
$this->saveMeta($from, $to); $this->saveMeta($from, $to);
return true; return true;
} }
if ($senderMailCountTotal >= 1000) { if ($senderMailCountTotal >= config('global_inbound_sender_block_mailcount')) {
nlog('E-Mail blocked, because the sender sended more than ' . $senderMailCountTotal . ' emails in the last 12 hours: ' . $from); nlog('E-Mail blocked, because the sender sended more than ' . $senderMailCountTotal . ' emails in the last 12 hours: ' . $from);
$this->saveMeta($from, $to); $this->saveMeta($from, $to);
return true; return true;
@ -113,7 +113,7 @@ class InboundMailEngine
// sender sended more than 50 emails to the wrong mailbox in the last 6 hours // sender sended more than 50 emails to the wrong mailbox in the last 6 hours
$senderMailCountUnknownRecipent = Cache::get('inboundMailCountSenderUnknownRecipent:' . $from, 0); $senderMailCountUnknownRecipent = Cache::get('inboundMailCountSenderUnknownRecipent:' . $from, 0);
if ($senderMailCountUnknownRecipent >= 50) { if ($senderMailCountUnknownRecipent >= config('company_inbound_sender_block_unknown_reciepent')) {
nlog('E-Mail blocked, because the sender sended more than ' . $senderMailCountUnknownRecipent . ' emails to the wrong mailbox in the last 6 hours: ' . $from); nlog('E-Mail blocked, because the sender sended more than ' . $senderMailCountUnknownRecipent . ' emails to the wrong mailbox in the last 6 hours: ' . $from);
$this->saveMeta($from, $to); $this->saveMeta($from, $to);
return true; return true;

View File

@ -235,7 +235,11 @@ return [
], ],
'inbound_mailbox' => [ 'inbound_mailbox' => [
'expense_mailbox_endings' => env('EXPENSE_MAILBOX_ENDINGS', '@expense.invoicing.co'), 'expense_mailbox_endings' => env('EXPENSE_MAILBOX_ENDINGS', '@expense.invoicing.co'),
'inbound_webhook_key' => env('INBOUND_WEBHOOK_KEY', null) 'inbound_webhook_key' => env('INBOUND_WEBHOOK_KEY', null),
'global_inbound_sender_block_mailcount' => env('GLOBAL_INBOUND_SENDER_BLOCK_MAILCOUNT', 1000),
'global_inbound_sender_permablock_mailcount' => env('GLOBAL_INBOUND_SENDER_PERMABLOCK_MAILCOUNT', 5000),
'company_inbound_sender_block_unknown_reciepent' => env('COMPANY_INBOUND_SENDER_BLOCK_UNKNOWN_RECIEPENT', 50),
'global_inbound_sender_permablock_unknown_reciepent' => env('GLOBAL_INBOUND_SENDER_PERMABLOCK_UNKNOWN_RECIEPENT', 5000),
], ],
'cloudflare' => [ 'cloudflare' => [
'turnstile' => [ 'turnstile' => [