diff --git a/dev/View/User/MailBox/MessageView.js b/dev/View/User/MailBox/MessageView.js index f655262bf..a5e167f60 100644 --- a/dev/View/User/MailBox/MessageView.js +++ b/dev/View/User/MailBox/MessageView.js @@ -155,10 +155,10 @@ export class MailMessageView extends AbstractViewRight { : '' ).join(' '), - askReadReceipt: () => - (MessagelistUserStore.isDraftFolder() || MessagelistUserStore.isSentFolder()) - && currentMessage()?.readReceipt() - && currentMessage()?.flags().includes('$mdnsent'), + askReadReceipt: () => currentMessage()?.readReceipt() + && !(MessagelistUserStore.isDraftFolder() || MessagelistUserStore.isSentFolder()) + && !currentMessage()?.flags().includes('$mdnsent') + && !currentMessage()?.flags().includes('\\answered'), listAttachments: () => currentMessage()?.attachments() .filter(item => SettingsUserStore.listInlineAttachments() || !item.isLinked()), diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php index 4f5954657..b80ac0e5e 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php @@ -197,10 +197,23 @@ class Message implements \JsonSerializable // $oMessage->sDeliveryReceipt = \trim($oHeaders->ValueByName(MimeHeader::RETURN_RECEIPT_TO)); // Read Receipt - $oMessage->ReadReceipt = \trim($oHeaders->ValueByName(MimeHeader::DISPOSITION_NOTIFICATION_TO)); - if (empty($oMessage->ReadReceipt)) { - $oMessage->ReadReceipt = \trim($oHeaders->ValueByName(MimeHeader::X_CONFIRM_READING_TO)); + $sReadReceipt = \trim($oHeaders->ValueByName(MimeHeader::DISPOSITION_NOTIFICATION_TO)); + if (empty($sReadReceipt)) { + $sReadReceipt = \trim($oHeaders->ValueByName(MimeHeader::X_CONFIRM_READING_TO)); } + if ($sReadReceipt) { + try + { + if (!\MailSo\Mime\Email::Parse($sReadReceipt)) { + $sReadReceipt = ''; + } + } + catch (\Throwable $oException) + { + $sReadReceipt = ''; + } + } + $oMessage->ReadReceipt = $sReadReceipt; if ($spam = $oHeaders->ValueByName(MimeHeader::X_SPAMD_RESULT)) { if (\preg_match('/\\[([\\d\\.-]+)\\s*\\/\\s*([\\d\\.]+)\\];/', $spam, $match)) { @@ -461,21 +474,6 @@ class Message implements \JsonSerializable } } - $aFlags = $this->getFlags(); - $sReadReceipt = $this->ReadReceipt; - if (\strlen($sReadReceipt) && !\in_array('$forwarded', $aFlags)) { - try - { - if (!\MailSo\Mime\Email::Parse($sReadReceipt)) { - $sReadReceipt = ''; - } - } - catch (\Throwable $oException) - { - $sReadReceipt = ''; - } - } - $result = array( '@Object' => 'Object/Message', 'folder' => $this->sFolder, @@ -499,7 +497,7 @@ class Message implements \JsonSerializable 'sender' => $this->oSender, 'deliveredTo' => $this->oDeliveredTo, - 'readReceipt' => $sReadReceipt, + 'readReceipt' => $this->ReadReceipt, 'autocrypt' => $aAutocrypt ?: null, 'attachments' => $this->Attachments, @@ -508,7 +506,7 @@ class Message implements \JsonSerializable 'dkim' => $this->DKIM, 'dmarc' => $this->DMARC, - 'flags' => $aFlags, + 'flags' => $this->getFlags(), 'inReplyTo' => $this->InReplyTo, diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php index 49139c2b3..af23dbef1 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php @@ -368,14 +368,15 @@ trait Messages $sFolderFullName = $this->GetActionParam('messageFolder', ''); $iUid = (int) $this->GetActionParam('messageUid', 0); - $this->Cacher($oAccount)->Set(\RainLoop\KeyPathHelper::ReadReceiptCache($oAccount->Email(), $sFolderFullName, $iUid), '1'); - if (\strlen($sFolderFullName) && 0 < $iUid) { try { $this->MailClient()->MessageSetFlag($sFolderFullName, new SequenceSet($iUid), MessageFlag::MDNSENT, true, true); } - catch (\Throwable $oException) {} + catch (\Throwable $oException) + { + $this->Cacher($oAccount)->Set(\RainLoop\KeyPathHelper::ReadReceiptCache($oAccount->Email(), $sFolderFullName, $iUid), '1'); + } } } } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php index 821bac496..446d3fcc4 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php @@ -96,7 +96,7 @@ trait Response if (!$this->Config()->Get('labs', 'date_from_headers', true) && $aResult['internalTimestamp']) { $aResult['dateTimestamp'] = $aResult['internalTimestamp']; } - if (!$sParent && \strlen($aResult['readReceipt']) && !\in_array('$forwarded', $aResult['flags'])) { + if (!$sParent && \strlen($aResult['readReceipt']) && !\in_array('$mdnsent', $aResult['flags']) && !\in_array('\\answered', $aResult['flags'])) { $oAccount = $this->getAccountFromToken(); if ('1' === $this->Cacher($oAccount)->Get(\RainLoop\KeyPathHelper::ReadReceiptCache($oAccount->Email(), $aResult['folder'], $aResult['uid']), '0')) { $aResult['readReceipt'] = '';