Subject: [sup-devel] [Heliotrope/Turnsole] RMail's parsing leads to SystemStackError

From: Michael Stapelberg <[email-masked]>
Date: Mon, 12 Mar 2012 19:24:06 +0100

Hi,

while working on the GPG signature verification, I noticed that RMail’s MIME
parsing sucks, at least with Ruby 1.9.3:

When encountering a boundary, such as "--=_libri-22937-1314886853-0001-2--",
RMail turns that into a regular expression which matches any amount of
characters or the whole thing, that looks like this:

\-(?:\-(?:=(?:_(?:l(?:i(?:b(?:r(?:i(?:\-(?:2(?:2(?:9(?:3(?:7(?:\-(?:1(?:3(?:1(?:4(?:8(?:8(?:6(?:8(?:5(?:3(?:\-(?:0(?:0(?:0(?:1(?:\-(?:2|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)|\z)

Running this regular expression leads to a SystemStackError. What is an
appropriate way to handle this? As far as I understand, RMail is unmaintained.
And we wanted to switch away from it. Should we monkey-patch?

Best regards,
Michael
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Matthieu Rakotojaona <[email-masked]>
Date: Fri, 23 Mar 2012 20:17:59 +0100

On Mon, Mar 12, 2012 at 7:24 PM, Michael Stapelberg
<[email-masked]> wrote:
> As far as I understand, RMail is unmaintained.

A little old, but I started moving message.rb from RMail to Mail gem
(https://github.com/mikel/mail). My tree is at
https://github.com/rakoo/heliotrope/tree/mail_gem

Unfortunately I don't have a lot of messages to test all the features,
especially MIME-related ones. I'd also love to have a test suite, so
maybe it could be time to gather some example messages with tricky
traps ?

-- 
Matthieu RAKOTOJAONA