Page MenuHomePhabricator

Inline images from emails sent from Outlook are not correctly attached to Maniphest Tasks
Closed, ResolvedPublic

Assigned To
Authored By
bzerr
Sep 21 2016, 3:36 PM
Referenced Files
F1843304: MimeMailParser.class.php
Sep 21 2016, 8:36 PM
F1842816: Outlook_Inline.eml
Sep 21 2016, 3:36 PM
F1842815: Outlook_Attached.eml
Sep 21 2016, 3:36 PM
F1842817: Thunderbird_Inline.eml
Sep 21 2016, 3:36 PM
F1842830: Screenshot_20160921_093355.png
Sep 21 2016, 3:36 PM

Description

Reproduction steps:

Setup an application email for Maniphest
Send an email to that address from Outlook with an inline image attachment

Expected result:

Maniphest Task created with image shown in task description

Actual result:

Maniphest Task created, no images are shown. Some references to images remain (cid:image003.png@01D17953.013322F0)

The above functionality works properly when sending from Thunderbird, or when sending from Outlook and attaching the image to the message instead of inlining the image.

I have attached email source files with the non-working and working examples from Outlook (

and respectively), as well as the working example from Thunderbird ()

Screenshot below is of the Maniphest Task created from the Outlook message with inlined image, with reference to the image in the task text.

Screenshot_20160921_093355.png (971×1 px, 96 KB)

Versions
phabricator 27cfd8d19e8369b6696d3a6b9ef50c8baff24ded (Wed, Aug 31)
arcanist 9e82ef979e8148c43b9b8439025d505b1219e213 (Thu, Aug 25)
phutil 491ebc74d816dbe2fc8bbbbc992e8a14f8c613be (Mon, Aug 29)

Event Timeline

How can we reproduce this locally? Do you have a specific version of Outlook / OS you are using?

With the .eml files, you could change the From: and To: headers and pipe directly into sendmail or similar MTA.
If that doesn't work, I would be happy to provide a VM instance to assist in reproduction.

We are presently using Windows 7 and Office 2007

We have no plans to support Windows 7. Do you have issues with more modern versions of Outlook?

Or I should say, the amount of time that would be needed to get to Windows 7 issues, would negate the need to support it. We're two developers and any bug is competing with thousands of others.

Makes sense, these are old versions of software. I will test with more recent versions of both Windows and Outlook to see if the issue persists.

I am also a developer and see if I can find out where the parser is choking. It seems to be an issue with cid: references, but both Outlook and Thunderbird use them. I'll have to see if it's an issue with the MimeMailParser (which we are using via local MTA) or if it's upstream, which means this could affect external mail API consumers as well.

So I've figured out the underlying cause. Outlook is sending attachments without a Content-Disposition header. The current version of mimemailparser included with Phabricator completely ignores attachments without that header.

This problem has been solved in the upstream version of mimemailparser here: https://github.com/php-mime-mail-parser/php-mime-mail-parser/blob/master/src/Parser.php#L392

I have backported the relevant parts to

, should I go about submitting a patch as lined out in your contributor guide?

Minimum viable patch sounds good to me, but @epriestley handles all contribs. Not sure what he prefers here. Feel free to patch locally first and verify.

Yeah, go ahead and submit a patch. Thanks!

epriestley claimed this task.

Presuming resolved by D16584. Thanks!