mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 16:07:03 +03:00
Bugfix: #342
This commit is contained in:
parent
7da5692865
commit
355f6158be
3 changed files with 16 additions and 6 deletions
|
|
@ -1474,7 +1474,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
: await this.mailvelope.encrypt(recipients);
|
: await this.mailvelope.encrypt(recipients);
|
||||||
/*
|
/*
|
||||||
Object.entries(PgpUserStore.getPublicKeyOfEmails(recipients) || {}).forEach(([k,v]) =>
|
Object.entries(PgpUserStore.getPublicKeyOfEmails(recipients) || {}).forEach(([k,v]) =>
|
||||||
params.autocrypt.push({addr:k, keydata:v.replace(/-----(BEGIN|END) PGP PUBLIC KEY BLOCK-----/).trim()})
|
params.autocrypt.push({addr:k, keydata:v.replace(/-----(BEGIN|END) PGP PUBLIC KEY BLOCK-----/g).trim()})
|
||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
} else if (sign || encrypt) {
|
} else if (sign || encrypt) {
|
||||||
|
|
@ -1525,7 +1525,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
}
|
}
|
||||||
if (encrypt) {
|
if (encrypt) {
|
||||||
Object.entries(PgpUserStore.getPublicKeyOfEmails(recipients) || {}).forEach(([k,v]) =>
|
Object.entries(PgpUserStore.getPublicKeyOfEmails(recipients) || {}).forEach(([k,v]) =>
|
||||||
params.autocrypt.push({addr:k, keydata:v.replace(/-----(BEGIN|END) PGP PUBLIC KEY BLOCK-----/).trim()})
|
params.autocrypt.push({addr:k, keydata:v.replace(/-----(BEGIN|END) PGP PUBLIC KEY BLOCK-----/g, '').trim()})
|
||||||
);
|
);
|
||||||
if ('openpgp' == encrypt) {
|
if ('openpgp' == encrypt) {
|
||||||
// Doesn't encrypt attachments
|
// Doesn't encrypt attachments
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,12 @@ class Message extends Part
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function SetAutocrypt(array $aValue) : self
|
||||||
|
{
|
||||||
|
$this->aHeadersValue['Autocrypt'] = $aValue;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function SetSubject(string $sSubject) : self
|
public function SetSubject(string $sSubject) : self
|
||||||
{
|
{
|
||||||
$this->aHeadersValue[Enumerations\Header::SUBJECT] = $sSubject;
|
$this->aHeadersValue[Enumerations\Header::SUBJECT] = $sSubject;
|
||||||
|
|
@ -415,7 +421,11 @@ class Message extends Part
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->aHeadersValue as $sName => $mValue) {
|
foreach ($this->aHeadersValue as $sName => $mValue) {
|
||||||
if (!($bWithoutBcc && \strtolower(Enumerations\Header::BCC) === \strtolower($sName))) {
|
if ('autocrypt' === \strtolower($sName)) {
|
||||||
|
foreach ($mValue as $key) {
|
||||||
|
$oRootPart->Headers->AddByName($sName, $key);
|
||||||
|
}
|
||||||
|
} else if (!($bWithoutBcc && \strtolower(Enumerations\Header::BCC) === \strtolower($sName))) {
|
||||||
$oRootPart->Headers->SetByName($sName, (string) $mValue);
|
$oRootPart->Headers->SetByName($sName, (string) $mValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1035,9 +1035,9 @@ trait Messages
|
||||||
$oMessage->SetReferences($this->GetActionParam('references', ''));
|
$oMessage->SetReferences($this->GetActionParam('references', ''));
|
||||||
|
|
||||||
$aAutocrypt = $this->GetActionParam('autocrypt', []);
|
$aAutocrypt = $this->GetActionParam('autocrypt', []);
|
||||||
foreach ($aAutocrypt as $header) {
|
$oMessage->SetAutocrypt(
|
||||||
$oMessage->SetCustomHeader('Autocrypt', "addr={$header['addr']}; keydata={$header['keydata']}");
|
\array_map(fn($header)=>"addr={$header['addr']}; keydata={$header['keydata']}", $aAutocrypt)
|
||||||
}
|
);
|
||||||
|
|
||||||
$aFoundCids = array();
|
$aFoundCids = array();
|
||||||
$aFoundDataURL = array();
|
$aFoundDataURL = array();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue