Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117808685
D2845.1775275576.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D2845.1775275576.diff
View Options
diff --git a/src/app/Policy/Greylist/Request.php b/src/app/Policy/Greylist/Request.php
--- a/src/app/Policy/Greylist/Request.php
+++ b/src/app/Policy/Greylist/Request.php
@@ -182,29 +182,15 @@
return false;
}
- // determine if the sender, net and recipient combination has existed before, for each recipient
- // any one recipient matching should supersede the other recipients not having matched
- $connect = Connect::where(
- [
- 'sender_local' => $this->senderLocal,
- 'sender_domain' => $this->senderDomain,
- 'recipient_hash' => $this->recipientHash,
- 'net_id' => $this->netID,
- 'net_type' => $this->netType,
- ]
- )
- ->whereDate('updated_at', '>=', $this->timestamp->copy()->subMonthsWithoutOverflow(1))
- ->orderBy('updated_at')
- ->first();
+ $defer = true;
- $deferIfPermit = true;
-
- if ($connect) {
+ // Retrieve the entry for the sender/recipient/net combination
+ if ($connect = $this->findConnectsCollection()->first()) {
$connect->connect_count += 1;
// TODO: The period of time for which the greylisting persists is configurable.
if ($connect->created_at < $this->timestamp->copy()->subMinutes(5)) {
- $deferIfPermit = false;
+ $defer = false;
$connect->greylisting = false;
}
@@ -226,7 +212,7 @@
);
}
- return $deferIfPermit;
+ return $defer;
}
private function findConnectsCollection()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 4, 4:06 AM (12 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18807834
Default Alt Text
D2845.1775275576.diff (1 KB)
Attached To
Mode
D2845: Greylist/Request simplify logic
Attached
Detach File
Event Timeline