HomePhorge
Diffusion kolab 8beb43d39950

Avoid large queries in greylist request

Description

Avoid large queries in greylist request

Summary:
The assumption is that the following query can yield a lot of results
for e.g. gmail.com:

$entries = Connect::where(
    [
        'sender_domain' => $this->senderDomain,
        'net_id' => $this->netID,
        'net_type' => $this->netType
    ]
)
    ->whereDate('updated_at', '>=', $this->timestamp->copy()->subDays(7));

Instead of counting and updating all of them, we only to the minimum
work necessary:

  • Update all entries that are currently greylisted
  • Count if we have at least 5 entries to automatically create a whitelist

This changes that entries that already have greylisting = false will
not get updated_at updated.

Differential Revision: https://git.kolab.org/D2833

Details

Provenance
mollekopfAuthored on Aug 27 2021, 9:56 AM
mollekopfPushed on Aug 27 2021, 10:50 AM
Differential Revision
D2833: Avoid large queries in greylist request
Parents
rKc727cdd61b80: GreylistTest enhancements
Branches
Unknown
Tags
Unknown
Build Status
Buildable 36490