mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Changes for BIMI-Selector #1394
This commit is contained in:
parent
b7bab3cf21
commit
e133cf5ffb
4 changed files with 29 additions and 17 deletions
|
|
@ -164,6 +164,12 @@ $Plugin->addHook('hook.name', 'functionName');
|
||||||
bool $bSuccess
|
bool $bSuccess
|
||||||
\MailSo\Imap\Settings $oSettings
|
\MailSo\Imap\Settings $oSettings
|
||||||
|
|
||||||
|
### imap.message-headers
|
||||||
|
params:
|
||||||
|
array &$aHeaders
|
||||||
|
|
||||||
|
Allows you to fetch more MIME headers for messages.
|
||||||
|
|
||||||
## Sieve
|
## Sieve
|
||||||
|
|
||||||
### sieve.before-connect
|
### sieve.before-connect
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ class AvatarsPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
NAME = 'Avatars',
|
NAME = 'Avatars',
|
||||||
AUTHOR = 'SnappyMail',
|
AUTHOR = 'SnappyMail',
|
||||||
URL = 'https://snappymail.eu/',
|
URL = 'https://snappymail.eu/',
|
||||||
VERSION = '1.14',
|
VERSION = '1.15',
|
||||||
RELEASE = '2024-01-17',
|
RELEASE = '2024-01-22',
|
||||||
REQUIRED = '2.25.0',
|
REQUIRED = '2.25.0',
|
||||||
CATEGORY = 'Contacts',
|
CATEGORY = 'Contacts',
|
||||||
LICENSE = 'MIT',
|
LICENSE = 'MIT',
|
||||||
|
|
@ -32,6 +32,16 @@ class AvatarsPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
$this->addHook('json.after-message', 'JsonMessage');
|
$this->addHook('json.after-message', 'JsonMessage');
|
||||||
$this->addHook('json.after-messagelist', 'JsonMessageList');
|
$this->addHook('json.after-messagelist', 'JsonMessageList');
|
||||||
}
|
}
|
||||||
|
// https://www.ietf.org/archive/id/draft-brand-indicators-for-message-identification-04.html#bimi-selector
|
||||||
|
if ($this->Config()->Get('plugin', 'bimi', false)) {
|
||||||
|
$this->addHook('imap.message-headers', 'ImapMessageHeaders');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ImapMessageHeaders(array &$aHeaders)
|
||||||
|
{
|
||||||
|
// \MailSo\Mime\Enumerations\Header::BIMI_SELECTOR
|
||||||
|
$aHeaders[] = 'BIMI-Selector';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function JsonMessage(array &$aResponse)
|
public function JsonMessage(array &$aResponse)
|
||||||
|
|
|
||||||
|
|
@ -61,15 +61,11 @@ abstract class FetchType
|
||||||
|
|
||||||
public static function BuildBodyCustomHeaderRequest(array $aHeaders, bool $bPeek = true) : string
|
public static function BuildBodyCustomHeaderRequest(array $aHeaders, bool $bPeek = true) : string
|
||||||
{
|
{
|
||||||
$sResult = '';
|
if (\count($aHeaders)) {
|
||||||
if (\count($aHeaders))
|
$aHeaders = \array_map(fn($sHeader) => \strtoupper(\trim($sHeader)), $aHeaders);
|
||||||
{
|
return ($bPeek ? self::BODY_PEEK : self::BODY)
|
||||||
$aHeaders = \array_map('strtoupper', \array_map('trim', $aHeaders));
|
. '[HEADER.FIELDS ('.\implode(' ', $aHeaders).')]';
|
||||||
|
|
||||||
$sResult = $bPeek ? self::BODY_PEEK : self::BODY;
|
|
||||||
$sResult .= '[HEADER.FIELDS ('.\implode(' ', $aHeaders).')]';
|
|
||||||
}
|
}
|
||||||
|
return '';
|
||||||
return $sResult;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ class MailClient
|
||||||
return FetchType::BODY_HEADER_PEEK;
|
return FetchType::BODY_HEADER_PEEK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FetchType::BuildBodyCustomHeaderRequest(array(
|
$aHeaders = array(
|
||||||
// MimeHeader::RETURN_PATH,
|
// MimeHeader::RETURN_PATH,
|
||||||
// MimeHeader::RECEIVED,
|
// MimeHeader::RECEIVED,
|
||||||
// MimeHeader::MIME_VERSION,
|
// MimeHeader::MIME_VERSION,
|
||||||
|
|
@ -75,8 +75,6 @@ class MailClient
|
||||||
MimeHeader::LIST_UNSUBSCRIBE,
|
MimeHeader::LIST_UNSUBSCRIBE,
|
||||||
// https://autocrypt.org/level1.html#the-autocrypt-header
|
// https://autocrypt.org/level1.html#the-autocrypt-header
|
||||||
MimeHeader::AUTOCRYPT,
|
MimeHeader::AUTOCRYPT,
|
||||||
// https://www.ietf.org/archive/id/draft-brand-indicators-for-message-identification-04.html#bimi-selector
|
|
||||||
MimeHeader::BIMI_SELECTOR,
|
|
||||||
// SPAM
|
// SPAM
|
||||||
MimeHeader::X_SPAM_STATUS,
|
MimeHeader::X_SPAM_STATUS,
|
||||||
MimeHeader::X_SPAM_FLAG,
|
MimeHeader::X_SPAM_FLAG,
|
||||||
|
|
@ -87,9 +85,11 @@ class MailClient
|
||||||
MimeHeader::X_VIRUS,
|
MimeHeader::X_VIRUS,
|
||||||
MimeHeader::X_VIRUS_SCANNED,
|
MimeHeader::X_VIRUS_SCANNED,
|
||||||
MimeHeader::X_VIRUS_STATUS
|
MimeHeader::X_VIRUS_STATUS
|
||||||
), true);
|
);
|
||||||
//
|
|
||||||
// return FetchType::ENVELOPE;
|
\RainLoop\Api::Actions()->Plugins()->RunHook('imap.message-headers', array(&$aHeaders));
|
||||||
|
|
||||||
|
return FetchType::BuildBodyCustomHeaderRequest($aHeaders, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue