mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-09 01:17:04 +03:00
draft code for TNEF winmail.dat #1012
This commit is contained in:
parent
8fe5cd3c95
commit
565e8f0fb7
37 changed files with 5073 additions and 16 deletions
|
|
@ -515,6 +515,29 @@ trait Messages
|
|||
} catch (\Throwable $e) {
|
||||
$this->logException($e);
|
||||
}
|
||||
/*
|
||||
if (!$oMessage->sPlain && !$oMessage->sHtml && !$oMessage->pgpEncrypted && !$oMessage->smimeEncrypted) {
|
||||
$aAttachments = $oMessage->Attachments ?: [];
|
||||
foreach ($aAttachments as $oAttachment) {
|
||||
// \in_array($oAttachment->ContentType(), ['application/vnd.ms-tnef', 'application/ms-tnef'])
|
||||
if ('winmail.dat' === \strtolower($oAttachment->FileName())) {
|
||||
$sData = $this->ImapClient()->FetchMessagePart(
|
||||
$oMessage->Uid,
|
||||
$oAttachment->PartID()
|
||||
);
|
||||
$oTNEF = new \TNEFDecoder\TNEFAttachment;
|
||||
$oTNEF->decodeTnef($sData);
|
||||
foreach ($oTNEF->getFiles() as $oFile) {
|
||||
if (\in_array($oFile->type, ['application/rtf', 'text/rtf'])) {
|
||||
$rtf = new \SnappyMail\Rtf\Document($oFile->content);
|
||||
$oMessage->setHtml($rtf->toHTML());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
catch (\Throwable $oException)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue