mikel/mail — pull request #380 by ConradIrwin (2012-04-10 04:47:58+00:00)
Title: Split strictly on MIME boundary lines [Fixes #379]

Tested on:
* jruby-1.6.7 [ amd64 ]
* ree-1.8.7-2011.12 [ x86_64 ]
* ruby-1.8.7-p352 [ x86_64 ]
* ruby-1.9.2-p290 [ x86_64 ]
* ruby-1.9.3-p125 [ x86_64 ]

Example problemative email: https://github.com/ConradIrwin/mail/blob/988f93eeb4d8a29347ba74a2394cc7fbe793b9d7/spec/fixtures/emails/mime_emails/email_with_similar_boundaries.eml

--8<--
Some mail generators ignore RFC 2046's "Boundary delimeters must not
appear within the encapsulated material" by using MIME boundaries for
inner parts that contain the MIME boundaries for outer parts.

To parse these emails as the author intended it is necessary to split
encapsulated content only on boundary delimeters that are on their own
line, instead of those that appear with suffixed content.