Emails inline attachments bug

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phoinic
    Junior Member
    • Mar 2015
    • 4

    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());
  • alasdaircr
    Active Community Member
    • Aug 2014
    • 525

    #2
    Probably best to create a pull request via github

    Comment

    • yuri
      Member
      • Mar 2014
      • 8562

      #3
      Sure. Bit confusing for me how to fix.
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      Working...