Announcement

Collapse
No announcement yet.

Emails inline attachments bug

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Emails inline attachments bug

    Hello!

    I have found that in some cases inline email attachments are ignored by email importer. Inside Importer class (method importPartDataToEmail) this condition:

    if (isset($part->ContentDisposition)) {

    is not met, so the inline attachment is not detected. Here is a simple patch I have used for myself, wich helped me. Take a look at it, please:

    diff --git application/Espo/Core/Mail/Importer.php application/Espo/Core/Mail/Importer.php
    index be7f09c..8687ce8 100644
    --- application/Espo/Core/Mail/Importer.php
    +++ application/Espo/Core/Mail/Importer.php
    @@ -305,6 +305,11 @@ class Importer
    $disposition = 'inline';
    }
    }
    + else if ($part->getHeaders()->has('Content-ID')) {
    + $contentId = trim($part->getHeaders()->get('Content-ID')->getFieldValue(), '<>');
    + $fileName = $contentId;
    + $disposition = 'inline';
    + }

    if (isset($part->contentTransferEncoding)) {
    $encoding = strtolower($part->getHeader('Content-Transfer-Encoding')->getTransferEncoding());

  • #2
    Probably best to create a pull request via github

    Comment


    • #3
      Sure. Bit confusing for me how to fix.

      Comment

      Working...
      X