Skip to content

Commit

Permalink
Feat: trusted sender phishing check
Browse files Browse the repository at this point in the history
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
  • Loading branch information
hamza221 committed May 29, 2024
1 parent b3d696b commit 54b7ae4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Service/PhishingDetection/PhishingDetectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ class PhishingDetectionService {
/** @var PhishingDetectionList */
private $list ;

public function __construct(private ContactCheck $contactCheck, private CustomEmailCheck $customEmailCheck, private DateCheck $dateCheck, private ReplyToCheck $replyToCheck) {
public function __construct(private ContactCheck $contactCheck, private CustomEmailCheck $customEmailCheck, private DateCheck $dateCheck, private ReplyToCheck $replyToCheck, private TrustedCheck $trustedCheck) {

Check failure on line 38 in lib/Service/PhishingDetection/PhishingDetectionService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable28

UndefinedClass

lib/Service/PhishingDetection/PhishingDetectionService.php:38:176: UndefinedClass: Class, interface or enum named OCA\Mail\Service\PhishingDetection\TrustedCheck does not exist (see https://psalm.dev/019)

Check failure on line 38 in lib/Service/PhishingDetection/PhishingDetectionService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable27

UndefinedClass

lib/Service/PhishingDetection/PhishingDetectionService.php:38:176: UndefinedClass: Class, interface or enum named OCA\Mail\Service\PhishingDetection\TrustedCheck does not exist (see https://psalm.dev/019)

Check failure on line 38 in lib/Service/PhishingDetection/PhishingDetectionService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable29

UndefinedClass

lib/Service/PhishingDetection/PhishingDetectionService.php:38:176: UndefinedClass: Class, interface or enum named OCA\Mail\Service\PhishingDetection\TrustedCheck does not exist (see https://psalm.dev/019)

Check failure on line 38 in lib/Service/PhishingDetection/PhishingDetectionService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

UndefinedClass

lib/Service/PhishingDetection/PhishingDetectionService.php:38:176: UndefinedClass: Class, interface or enum named OCA\Mail\Service\PhishingDetection\TrustedCheck does not exist (see https://psalm.dev/019)
$this->contactCheck = $contactCheck;
$this->customEmailCheck = $customEmailCheck;
$this->dateCheck = $dateCheck;
$this->replyToCheck = $replyToCheck;
$this->trustedCheck = $trustedCheck;
$this->list = new PhishingDetectionList();
}

Expand All @@ -56,6 +57,7 @@ public function checkHeadersForPhishing(Horde_Mime_Headers $headers, string $uid
$this->list->addCheck($this->contactCheck->run($fromFN, $fromEmail));
$this->list->addCheck($this->dateCheck->run($date));
$this->list->addCheck($this->customEmailCheck->run($fromEmail, $customEmail));
// $this->trustedCheck->run($uid, $fromEmail);
return $this->list->jsonSerialize();
}
}

0 comments on commit 54b7ae4

Please sign in to comment.