Parsing of malformed messages

39 views
Skip to first unread message

Fabio Sangiovanni

unread,
Oct 9, 2012, 3:20:58 AM10/9/12
to Ruby's Mail Discussion Group
Hi,

I'm using Mail to build a mail content filter, invoked by Postfix upon
mail submission by users, so the primary use I make of the gem is
parsing incoming mail.

While testing my content filter, I found out that when I receive a
malformed mail (in particular a multipart mail with bad syntax of
boundaries) the message.parts array has obviously a length that
doesn't match the intended number of parts - and this is fine to me,
since the message doesn't comply with RFC. But, and here's my problem,
is there a way to find out if all the parsing (in general) went fine
or not? Some flags that are rised, or some methods to call? I need to
deal with such messages in a special way, but I couldn't find the
right way to discriminate them from proper ones.

You can see the mail at http://pastebin.com/B3qkYbL1 -- please note
the error (missing trailing "--") in the closing boundary "--
==RelatedBoundary==".

Thank you for your time!

Fabio Sangiovanni

Fabio Sangiovanni

unread,
Oct 11, 2012, 9:36:01 AM10/11/12
to mail...@googlegroups.com
Any suggestions on this, please?
Reply all
Reply to author
Forward
0 new messages