zendframework / zend-mime

Mime component from Zend Framework
BSD 3-Clause "New" or "Revised" License
62 stars 37 forks source link

Fix issue with parsing MIME parts with no headers #7

Closed mikesul closed 8 years ago

mikesul commented 8 years ago

Parsing of MIME parts some times failed when there were no headers present. This is due to the attempt to match the first line unexpectedly matching the second (since strtok will skip a match at position 0).

This is related to zendframework/zend-mail#19 . While the error generates in Mail\Headers::fromString, it's caused by Mime\Decode::splitMessage parsing this case inconsistently.

I've added a test case using a stripped down version of the message in the referenced issue.