Draft code for BIMI (not active due to being slow)

https://github.com/the-djmaze/snappymail/issues/115#issuecomment-1186485370
This commit is contained in:
the-djmaze 2022-10-17 15:43:45 +02:00
parent ddbe6b2a75
commit 40e2375b3e

View file

@ -257,12 +257,26 @@ class Email implements \JsonSerializable
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
/*
$BIMI = '';
if (Enumerations\DkimStatus::PASS == $this->GetDkimStatus()) {
if ($values = \dns_get_record($this->GetDomain(), \DNS_TXT)) {
foreach ($values as $value) {
if (\str_starts_with($value['txt'], 'v=BIMI1')) {
$BIMI = \preg_replace('/^.+l=([^;]+)(;.*)?$/', '$1', $value['txt']);
break;
}
}
}
}
*/
return array(
'@Object' => 'Object/Email',
'Name' => \MailSo\Base\Utils::Utf8Clear($this->GetDisplayName()),
'Email' => \MailSo\Base\Utils::Utf8Clear($this->GetEmail(true)),
'DkimStatus' => $this->GetDkimStatus(),
'DkimValue' => $this->GetDkimValue()
'DkimValue' => $this->GetDkimValue(),
'BIMI' => $BIMI
);
}
}