Fetch icon indicating copy to clipboard operation
Fetch copied to clipboard

Alternative subtype not properly handled

Open Arcesilas opened this issue 11 years ago • 3 comments

Hi.

I've been wondering why an email with plain text and html was not correctly read. It seems to happen only when the html part contains an inline image. In this case, subtype is "alternative" and is handled by line from 451 to 459 in Message.php file.

What should be done then is parse the part which contains both plain text and html. Instead, the whole part (including boundaries, encoding, etc.) is assigned to html body.

Here are some information about this email :

  • mail source read in Roundcube
  • result of imap_fetchstructure()
  • result of imap_bodystruct()
  • result of imap_fetchbody()

https://gist.github.com/OlivierCecillon/511c2dd97fb94f4e462d

I can try to work on this problem, but I'm not completely ready with unit tests and vagrant yet...

Arcesilas avatar Apr 17 '14 21:04 Arcesilas

I added some additional testing code over the last week, so you should try things again.

From the project root run "./tests/runTests.sh" rather than calling phpunit direct :-)

tedivm avatar Apr 17 '14 21:04 tedivm

Hi @tedivm,

i just stumbled over an issue when dealing with inline attachments. The part containing the inline attachment has type 1 and subtype = related, which executes following branch https://github.com/tedious/Fetch/blob/master/src/Fetch/Message.php#L487

I tried to gather some information if that should be considered as expected behaviour. What do you think? In my opinion, getting the message body as plain text should not contain anything but human readable text.

If you agree I'd fix the issue and open a pr

dfreudenberger avatar Nov 19 '14 10:11 dfreudenberger

@dfreudenberger, I'd love it if you wanted to take a look at this.

tedivm avatar Nov 29 '14 02:11 tedivm