getHeader('From'); if ($fromHeader instanceof Horde_Mime_Headers_Element_Address) { $firstAddr = AddressList::fromHorde($fromHeader->getAddressList(true))?->first(); $fromFN = $firstAddr?->getLabel(); $fromEmail = $firstAddr?->getEmail(); $customEmail = $firstAddr?->getCustomEmail(); } /** @var string|null $replyToEmail */ $replyToEmail = null; $replyToHeader = $headers->getHeader('Reply-To'); if ($replyToHeader instanceof Horde_Mime_Headers_Element_Address) { $replyToAddrs = $replyToHeader->getAddressList(true); if (isset($replyToAddrs)) { $replyToEmail = AddressList::fromHorde($replyToAddrs)->first()?->getEmail(); } } $date = $headers->getHeader('Date')?->value; $list = new PhishingDetectionList(); if ($fromEmail !== null) { if ($replyToEmail !== null) { $list->addCheck($this->replyToCheck->run($fromEmail, $replyToEmail)); } if ($fromFN !== null) { $list->addCheck($this->contactCheck->run($fromFN, $fromEmail)); } if ($customEmail !== null) { $list->addCheck($this->customEmailCheck->run($fromEmail, $customEmail)); } } if ($date !== null) { $list->addCheck($this->dateCheck->run($date)); } if ($hasHtmlMessage) { $list->addCheck($this->linkCheck->run($htmlMessage)); } return $list->jsonSerialize(); } }