mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 23:08:08 +08:00
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:
parent
ddbe6b2a75
commit
40e2375b3e
1 changed files with 15 additions and 1 deletions
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue